var _=Object.defineProperty;var j=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable;var v=(s,t,e)=>t in s?_(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,L=(s,t)=>{for(var e in t||(t={}))I.call(t,e)&&v(s,e,t[e]);if(j)for(var e of j(t))b.call(t,e)&&v(s,e,t[e]);return s};import{v as k,r as m,j as i,S as C,d}from"./main-40.js";/* empty css          */import{S as F}from"./bf-679-136.js";import{b as N}from"./bf-132-75.js";import{I as w}from"./bf-94-335.js";import{N as P}from"./bf-504-404.js";import E from"./bf-675-272.js";import{h as T,c as q}from"./bf-939-399.js";import{M as z}from"./bf-321-400.js";import"./bf-860-126.js";import"./bf-892-199.js";import"./bf-141-80.js";import"./bf-586-70.js";import"./bf-492-405.js";import"./bf-541-403.js";import"./bf-5-193.js";import"./bf-528-128.js";import"./bf-689-131.js";import"./bf-200-122.js";function it({formFields:s,setIntegration:t,integrations:e,allIntegURL:f}){const u=k(),[g,p]=m.useState(!1),[a,h]=m.useState(1),[S,l]=m.useState({show:!1}),[r,c]=m.useState({name:"MailerLite",type:"MailerLite",auth_token:"",field_map:[{formField:"",mailerLiteFormField:"email"}],mailer_lite_type:"",mailerLiteFields:[],groups:[],group_ids:[],actions:{}}),M=()=>{p(!0),N(e,t,f,r,u,"","").then(n=>{var x;n.success?(d.success((x=n.data)==null?void 0:x.msg),u(f)):d.error(n.data||n)})},y=o=>{if(!q(r)){d.error("Please map mandatory fields");return}r.field_map.length>0&&h(o),document.querySelector(".btcd-s-wrp").scrollTop=0};return i.jsxs("div",{children:[i.jsx(C,{snack:S,setSnackbar:l}),i.jsx("div",{className:"txt-center mt-2",children:i.jsx(F,{step:3,active:a})}),i.jsx(E,{mailerLiteConf:r,setMailerLiteConf:c,step:a,setstep:h,isLoading:g,setIsLoading:p,setSnackbar:l}),i.jsxs("div",{className:"btcd-stp-page",style:L({},a===2&&{width:900,height:"auto",overintegrations:"visible"}),children:[i.jsx(z,{formFields:s,handleInput:o=>T(o,r,c),mailerLiteConf:r,setMailerLiteConf:c,isLoading:g,setIsLoading:p,setSnackbar:l}),i.jsx(P,{nextPageHandler:()=>y(3)})]}),i.jsx(w,{step:a,saveConfig:()=>M()})]})}export{it as default};
