import{u as j,d as p,r as o,h as F,j as t}from"./main-406.js";import{$ as b,g as I,h as _,d as C,_ as r,i as S,I as N,W as l,s as v}from"./bi.394.85.js";import{h as f,c as u}from"./bi.81.909.js";import{F as P}from"./bi.298.910.js";function O({allIntegURL:m}){j();const[n,k]=p(b),[e,a]=p(I),[g,c]=o.useState(!1),[x,h]=o.useState({}),[y,s]=o.useState({show:!1}),d=F(_),w=()=>{if(!u(e)){s({show:!0,msg:r("Please map mandatory fields","bit-integrations")});return}if(e.actionName==="account"&&!e.selectedAccountType){l.error("Please select an Account Type");return}if(e.actionName==="opportunity"){if(!e.selectedPipeline){l.error("Please select a Opportunity Pipeline");return}if(!e.selectedOpportunityStage){l.error("Please select a Opportunity Stage");return}}v({flow:n,allIntegURL:m,conf:e,history,edit:1,setIsLoading:c,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(C,{snack:y,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=>f(i,e,a),name:"name",value:e.name,type:"text",placeholder:r("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(S,{entity:n.triggered_entity,setSnackbar:s}),t.jsx(P,{formID:n.triggered_entity_id,formFields:d,handleInput:i=>f(i,e,a),flowluConf:e,setFlowluConf:a,loading:x,setLoading:h,setIsLoading:c,setSnackbar:s}),t.jsx(N,{edit:!0,saveConfig:w,disabled:!u(e),isLoading:g,dataConf:e,setDataConf:a,formFields:d}),t.jsx("br",{})]})}export{O as default};
