import{v as u,j as a,$ as c}from"./app-CffHYkHW.js";import{I as o}from"./input-error-Def0KqrX.js";import{T as x}from"./text-link-BntpQ-Tw.js";import{B as h}from"./button-qhe8lrPU.js";import{I as m}from"./input-Bw4IOOzt.js";import{L as n}from"./label-iPcRrN_N.js";import{A as g}from"./auth-layout-COiwI2QE.js";import{L as j}from"./loader-circle-BRrBaJrT.js";import"./utils-C8zp8JNC.js";import"./index-DPkgfxsD.js";import"./app-logo-icon-D3Jzt_fn.js";import"./createLucideIcon-DAR-hy5d.js";import"./badge-soq0-NVD.js";import"./utensils-Ds87evzs.js";import"./card-X_CDEGIm.js";function B(){const{data:r,setData:t,post:d,processing:s,errors:i,reset:l}=u({name:"",email:"",password:"",password_confirmation:""}),p=e=>{e.preventDefault(),d(route("register"),{onFinish:()=>l("password","password_confirmation")})};return a.jsxs(g,{title:"Buat Akun",description:"Masukkan data kamu di bawah ini untuk membuat akun",children:[a.jsx(c,{title:"Register"}),a.jsxs("form",{className:"flex flex-col gap-6",onSubmit:p,children:[a.jsxs("div",{className:"grid gap-6",children:[a.jsxs("div",{className:"grid gap-2",children:[a.jsx(n,{htmlFor:"name",children:"Nama"}),a.jsx(m,{id:"name",type:"text",required:!0,autoFocus:!0,tabIndex:1,autoComplete:"name",value:r.name,onChange:e=>t("name",e.target.value),disabled:s,placeholder:"Nama lengkap"}),a.jsx(o,{message:i.name,className:"mt-2"})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(n,{htmlFor:"email",children:"Alamat Email"}),a.jsx(m,{id:"email",type:"email",required:!0,tabIndex:2,autoComplete:"email",value:r.email,onChange:e=>t("email",e.target.value),disabled:s,placeholder:"email@example.com"}),a.jsx(o,{message:i.email})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(n,{htmlFor:"password",children:"Kata Sandi"}),a.jsx(m,{id:"password",type:"password",required:!0,tabIndex:3,autoComplete:"new-password",value:r.password,onChange:e=>t("password",e.target.value),disabled:s,placeholder:"Kata Sandi"}),a.jsx(o,{message:i.password})]}),a.jsxs("div",{className:"grid gap-2",children:[a.jsx(n,{htmlFor:"password_confirmation",children:"Konfirmasi Kata Sandi"}),a.jsx(m,{id:"password_confirmation",type:"password",required:!0,tabIndex:4,autoComplete:"new-password",value:r.password_confirmation,onChange:e=>t("password_confirmation",e.target.value),disabled:s,placeholder:"Ulangi kata sandi"}),a.jsx(o,{message:i.password_confirmation})]}),a.jsxs(h,{type:"submit",className:"mt-2 w-full",tabIndex:5,disabled:s,children:[s&&a.jsx(j,{className:"h-4 w-4 animate-spin"}),"Buat Akun"]})]}),a.jsxs("div",{className:"text-muted-foreground text-center text-sm",children:["Sudah punya akun?"," ",a.jsx(x,{href:route("login"),tabIndex:6,children:"Masuk"})]})]})]})}export{B as default};
