PageSourceSearch

https://doxxo.ai/assets/ResetPassword-Czl2WA3K.js

js doxxo.ai collected 2026-10-05 12:51:57 UTC 5,165 bytes, 1 lines download raw bytes

1import{r,j as e}from"./vendor-react-BGSoyBC3.js";import{u as N,L as k}from"./vendor-router-Bky5zxn0.js";import{m as y,a as P,W as S,c as o}from"./index-CY3lR3NC.js";import{aF as C,as as L,at as E,ar as R,L as h,aE as A}from"./vendor-icons-0KQIW_PB.js";import"./vendor-trpc-C-BLj2ba.js";import"./vendor-react-dom-CzqU2IQt.js";import"./vendor-ui-BKDt2K1P.js";import"./vendor-charts-BBE7Gg4G.js";function W(){const[,f]=N(),{isRTL:s}=y(),i=new URLSearchParams(window.location.search).get("token")??"",[t,b]=r.useState(""),[c,p]=r.useState(""),[n,g]=r.useState(!1),[m,l]=r.useState(""),[x,w]=r.useState(!1),[u,j]=r.useState(null),d=P.emailAuth.resetPassword.useMutation({onSuccess:()=>{w(!0),setTimeout(()=>{window.location.href="/dashboard"},2500)},onError:a=>{l(a.message)}});r.useEffect(()=>{j(!!i)},[i]);const v=a=>{if(a.preventDefault(),l(""),t.length<8){l(s?"كلمة المرور يجب أن تكون 8 أحرف على الأقل":"Password must be at least 8 characters");return}if(t!==c){l(s?"كلمتا المرور غير متطابقتين":"Passwords do not match");return}d.mutate({token:i,password:t})};return e.jsxs(S,{mode:"signin",centered:!0,children:[u===!1&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"mb-4 flex justify-center",children:e.jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-full bg-red-50",children:e.jsx(C,{className:"h-9 w-9 text-red-500"})})}),e.jsx("h1",{className:"brand-wordmark mb-2 text-center text-xl font-bold text-[var(--brand-ink-soft)]",children:s?"رابط غير صالح":"Invalid Link"}),e.jsx("p",{className:"mb-5 text-center text-sm text-red-600",children:s?"رابط إعادة التعيين غير صالح أو منتهي الصلاحية.":"This reset link is invalid or has expired."}),e.jsx("button",{type:"button",className:"gulf-btn-primary h-11 w-full",onClick:()=>f("/forgot-password"),children:s?"طلب رابط جديد":"Request new link"})]}),u===!0&&!x&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"brand-wordmark mb-2 text-[22px] font-bold text-[var(--brand-ink-soft)]",children:s?"تعيين كلمة مرور جديدة":"Set New Password"}),e.jsx("p",{className:"mb-5 text-sm text-[var(--brand-ink-muted)]",children:s?"أنشئ كلمة مرور قوية لحسابك":"Create a strong password for your account"}),e.jsxs("form",{onSubmit:v,className:"space-y-3.5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"gulf-field-label",children:s?"كلمة المرور الجديدة":"New Password"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:n?"text":"password",value:t,onChange:a=>b(a.target.value),placeholder:s?"8 أحرف على الأقل":"At least 8 characters",className:o("gulf-field-input",s?"pl-10":"pr-10"),required:!0,dir:"ltr"}),e.jsx("button",{type:"button",onClick:()=>g(!n),className:o("absolute top-1/2 -translate-y-1/2 text-[var(--brand-ink-faint)]",s?"left-3":"right-3"),children:n?e.jsx(L,{className:"h-4 w-4"}):e.jsx(E,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{children:[e.jsx("label",{className:"gulf-field-label",children:s?"تأكيد كلمة المرور":"Confirm Password"}),e.jsx("input",{type:n?"text":"password",value:c,onChange:a=>p(a.target.value),placeholder:s?"أعد إدخال كلمة المرور":"Re-enter password",className:"gulf-field-input",required:!0,dir:"ltr"})]}),t.length>0&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("div",{className:"flex gap-1",children:[1,2,3,4].map(a=>e.jsx("div",{className:o("h-1 flex-1 rounded-full transition-colors",t.length>=a*3?t.length>=12?"bg-[var(--brand-teal)]":t.length>=8?"bg-amber-400":"bg-red-400":"bg-[var(--brand-line)]")},a))}),e.jsx("p",{className:"text-xs text-[var(--brand-ink-faint)]",children:t.length<8?s?"ضعيفة":"Weak":t.length<12?s?"متوسطة":"Medium":s?"قوية":"Strong"})]}),m&&e.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-red-200 bg-red-50 p-3 text-sm text-red-700",children:[e.jsx(R,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("p",{children:m})]}),e.jsx("button",{type:"submit",className:"gulf-btn-primary h-11 w-full",disabled:d.isPending,children:d.isPending?e.jsx(h,{className:"mx-auto h-4 w-4 animate-spin"}):s?"تعيين كلمة المرور":"Set Password"})]})]}),x&&e.jsxs("div",{className:"py-4 text-center",children:[e.jsx("div",{className:"mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-full bg-[var(--accent-teal)]",children:e.jsx(A,{className:"h-9 w-9 text-[var(--brand-teal)]"})}),e.jsx("h1",{className:"brand-wordmark mb-2 text-xl font-bold text-[var(--brand-ink-soft)]",children:s?"تم تعيين كلمة المرور!":"Password Updated!"}),e.jsx("p",{className:"mb-4 text-sm text-[var(--brand-ink-muted)]",children:s?"جارٍ توجيهك لمساحة العمل...":"Redirecting to workspace..."}),e.jsx(h,{className:"mx-auto h-6 w-6 animate-spin text-[var(--brand-navy)]"})]}),e.jsx(k,{href:"/login",className:"mt-4 block text-center text-[13px] font-medium text-[var(--brand-ink-muted)] hover:text-[var(--brand-navy)]",children:s?"← العودة لتسجيل الدخول":"← Back to Sign In"})]})}
1export{W 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.