var M=Object.defineProperty;var f=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var h=(i,s,e)=>s in i?M(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e,b=(i,s)=>{for(var e in s||(s={}))w.call(s,e)&&h(i,e,s[e]);if(f)for(var e of f(s))C.call(s,e)&&h(i,e,s[e]);return i};import{j as t,_ as g}from"./main.2.8.1.js";import{u as I,d as n}from"./react-router-dom.9mCuUg3q.js";import"./Note.BeM7sN-p.js";import{B as W}from"./BackIcn._kGL_vVw.js";import{S as k}from"./SnackMsg.S8DrwLlT.js";import{S as N}from"./Steps.1hz7v9Vj.js";import{I as y,g as _}from"./Integrations.D2bgBas2.js";import B from"./WishlistMemberAuthorization.Bohwd9dZ.js";import{c as u}from"./WishlistMemberCommonFunc.BnmMgjU4.js";import{W as E}from"./WishlistMemberIntegLayout.GdNWFvPb.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./tutorialLinks.kMkIDzcD.js";import"./TutorialLink.BAFX--T3.js";import"./ProUtilHelpers.fQlR3mWW.js";import"./TagifyInput.Cu0YIRbG.js";import"./tagify.YxUZd8Ix.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:b({},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};
