import{h as m,$ as C,g as j,k as y,i as S,j as e,_ as s,q as _}from"./main.2.9.0.js";import{u as w,e as I,b as i}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 F,I as N,s as k}from"./Integrations.DL8wqGct.js";import{h as E,c as d}from"./CompanyHubCommonFunc.CEzGUMIe.js";import{C as H}from"./CompanyHubIntegLayout.Bckeev52.js";import"./react-vendor.P7K3d6op.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";function K({allIntegURL:c}){const l=w(),{id:L}=I(),[n,$]=m(C),[t,o]=m(j),[p,f]=i.useState(!1),[g,u]=i.useState({}),[x,a]=i.useState({show:!1}),r=y(S),b=()=>{if(!d(t)){a({show:!0,msg:s("Please map mandatory fields","bit-integrations")});return}if(t.actionName==="deal"&&!t.selectedStage){_.error(s("Please select a Deal Stage","bit-integrations"));return}k({flow:n,allIntegURL:c,conf:t,navigate:l,edit:1,setSnackbar:a})};return e.jsxs("div",{style:{width:900},children:[e.jsx(v,{snack:x,setSnackbar:a}),e.jsxs("div",{className:"flx mt-3",children:[e.jsx("b",{className:"wdt-200 d-in-b",children:s("Integration Name:","bit-integrations")}),e.jsx("input",{className:"btcd-paper-inp w-5",onChange:h=>E(h,t,o),name:"name",value:t.name,type:"text",placeholder:s("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx(F,{entity:n.triggered_entity,setSnackbar:a}),e.jsx(H,{formID:n.triggered_entity_id,formFields:r,companyHubConf:t,setCompanyHubConf:o,loading:g,setLoading:u,setIsLoading:f,setSnackbar:a}),e.jsx(N,{edit:!0,saveConfig:b,disabled:!d(t),isLoading:p,dataConf:t,setDataConf:o,formFields:r}),e.jsx("br",{})]})}export{K as default};
