import{o as e,r as t,t as n}from"./jsx-runtime-BbTa8W_M-1776590214964.js";import{a as r,n as i,r as a}from"./app-CXDQ5oEH-1776590214964.js";import{t as o}from"./useTranslation-D1etqd9u-1776590214964.js";import{t as s}from"./button-WiAFyHfP-1776590214964.js";import{t as c}from"./label-DwYxovYB-1776590214964.js";import{t as l}from"./switch-Cb0OQpvv-1776590214964.js";import{t as u}from"./AuthLayout-BNB2211y-1776590214964.js";import{a as d,i as f,n as p,o as m,r as h,t as g}from"./card-Cby8flFO-1776590214964.js";import{t as _}from"./input-BlYvaS0F-1776590214964.js";var v=e(t(),1),y=n();function b({status:e}){let{t}=o(),{data:n,setData:b,post:x,processing:S,errors:C,reset:w}=r({login:``,password:``,remember:!1});return(0,v.useEffect)(()=>()=>w(`password`),[]),(0,y.jsxs)(u,{children:[(0,y.jsx)(i,{title:t(`Log in`)}),(0,y.jsxs)(g,{className:`w-full border-border/50 shadow-lg bg-card`,children:[(0,y.jsxs)(d,{className:`space-y-1 text-center`,children:[(0,y.jsx)(m,{className:`text-2xl`,children:t(`Welcome back`)}),(0,y.jsx)(h,{children:t(`Enter your username or email to login`)})]}),(0,y.jsxs)(p,{children:[e&&(0,y.jsx)(`div`,{className:`mb-4 font-medium text-sm text-green-600`,children:e}),(0,y.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),x(route(`login`))},className:`space-y-4`,children:[(0,y.jsxs)(`div`,{className:`space-y-2`,children:[(0,y.jsx)(c,{htmlFor:`login`,children:t(`Username or Email`)}),(0,y.jsx)(_,{id:`login`,type:`text`,placeholder:t(`johndoe or m@example.com`),value:n.login,onChange:e=>b(`login`,e.target.value)}),C.login&&(0,y.jsx)(`p`,{className:`text-sm text-destructive`,children:C.login})]}),(0,y.jsxs)(`div`,{className:`space-y-2`,children:[(0,y.jsxs)(`div`,{className:`flex items-center justify-between`,children:[(0,y.jsx)(c,{htmlFor:`password`,children:t(`Password`)}),(0,y.jsx)(a,{href:route(`password.request`),className:`text-sm font-medium text-primary hover:underline`,children:t(`Forgot password?`)})]}),(0,y.jsx)(_,{id:`password`,type:`password`,value:n.password,onChange:e=>b(`password`,e.target.value)}),C.password&&(0,y.jsx)(`p`,{className:`text-sm text-destructive`,children:C.password})]}),(0,y.jsxs)(`div`,{className:`flex items-center space-x-2 pt-2 pb-1`,children:[(0,y.jsx)(l,{id:`remember`,checked:n.remember,onCheckedChange:e=>b(`remember`,e),className:`data-[state=checked]:bg-primary`}),(0,y.jsx)(c,{htmlFor:`remember`,className:`text-sm font-medium cursor-pointer text-muted-foreground hover:text-foreground transition-colors`,children:t(`Remember me`)})]}),(0,y.jsx)(s,{className:`w-full mt-2`,type:`submit`,disabled:S,children:t(S?`Logging in...`:`Login`)})]})]}),(0,y.jsx)(f,{className:`flex justify-center`,children:(0,y.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[t(`Don't have an account?`),` `,(0,y.jsx)(a,{href:route(`register`),className:`text-primary font-medium hover:underline`,children:t(`Sign up`)})]})})]})]})}export{b as default};