import{u as w,r as b,b as _,j as e,H as v,R as N}from"./vendor-BKmmeuxg.js";import{I as n}from"./input-error-LaPr_4wd.js";import{L as I}from"./loading-button-BnTVAMJ7.js";import{T as y}from"./text-link-Tx06gMWU.js";import{B as C}from"./button-BpNwv2aE.js";import{I as d}from"./input-DM0goJrn.js";import{L as m}from"./label-HmIcv5Yx.js";import{A as F}from"./auth-layout-BJbsflAX.js";import"./utils-DxSsnXxD.js";import"./index-WW_1X1qx.js";import"./app-logo-CmnEIwal.js";import"./main-_V386djS.js";import"./index-D9-QKOod.js";function S({googleLogIn:x,recaptcha:c}){const{props:h}=w(),{auth:r,input:s,button:p}=h.translate,u=b.useRef(null),{data:l,setData:t,post:f,processing:o,errors:i,reset:g}=_({name:"",email:"",password:"",password_confirmation:"",recaptcha:"",recaptcha_status:c.status}),j=a=>{a.preventDefault(),f(route("register"),{onFinish:()=>g("password","password_confirmation"),onError:()=>{u.current&&u.current.reset()}})};return e.jsxs(F,{title:r.register_title,description:r.register_description,children:[e.jsx(v,{title:r.register_title}),e.jsxs("form",{className:"flex flex-col gap-6",onSubmit:j,children:[e.jsxs("div",{className:"grid gap-6",children:[e.jsxs("div",{className:"grid gap-2",children:[e.jsx(m,{htmlFor:"name",children:s.name}),e.jsx(d,{id:"name",type:"text",required:!0,autoFocus:!0,tabIndex:1,autoComplete:"name",value:l.name,onChange:a=>t("name",a.target.value),disabled:o,placeholder:s.full_name_placeholder}),e.jsx(n,{message:i.name,className:"mt-2"})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(m,{htmlFor:"email",children:s.email}),e.jsx(d,{id:"email",type:"email",required:!0,tabIndex:2,autoComplete:"email",value:l.email,onChange:a=>t("email",a.target.value),disabled:o,placeholder:s.email_placeholder}),e.jsx(n,{message:i.email})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(m,{htmlFor:"password",children:s.password}),e.jsx(d,{id:"password",type:"password",required:!0,tabIndex:3,autoComplete:"new-password",value:l.password,onChange:a=>t("password",a.target.value),disabled:o,placeholder:s.password_placeholder}),e.jsx(n,{message:i.password})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsx(m,{htmlFor:"password_confirmation",children:s.confirm_password}),e.jsx(d,{id:"password_confirmation",type:"password",required:!0,tabIndex:4,autoComplete:"new-password",value:l.password_confirmation,onChange:a=>t("password_confirmation",a.target.value),disabled:o,placeholder:s.confirm_password}),e.jsx(n,{message:i.password_confirmation})]}),c.status&&e.jsxs("div",{children:[e.jsx(N,{ref:u,sitekey:c.siteKey,onChange:a=>t("recaptcha",a)}),e.jsx(n,{message:i.recaptcha})]}),e.jsx(I,{className:"mt-2 w-full",tabIndex:5,loading:o,children:p.create})]}),x&&e.jsxs(e.Fragment,{children:[e.jsx("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.jsx("span",{className:"bg-background text-muted-foreground relative z-10 px-2",children:r.continue_with})}),e.jsx("a",{type:"button",className:"w-full",href:"auth/google",children:e.jsx(C,{type:"button",variant:"outline",className:"w-full",children:p.continue_with_google})})]}),e.jsxs("div",{className:"text-muted-foreground text-center text-sm",children:[r.have_account," ",e.jsx(y,{href:route("login"),tabIndex:6,children:p.login})]})]})]})}export{S as default};
