module.exports=[12576,(a,b,c)=>{"use strict";b.exports=a.r(81232).vendored["react-ssr"].ReactServerDOMTurbopackClient},27532,a=>{"use strict";var b=a.i(6155),c=a.i(54297),d=a.i(1845),e=a.i(14672),f=a.i(31483),g=a.i(8895),h=a.i(59580),i=a.i(85801),j=a.i(99766),k=a.i(24749),l=a.i(38076);function m(){(0,e.useRouter)();let[a,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(""),[r,s]=(0,c.useState)(!1),t=async b=>{b.preventDefault(),q(""),s(!0);try{await (0,d.signOut)({redirect:!1}),await new Promise(a=>setTimeout(a,500)),localStorage.clear(),sessionStorage.clear();let b=await (0,d.signIn)("credentials",{email:a,password:n,redirect:!1});b?.error?(q("邮箱或密码错误"),s(!1)):window.location.replace("/")}catch(a){q("登录失败,请稍后重试"),s(!1)}};return(0,b.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-gradient-to-br from-primary/5 via-background to-secondary/5 p-4",children:(0,b.jsxs)(j.Card,{className:"w-full max-w-md",children:[(0,b.jsxs)(j.CardHeader,{className:"space-y-1 text-center",children:[(0,b.jsx)("div",{className:"flex justify-center mb-4",children:(0,b.jsx)("div",{className:"flex h-12 w-12 items-center justify-center rounded-lg bg-primary text-primary-foreground",children:(0,b.jsx)(l.BookOpen,{className:"h-7 w-7"})})}),(0,b.jsx)(j.CardTitle,{className:"text-2xl font-serif",children:"登录"}),(0,b.jsx)(j.CardDescription,{children:"登录到华夏谱家族树系统"})]}),(0,b.jsxs)("form",{onSubmit:t,children:[(0,b.jsxs)(j.CardContent,{className:"space-y-4",children:[p&&(0,b.jsx)(k.Alert,{variant:"destructive",children:(0,b.jsx)(k.AlertDescription,{children:p})}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(i.Label,{htmlFor:"email",children:"邮箱"}),(0,b.jsx)(h.Input,{id:"email",type:"email",placeholder:"请输入邮箱",value:a,onChange:a=>m(a.target.value),required:!0,disabled:r})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(i.Label,{htmlFor:"password",children:"密码"}),(0,b.jsx)(h.Input,{id:"password",type:"password",placeholder:"••••••••",value:n,onChange:a=>o(a.target.value),required:!0,disabled:r})]})]}),(0,b.jsxs)(j.CardFooter,{className:"flex flex-col space-y-4 pt-6",children:[(0,b.jsx)(g.Button,{type:"submit",className:"w-full",disabled:r,children:r?"登录中...":"登录"}),(0,b.jsxs)("div",{className:"text-sm text-center text-muted-foreground",children:["还没有账号?"," ",(0,b.jsx)(f.default,{href:"/auth/register",className:"text-primary hover:underline",children:"立即注册"})]})]})]})]})})}a.s(["default",()=>m])}]; //# sourceMappingURL=Documents_go-new_chinese-family-tree_e4bc167c._.js.map