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