| Current Path : /home/users/unlimited/www/learnoid.codeskitter.site/public/build/assets/ |
| Current File : /home/users/unlimited/www/learnoid.codeskitter.site/public/build/assets/Login-D-x7SBW_.js |
import{_ as M,r as g,E as P,u as A,D as N,i as U,z as E,c as i,G as _,d as a,t as l,a as e,s as k,x as D,y as z,w as R,b as L,v as O,L as G,H,e as h,C as Y,F as q,S as y,f as J,o as c}from"./app-DM0q11P6.js";import{e as K,g as Q,F as W}from"./index-XZxFLTeX.js";/* empty css */const X={key:0,class:"powerBy"},Z={key:1,class:"version-badge"},ee={key:2,class:"bg-light d-flex align-items-center justify-content-center flex-grow-1"},se={class:"login-wizard bg-white col-12 col-lg-8 theme-shadow p-4 h-100"},te={class:"row"},oe={class:"col-12 col-lg-6 px-5 py-3"},ae={class:"text-center logo-img"},le=["src"],ne={class:"d-flex h-75 pb-3"},re={class:"my-auto w-100"},ie={class:"fw-bold mb-3"},ce={class:"text-muted"},de={class:"mb-4"},ue=["placeholder"],me={key:0,class:"text-danger fw-bold mt-2"},pe={class:"mb-3 position-relative"},ge=["type","placeholder"],fe={key:0,class:"text-danger fw-bold mt-2"},ve={type:"submit",class:"btn btn-primary w-100 rounded-pill"},_e={key:0,class:"border p-3 d-flex align-items-center justify-content-between rounded-4 my-3"},he={key:3,class:"loading"},ye={__name:"Login",setup(we){let m=g("");const S=g(!1),$=J(),V=P(),p=A(),w=g(""),b=g(""),x=g("Sign in"),{t:j}=N();let d=g(!1);const F=async()=>{var t,s,u,n,f,v;try{S.value=!0,x.value="Signing in...";const o=await E.post("/login",{email:w.value,password:b.value});V.setAuthData(o.data.data.token,o.data.data.user),y.fire({icon:"success",title:"Success",text:"Login successful",showConfirmButton:!1,timer:1500}),localStorage.getItem("handle_course_id")?($.push("/checkout/"+localStorage.getItem("handle_course_id")),localStorage.removeItem("handle_course_id")):$.push("/dashboard")}catch(o){S.value=!1,(t=o==null?void 0:o.response)!=null&&t.data.errors?m.value=(s=o==null?void 0:o.response)==null?void 0:s.data.errors:m.value=(u=o==null?void 0:o.response)==null?void 0:u.data.message,x.value="Sign in",((n=o==null?void 0:o.response)==null?void 0:n.status)===403&&y.fire({icon:"error",title:"Oops...",text:((v=(f=o.response)==null?void 0:f.data)==null?void 0:v.message)||"Login failed. Please try again."})}},I=(t,s)=>{w.value=t,b.value=s,y.mixin({toast:!0,position:"top-end",showConfirmButton:!1,timer:3e3,timerProgressBar:!0,didOpen:n=>{n.onmouseenter=y.stopTimer,n.onmouseleave=y.resumeTimer}}).fire({icon:"success",title:j("Demo credentials copied Successfully!!")})};return U(async()=>{p.data||E.get("/master",{headers:{"Content-Type":"application/json",Accept:"application/json"}}).then(t=>{p.setMasterData(t.data.data.master)}).catch(t=>{console.error("Error fetching data:",t)})}),(t,s)=>{var n,f,v,o,C,B;const u=z("router-link");return c(),i(q,null,[((f=(n=a(p))==null?void 0:n.masterData)==null?void 0:f.mode)=="local"?(c(),i("div",X,"Powered by RazinSoft ©"+l(new Date().getFullYear()),1)):_("",!0),((o=(v=a(p))==null?void 0:v.masterData)==null?void 0:o.mode)=="local"?(c(),i("div",Z,"v2.0.0")):_("",!0),S.value?(c(),i("div",he,s[8]||(s[8]=[Y('<svg class="pl" width="240" height="240" viewBox="0 0 240 240" data-v-1bc59f17><circle class="pl__ring pl__ring--a" cx="120" cy="120" r="105" fill="none" stroke="#000" stroke-width="20" stroke-dasharray="0 660" stroke-dashoffset="-330" stroke-linecap="round" data-v-1bc59f17></circle><circle class="pl__ring pl__ring--b" cx="120" cy="120" r="35" fill="none" stroke="#000" stroke-width="20" stroke-dasharray="0 220" stroke-dashoffset="-110" stroke-linecap="round" data-v-1bc59f17></circle><circle class="pl__ring pl__ring--c" cx="85" cy="120" r="70" fill="none" stroke="#000" stroke-width="20" stroke-dasharray="0 440" stroke-linecap="round" data-v-1bc59f17></circle><circle class="pl__ring pl__ring--d" cx="155" cy="120" r="70" fill="none" stroke="#000" stroke-width="20" stroke-dasharray="0 440" stroke-linecap="round" data-v-1bc59f17></circle></svg>',1)]))):(c(),i("section",ee,[e("section",se,[e("div",te,[e("div",oe,[e("div",ae,[k(u,{to:"/"},{default:D(()=>{var r,T;return[e("img",{src:(T=(r=a(p))==null?void 0:r.masterData)==null?void 0:T.logo,class:"object-fit-cover",alt:"Login"},null,8,le)]}),_:1})]),e("div",ne,[e("div",re,[e("h3",ie,l(t.$t("Login")),1),e("span",ce,l(t.$t("Boost your skill always and forever"))+".",1),e("form",{class:"my-4",onSubmit:R(F,["prevent"])},[e("div",de,[L(e("input",{type:"email","onUpdate:modelValue":s[0]||(s[0]=r=>w.value=r),class:"form-control",placeholder:t.$t("Email Address")},null,8,ue),[[O,w.value]]),a(m).email?(c(),i("p",me,l(a(m).email[0]),1)):_("",!0)]),e("div",pe,[L(e("input",{type:a(d)?"text":"password","onUpdate:modelValue":s[1]||(s[1]=r=>b.value=r),class:"form-control",placeholder:t.$t("Password")},null,8,ge),[[G,b.value]]),a(m).password?(c(),i("p",fe,l(a(m).password[0]),1)):_("",!0),e("div",{class:"eye-icon",onClick:s[2]||(s[2]=r=>H(d)?d.value=!a(d):d=!a(d))},[k(a(W),{icon:a(d)?a(K):a(Q)},null,8,["icon"])])]),k(u,{to:"/reset_password",class:"small d-block text-decoration-none mb-4"},{default:D(()=>[h(l(t.$t("Forgot your password"))+"?",1)]),_:1}),e("button",ve,l(x.value),1)],32),e("span",null,[h(l(t.$t("Don't have an account"))+"? ",1),k(u,{to:"/register"},{default:D(()=>[h(l(t.$t("Sign Up")),1)]),_:1})]),((B=(C=a(p))==null?void 0:C.masterData)==null?void 0:B.mode)=="local"?(c(),i("div",_e,[e("div",null,[e("strong",null,l(t.$t("Email"))+":",1),s[4]||(s[4]=h(" user@readylms.com ")),s[5]||(s[5]=e("br",null,null,-1)),e("strong",null,l(t.$t("Password"))+":",1),s[6]||(s[6]=h(" secret@123 "))]),e("button",{onClick:s[3]||(s[3]=r=>I("user@readylms.com","secret@123")),class:"btn btn-sm btn-outline-primary small float-end"},l(t.$t("Copy")),1)])):_("",!0)])])]),s[7]||(s[7]=e("div",{class:"col-6 d-none d-lg-block my-auto"},[e("img",{src:"/assets/images/website/image.png",class:"side-image object-fit-cover w-100"})],-1))])])]))],64)}}},xe=M(ye,[["__scopeId","data-v-1bc59f17"]]);export{xe as default};