import{j as e,_ as d}from"./main.2.9.0.js";import{u as j,e as C,b as r}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{B as F}from"./BackIcn._8Wofmn2.js";import{S as T}from"./SnackMsg.DYSD96P4.js";import{I as S,g as I}from"./Integrations.DL8wqGct.js";import M from"./TeamsForWooCommerceMembershipsAuthorization.BQizF6_s.js";import{T as W,c as k}from"./TeamsForWooCommerceMembershipsIntegLayout.Bi6wDp6i.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TutorialLink.CFG7bS5c.js";import"./ProUtilHelpers.CHf_DzPf.js";import"./TagifyInput.KPPRQJ1B.js";import"./lodash.DCvQBX3r.js";import"./GlobalIntegrationHelper.B6YI8w_n.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};
