import{y as v,u as h,l as u,n as b,P as w}from"./auth.8c936e9a.js";import{a as x,r as m,m as c,c as p,u as L}from"./entry.0b5898f4.js";import{u as y,l as C,n as T}from"./nuxt-link.a91ddf68.js";import"./app.config.5ff5ca90.js";import A from"./LoginSVG.52eb3125.js";import{d as P,r as R,h as e}from"./runtime-core.esm-bundler.24b58585.js";import"./composables.050e3231.js";import"./utils.61cc85c6.js";import"./layout.1eaf47bc.js";import"./page.16487999.js";import"./_plugin-vue_export-helper.c27b6911.js";const S=()=>y().$ilingo,d=(t,s)=>S().getSync(`validation.${t}`,s,"en"),M=v({setup(){const t=P({name:"",password:""}),s=x({name:{required:m,minLength:c(3),maxLength:p(255)},password:{required:m,minLength:c(3),maxLength:p(255)}},t),i=h(),g=R(!1),l=async()=>{try{await i.login(t.name,t.password);const a=C(),{redirect:n,...r}=a.query;T({path:n||"/",query:r})}catch(a){a instanceof Error&&L().warning(a.message)}};Promise.resolve().then(i.logout);const f=()=>{const a=u({validationResult:s.value.name,validationTranslator:d,labelContent:"Name",value:t.name,onChange(o){t.name=o}}),n=u({validationResult:s.value.password,validationTranslator:d,labelContent:"Password",value:t.password,onChange(o){t.password=o},props:{type:"password"}}),r=b({validationResult:s.value,createText:"Login",createButtonClass:{value:"btn btn-sm btn-dark btn-block",presets:{[w.BOOTSTRAP_V5]:!1}},createIconClass:"fa-solid fa-right-to-bracket",submit:l,busy:g});return e("div",{class:"container"},[e("h4",[e("i",{class:"fa-solid fa-arrow-right-to-bracket pe-2"}),"Login"]),e("div",{class:"text-center"},[e(A,{height:320})]),e("form",{onSubmit(o){return o.preventDefault(),l.call(null)}},[a,n,r])])};return()=>f()}});export{M as default};
