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