import{b as c,h as I,$ as S,k as _,i as y,j as e,_ as a}from"./main.2.8.1.js";import{u as v,h as N,d as m}from"./react-router-dom.9mCuUg3q.js";import{S as k}from"./SnackMsg.S8DrwLlT.js";import"./Note.BeM7sN-p.js";import{S as C,I as F,s as E}from"./Integrations.D2bgBas2.js";import{h as u,c as L}from"./ZohoBiginCommonFunc.BCC_jX9F.js";import{Z as $}from"./ZohoBiginIntegLayout.9tXX3G04.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./TabPanel.VqazfIFY.js";import"./ActionProFeatureLabels.CuihmlQ8.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.js";function Q({allIntegURL:f}){const g=v(),{id:B,formID:d}=N(),[t,o]=c(I),[l,h]=c(S),[p,i]=m.useState(!1),[x,s]=m.useState({show:!1}),[n,j]=m.useState(0),b=_(y),w=()=>{if(!L(t)){s({show:!0,msg:a("Please map mandatory fields","bit-integrations")});return}if((t==null?void 0:t.module)==="Deals"&&!(t!=null&&t.pLayout)){s({show:!0,msg:a("Please select a layout","bit-integrations")});return}E({flow:l,setFlow:h,allIntegURL:f,conf:t,navigate:g,edit:1,setIsLoading:i,setSnackbar:s})};return e.jsxs("div",{style:{width:900},children:[e.jsx(k,{snack:x,setSnackbar:s}),e.jsxs("div",{className:"flx mt-3",children:[e.jsx("b",{className:"wdt-200 d-in-b",children:a("Integration Name:","bit-integrations")}),e.jsx("input",{className:"btcd-paper-inp w-5",onChange:r=>u(r,n,t,o),name:"name",value:t.name,type:"text",placeholder:a("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx(C,{entity:l.triggered_entity,setSnackbar:s}),e.jsx($,{tab:n,settab:j,formID:d,handleInput:r=>u(r,n,t,o,d,i,s),isLoading:p,setIsLoading:i,setSnackbar:s}),e.jsx(F,{edit:!0,saveConfig:w,disabled:t.module===""||t.field_map.length<1,isLoading:p,dataConf:t,setDataConf:o,formFields:b}),e.jsx("br",{})]})}export{Q as default};
