import{W as c,r as p,j as s,Y as x,a as u}from"./app-BAHAOwU3.js";import{G as h}from"./guest-layout-g1xwyawt.js";import{B as j}from"./button-T-Jxhehc.js";import{C as g,a as f,e as w,b as v,c as C}from"./card-pClq6asL.js";import{I as i}from"./input-CeK7CEQL.js";import{L as o}from"./label-DP7sGf18.js";import{I as n}from"./input-error-Be2KxtIS.js";function R(){const{data:a,setData:r,post:m,processing:N,errors:t,reset:d}=c({name:"",email:"",password:"",password_confirmation:""});p.useEffect(()=>()=>{d("password","password_confirmation")},[]);const l=e=>{e.preventDefault(),m(route("register"))};return s.jsxs(h,{children:[s.jsx(x,{title:"Register"}),s.jsx("form",{onSubmit:l,children:s.jsxs(g,{className:"mx-auto max-w-sm",children:[s.jsxs(f,{children:[s.jsx(w,{className:"text-xl",children:"Sign Up"}),s.jsx(v,{children:"Enter your information to create an account"})]}),s.jsxs(C,{children:[s.jsxs("div",{className:"grid gap-4",children:[s.jsxs("div",{className:"grid gap-2",children:[s.jsx(o,{htmlFor:"name",children:"Name"}),s.jsx(i,{id:"name",placeholder:"John Doe",onChange:e=>r("name",e.target.value),value:a.name,required:!0}),s.jsx(n,{message:t.name})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(o,{htmlFor:"email",children:"Email"}),s.jsx(i,{id:"email",type:"email",placeholder:"m@example.com",onChange:e=>r("email",e.target.value),value:a.email,required:!0}),s.jsx(n,{message:t.email})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(o,{htmlFor:"password",children:"Password"}),s.jsx(i,{id:"password",type:"password",onChange:e=>r("password",e.target.value),value:a.password}),s.jsx(n,{message:t.password})]}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(o,{htmlFor:"password_confirmation",children:"Retype Password"}),s.jsx(i,{id:"password_confirmation",type:"password",onChange:e=>r("password_confirmation",e.target.value),value:a.password_confirmation}),s.jsx(n,{message:t.password_confirmation})]}),s.jsx(j,{type:"submit",className:"w-full",children:"Create an account"})]}),s.jsxs("div",{className:"mt-4 text-center text-sm",children:["Already have an account?"," ",s.jsx(u,{href:"/login",className:"underline",children:"Sign in"})]})]})]})})]})}export{R as default};
