var y=Object.defineProperty;var f=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var h=(s,e,t)=>e in s?y(s,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):s[e]=t,g=(s,e)=>{for(var t in e||(e={}))N.call(e,t)&&h(s,t,e[t]);if(f)for(var t of f(e))w.call(e,t)&&h(s,t,e[t]);return s};import{G as k,g as M,r,j as o,S as _,_ as p}from"./main-343.js";import{a7 as E}from"./bf-659-81.js";import{I as L}from"./bf-58-184.js";import{h as x,c as R}from"./bf-569-96.js";import{Z}from"./bf-455-190.js";import"./bf-974-82.js";import"./bf-649-79.js";import"./bf-529-105.js";import"./bf-541-186.js";import"./bf-594-113.js";function K({formFields:s,setIntegration:e,integrations:t,allIntegURL:j}){const I=k(),{id:c,formID:l}=M(),[a,i]=r.useState(g({},t[c])),[b,u]=r.useState(!1),[C,n]=r.useState({show:!1}),[m,S]=r.useState(0),v=()=>{if(!R(a)){n({show:!0,msg:p("Please map mandatory fields")});return}E(t,e,j,a,I,c,1)};return o.jsxs("div",{style:{width:900},children:[o.jsx(_,{snack:C,setSnackbar:n}),o.jsxs("div",{className:"flx mt-3",children:[o.jsx("b",{className:"wdt-100 d-in-b",children:p("Integration Name:")}),o.jsx("input",{className:"btcd-paper-inp w-7",onChange:d=>x(d,m,a,i),name:"name",value:a.name,type:"text",placeholder:p("Integration Name...")})]}),o.jsx(Z,{tab:m,settab:S,formID:l,formFields:s,handleInput:d=>x(d,m,a,i,l,u,n),crmConf:a,setCrmConf:i,isLoading:b,setisLoading:u,setSnackbar:n}),o.jsx(L,{edit:!0,saveConfig:v,disabled:a.module===""||a.layout===""||a.field_map.length<1}),o.jsx("br",{})]})}export{K as default};
