import{a as b,l as h,G as f,H as i,J as l,K as u,s as w,b as x,L as c,M as L,P as C,h as a,k as T,p as y,m as k}from"./entry.731fa101.js";import{d as A}from"./component.6c997487.js";import R from"./LoginSVG.150727e9.js";import"./composables.3f41d4a8.js";const S=()=>b().$ilingo,m=(t,e)=>S().getSync(`validation.${t}`,e,"en"),V=A({setup(){const t=h({name:"",password:""}),e=f({name:{required:i,minLength:l(3),maxLength:u(255)},password:{required:i,minLength:l(3),maxLength:u(255)}},t),d=w(),p=x(!1),o=async()=>{try{await d.login(t.name,t.password);const s=T();y({path:s.query.redirect||"/"})}catch(s){k().warning(s.message)}},g=()=>{const s=c({validationResult:e.value.name,validationTranslator:m,labelContent:"Name",value:t.name,onChange(n){t.name=n}}),r=c({validationResult:e.value.password,validationTranslator:m,labelContent:"Password",value:t.password,onChange(n){t.password=n},props:{type:"password"}}),v=L({validationResult:e.value,createText:"Login",createButtonClass:{value:"btn btn-sm btn-dark btn-block",presets:{[C.BOOTSTRAP_V5]:!1}},createIconClass:"fa-solid fa-right-to-bracket",submit:o,busy:p});return a("div",{class:"container"},[a("h4",[a("i",{class:"fa-solid fa-arrow-right-to-bracket pe-2"}),"Login"]),a("div",{class:"text-center"},[a(R,{height:320})]),a("form",{onSubmit(n){return n.preventDefault(),o.call(null)}},[s,r,v])])};return()=>g()}});export{V as default};
