PageSourceSearch

https://app.verbix.ai/assets/ForgotPasswordPage-ejfouIl9.js

js verbix.ai collected 2026-10-05 13:53:46 UTC 5,466 bytes, 1 lines download raw bytes

1import{u as x,j as e,M as f,C as g,a as p,L as u,r as n}from"./index-jmx1CJ5H.js";import{a as b,A as j,b as v}from"./authService-B0-lv_XG.js";import{A as h}from"./arrow-left-B-5eRZsS.js";import{C as N}from"./circle-check-_Kks0S3M.js";const w=({email:a,setEmail:r,loading:s,error:l,onSubmit:o})=>{const{t}=x();return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-8",children:[e.jsx("h1",{className:"text-2xl font-semibold text-slate-900 tracking-tight",children:t("auth.forgotPasswordTitle")}),e.jsx("p",{className:"text-slate-500 mt-2 text-sm",children:t("auth.forgotPasswordSubtitle")})]}),e.jsxs("form",{onSubmit:o,className:"space-y-6",children:[e.jsxs("div",{className:"space-y-1.5 text-left",children:[e.jsx("label",{htmlFor:"email",className:"text-sm font-medium text-slate-700",children:t("auth.emailLabel")}),e.jsxs("div",{className:"relative group",children:[e.jsx("div",{className:"absolute left-4 top-1/2 -translate-y-1/2 text-slate-400 group-focus-within:text-red-500 transition-colors",children:e.jsx(f,{size:18})}),e.jsx("input",{id:"email",type:"email",value:a,onChange:i=>r(i.target.value),required:!0,placeholder:t("auth.emailPlaceholder"),className:"w-full pl-11 pr-4 py-2.5 bg-white border border-slate-200 rounded-lg text-slate-900 placeholder:text-slate-400 outline-none focus:border-red-500 focus:ring-4 focus:ring-red-500/10 transition-all text-sm"})]})]}),l&&e.jsxs("div",{className:"flex items-start gap-3 p-3 bg-red-50 border border-red-100 rounded-lg animate-fade-in",children:[e.jsx(g,{className:"text-red-500 shrink-0 mt-0.5",size:16}),e.jsx("p",{className:"text-xs font-medium text-red-600 leading-relaxed text-left",children:l})]}),e.jsx("button",{type:"submit",disabled:s,className:"w-full flex items-center justify-center px-4 py-3 bg-red-600 hover:bg-red-700 disabled:bg-red-400 text-white rounded-lg font-semibold transition-all shadow-md shadow-red-100 group active:scale-[0.98]",children:s?e.jsxs("svg",{className:"animate-spin h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[e.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),e.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):e.jsxs("div",{className:"flex items-center gap-2",children:[t("auth.sendResetLink"),e.jsx(p,{size:18,className:"transition-transform group-hover:translate-x-0.5"})]})})]}),e.jsx("div",{className:"mt-8 text-center sm:text-left border-t border-slate-100 pt-6",children:e.jsxs(u,{to:"/login",className:"inline-flex items-center gap-2 text-sm font-semibold text-slate-600 hover:text-red-600 transition-colors group",children:[e.jsx(h,{size:16,className:"transition-transform group-hover:-translate-x-0.5"}),t("auth.backToLogin")]})})]})},y=({email:a,onRetry:r})=>{const{t:s}=x();return e.jsxs("div",{className:"text-center py-4",children:[e.jsx("div",{className:"flex justify-center mb-6",children:e.jsx("div",{className:"w-16 h-16 bg-red-50 rounded-full flex items-center justify-center text-red-600",children:e.jsx(N,{size:32})})}),e.jsx("h1",{className:"text-2xl font-semibold text-slate-900 tracking-tight",children:s("auth.checkEmailTitle")}),e.jsxs("p",{className:"text-slate-500 mt-3 text-sm leading-relaxed",children:[s("auth.checkEmailSubtitle"),e.jsx("br",{}),e.jsx("span",{className:"font-semibold text-slate-900",children:a})]}),e.jsx("button",{onClick:r,className:"mt-8 text-sm font-semibold text-red-600 hover:text-red-700 transition-colors",children:s("auth.didntReceiveEmail")}),e.jsx("div",{className:"mt-8 text-center sm:text-left border-t border-slate-100 pt-6",children:e.jsxs(u,{to:"/login",className:"inline-flex items-center gap-2 text-sm font-semibold text-slate-600 hover:text-red-600 transition-colors group",children:[e.jsx(h,{size:16,className:"transition-transform group-hover:-translate-x-0.5"}),s("auth.backToLogin")]})})]})},S=()=>{const[a,r]=n.useState(""),[s,l]=n.useState(!1),[o,t]=n.useState(!1),[i,d]=n.useState("");return{email:a,setEmail:r,loading:s,submitted:o,setSubmitted:t,error:i,handleSubmit:async c=>{c&&c.preventDefault(),l(!0),d("");try{await b.forgotPassword(a),t(!0)}catch(m){m.response?.status===404?(console.warn("Forgot password endpoint not found. Simulating success for UI demo."),t(!0)):d(m.response?.data?.message||"Something went wrong. Please try again.")}finally{l(!1)}}}},E=()=>{const{email:a,setEmail:r,loading:s,submitted:l,setSubmitted:o,error:t,handleSubmit:i}=S();return e.jsxs("div",{className:"min-h-screen bg-slate-50 flex flex-col items-center justify-center p-4 font-sans selection:bg-red-100 selection:text-red-700 relative overflow-hidden",children:[e.jsxs("div",{className:"absolute top-0 left-0 w-full h-full pointer-events-none",children:[e.jsx("div",{className:"absolute top-[-10%] left-[-10%] w-[40%] h-[40%] bg-red-100/50 rounded-full blur-[120px]"}),e.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] w-[40%] h-[40%] bg-rose-100/50 rounded-full blur-[120px]"})]}),e.jsxs("div",{className:"w-full max-w-[420px] relative z-10 px-2 lg:px-0",children:[e.jsx(j,{}),e.jsx("div",{className:"bg-white rounded-2xl shadow-[0_8px_30px_rgb(0,0,0,0.04)] border border-slate-100 p-8 sm:p-10",children:l?e.jsx(y,{email:a,onRetry:()=>o(!1)}):e.jsx(w,{email:a,setEmail:r,loading:s,error:t,onSubmit:i})}),e.jsx(v,{})]})]})};export{E 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.