var C=Object.defineProperty;var u=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,_=Object.prototype.propertyIsEnumerable;var p=(t,e,s)=>e in t?C(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,f=(t,e)=>{for(var s in e||(e={}))N.call(e,s)&&p(t,s,e[s]);if(u)for(var s of u(e))_.call(e,s)&&p(t,s,e[s]);return t};import{D as w,g as L,r as n,j as a,S as q}from"./main-634.js";import"./bf-25-81.js";import{S as E}from"./bf-54-258.js";import{a7 as D}from"./bf-746-82.js";import{I as P}from"./bf-942-184.js";import{N as T}from"./bf-123-109.js";import A from"./bf-872-125.js";import{a as B,i as U}from"./bf-138-179.js";import{S as z}from"./bf-190-224.js";import"./bf-275-83.js";import"./bf-822-108.js";import"./bf-438-114.js";function $({formFields:t,setIntegration:e,integrations:s,allIntegURL:x}){const F=w(),{formID:b}=L(),[m,r]=n.useState(!1),[i,c]=n.useState(1),[g,l]=n.useState({show:!1}),S=[{key:"1",label:"Create List"},{key:"2",label:"Create Contact"},{key:"3",label:"Unsubscribe Contact"}],h=[{key:"email",label:"Email",required:!0},{key:"first_name",label:"First Name",required:!1},{key:"last_name",label:"Last Name",required:!1}],y=[{key:"name",label:"Name",required:!0}],k=[{key:"email",label:"Email",required:!0}],[o,d]=n.useState({name:"SendFox",type:"SendFox",listId:"",access_token:"",field_map:[{formField:"",sendFoxFormField:""}],field_map_list:[{formField:"",sendFoxListFormField:""}],field_map_unsubscribe:[{formField:"",sendFoxUnsubscribeFormField:""}],allActions:S,contactFields:h,unsubscribeFields:k,listFields:y,actions:{}}),j=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),c(3)},v=()=>{D(s,e,x,o,F)};return a.jsxs("div",{children:[a.jsx(q,{snack:g,setSnackbar:l}),a.jsx("div",{className:"txt-center w-9 mt-2 cal-width",children:a.jsx(E,{step:3,active:i})}),a.jsx(A,{formID:b,sendFoxConf:o,setSendFoxConf:d,step:i,setstep:c,isLoading:m,setIsLoading:r,setSnackbar:l}),a.jsxs("div",{className:"btcd-stp-page",style:f({},i===2&&{width:900,height:"auto",overflow:"visible"}),children:[a.jsx(z,{formFields:t,handleInput:I=>B(I,o,d,r),sendFoxConf:o,setSendFoxConf:d,isLoading:m,setIsLoading:r,setSnackbar:l}),a.jsx(T,{nextPageHandler:()=>j(),disabled:U(o)})]}),a.jsx(P,{step:i,saveConfig:()=>v()})]})}export{$ as default};
