import{u as j,k as _,d as m,r as o,h as b,j as e}from"./main-406.js";import{$ as I,g as w,h as C,d as L,_ as r,i as v,I as y,s as F}from"./bi.394.85.js";import{h as f,c as S}from"./bi.662.796.js";import{M}from"./bi.641.797.js";import"./bi.704.707.js";import"./bi.701.708.js";function T({allIntegURL:c}){const g=j();_();const[i,N]=m(I),[t,a]=m(w),[p,k]=o.useState(!1),[u,l]=o.useState({list:!1,field:!1,auth:!1,group:!1}),[x,s]=o.useState({show:!1}),d=b(C),h=()=>{if(!S(t)){s({show:!0,msg:r("Please map mandatory fields","bit-integrations")});return}F({flow:i,allIntegURL:c,conf:t,navigate:g,edit:1,setLoading:l,setSnackbar:s})};return e.jsxs("div",{style:{width:900},children:[e.jsx(L,{snack:x,setSnackbar:s}),e.jsxs("div",{className:"flx mt-3",children:[e.jsx("b",{className:"wdt-200 d-in-b",children:r("Integration Name:","bit-integrations")}),e.jsx("input",{className:"btcd-paper-inp w-5",onChange:n=>f(n,t,a),name:"name",value:t.name,type:"text",placeholder:r("Integration Name...","bit-integrations")})]}),e.jsx("br",{}),e.jsx(v,{entity:i.triggered_entity,setSnackbar:s}),e.jsx(M,{formID:i.triggered_entity_id,formFields:d,handleInput:n=>f(n,t,a),mailerLiteConf:t,setMailerLiteConf:a,loading:u,setLoading:l,setSnackbar:s}),e.jsx(y,{edit:!0,saveConfig:h,disabled:t.field_map.length<1,isLoading:p,dataConf:t,setDataConf:a,formFields:d}),e.jsx("br",{})]})}export{T as default};
