import{F as a,o as u,b as d,a2 as x,j as e,h as r,B as n,a1 as h,m as p}from"./index-BXrEGOGf.js";import{R as g,a as j}from"./UserOutlined-H1Qqgxoz.js";const w=function(){const[c]=a.useForm(),i=u(),{t:s}=d(),t=x(),l=async o=>{try{await t.mutateAsync(o),i({to:"/"})}catch(m){console.error("login failed",m),p.error(s("account.usernameIncorrect"))}};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-[url(/bg.png)] p-4",children:e.jsxs("div",{className:"max-w-md w-full space-y-8 bg-white p-10 pb-4 rounded-xl shadow-lg",children:[e.jsxs("div",{className:"text-center",children:[e.jsxs("div",{className:"flex items-center justify-center gap-2",children:[e.jsx("img",{src:"/logo.svg",alt:"logo",className:"w-8 h-8"}),e.jsx("span",{className:"text-3xl text-gray-800",children:"Vis3"})]}),e.jsx("p",{className:"mt-2 text-gray-600",children:s("slogan")})]}),e.jsxs(a,{form:c,name:"login",layout:"vertical",initialValues:{remember:!0},onFinish:l,size:"large",className:"mt-8",children:[e.jsx(a.Item,{name:"username",rules:[{required:!0,message:s("account.usernamePlaceholder")}],children:e.jsx(r,{prefix:e.jsx(g,{className:"site-form-item-icon"}),placeholder:s("account.username")})}),e.jsx(a.Item,{name:"password",rules:[{required:!0,message:s("account.passwordPlaceholder")}],children:e.jsx(r.Password,{prefix:e.jsx(j,{className:"site-form-item-icon"}),placeholder:s("account.password")})}),e.jsx(a.Item,{children:e.jsx(n,{type:"primary",htmlType:"submit",className:"w-full",loading:t.isPending,children:s("account.login")})}),e.jsx(a.Item,{className:"text-center",children:e.jsx(n,{type:"link",className:"!px-0",size:"small",href:"/register",children:s("account.register")})})]}),e.jsx("div",{className:"flex items-center justify-center",children:e.jsx(h,{})})]})})};export{w as component};
