PageSourceSearch

https://doxxo.ai/assets/VerifyEmail-DFgnNr_n.js

js doxxo.ai collected 2026-10-05 12:51:55 UTC 6,074 bytes, 1 lines download raw bytes

1import{r,j as e}from"./vendor-react-BGSoyBC3.js";import{u as L,L as M}from"./vendor-router-Bky5zxn0.js";import{m as V,a as p,W as A,c}from"./index-CY3lR3NC.js";import{L as m,aF as R,aE as v,as as D,at as F,ar as T}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 H(){const[,g]=L(),{isRTL:s}=V(),x=new URLSearchParams(window.location.search).get("token")??"",[i,o]=r.useState("loading"),[w,j]=r.useState(""),[N,u]=r.useState(""),[t,y]=r.useState(""),[h,k]=r.useState(""),[n,S]=r.useState(!1),[f,l]=r.useState(""),[b,P]=r.useState(!1),E=p.emailAuth.verifyEmail.useMutation({onSuccess:a=>{j(a.email),o("success")},onError:a=>{u(a.message),o("error")}}),d=p.emailAuth.setPassword.useMutation({onSuccess:()=>{P(!0),setTimeout(()=>{window.location.href="/dashboard"},2e3)},onError:a=>{l(a.message)}});r.useEffect(()=>{if(!x){u(s?"رابط التحقق غير صالح.":"Invalid verification link."),o("error");return}E.mutate({token:x})},[]);const C=a=>{if(a.preventDefault(),l(""),t.length<8){l(s?"كلمة المرور يجب أن تكون 8 أحرف على الأقل":"Password must be at least 8 characters");return}if(t!==h){l(s?"كلمتا المرور غير متطابقتين":"Passwords do not match");return}d.mutate({email:w,password:t})};return e.jsxs(A,{mode:"signup",centered:!0,children:[i==="loading"&&e.jsxs("div",{className:"py-6 text-center",children:[e.jsx(m,{className:"mx-auto mb-4 h-12 w-12 animate-spin text-[var(--brand-navy)]"}),e.jsx("h1",{className:"brand-wordmark mb-2 text-xl font-bold text-[var(--brand-ink-soft)]",children:s?"جارٍ التحقق...":"Verifying..."}),e.jsx("p",{className:"text-sm text-[var(--brand-ink-muted)]",children:s?"يرجى الانتظار لحظة":"Please wait a moment"})]}),i==="error"&&e.jsxs("div",{className:"space-y-4 text-center",children:[e.jsx("div",{className:"mx-auto flex h-14 w-14 items-center justify-center rounded-full bg-red-50",children:e.jsx(R,{className:"h-9 w-9 text-red-500"})}),e.jsx("h1",{className:"brand-wordmark text-xl font-bold text-[var(--brand-ink-soft)]",children:s?"فشل التحقق":"Verification Failed"}),e.jsx("p",{className:"text-sm text-red-600",children:N}),e.jsx("p",{className:"text-sm text-[var(--brand-ink-muted)]",children:s?"قد يكون الرابط منتهي الصلاحية أو مستخدماً مسبقاً.":"The link may have expired or already been used."}),e.jsx("button",{type:"button",className:"gulf-btn-primary h-11 w-full",onClick:()=>g("/signup"),children:s?"إنشاء حساب جديد":"Create new account"}),e.jsx(M,{href:"/login",className:"block text-sm font-medium text-[var(--brand-ink-muted)] hover:text-[var(--brand-navy)]",children:s?"← تسجيل الدخول":"← Sign in"})]}),i==="success"&&!b&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-5 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(v,{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?"تم التحقق بنجاح!":"Email Verified!"}),e.jsx("p",{className:"text-sm text-[var(--brand-ink-muted)]",children:s?"الآن عيّن كلمة مرور لحسابك":"Now set a password for your account"})]}),e.jsxs("form",{onSubmit:C,className:"space-y-3.5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"gulf-field-label",children:s?"كلمة المرور":"Password"}),e.jsxs("div",{className:"relative",children:[e.jsx("input",{type:n?"text":"password",value:t,onChange:a=>y(a.target.value),placeholder:s?"8 أحرف على الأقل":"At least 8 characters",className:c("gulf-field-input",s?"pl-10":"pr-10"),required:!0,dir:"ltr"}),e.jsx("button",{type:"button",onClick:()=>S(!n),className:c("absolute top-1/2 -translate-y-1/2 text-[var(--brand-ink-faint)]",s?"left-3":"right-3"),children:n?e.jsx(D,{className:"h-4 w-4"}):e.jsx(F,{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:h,onChange:a=>k(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:c("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"})]}),f&&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(T,{className:"mt-0.5 h-4 w-4 shrink-0"}),e.jsx("p",{children:f})]}),e.jsx("button",{type:"submit",className:"gulf-btn-primary h-11 w-full",disabled:d.isPending,children:d.isPending?e.jsx(m,{className:"mx-auto h-4 w-4 animate-spin"}):s?"تعيين كلمة المرور والدخول":"Set Password & Sign In"})]})]}),b&&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(v,{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?"مرحباً بك في Doxxo!":"Welcome to Do
1xxo!"}),e.jsx("p",{className:"mb-4 text-sm text-[var(--brand-ink-muted)]",children:s?"جارٍ توجيهك لمساحة العمل...":"Redirecting to workspace..."}),e.jsx(m,{className:"mx-auto h-6 w-6 animate-spin text-[var(--brand-navy)]"})]})]})}export{H 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.