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