import{u as I,k as _,d as c,r as i,h as w,j as t}from"./main-406.js";import{$ as y,g as S,h as N,d as v,_ as r,i as F,I as R,W as m,s as L}from"./bi.394.85.js";import{h as f,c as u}from"./bi.135.917.js";import{O as M}from"./bi.282.918.js";function $({allIntegURL:g}){const p=I();_();const[n,k]=c(y),[e,a]=c(S),[h,d]=i.useState(!1),[x,C]=i.useState({}),[j,s]=i.useState({show:!1}),l=w(N),b=()=>{if(!u(e)){s({show:!0,msg:r("Please map mandatory fields","bit-integrations")});return}if(e.actionName==="customer"&&!e.selectedCustomerType){m.error("Please select Customer Type");return}if(e.actionName==="lead"&&!e.selectedLeadStatus){m.error("Please select Lead Status");return}L({flow:n,allIntegURL:g,conf:e,navigate:p,edit:1,setIsLoading:d,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(v,{snack:j,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:o=>f(o,e,a),name:"name",value:e.name,type:"text",placeholder:r("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(F,{entity:n.triggered_entity,setSnackbar:s}),t.jsx(M,{formID:n.triggered_entity_id,formFields:l,handleInput:o=>f(o,e,a),oneHashCRMConf:e,setOneHashCRMConf:a,loading:x,setLoading:C,setIsLoading:d,setSnackbar:s}),t.jsx(R,{edit:!0,saveConfig:b,disabled:!u(e),isLoading:h,dataConf:e,setDataConf:a,formFields:l}),t.jsx("br",{})]})}export{$ as default};
