import{r as h,j as e}from"./main-406.js";import{B as N}from"./bi.46.744.js";import{_ as i,L as k,b as v,A as w}from"./bi.394.85.js";import{T as m,t as z}from"./bi.150.760.js";function _({formID:C,msLmsConf:a,setMsLmsConf:u,step:o,setStep:b,isLoading:c,setIsLoading:l,setSnackbar:d}){const[n,p]=h.useState(!1),[x,g]=h.useState(!1),{masterStudyLMS:t}=z,f=()=>{l("auth"),v({},"MasterStudyLms_authorize").then(s=>{s!=null&&s.success&&(p(!0),d({show:!0,msg:i("Connected with MasterStudyLMs Successfully","bit-integrations")})),l(!1),g(!0)})},j=s=>{const r=w(a);r[s.target.name]=s.target.value,u(r)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:o===1&&900,height:o===1&&"auto"},children:[(t==null?void 0:t.youTubeLink)&&e.jsx(m,{title:t==null?void 0:t.title,youTubeLink:t==null?void 0:t.youTubeLink}),(t==null?void 0:t.docLink)&&e.jsx(m,{title:t==null?void 0:t.title,docLink:t==null?void 0:t.docLink}),e.jsx("div",{className:"mt-3",children:e.jsx("b",{children:i("Integration Name:","bit-integrations")})}),e.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:j,name:"name",value:a.name,type:"text",placeholder:i("Integration Name...","bit-integrations")}),c==="auth"&&e.jsxs("div",{className:"flx mt-5",children:[e.jsx(k,{size:25,clr:"#022217",className:"mr-2"}),"Checking if MasterStudyLms is active!!!"]}),x&&!n&&!c&&e.jsxs("div",{className:"flx mt-5",style:{color:"red"},children:[e.jsx("span",{className:"btcd-icn mr-2",style:{fontSize:30,marginTop:-5},children:"×"}),"MasterStudyLms plugin must be activated to integrate with Bit Integrations."]}),!n&&e.jsx("button",{onClick:f,className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",children:i("Connect","bit-integrations")}),n&&e.jsxs("button",{onClick:()=>b(2),className:"btn btcd-btn-lg purple sh-sm flx mt-5",type:"button",disabled:!n,children:[i("Next","bit-integrations"),e.jsx(N,{className:"ml-1 rev-icn"})]})]})}export{_ as default};
