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