import{j as e,_ as f}from"./main.2.8.1.js";import{u as j,h as C,d as r}from"./react-router-dom.9mCuUg3q.js";import"./Note.BeM7sN-p.js";import{B as F}from"./BackIcn._kGL_vVw.js";import{S as T}from"./SnackMsg.S8DrwLlT.js";import{I as S,g as I}from"./Integrations.D2bgBas2.js";import M from"./TeamsForWooCommerceMembershipsAuthorization.BGTPJe6H.js";import{T as W,c as k}from"./TeamsForWooCommerceMembershipsIntegLayout.DhBshasS.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";import"./GlobalIntegrationHelper.CgnhJgll.js";function J({formFields:p,setFlow:g,flow:h,allIntegURL:u}){const x=j(),{formID:c}=C(),[a,m]=r.useState(!1),[s,l]=r.useState(1),[b,o]=r.useState({show:!1}),[t,i]=r.useState({name:"Teams For WooCommerce Memberships",type:"Teams For WooCommerce Memberships",field_map:[{formField:"",teamsForWooCommerceMembershipsField:""}],mainAction:""}),d=n=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),n===3){if(!k(t)){o({show:!0,msg:f("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:b,setSnackbar:o}),e.jsx("div",{className:"txt-center mt-2"}),e.jsx(M,{formID:c,teamsForWcConf:t,setTeamsForWcConf:i,step:s,nextPage:d,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&&"200px"},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:()=>d(3),disabled:t.field_map.length<1,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[f("Next","bit-integrations"),e.jsx(F,{className:"ml-1 rev-icn"})]})]}),e.jsx(S,{step:s,saveConfig:()=>I(h,g,u,t,x,"","",m),isLoading:a,dataConf:t,setDataConf:i,formFields:p})]})}export{J as default};
