1import{am as k,j as e,P as v,C as d,b as m,au as S,c as x,d as h,R as u,ao as j,V as f,B as l,ag as y,av as L,aw as F,ax as P,ay as C,az as E,N as A,aA as I,ar as R,as as T,at as B}from"./index-DGo-vssZ.js";import{r as i,L as p}from"./vendor-Qgthw7N1.js";const D=T({email:B().email("Please enter a valid email address")});function O(){const[n,c]=i.useState(!1),[N,g]=i.useState(!1),[o,s]=i.useState(""),a=k({resolver:R(D),defaultValues:{email:""}}),w=async r=>{c(!0),s("");try{const t=await fetch("/api/auth/forgot-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(t.ok)g(!0);else{const b=await t.json();s(b.message||"Failed to send reset email. Please try again.")}}catch{s("Network error. Please check your connection and try again.")}finally{c(!1)}};return e.jsx(v,{hideHeader:!0,hideEmailIntake:!0,hideFooter:!0,children:N?e.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",children:e.jsxs(d,{className:"w-full max-w-md",children:[e.jsxs(m,{className:"text-center",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center",children:e.jsx(S,{className:"w-8 h-8 text-green-600"})})}),e.jsx(x,{className:"text-2xl font-bold",children:"Check Your Email"}),e.jsx("p",{className:"text-gray-600",children:"We've sent a password reset link to your email address."})]}),e.jsxs(h,{className:"space-y-4",children:[e.jsxs(u,{children:[e.jsx(j,{className:"h-4 w-4"}),e.jsx(f,{children:"If you don't see the email in your inbox, please check your spam folder. The reset link will expire in 24 hours."})]}),e.jsx("div",{className:"text-center",children:e.jsx(p,{href:"/login",children:e.jsxs(l,{variant:"outline",className:"w-full",children:[e.jsx(y,{className:"w-4 h-4 mr-2"}),"Back to Login"]})})})]})]})}):e.jsx("div",{className:"min-h-screen flex items-center justify-center p-4",children:e.jsxs(d,{className:"w-full max-w-md",children:[e.jsxs(m,{className:"text-center",children:[e.jsx("div",{className:"flex justify-center mb-4",children:e.jsx("img",{src:"/repsshield-logo-full.png",alt:"REPSShield Logo",className:"h-16 w-auto"})}),e.jsx(x,{className:"text-2xl font-bold",children:"Reset Password"}),e.jsx("p",{className:"text-gray-600",children:"Enter your email address and we'll send you a link to reset your password."})]}),e.jsxs(h,{className:"space-y-6",children:[o&&e.jsxs(u,{variant:"destructive",children:[e.jsx(j,{className:"h-4 w-4"}),e.jsx(f,{children:o})]}),e.jsx(L,{...a,children:e.jsxs("form",{onSubmit:a.handleSubmit(w),className:"space-y-4",children:[e.jsx(F,{control:a.control,name:"email",render:({field:r})=>e.jsxs(P,{children:[e.jsx(C,{children:"Email Address"}),e.jsx(E,{children:e.jsx(A,{type:"email",placeholder:"Enter your email address",...r})}),e.jsx(I,{})]})}),e.jsx(l,{type:"submit",className:"w-full",disabled:n,children:n?"Sending Reset Link...":"Send Reset Link"})]})}),e.jsx("div",{className:"text-center",children:e.jsx(p,{href:"/login",children:e.jsxs(l,{variant:"link",className:"text-sm",children:[e.jsx(y,{className:"w-4 h-4 mr-1"}),"Back to Login"]})})})]})]})})})}export{O as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.