import{b as m,$ as j,h as C,k as I,i as _,j as t,_ as i,q as w}from"./main.2.8.1.js";import{u as v,h as y,d as r}from"./react-router-dom.9mCuUg3q.js";import{S as F}from"./SnackMsg.S8DrwLlT.js";import"./Note.BeM7sN-p.js";import{S as N,I as k,s as E}from"./Integrations.D2bgBas2.js";import{h as l,c}from"./SalesmateCommonFunc.B0_IVjr9.js";import{S as L}from"./SalesmateIntegLayout.BdkStcEg.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";function J({allIntegURL:f}){const p=v(),{id:P}=y(),[n,R]=m(j),[e,a]=m(C),[g,u]=r.useState(!1),[x,h]=r.useState({}),[S,s]=r.useState({show:!1}),d=I(_),b=()=>{if(!c(e)){s({show:!0,msg:i("Please map mandatory fields","bit-integrations")});return}if(e.actionName==="lead"&&!e.selectedCRMPipeline){w.error(i("Please select a pipeline","bit-integrations"));return}E({flow:n,allIntegURL:f,conf:e,navigate:p,edit:1,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(F,{snack:S,setSnackbar:s}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:i("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:o=>l(o,e,a),name:"name",value:e.name,type:"text",placeholder:i("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(N,{entity:n.triggered_entity,setSnackbar:s}),t.jsx(L,{formID:n.triggered_entity_id,formFields:d,handleInput:o=>l(o,e,a),salesmateConf:e,setSalesmateConf:a,loading:x,setLoading:h,setIsLoading:u,setSnackbar:s}),t.jsx(k,{edit:!0,saveConfig:b,disabled:!c(e),isLoading:g,dataConf:e,setDataConf:a,formFields:d}),t.jsx("br",{})]})}export{J as default};
