var N=Object.defineProperty;var p=Object.getOwnPropertySymbols;var k=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var c=(s,t,e)=>t in s?N(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,u=(s,t)=>{for(var e in t||(t={}))k.call(t,e)&&c(s,e,t[e]);if(p)for(var e of p(t))y.call(t,e)&&c(s,e,t[e]);return s};import{v as C,w as _,r as i,j as a,S as E,_ as d}from"./main-40.js";import{b as z}from"./bf-132-75.js";import{I as A}from"./bf-94-335.js";import{h as f,c as P}from"./bf-939-399.js";import{M as D}from"./bf-321-400.js";import"./bf-528-128.js";/* empty css          */import"./bf-689-131.js";import"./bf-200-122.js";function Q({formFields:s,setIntegration:t,integrations:e,allIntegURL:h}){const x=C(),{id:l,formID:g}=_(),[r,n]=i.useState(u({},e[l])),[j,I]=i.useState(!1),[S,o]=i.useState({show:!1}),[b,v]=i.useState(!1),[L,w]=i.useState({name:"",auth_token:""}),M=()=>{if(!P(r)){o({show:!0,msg:d("Please map mandatory fields")});return}z(e,t,h,r,x,l,1)};return a.jsxs("div",{style:{width:900},children:[a.jsx(E,{snack:S,setSnackbar:o}),a.jsxs("div",{className:"flx mt-3",children:[a.jsx("b",{className:"wdt-200 d-in-b",children:d("Integration Name:")}),a.jsx("input",{className:"btcd-paper-inp w-5",onChange:m=>f(m,r,n),name:"name",value:r.name,type:"text",placeholder:d("Integration Name...")})]}),a.jsx("br",{}),a.jsx(D,{formID:g,formFields:s,handleInput:m=>f(m,r,n),mailerLiteConf:r,setMailerLiteConf:n,isLoading:j,setIsLoading:I,setSnackbar:o,isAuthorized:b,setisAuthorized:v,error:L,setError:w}),a.jsx(A,{edit:!0,saveConfig:M,disabled:r.field_map.length<1}),a.jsx("br",{})]})}export{Q as default};
