var L=(v,C,u)=>new Promise((w,d)=>{var s=l=>{try{i(u.next(l))}catch(t){d(t)}},h=l=>{try{i(u.throw(l))}catch(t){d(t)}},i=l=>l.done?w(l.value):Promise.resolve(l.value).then(s,h);i((u=u.apply(v,C)).next())});import{d as A,s as R,T,r as y,u as j,f as P,g as a,z as q,B as g,_ as F,D as x,V as E,W as J,o as I,h as e,j as K,n as S,F as n,J as M,R as W,l as X,L as m,M as f,P as _,N as G,K as D,X as b,q as H}from"./index-C8qz7c0N.js";import{_ as O}from"./wd-form.ITOgUkaZ.js";import{_ as Q}from"./login-logo.yJ3QTl4S.js";const Y=A({name:"Login",__name:"login",setup(v){const u=R().safeAreaInsets,w=T(),d=y(null),s=y({username:"",password:""});function h(){return new Promise(t=>{if(!s.value.username.trim()){b.error(_("auth.login.error.emptyUsername")),t(!1);return}if(!s.value.password.trim()){b.error(_("auth.login.error.emptyPassword")),t(!1);return}if(s.value.password.length<6||s.value.password.length>20){b.error(_("auth.login.error.passwordLength")),t(!1);return}t(!0)})}function i(){return L(this,null,function*(){try{if(!(yield h()))return;const r={account:s.value.username,pwd:s.value.password};yield w.login(r,d.value)}catch(t){}})}const l=y(null);return j(t=>{l.value=t.isReLaunch,d.value=t.redirect||null}),(t,r)=>{const U=g(x("wd-icon"),F),o=K,z=X,V=g(x("wd-input"),E),$=g(x("wd-button"),J),B=g(x("wd-form"),O),k=G,N=q("layout-default-uni");return I(),P(N,null,{default:a(()=>[e(o,{class:"login-page min-h-screen bg-white"},{default:a(()=>[e(o,{class:"auth-bg-section relative"},{default:a(()=>{var p;return[e(o,{style:S({paddingTop:`${(p=n(u))==null?void 0:p.top}px`})},{default:a(()=>[e(o,{class:"h-88rpx flex items-center px-24rpx"},{default:a(()=>[n(l)?M("",!0):(I(),P(U,{key:0,name:"thin-arrow-left",size:"32rpx",onClick:r[0]||(r[0]=()=>n(W)())}))]),_:1})]),_:1},8,["style"]),e(o,{class:"pb-40rpx pt-134rpx text-center"},{default:a(()=>[e(o,{class:"mb-20rpx flex flex-col items-center justify-center"},{default:a(()=>[e(z,{src:Q,class:"mb-18rpx h-56rpx w-350.48rpx"}),e(o,null,{default:a(()=>[m(f(t.$t("login.slogan")),1)]),_:1})]),_:1})]),_:1})]}),_:1}),e(o,{class:"flex flex-col px-20rpx"},{default:a(()=>{var p;return[e(o,{class:"mb-40rpx"}),e(B,{ref:"form",model:n(s)},{default:a(()=>[e(o,{class:"mb-40rpx space-y-32rpx"},{default:a(()=>[e(V,{modelValue:n(s).username,"onUpdate:modelValue":r[1]||(r[1]=c=>n(s).username=c),prop:"username",placeholder:n(_)("auth.login.username.placeholder"),"no-border":"","custom-class":"bandhu-auth-input-field"},null,8,["modelValue","placeholder"]),e(V,{modelValue:n(s).password,"onUpdate:modelValue":r[2]||(r[2]=c=>n(s).password=c),prop:"password",placeholder:n(_)("auth.login.password.placeholder"),"no-border":"","show-password":"","custom-class":"bandhu-auth-input-field"},null,8,["modelValue","placeholder"])]),_:1}),e($,{size:"large",block:"","custom-class":"mb-40rpx",onClick:i},{default:a(()=>[m(f(t.$t("auth.login.button")),1)]),_:1})]),_:1},8,["model"]),e(o,{class:"mb-200rpx text-center"},{default:a(()=>[e(k,{class:"text-28rpx text-#5C5C5C"},{default:a(()=>[m(f(t.$t("auth.login.noAccount")),1)]),_:1}),e(o,{class:"mt-40rpx"},{default:a(()=>[e($,{plain:"",onClick:r[3]||(r[3]=c=>n(D)({url:"/pages/register/register"}))},{default:a(()=>[m(f(t.$t("auth.login.register")),1)]),_:1})]),_:1})]),_:1}),e(o,{class:"absolute left-0 w-full text-center",style:S({bottom:`${((p=n(u))==null?void 0:p.bottom)+20}px`})},{default:a(()=>[e(k,{class:"text-28rpx text-#5C5C5C",onClick:r[4]||(r[4]=c=>n(D)({url:"/pages/forgotPassword/forgotPassword"}))},{default:a(()=>[m(f(t.$t("auth.login.forgotPassword")),1)]),_:1})]),_:1},8,["style"])]}),_:1})]),_:1})]),_:1})}}}),se=H(Y,[["__scopeId","data-v-ac8697e2"]]);export{se as default};
