var C=Object.defineProperty;var f=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,I=Object.prototype.propertyIsEnumerable;var u=(a,t,e)=>t in a?C(a,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[t]=e,b=(a,t)=>{for(var e in t||(t={}))N.call(t,e)&&u(a,e,t[e]);if(f)for(var e of f(t))I.call(t,e)&&u(a,e,t[e]);return a};import{u as _,k as A,r as m,j as s}from"./main-406.js";import{d as w,_ as E,I as F,s as q}from"./bi.394.85.js";import{S as L}from"./bi.68.941.js";import{h as T}from"./bi.99.882.js";import D from"./bi.350.312.js";import{M as P}from"./bi.840.881.js";import"./bi.46.744.js";import"./bi.150.760.js";import"./bi.704.707.js";import"./bi.701.708.js";function X({formFields:a,setFlow:t,flow:e,allIntegURL:d,isInfo:x,edit:M}){const g=_(),{formID:h}=A(),[n,o]=m.useState(!1),[r,p]=m.useState(1),[j,l]=m.useState({show:!1}),v=[{key:"1",label:"Add contact"}],k=[{key:"email",label:"Email",required:!0},{key:"first_name",label:"First Name",required:!1},{key:"last_name",label:"Last Name",required:!1}],[i,c]=m.useState({name:"Mail Mint",type:"Mail Mint",mainAction:"",field_map:[{formField:"",mailMintFormField:""}],allActions:v,mailMintContactFields:k,actions:{}}),S=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),i.mainAction!==""&&p(3)};return s.jsxs("div",{children:[s.jsx(w,{snack:j,setSnackbar:l}),s.jsx("div",{className:"txt-center mt-2",children:s.jsx(L,{step:3,active:r})}),s.jsx(D,{formID:h,mailMintConf:i,setMailMintConf:c,step:r,setStep:p,isLoading:n,setIsLoading:o,setSnackbar:l}),s.jsxs("div",{className:"btcd-stp-page",style:b({},r===2&&{width:900,height:"auto",overflow:"visible"}),children:[s.jsx(P,{formFields:a,handleInput:y=>T(y,i,c,o),mailMintConf:i,setMailMintConf:c,isLoading:n,setIsLoading:o,setSnackbar:l,allIntegURL:d,isInfo:x,edit:M}),s.jsxs("button",{onClick:()=>S(),disabled:n,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[E("Next","bit-integrations")," ",s.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),s.jsx(F,{step:r,saveConfig:()=>q({flow:e,setFlow:t,allIntegURL:d,navigate:g,conf:i,setIsLoading:o,setSnackbar:l}),isLoading:n,dataConf:i,setDataConf:c,formFields:a})]})}export{X as default};
