var M=Object.defineProperty;var f=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var b=(i,s,e)=>s in i?M(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e,h=(i,s)=>{for(var e in s||(s={}))w.call(s,e)&&b(i,e,s[e]);if(f)for(var e of f(s))C.call(s,e)&&b(i,e,s[e]);return i};import{j as t,_ as g}from"./main.2.8.10.js";import{u as I,b as n}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{B as W}from"./BackIcn.BFDZx8No.js";import{S as k}from"./SnackMsg.7BjcJK1j.js";import{S as N}from"./Steps.B84Ui3GU.js";import{I as y,g as _}from"./Integrations.BFhED4ck.js";import B from"./WishlistMemberAuthorization.CDsOfyRn.js";import{c as u}from"./WishlistMemberCommonFunc.D1BdzkaF.js";import{W as E}from"./WishlistMemberIntegLayout.B9HFH6TP.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";function Z({formFields:i,setFlow:s,flow:e,allIntegURL:x}){const j=I(),[p,m]=n.useState(!1),[r,S]=n.useState(1),[v,a]=n.useState({show:!1}),[o,l]=n.useState({name:"Wishlist Member",type:"Wishlist Member",field_map:[{formField:"",wishlistMemberField:""}],wishlistFields:[],action:""}),c=d=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),d===3&&u(o)){a({show:!0,msg:g("Please map all required fields to continue.","bit-integrations")});return}S(d)};return t.jsxs("div",{children:[t.jsx(k,{snack:v,setSnackbar:a}),t.jsx("div",{className:"txt-center mt-2",children:t.jsx(N,{step:3,active:r})}),t.jsx(B,{wishlistMemberConf:o,setWishlistMemberConf:l,step:r,nextPage:c,isLoading:p,setIsLoading:m,setSnackbar:a}),t.jsxs("div",{className:"btcd-stp-page",style:h({},r===2&&{width:900,minHeight:"600px",height:"auto",overflow:"visible"}),children:[t.jsx(E,{formFields:i,wishlistMemberConf:o,setWishlistMemberConf:l,setSnackbar:a,setIsLoading:m}),t.jsx("br",{}),t.jsx("br",{}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>c(3),disabled:u(o),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[g("Next","bit-integrations"),t.jsx(W,{className:"ml-1 rev-icn"})]})]}),t.jsx(y,{step:r,saveConfig:()=>_(e,s,x,o,j,"","",m),isLoading:p,dataConf:o,setDataConf:l,formFields:i})]})}export{Z as default};
