import{b as l,h as b,$ as _,k as w,i as F,j as t,_ as n}from"./main.2.8.1.js";import{u as I,h as S,d as i}from"./react-router-dom.9mCuUg3q.js";import{S as v}from"./SnackMsg.S8DrwLlT.js";import"./Note.BeM7sN-p.js";import{S as N,I as k,s as y}from"./Integrations.D2bgBas2.js";import{h as E,F as L,c as $}from"./FluentCrmIntegLayout.C067nvKY.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./ActionProFeatureLabels.CuihmlQ8.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.js";function O({allIntegURL:c}){const p=I(),{id:R,formID:f}=S(),[e,a]=l(b),[o,u]=l(_),r=w(F),[m,d]=i.useState(!1),[g,x]=i.useState({}),[h,s]=i.useState({show:!1}),C=()=>{if(!$(e)){s({show:!0,msg:n("Please map all required fields to continue.","bit-integrations")});return}y({flow:o,setFlow:u,allIntegURL:c,conf:e,navigate:p,edit:1,setIsLoading:d,setSnackbar:s})};return t.jsxs("div",{style:{width:900},children:[t.jsx(v,{snack:h,setSnackbar:s}),t.jsxs("div",{className:"flx mt-3",children:[t.jsx("b",{className:"wdt-200 d-in-b",children:n("Integration Name:","bit-integrations")}),t.jsx("input",{className:"btcd-paper-inp w-5",onChange:j=>E(j,e,a),name:"name",value:e.name,type:"text",placeholder:n("Integration Name...","bit-integrations")})]}),t.jsx("br",{}),t.jsx(N,{entity:o.triggered_entity,setSnackbar:s}),t.jsx(L,{formID:f,formFields:r,fluentCrmConf:e,setFluentCrmConf:a,isLoading:m,step:2,setIsLoading:d,loading:g,setLoading:x,setSnackbar:s}),t.jsx(k,{edit:!0,saveConfig:C,disabled:e.list_id===""||e.field_map.length<1,isLoading:m,dataConf:e,setDataConf:a,formFields:r}),t.jsx("br",{})]})}export{O as default};
