import{r as a,j as e,L as l,t as m,s as h}from"./index-C-9v46qO.js";import{B as c}from"./button-B-2orO_-.js";import{I as f}from"./input-Dr7-mDl9.js";import{L as j}from"./label-BXZLGOSD.js";import{C as g}from"./card-Bnq45TwS.js";import{s as N}from"./types-By9teAtI.js";import"./utils-BQHNewu7.js";function E(){const[r,d]=a.useState(""),[i,n]=a.useState(!1),[u,x]=a.useState(!1),p=async s=>{s.preventDefault();const t=N().email("সঠিক ইমেইল দিন").safeParse(r.trim());if(!t.success){m.error(t.error.issues[0].message);return}n(!0);const{error:o}=await h.auth.resetPasswordForEmail(t.data,{redirectTo:`${window.location.origin}/auth/reset-password`});if(n(!1),o){m.error(o.message);return}x(!0)};return e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background px-4 py-12",children:e.jsxs(g,{className:"w-full max-w-md p-8",children:[e.jsx("h1",{className:"text-2xl font-semibold text-center mb-6",children:"পাসওয়ার্ড ভুলে গেছেন?"}),u?e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"রিসেট লিংক পাঠানো হয়েছে। ইমেইল চেক করুন।"}),e.jsx(c,{asChild:!0,variant:"outline",className:"w-full",children:e.jsx(l,{to:"/auth/login",children:"লগইন"})})]}):e.jsxs("form",{onSubmit:p,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(j,{htmlFor:"email",children:"ইমেইল"}),e.jsx(f,{id:"email",type:"email",value:r,onChange:s=>d(s.target.value),required:!0})]}),e.jsx(c,{type:"submit",className:"w-full",disabled:i,children:i?"পাঠানো হচ্ছে...":"রিসেট লিংক পাঠান"}),e.jsx("p",{className:"text-center text-sm",children:e.jsx(l,{to:"/auth/login",className:"text-primary hover:underline",children:"লগইনে ফিরে যান"})})]})]})})}export{E as component};
