var C=Object.defineProperty;var f=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable;var b=(o,e,s)=>e in o?C(o,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):o[e]=s,g=(o,e)=>{for(var s in e||(e={}))M.call(e,s)&&b(o,s,e[s]);if(f)for(var s of f(e))A.call(e,s)&&b(o,s,e[s]);return o};import{_ as a,j as i}from"./main.2.8.10.js";import{u as w,e as N,b as l}from"./react-router.DMwpH23k.js";import"./CopyIcn.BnhKHfEP.js";import{S as _}from"./SnackMsg.7BjcJK1j.js";import{S as z}from"./Steps.B84Ui3GU.js";import{I as D,s as E}from"./Integrations.BFhED4ck.js";import{M as T,h as F}from"./MasterStudyLmsIntegLayout.CXikO0fM.js";import P from"./MasterStudyLmsAuthorization.B4G4s0Qj.js";import"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./Note.DalStCGz.js";import"./Table.DSsAy4VI.js";import"./index.DpWdl9V1.js";import"./BackIcn.BFDZx8No.js";function U({formFields:o,setFlow:e,flow:s,allIntegURL:d,isInfo:h,edit:x}){const v=w(),{formID:S}=N(),[n,u]=l.useState(!1),[r,p]=l.useState(1),[y,c]=l.useState({show:!1}),j=[{key:"1",label:a("Course complete for the user","bit-integrations")},{key:"2",label:a("Lesson complete for the user","bit-integrations")},{key:"3",label:a("Quiz complete for the user","bit-integrations")},{key:"4",label:a("Reset user course","bit-integrations")},{key:"5",label:a("Reset user lesson","bit-integrations")}],[t,m]=l.useState({name:"MasterStudyLms",type:"MasterStudyLms",mainAction:"",field_map:[{formField:"",msLmsFormField:""}],allActions:j,actions:{}}),I=()=>{setTimeout(()=>{document.getElementById("btcd-settings-wrp").scrollTop=0},300),t.mainAction!==""&&p(3)};function L(){switch(t.mainAction){case"1":return t.courseId===void 0;case"4":return t.courseId===void 0;case"2":return t.lessonId===void 0;case"5":return t.lessonId===void 0;case"3":return t.quizId===void 0;default:return!1}}return i.jsxs("div",{children:[i.jsx(_,{snack:y,setSnackbar:c}),i.jsx("div",{className:"txt-center mt-2",children:i.jsx(z,{step:3,active:r})}),i.jsx(P,{formID:S,msLmsConf:t,setMsLmsConf:m,step:r,setStep:p,isLoading:n,setIsLoading:u,setSnackbar:c}),i.jsxs("div",{className:"btcd-stp-page",style:g({},r===2&&{width:900,height:"auto",overflow:"visible"}),children:[i.jsx(T,{formFields:o,handleInput:k=>F(k,t,m),msLmsConf:t,setMsLmsConf:m,isLoading:n,setIsLoading:u,setSnackbar:c,allIntegURL:d,isInfo:h,edit:x}),i.jsxs("button",{onClick:()=>I(),disabled:!t.mainAction||n||L(),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[a("Next","bit-integrations")," ",i.jsx("div",{className:"btcd-icn icn-arrow_back rev-icn d-in-b"})]})]}),i.jsx(D,{step:r,saveConfig:()=>E({flow:s,setFlow:e,allIntegURL:d,navigate:v,conf:t,setIsLoading:u,setSnackbar:c}),isLoading:n,dataConf:t,setDataConf:m,formFields:o})]})}export{U as default};
