import{j as s,_ as d}from"./main.2.8.10.js";import{u as j,e as P,b as r}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{B as M}from"./BackIcn.BFDZx8No.js";import{S}from"./SnackMsg.7BjcJK1j.js";import{I,g as k}from"./Integrations.BFhED4ck.js";import v from"./MailerPressAuthorization.BlEImrIa.js";import{M as N,c as _}from"./MailerPressIntegLayout.Bne6_cWf.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./TutorialLink.D6K_DiHL.js";import"./ProUtilHelpers.CtRYkgop.js";import"./TagifyInput.C4ilRm4k.js";import"./lodash.DCvQBX3r.js";import"./GlobalIntegrationHelper.Belqr4OT.js";function O({formFields:f,setFlow:g,flow:u,allIntegURL:x}){const h=j(),{formID:m}=P(),[a,o]=r.useState(!1),[e,l]=r.useState(1),[b,i]=r.useState({show:!1}),[t,p]=r.useState({name:"MailerPress",type:"MailerPress",field_map:[{formField:"",mailerPressField:""}],lists:[],tags:[],actions:{},mainAction:""}),c=n=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),n===3){if(!_(t)){i({show:!0,msg:d("Please map all required fields to continue.","bit-integrations")});return}t.name!==""&&t.field_map.length>0&&l(n)}else l(n)};return s.jsxs("div",{children:[s.jsx(S,{snack:b,setSnackbar:i}),s.jsx("div",{className:"txt-center mt-2"}),s.jsx(v,{formID:m,mailerPressConf:t,setMailerPressConf:p,step:e,nextPage:c,isLoading:a,setIsLoading:o,setSnackbar:i}),s.jsxs("div",{className:"btcd-stp-page",style:{width:e===2&&900,height:e===2&&"auto",minHeight:e===2&&"500px"},children:[s.jsx(N,{formID:m,formFields:f,mailerPressConf:t,setMailerPressConf:p,setSnackbar:i,setIsLoading:o,isLoading:a}),s.jsx("br",{}),s.jsx("br",{}),s.jsx("br",{}),s.jsxs("button",{onClick:()=>c(3),disabled:t.field_map.length<1,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[d("Next","bit-integrations"),s.jsx(M,{className:"ml-1 rev-icn"})]})]}),s.jsx(I,{step:e,saveConfig:()=>k(u,g,x,t,h,"","",o),isLoading:a})]})}export{O as default};
