1import { r as reactExports, j as jsxRuntimeExports } from "./vendor-react-Bay9Y7Lb.js"; 2import { a as api } from "./index-w5lXls15.js"; 3import { b6 as LoaderCircle, a_ as CircleCheck, ea as CircleX, db as Music2, cn as ArrowRight } from "./vendor-D0P4XgNj.js"; 4import "./vendor-i18n-BC7ZMXWQ.js"; 5const EmailVerification = ({ onAuthSuccess, onNavigate }) => { 6 const params = new URLSearchParams(window.location.search); 7 const status = params.get("status"); 8 const message = params.get("message"); 9 const token = params.get("token"); 10 const isSuccess = status === "success"; 11 reactExports.useEffect(() => { 12 if (!status && token) { 13 window.location.href = `/api/auth/verify-email?token=${token}`; 14 } else if (isSuccess) { 15 api.getMe().then((user) => { 16 if (user) { 17 localStorage.setItem("hamie_session", JSON.stringify(user)); 18 if (onAuthSuccess) { 19 onAuthSuccess(user); 20 } 21 } 22 }); 23 } 24 }, [status, token, isSuccess, onAuthSuccess]); 25 if (!status && token) { 26 return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 flex items-center justify-center p-6 bg-zinc-50 dark:bg-[#0a0a0a]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center", children: [
27 /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "w-12 h-12 text-indigo-500 animate-spin mx-auto mb-4" }), 28 /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-zinc-500 font-medium", children: "Verifying your account..." }) 29 ] }) }); 30 } 31 return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1 flex items-center justify-center p-6 bg-zinc-50 dark:bg-[#0a0a0a]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-md w-full animate-in fade-in slide-in-from-bottom-8 duration-700", children: [ 32 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white dark:bg-zinc-900 rounded-3xl p-8 shadow-2xl shadow-indigo-500/10 border border-zinc-200 dark:border-zinc-800 text-center", children: [ 33 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-8 flex justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [ 34 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: `w-24 h-24 rounded-full flex items-center justify-center ${isSuccess ? "bg-emerald-50 dark:bg-emerald-900/20 text-emerald-500" : "bg-red-50 dark:bg-red-900/20 text-red-500"}`, children: isSuccess ? /* @__PURE__ */ jsxRuntimeExports.jsx(CircleCheck, { size: 48 }) : /* @__PURE__ */ jsxRuntimeExports.jsx(CircleX, { size: 48 }) }),
35 isSuccess && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "absolute -top-2 -right-2 w-8 h-8 bg-indigo-500 rounded-full flex items-center justify-center text-white animate-bounce", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Music2, { size: 16 }) }) 36 ] }) }), 37 /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-3xl font-black text-zinc-900 dark:text-white mb-3 tracking-tight", children: isSuccess ? "Account Verified!" : "Verification Failed" }), 38 /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-zinc-600 dark:text-zinc-400 mb-8 leading-relaxed", children: isSuccess ? "Success! Your HamieNET account is now active. You can now explore, download, and contribute to our MIDI library." : message || "We couldn't verify your email address. The link might be expired or already used." }), 39 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [ 40 /* @__PURE__ */ jsxRuntimeExports.jsxs( 41 "button", 42 { 43 type: "button", 44 onClick: () => { 45 if (onNavigate) { 46 onNavigate("home"); 47 } else { 48 window.location.href = "/"; 49 } 50 }, 51 className: `w-full flex items-center justify-center gap-2 py-4 rounded-2xl font-bold transition-all shadow-lg cursor-pointer ${isSuccess ? "bg-indigo-600 hover:bg-indigo-700 text-white shadow-indigo-600/30" : "bg-zinc-200 dark:bg-zinc-800 hover:bg-zinc-300 dark:hover:bg-zinc-700 text-zinc-900 dark:text-white"}`, 52 children: [ 53 isSuccess ? "Continue to HamieNET" : "Back to Home",
54 /* @__PURE__ */ jsxRuntimeExports.jsx(ArrowRight, { size: 18 }) 55 ] 56 } 57 ), 58 !isSuccess && /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-zinc-500", children: [ 59 "Need help? ", 60 /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: "/help", className: "text-indigo-500 hover:underline", children: "Contact Support" }) 61 ] }) 62 ] }) 63 ] }), 64 isSuccess && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-8 grid grid-cols-2 gap-4 animate-in fade-in slide-in-from-bottom-4 delay-500 fill-mode-both", children: [ 65 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white/50 dark:bg-zinc-900/50 backdrop-blur-sm p-4 rounded-2xl border border-zinc-200/50 dark:border-zinc-800/50 text-center", children: [ 66 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs font-bold text-zinc-400 uppercase tracking-widest mb-1", children: "Downloads" }), 67 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xl font-black text-zinc-900 dark:text-white", children: "Unlimited" }) 68 ] }),
69 /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white/50 dark:bg-zinc-900/50 backdrop-blur-sm p-4 rounded-2xl border border-zinc-200/50 dark:border-zinc-800/50 text-center", children: [ 70 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs font-bold text-zinc-400 uppercase tracking-widest mb-1", children: "Status" }), 71 /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xl font-black text-emerald-500", children: "Verified" }) 72 ] }) 73 ] }) 74 ] }) }); 75}; 76export { 77 EmailVerification as default 78};
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.