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