import{b as m,$ as b,h as I,k as N,i as _,j as t,_ as o}from"./main.2.8.1.js";import{u as w,h as S,d as r}from"./react-router-dom.9mCuUg3q.js";import{S as v}from"./SnackMsg.S8DrwLlT.js";import"./Note.BeM7sN-p.js";import{S as y,I as F,s as R}from"./Integrations.D2bgBas2.js";import{h as c,c as f}from"./NutshellCRMCommonFunc.BvdCdj1w.js";import{N as M}from"./NutshellCRMIntegLayout.BVsyUSa6.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";function H({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{H as default};
