import{j as e}from"./vendor-query-Brcc40-Y.js";import{u as m,b as c,s as d}from"./vendor-form-BQNAly2Z.js";import{c as u,B as r,I as x,t as p}from"./index-tN-ddyeb.js";import{L as h}from"./vendor-react-DP6BW_9B.js";import{A as f}from"./AuthLayout-DounjrD9.js";import"./vendor-utils-ui5PHgZB.js";import"./vendor-zustand-CVDiRiMG.js";const j=c({email:d().email("Enter a valid email address")});function S(){var t;const s=u(),{register:i,handleSubmit:a,formState:{errors:o}}=m({resolver:p(j)}),n=l=>s.mutate(l.email);return e.jsxs(f,{title:"Reset your password",subtitle:"We'll send a link to your email if it exists in our system",children:[s.isSuccess?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"rounded-2xl border border-success/30 bg-success-subtle px-6 py-5 text-center",children:[e.jsx("div",{className:"mx-auto mb-3 flex h-12 w-12 items-center justify-center rounded-full bg-success/10",children:e.jsx("svg",{className:"h-6 w-6 text-success",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})})}),e.jsx("p",{className:"font-medium text-success",children:"Check your inbox"}),e.jsx("p",{className:"mt-1 text-sm text-ink-muted",children:"If an account with that email exists, a reset link has been sent."})]}),e.jsx(r,{variant:"secondary",fullWidth:!0,size:"lg",onClick:()=>s.reset(),children:"Send again"})]}):e.jsxs("form",{onSubmit:a(n),noValidate:!0,className:"space-y-5",children:[e.jsx(x,{label:"Email address",type:"email",autoComplete:"email",placeholder:"you@example.com",error:(t=o.email)==null?void 0:t.message,...i("email")}),e.jsx(r,{type:"submit",fullWidth:!0,size:"lg",loading:s.isPending,children:"Send reset link"})]}),e.jsx("p",{className:"mt-8 text-center text-sm text-ink-muted",children:e.jsx(h,{to:"/login",className:"text-primary hover:text-primary-hover font-medium transition-colors",children:"← Back to sign in"})})]})}export{S as default};
