import{j as t,_ as w}from"./main.2.9.0.js";import{u as C,e as j,b as r}from"./react-router.DMwpH23k.js";import"./CopyIcn.CEA_lFLo.js";import{B as b}from"./BackIcn._8Wofmn2.js";import{S}from"./SnackMsg.DYSD96P4.js";import{S as v}from"./Steps.BYe8zHkm.js";import{I as P,s as I}from"./Integrations.DL8wqGct.js";import N from"./WPCoursewareAuthorization.1DQEh1UP.js";import{W}from"./WPCoursewareIntegLayout.fm7Dgqqu.js";import"./react-vendor.P7K3d6op.js";import"./Note.NSUdvR3c.js";import"./Table.BfF8RYFZ.js";import"./index.DpWdl9V1.js";import"./TutorialLink.CFG7bS5c.js";function q({formFields:c,setFlow:f,flow:d,allIntegURL:g}){const x=C(),{formID:m}=j(),[p,i]=r.useState(!1),[e,u]=r.useState(1),[h,o]=r.useState({show:!1}),[s,n]=r.useState({name:"WP Courseware",type:"WP Courseware",field_map:[{formField:"",wpCoursewareField:""}],default:{},action:"",course:[],actions:{}}),l=a=>{(a===2&&s.name!==""||a===3&&s.action!==""&&s.course.length>0)&&u(a),document.getElementById("btcd-settings-wrp").scrollTop=0};return t.jsxs("div",{children:[t.jsx(S,{snack:h,setSnackbar:o}),t.jsx("div",{className:"txt-center mt-2",children:t.jsx(v,{step:3,active:e})}),t.jsx(N,{formID:m,wpCoursewareConf:s,setWPCoursewareConf:n,step:e,nextPage:l,isLoading:p,setIsLoading:i,setSnackbar:o}),t.jsx("div",{className:"btcd-stp-page",style:{overflow:e===2&&"initial",width:e===2&&900,height:e===2&&"auto",minHeight:e===2&&"500px"},children:t.jsx(W,{formID:m,formFields:c,wpCoursewareConf:s,setWPCoursewareConf:n,setIsLoading:i,setSnackbar:o})}),t.jsx(P,{step:e,saveConfig:()=>I({flow:d,setFlow:f,allIntegURL:g,conf:s,navigate:x,setIsLoading:i,setSnackbar:o}),isLoading:p,dataConf:s,setDataConf:n,formFields:c}),t.jsx("div",{className:"btcd-stp-page",style:{width:e===2&&900,height:e===2&&"auto",minHeight:e===2&&"500px"},children:t.jsxs("button",{onClick:()=>l(3),disabled:s.action===""||s.course.length===0,className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",children:[w("Next","bit-integrations"),t.jsx(b,{className:"ml-1 rev-icn"})]})})]})}export{q as default};
