var w=Object.defineProperty;var u=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var f=(s,t,e)=>t in s?w(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e,b=(s,t)=>{for(var e in t||(t={}))y.call(t,e)&&f(s,e,t[e]);if(u)for(var e of u(t))C.call(t,e)&&f(s,e,t[e]);return s};import{v as F,w as N,r as m,j as a,S as E}from"./main-40.js";/* empty css          */import{S as P}from"./bf-679-136.js";import{b as L}from"./bf-132-75.js";import{I as T}from"./bf-94-335.js";import{N as _}from"./bf-504-404.js";import B from"./bf-387-269.js";import{h as D,c as g}from"./bf-826-393.js";import{A as M}from"./bf-640-394.js";import"./bf-860-126.js";import"./bf-892-199.js";import"./bf-141-80.js";import"./bf-586-70.js";import"./bf-541-403.js";import"./bf-200-122.js";import"./bf-689-131.js";import"./bf-806-365.js";function st({formFields:s,setIntegration:t,integrations:e,allIntegURL:h}){const x=F(),{formID:c}=N(),[d,n]=m.useState(!1),[r,p]=m.useState(1),[S,o]=m.useState({show:!1}),A=[{key:"1",label:"Add/Update Subscriber"},{key:"2",label:"Delete Subscriber"}],j=[{key:"email",label:"Email",required:!0}],[i,l]=m.useState({name:"Acumbamail",type:"Acumbamail",mainAction:"",listId:"",auth_token:"",field_map:[{formField:"",acumbamailFormField:"email"}],addSubsCriberFields:j,allActions:A,address_field:[],actions:{}}),v=()=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),!g(i)){o({show:!0,msg:"Please map fields to continue."});return}i.listId!==""&&p(3)},I=()=>{L(e,t,h,i,x)};return a.jsxs("div",{children:[a.jsx(E,{snack:S,setSnackbar:o}),a.jsx("div",{className:"txt-center w-9 mt-2 cal-width",children:a.jsx(P,{step:3,active:r})}),a.jsx(B,{formID:c,acumbamailConf:i,setAcumbamailConf:l,step:r,setstep:p,isLoading:d,setIsLoading:n,setSnackbar:o}),a.jsxs("div",{className:"btcd-stp-page",style:b({},r===2&&{width:900,height:"auto",overflow:"visible"}),children:[a.jsx(M,{formFields:s,handleInput:k=>D(k,i,l,n,o,c),acumbamailConf:i,setAcumbamailConf:l,isLoading:d,setIsLoading:n,setSnackbar:o}),a.jsx(_,{nextPageHandler:()=>v(),disabled:!i.mainAction||!g(i)})]}),a.jsx(T,{step:r,saveConfig:()=>I()})]})}export{st as default};
