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