import{r as a,j as e}from"./main-406.js";import{B as N}from"./bi.46.744.js";import{_ as i,L as k,b as A,A as v}from"./bi.394.85.js";import{T as h,t as w}from"./bi.150.760.js";function T({academyLmsConf:o,setAcademyLmsConf:d,step:r,setStep:b,setSnackbar:m}){const{academyLms:t}=w,[n,p]=a.useState(!1),[l,c]=a.useState(!1),[g,x]=a.useState(!1),f=()=>{c("auth"),A({},"academy_lms_authorize").then(s=>{s!=null&&s.success&&(p(!0),m({show:!0,msg:i("Connected with Academy Lms Successfully","bit-integrations")})),c(!1),x(!0)})},j=s=>{const u=v(o);u[s.target.name]=s.target.value,d(u)};return e.jsxs("div",{className:"btcd-stp-page",style:{width:r===1&&900,height:r===1&&"auto"},children:[(t==null?void 0:t.youTubeLink)&&e.jsx(h,{title:t==null?void 0:t.title,youTubeLink:t==null?void 0:t.youTubeLink}),(t==null?void 0:t.docLink)&&e.jsx(h,{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:o.name,type:"text",placeholder:i("Integration Name...","bit-integrations")}),l==="auth"&&e.jsxs("div",{className:"flx mt-5",children:[e.jsx(k,{size:25,clr:"#022217",className:"mr-2"}),"Checking if Academy Lms is active!!!"]}),g&&!n&&!l&&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:"×"}),"Academy Lms 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{T as default};
