var q=Object.defineProperty;var u=Object.getOwnPropertySymbols;var C=Object.prototype.hasOwnProperty,S=Object.prototype.propertyIsEnumerable;var f=(a,t,i)=>t in a?q(a,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):a[t]=i,g=(a,t)=>{for(var i in t||(t={}))C.call(t,i)&&f(a,i,t[i]);if(u)for(var i of u(t))S.call(t,i)&&f(a,i,t[i]);return a};import{_ as e,j as r}from"./main.2.8.1.js";import{u as N,d as m}from"./react-router-dom.9mCuUg3q.js";import"./Note.BeM7sN-p.js";import{S as R}from"./SnackMsg.S8DrwLlT.js";import{S as L}from"./Steps.1hz7v9Vj.js";import{I,s as w}from"./Integrations.D2bgBas2.js";import A from"./RestrictContentAuthorization.DajagvSU.js";import{R as E}from"./RestrictContentIntegLayout.CvgxfVdK.js";import{h as F}from"./RestrictContentCommonFunc.CEEFyJFV.js";import"./CopyIcn.3gZpHton.js";import"./Table.DAL7rcPQ.js";import"./index.wO-AxluA.js";import"./BackIcn._kGL_vVw.js";import"./TutorialLink.BAFX--T3.js";import"./tutorialLinks.kMkIDzcD.js";import"./tagify.YxUZd8Ix.js";function Y({formFields:a,setFlow:t,flow:i,allIntegURL:y}){const v=N(),[b,n]=m.useState(!1),[o,p]=m.useState(1),[k,l]=m.useState({show:!1}),x=[{key:"user_login",label:e("User Name","bit-integrations"),required:!0},{key:"user_email",label:e("Email","bit-integrations"),required:!0},{key:"user_pass",label:e("User Password","bit-integrations"),required:!1},{key:"first_name",label:e("First Name","bit-integrations"),required:!1},{key:"last_name",label:e("Last Name","bit-integrations"),required:!1},{key:"company",label:e("Company","bit-integrations"),required:!1},{key:"address1",label:e("Address Line 1","bit-integrations"),required:!1},{key:"address2",label:e("Address Line 2","bit-integrations"),required:!1},{key:"city",label:e("City","bit-integrations"),required:!1},{key:"state",label:e("State","bit-integrations"),required:!1},{key:"zip",label:e("Zip","bit-integrations"),required:!1},{key:"country",label:e("Country","bit-integrations"),required:!1}],h=[{key:"add-member-level",label:e("Add the user to a level","bit-integrations")},{key:"remove-member-level",label:e("Remove the user to a level","bit-integrations")}],[s,d]=m.useState({name:"Restrict Content",type:"RestrictContent",field_map:[{formField:"",restrictField:""}],exp_date:"",memberFields:x,actionLists:h,actions:{}}),_=()=>{n(!0),w({flow:i,setFlow:t,allIntegURL:y,conf:s,navigate:v,setIsLoading:n,setSnackbar:l})},j=c=>{s.field_map.length>0&&p(c)};return r.jsxs("div",{children:[r.jsx(R,{snack:k,setSnackbar:l}),r.jsx("div",{className:"txt-center mt-2",children:r.jsx(L,{step:3,active:o})}),r.jsx(A,{restrictConf:s,setRestrictConf:d,step:o,setStep:p,isLoading:b,setIsLoading:n,setSnackbar:l}),r.jsxs("div",{className:"btcd-stp-page",style:g({},o===2&&{width:900,height:"auto",overflow:"visible"}),children:[r.jsx(E,{formFields:a,handleInput:c=>F(c,s,d),restrictConf:s,setRestrictConf:d,isLoading:b,setIsLoading:n,setSnackbar:l}),r.jsxs("button",{onClick:()=>j(3),disabled:!(s!=null&&s.level_id)&&!(s!=null&&s.member_id),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[e("Next","bit-integrations"),"  ",r.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),r.jsx(I,{step:o,saveConfig:()=>_(),isLoading:b,dataConf:s,setDataConf:d,formFields:a})]})}export{Y as default};
