var S=Object.defineProperty;var u=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,z=Object.prototype.propertyIsEnumerable;var b=(i,e,s)=>e in i?S(i,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[e]=s,x=(i,e)=>{for(var s in e||(e={}))w.call(e,s)&&b(i,s,e[s]);if(u)for(var s of u(e))z.call(e,s)&&b(i,s,e[s]);return i};import{j as t,_ as a,b as M}from"./main.2.8.10.js";import{b as p}from"./react-router.DMwpH23k.js";import{B as k}from"./BackIcn.BFDZx8No.js";import{y as j}from"./Note.DalStCGz.js";import{T as A}from"./TutorialLink.D6K_DiHL.js";import"./react-vendor.P7K3d6op.js";import"./CopyIcn.BnhKHfEP.js";function H({formID:i,creatorLmsConf:e,setCreatorLmsConf:s,step:l,nextPage:f,isLoading:r,setIsLoading:o,setSnackbar:N,isInfo:m}){const[c,g]=p.useState(!1),[d,v]=p.useState(!1),C=()=>{o("auth"),M({},"creator_lms_authorize").then(n=>{n!=null&&n.success&&(g(!0),N({show:!0,msg:a("Connected with Creator LMS Successfully","bit-integrations")})),o(!1),v(!0)})},y=n=>{const h=x({},e);h[n.target.name]=n.target.value,s(h)};return t.jsxs("div",{className:"btcd-stp-page",style:{width:l===1&&900,height:l===1&&"auto"},children:[t.jsx(A,{linkKey:"creatorLms"}),t.jsx("div",{className:"mt-3",children:t.jsx("b",{children:a("Integration Name:","bit-integrations")})}),t.jsx("input",{className:"btcd-paper-inp w-6 mt-1",onChange:y,name:"name",value:e.name,type:"text",placeholder:a("Integration Name...","bit-integrations"),disabled:m}),r==="auth"&&t.jsxs("div",{className:"flx mt-5",children:[t.jsx(j,{size:25,clr:"#022217",className:"mr-2"}),a("Checking if Creator LMS is authorized!!!","bit-integrations")]}),d&&!c&&!r&&t.jsx("div",{className:"flx mt-5",style:{width:900,justifyContent:"center"},children:t.jsxs("div",{className:"txt-center",children:[t.jsx("div",{className:"btcd-icn btcd-icn-err",children:t.jsx("span",{children:"✕"})}),t.jsx("div",{className:"mt-2",children:a("Creator LMS is not activated or not installed","bit-integrations")})]})}),d&&c&&!r&&t.jsxs("div",{className:"flx mt-5",style:{width:900},children:[t.jsx("div",{className:"btcd-icn btcd-icn-success",children:t.jsx("span",{children:"✓"})}),t.jsx("div",{className:"mt-2",children:a("Creator LMS is activated","bit-integrations")})]}),t.jsxs("button",{onClick:C,className:"btn btcd-btn-lg purple sh-sm flx",type:"button",disabled:c||r==="auth"||m,children:[c?a("Connected","bit-integrations"):a("Connect to Creator LMS","bit-integrations"),r==="auth"&&t.jsx(j,{size:20,clr:"#022217",className:"ml-2"})]}),t.jsx("br",{}),t.jsxs("button",{onClick:()=>f(2),className:"btn f-right btcd-btn-lg purple sh-sm flx",type:"button",disabled:!c,children:[a("Next","bit-integrations"),t.jsx(k,{className:"ml-1 rev-icn"})]})]})}export{H as default};
