import{j as t,_ as l}from"./main.2.9.0.js";import{u as j,b as r}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{B as R}from"./BackIcn._8Wofmn2.js";import{S}from"./SnackMsg.DYSD96P4.js";import{I as C,g as I}from"./Integrations.DL8wqGct.js";import M from"./UserRegistrationMembershipAuthorization.D6fNUeT5.js";import{c as f}from"./UserRegistrationMembershipCommonFunc.BC_aLMtu.js";import{U}from"./UserRegistrationMembershipIntegLayout.BQU2S0-D.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 G({formFields:p,setFlow:d,flow:u,allIntegURL:x}){const b=j(),[o,a]=r.useState(!1),[s,c]=r.useState(1),[h,i]=r.useState({show:!1}),[e,n]=r.useState({name:"User Registration & Membership",type:"User Registration & Membership",field_map:[{formField:"",userRegistrationField:""}],actions:{},mainAction:""}),g=m=>{if(setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),m===3){if(!f(e)){i({show:!0,msg:l("Please map all required fields to continue.","bit-integrations")});return}e.name!==""&&e.field_map.length>0&&c(m)}else c(m)};return t.jsxs("div",{children:[t.jsx(S,{snack:h,setSnackbar:i}),t.jsx("div",{className:"txt-center mt-2"}),t.jsx(M,{userRegistrationConf:e,setUserRegistrationConf:n,step:s,nextPage:g,isLoading:o,setIsLoading:a,setSnackbar:i}),t.jsxs("div",{className:"btcd-stp-page",style:{width:s===2&&900,height:s===2&&"auto",minHeight:s===2&&"500px"},children:[t.jsx(U,{userRegistrationConf:e,setUserRegistrationConf:n,setSnackbar:i,setIsLoading:a,isLoading:o,formFields:p}),t.jsx("br",{}),t.jsx("br",{}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>g(3),disabled:!f(e),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[l("Next","bit-integrations"),t.jsx(R,{className:"ml-1 rev-icn"})]})]}),t.jsx(C,{step:s,saveConfig:()=>I(u,d,x,e,b,"","",a),isLoading:o,dataConf:e,setDataConf:n,formFields:p})]})}export{G as default};
