import{jsxs as r,jsx as e,Fragment as _}from"react/jsx-runtime";import{I as c}from"./input-error-BbsDx4-P.js";import{L as C}from"./loading-button-B_LaGOAp.js";import{T as y}from"./text-link-CWNsTFdM.js";import{L as d,I as h,C as I,B as L}from"./ui-components-B24mpb8o.js";import{A as k}from"./auth-layout-EQmmD-FL.js";import{usePage as F,useForm as A,Head as q,Link as B}from"@inertiajs/react";import{useRef as R}from"react";import T from"react-google-recaptcha";import"lucide-react";import"next-themes";import"sonner";import"@radix-ui/react-label";import"class-variance-authority";import"@radix-ui/react-checkbox";import"@radix-ui/react-avatar";import"@radix-ui/react-dropdown-menu";import"@radix-ui/react-scroll-area";import"@radix-ui/react-popover";import"@radix-ui/react-radio-group";import"@radix-ui/react-dialog";import"@radix-ui/react-slot";import"clsx";import"@radix-ui/react-separator";import"@radix-ui/react-tooltip";import"@radix-ui/react-tabs";import"@radix-ui/react-accordion";import"@radix-ui/react-progress";import"@radix-ui/react-select";import"cmdk";import"@radix-ui/react-switch";import"react-day-picker";import"@radix-ui/react-slider";import"embla-carousel-react";import"@radix-ui/react-toggle-group";import"vaul";import"tailwind-merge";import"./app-logo-CAnM-q9p.js";import"./main-Cv60h411.js";import"./theme-colors-CLpwvDr4.js";function ve({status:u,recaptcha:m,canResetPassword:f,googleLogIn:g}){const{props:b}=F(),{auth:o,input:a,button:l}=b.translate,n=R(null),{data:i,setData:s,post:x,processing:w,errors:p,reset:v}=A({email:"",password:"",remember:!1,recaptcha:"",recaptcha_status:m.status}),N=t=>{t.preventDefault(),x(route("login"),{onFinish:()=>v("password","recaptcha"),onError:()=>{n.current&&n.current.reset()}})};return r(k,{title:o.login_title,description:o.login_description,children:[e(q,{title:o.login_title}),r("form",{className:"flex flex-col gap-6",onSubmit:N,children:[r("div",{className:"grid gap-6",children:[r("div",{className:"grid gap-2",children:[e(d,{htmlFor:"email",children:a.email}),e(h,{id:"email",type:"email",required:!0,autoFocus:!0,tabIndex:1,autoComplete:"email",value:i.email,onChange:t=>s("email",t.target.value),placeholder:a.email_placeholder}),e(c,{message:p.email})]}),r("div",{className:"grid gap-2",children:[r("div",{className:"flex items-center",children:[e(d,{htmlFor:"password",children:a.password}),f&&e(y,{href:route("password.request"),className:"ml-auto text-sm",tabIndex:5,children:o.forgot_password})]}),e(h,{id:"password",type:"password",required:!0,tabIndex:2,autoComplete:"current-password",value:i.password,onChange:t=>s("password",t.target.value),placeholder:a.password_placeholder}),e(c,{message:p.password})]}),m.status&&r("div",{children:[e(T,{ref:n,sitekey:m.siteKey,onChange:t=>s("recaptcha",t)}),e(c,{message:p.recaptcha})]}),r("div",{className:"flex items-center space-x-3",children:[e(I,{id:"remember",name:"remember",checked:i.remember,onClick:()=>s("remember",!i.remember),tabIndex:3}),e(d,{htmlFor:"remember",children:a.remember_me})]}),e(C,{loading:w,type:"submit",className:"w-full",children:l.login}),g&&r(_,{children:[e("div",{className:"after:border-border relative text-center text-sm after:absolute after:inset-0 after:top-1/2 after:z-0 after:flex after:items-center after:border-t",children:e("span",{className:"bg-background text-muted-foreground relative z-10 px-2",children:o.continue_with})}),e("a",{type:"button",className:"w-full",href:"auth/google",children:e(L,{type:"button",variant:"outline",className:"w-full",children:l.continue_with_google})})]})]}),r("div",{className:"text-center text-sm",children:[o.no_account," ",e(B,{href:route("register"),className:"underline underline-offset-4",children:l.sign_up})]})]}),u&&e("div",{className:"mb-4 text-center text-sm font-medium text-green-600",children:u})]})}export{ve as default};
