var j=Object.defineProperty,S=Object.defineProperties;var M=Object.getOwnPropertyDescriptors;var c=Object.getOwnPropertySymbols;var y=Object.prototype.hasOwnProperty,N=Object.prototype.propertyIsEnumerable;var f=(t,e,s)=>e in t?j(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s,g=(t,e)=>{for(var s in e||(e={}))y.call(e,s)&&f(t,s,e[s]);if(c)for(var s of c(e))N.call(e,s)&&f(t,s,e[s]);return t},u=(t,e)=>S(t,M(e));import{_ as n,j as i}from"./main.2.9.0.js";import{u as _,b as d}from"./react-router.DMwpH23k.js";import{S as k}from"./StepPage.6Rz8L_er.js";import{S as C}from"./Steps.BYe8zHkm.js";import{I as E}from"./Integrations.DL8wqGct.js";import F from"./MoosendAuthorization.BNPM6pQc.js";import{n as I,c as L}from"./MoosendCommonFunc.h8eAwVpN.js";import{M as q}from"./MoosendIntegLayout.fITD4G5T.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./CopyIcn.CEA_lFLo.js";import"./SnackMsg.DYSD96P4.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TutorialLink.CFG7bS5c.js";import"./GlobalIntegrationHelper.B6YI8w_n.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";function Z({formFields:t,setFlow:e,flow:s,allIntegURL:b}){const h=_(),[a,p]=d.useState(1),[r,m]=d.useState({auth:!1,list:!1,page:!1}),[o,l]=d.useState({name:"Moosend",type:"Moosend",authKey:"",field_map:[{formFields:"",moosendFormFields:""}],listId:"",method:"",actions:{},moosendFields:[],basicFields:[{key:"Email",label:n("Email","bit-integrations"),required:!0},{key:"Name",label:n("Name","bit-integrations"),required:!1},{key:"Mobile",label:n("Mobile","bit-integrations"),required:!1}]}),x=v=>{m(u(g({},r),{page:v}))};return i.jsxs("div",{children:[i.jsx("div",{className:"txt-center mt-2",children:i.jsx(C,{step:3,active:a})}),i.jsx(F,{moosendConf:o,setMoosendConf:l,loading:r,setLoading:m,step:a,setStep:p}),i.jsxs(k,{step:a,stepNo:2,style:{width:900,height:"auto",overflow:"visible"},children:[i.jsx(q,{moosendConf:o,setMoosendConf:l,formFields:t,loading:r,setLoading:m}),(o==null?void 0:o.method)&&i.jsxs("button",{onClick:()=>I(o,p,3),disabled:o.field_map.length<1,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[n("Next")," ",i.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),o.method&&i.jsx(E,{step:a,saveConfig:()=>L(s,e,b,o,h,x),isLoading:r.page,dataConf:o,setDataConf:l,formFields:t})]})}export{Z as default};
