import{h as p,g as j,$ as I,k,i as w,j as e,_ as r}from"./main.2.8.10.js";import{u as C,e as _,b as c}from"./react-router.DMwpH23k.js";import{S}from"./SnackMsg.7BjcJK1j.js";import"./Note.DalStCGz.js";import"./CopyIcn.BnhKHfEP.js";import{S as v,I as y,s as N}from"./Integrations.BFhED4ck.js";import{h as f,c as F}from"./ZohoMarketingHubCommonFunc.D9HOH5FN.js";import{Z as M}from"./ZohoMarketingHubIntegLayout.CdjRCQLh.js";import"./react-vendor.P7K3d6op.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";function J({allIntegURL:g}){const u=C(),{id:E,formID:n}=_(),[t,a]=p(j),[m,h]=p(I),[d,i]=c.useState(!1),[x,s]=c.useState({show:!1}),l=k(w),b=()=>{if(!F(t)){s({show:!0,msg:r("Please map mandatory fields","bit-integrations")});return}N({flow:m,setFlow:h,allIntegURL:g,conf:t,navigate:u,edit:1,setIsLoading:i,setSnackbar:s})};return e.jsxs("div",{style:{width:900},children:[e.jsx(S,{snack:x,setSnackbar:s}),e.jsxs("div",{className:"flx mt-3",children:[e.jsx("b",{className:"wdt-200 d-in-b",children:r("Integration Name:","bit-integrations")}),e.jsx("input",{className:"btcd-paper-inp w-5",onChange:o=>f(o,n,t,a),name:"name",value:t.name,type:"text",placeholder:r("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx(v,{entity:m.triggered_entity,setSnackbar:s}),e.jsx(M,{formID:n,formFields:l,handleInput:o=>f(o,n,t,a,i,s),marketingHubConf:t,setMarketingHubConf:a,isLoading:d,setIsLoading:i,setSnackbar:s}),e.jsx(y,{edit:!0,saveConfig:b,disabled:t.list===""||t.table===""||t.field_map.length<1,isLoading:d,dataConf:t,setDataConf:a,formFields:l})]})}export{J as default};
