2 lines
3.9 KiB
JavaScript
2 lines
3.9 KiB
JavaScript
import{_ as S,K as V,q as g,J as u,N as D,D as P,v as G,r as w,e as n,f as e,g as _,t as a,O as b,P as y,h as o,n as I,F as $,i as k,j as p,af as U,l as L,E as N,M as A,w as B,a as E,c as l,k as F}from"./index.86e1cebf.js";import{c as x,r as M,e as q,m as K,u as j}from"./index.esm.1c33b54f.js";import{L as H}from"./Main.7a6f5f37.js";import{_ as Q}from"./Main.27f3939b.js";import{_ as W}from"./Main.4ab270f3.js";const z={class:"container"},J={class:"block xl:grid grid-cols-2 gap-4"},Y={class:"h-screen xl:h-auto md:flex py-5 xl:py-0 my-10 xl:my-0"},X={class:"md:hidden mb-6"},Z={class:"text-center text-white text-lg ml-3"},ee={class:"my-auto mx-auto xl:ml-20 bg-white dark:bg-darkmode-600 xl:bg-transparent px-5 sm:px-8 py-8 xl:p-0 rounded-md shadow-md xl:shadow-none w-full sm:w-3/4 lg:w-2/4 xl:w-auto"},te={class:"flex items-center justify-between"},se={class:"intro-x font-bold text-2xl xl:text-3xl text-center xl:text-left"},oe={class:"intro-x mt-2 text-slate-400 xl:hidden text-center"},ae={class:"intro-x mt-8"},re=["placeholder"],le=["placeholder","onKeyup"],ne={class:"intro-x flex text-slate-600 dark:text-slate-500 text-xs sm:text-sm mt-4"},ie={class:"intro-x mt-5 xl:mt-8 text-center xl:text-left"},de=["onClick"],ce={class:"intro-x mt-5 xl:mt-8 text-primary xl:text-left"},me=["onClick"],ue={__name:"Main",setup(_e){const i=V({email:"",password:""}),d=g(!1),c=g(!1),O={email:{required:x.withMessage(u.global.t("REQUIRED_VALIDATION"),M),email:x.withMessage(u.global.t("EMAIL_VALIDATION"),q)},password:{required:x.withMessage(u.global.t("REQUIRED_VALIDATION"),M),minLength:x.withMessage(u.global.t("MIN_LENGTH_VALIDATION",{min:8}),K(8))}},t=j(O,D(i)),h=async()=>{if(d.value)return;const s=E();t.value.$touch(),!t.value.$invalid&&(d.value=!0,await s.login(i.email,i.password),d.value=!1)},T=async()=>{if(c.value||(t.value.email.$touch(),t.value.email.$invalid))return;c.value=!0,await E().forgotPassword(i.email),c.value=!1},C=()=>F.push({path:"/register"});return P(()=>{G("body").removeClass("main").removeClass("error-page").addClass("login")}),(s,m)=>{const f=w("LoadingIcon"),R=w("i18n-t");return l(),n("div",null,[e("div",z,[e("div",J,[_(Q),e("div",Y,[e("div",X,[e("a",null,[_(H,{class:"mx-auto"}),e("div",Z,a(s.$t("APP_TITLE")),1)])]),e("div",ee,[e("div",te,[e("h2",se,a(s.$t("SIGN_IN")),1),_(W)]),e("div",oe,a(s.$t("SING_IN_MOTIVATION_MOBILE")),1),e("div",ae,[b(e("input",{type:"text","onUpdate:modelValue":m[0]||(m[0]=r=>o(t).email.$model=r),class:I(["intro-x login__input form-control py-3 px-4 block mt-4",{"border-danger":o(t).email.$error}]),placeholder:s.$t("EMAIL")},null,10,re),[[y,o(t).email.$model,void 0,{trim:!0}]]),o(t).email.$error?(l(!0),n($,{key:0},k(o(t).email.$errors,(r,v)=>(l(),n("div",{key:v,class:"text-danger mt-2"},a(r.$message),1))),128)):p("",!0),b(e("input",{type:"password","onUpdate:modelValue":m[1]||(m[1]=r=>o(t).password.$model=r),class:I(["intro-x login__input form-control py-3 px-4 block mt-4",{"border-danger":o(t).password.$error}]),placeholder:s.$t("PASSWORD"),onKeyup:U(h,["enter"])},null,42,le),[[y,o(t).password.$model,void 0,{trim:!0}]]),o(t).password.$error?(l(!0),n($,{key:1},k(o(t).password.$errors,(r,v)=>(l(),n("div",{key:v,class:"text-danger mt-2"},a(r.$message),1))),128)):p("",!0)]),e("div",ne,[e("a",{type:"button",class:"flex items-center ml-auto cursor-pointer",onClick:T},[L(a(s.$t("FORGOT_PASSWORD"))+" ",1),c.value?(l(),N(f,{key:0,icon:"oval",class:"w-4 h-4 ml-2 primary"})):p("",!0)])]),e("div",ie,[e("button",{class:"btn btn-primary py-3 px-4 w-full xl:mr-3 align-top custom-btns",onClick:A(h,["prevent"])},[L(a(s.$t("LOGIN"))+" ",1),d.value?(l(),N(f,{key:0,icon:"oval",color:"white",class:"w-4 h-4 ml-2"})):p("",!0)],8,de)]),e("div",ce,[_(R,{keypath:"YOU_HAVE_NO_ACCOUNT",for:"REGISTER",class:"w-full text-center",tag:"p"},{default:B(()=>[e("a",{onClick:A(C,["prevent"]),href:"#",class:"font-bold underline"},a(s.$t("REGISTER")),9,me)]),_:1})])])])])])])}}};var ge=S(ue,[["__scopeId","data-v-83f9bdbc"]]);export{ge as default};
|