import{j as e,Y as u,v as x,$ as h}from"./app-BGey7YPf.js";import{u as p}from"./use-toast-DGElh_6W.js";import{A as f}from"./auth-layout-B0XB68nN.js";import{a as g,B as j}from"./button-D5r5edT8.js";import{I as i}from"./input-CGSIKYsG.js";import{L as l}from"./label-BbSRpehS.js";import{C as v,a as w,b as k,c as C,d as N}from"./card-CgL3Iyx6.js";import{S as b}from"./shine-border-n_58aha0.js";import"./theme-provider-NKMbg-kV.js";function n({className:s="",children:t,...r}){return e.jsx(u,{className:g("text-foreground underline decoration-neutral-300 underline-offset-4 transition-colors duration-300 ease-out hover:decoration-current! dark:decoration-neutral-500",s),...r,children:t})}function y(){const{toast:s}=p(),{data:t,setData:r,post:d,processing:c,errors:o}=x({login:"",password:""}),m=a=>{a.preventDefault(),d(route("login"),{onSuccess:()=>{s({variant:"success",title:"Selamat Datang",description:"Anda berhasil login!"})}})};return e.jsxs(e.Fragment,{children:[e.jsx(h,{title:"Login"}),e.jsxs(v,{className:"relative overflow-hidden max-w-full w-full bg-slate-50 dark:bg-slate-950",children:[e.jsx(b,{duration:6,borderWidth:2,shineColor:["#A07CFE","#FE8FB5","#FFBE7B"]}),e.jsxs(w,{className:"space-y-2 text-center",children:[e.jsx(k,{className:"text-2xl font-semibold tracking-tight",children:"Masuk ke Akun Anda"}),e.jsx(C,{children:"Masukkan email/username dan kata sandi untuk memulai sesi."})]}),e.jsxs(N,{children:[e.jsxs("form",{onSubmit:m,className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx(l,{htmlFor:"login",children:"Email / Username"}),e.jsx(i,{id:"login",type:"text",placeholder:"contoh: admin atau admin@email.com",autoComplete:"off",value:t.login,onChange:a=>r("login",a.target.value)}),o.login&&e.jsx("p",{className:"text-xs text-rose-500 mt-1",children:o.login})]}),e.jsxs("div",{children:[e.jsx(l,{htmlFor:"password",children:"Kata Sandi"}),e.jsx(i,{id:"password",type:"password",placeholder:"********",autoComplete:"off",value:t.password,onChange:a=>r("password",a.target.value)}),o.password&&e.jsx("p",{className:"text-xs text-rose-500 mt-1",children:o.password})]}),e.jsx("div",{className:"flex justify-between items-center text-sm",children:e.jsx(n,{href:"/forgot-password",className:"text-muted-foreground",children:"Lupa password?"})}),e.jsx(j,{type:"submit",className:"w-full mt-2",disabled:c,children:"Login"})]}),e.jsxs("div",{className:"mt-6 text-center text-sm text-muted-foreground",children:["Belum punya akun?"," ",e.jsx(n,{href:"/register",children:"Daftar sekarang"})]}),e.jsx("div",{className:"mt-4 text-center",children:e.jsx(n,{href:"/",className:"text-xs",children:"← Kembali ke Beranda"})})]})]})]})}y.layout=s=>e.jsx(f,{children:s});export{y as default};
