import{j as t,_ as c}from"./main.2.8.10.js";import{u as j,e as v,b as i}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{B as C}from"./BackIcn.BFDZx8No.js";import{S as M}from"./SnackMsg.7BjcJK1j.js";import{I as S,g as I}from"./Integrations.BFhED4ck.js";import W from"./MoreConvertWishlistAuthorization.BKzeS4CR.js";import{M as k,c as N}from"./MoreConvertWishlistIntegLayout.bzPtp_Bg.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 K({formFields:d,setFlow:f,flow:g,allIntegURL:h}){const u=j(),{formID:x}=v(),[n,a]=i.useState(!1),[s,m]=i.useState(1),[b,o]=i.useState({show:!1}),[e,l]=i.useState({name:"MoreConvert Wishlist",type:"MoreConvert Wishlist",field_map:[{formField:"",moreConvertWishlistField:""}],actions:{},mainAction:""}),p=r=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),r===3){if(!N(e)){o({show:!0,msg:c("Please map all required fields to continue.","bit-integrations")});return}e.name!==""&&e.field_map.length>0&&m(r)}else m(r)};return t.jsxs("div",{children:[t.jsx(M,{snack:b,setSnackbar:o}),t.jsx("div",{className:"txt-center mt-2"}),t.jsx(W,{formID:x,moreConvertWishlistConf:e,setMoreConvertWishlistConf:l,step:s,nextPage:p,isLoading:n,setIsLoading:a,setSnackbar:o}),t.jsxs("div",{className:"btcd-stp-page",style:{width:s===2&&900,height:s===2&&"auto",minHeight:s===2&&"500px"},children:[t.jsx(k,{formFields:d,moreConvertWishlistConf:e,setMoreConvertWishlistConf:l}),t.jsx("br",{}),t.jsx("br",{}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>p(3),disabled:e.field_map.length<1,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[c("Next","bit-integrations"),t.jsx(C,{className:"ml-1 rev-icn"})]})]}),t.jsx(S,{step:s,saveConfig:()=>I(g,f,h,e,u,"","",a),isLoading:n})]})}export{K as default};
