import{h as l,g as C,$ as _,k as I,i as w,j as e,_ as m}from"./main.2.9.0.js";import{u as S,e as y,b as d}from"./react-router.DMwpH23k.js";import{S as v}from"./SnackMsg.DYSD96P4.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import{S as N,I as k,s as F}from"./Integrations.DL8wqGct.js";import{h as f,c as R}from"./ZohoCRMCommonFunc.BIG3eSW6.js";import{Z as E}from"./ZohoCRMIntegLayout.BKBoPOSQ.js";import"./react-vendor.P7K3d6op.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./CheckBox.EE_22KNp.js";import"./TitleModal.emRFbfw0.js";import"./EditIcn.ClgiZunh.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";function U({allIntegURL:g}){const u=S(),{id:M}=y(),[t,a]=l(C),[o,x]=l(_),[p,i]=d.useState(!1),[h,s]=d.useState({show:!1}),[n,b]=d.useState(0),c=I(w),j=()=>{if(!R(t)){s({show:!0,msg:m("Please map mandatory fields","bit-integrations")});return}F({flow:o,setFlow:x,allIntegURL:g,conf:t,navigate:u,edit:1,setIsLoading:i,setSnackbar:s})};return e.jsxs("div",{style:{width:900},children:[e.jsx(v,{snack:h,setSnackbar:s}),e.jsxs("div",{className:"flx mt-3",children:[e.jsx("b",{className:"wdt-200 ",children:m("Integration Name:","bit-integrations")}),e.jsx("input",{className:"btcd-paper-inp w-5",onChange:r=>f(r,n,t,a),name:"name",value:t.name,type:"text",placeholder:m("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx(N,{entity:o.triggered_entity,setSnackbar:s}),e.jsx(E,{tab:n,settab:b,formID:o.triggered_entity_id,formFields:c,handleInput:r=>f(r,n,t,a,i,s),crmConf:t,setCrmConf:a,isLoading:p,setIsLoading:i,setSnackbar:s}),e.jsx(k,{edit:!0,saveConfig:j,disabled:t.module===""||t.layout===""||t.field_map.length<1,isLoading:p,dataConf:t,setDataConf:a,formFields:c}),e.jsx("br",{})]})}export{U as default};
