1import{j as e}from"./vendor-query-BJ5Fw6ip.js";import{f,e as h,r as i}from"./vendor-react-BT7e8nQi.js";import{L as p,s as g}from"./index-vS3UXLsm.js";import"./vendor-ui-D27gcjqV.js";import"./vendor-supabase-B5vpo0AN.js";import"./vendor-motion-C0dDRZUy.js";const N=()=>{const[r]=f(),s=h(),[u,n]=i.useState("verifying"),[x,a]=i.useState("");return i.useEffect(()=>{const o=r.get("token_hash"),c=r.get("type")||"signup",l=r.get("redirect_to")||"/profile";if(!o){n("error"),a("This confirmation link is missing its token. Please request a new email.");return}(async()=>{var m;try{const{error:t}=await g.auth.verifyOtp({token_hash:o,type:c});if(t){console.error("verifyOtp failed",t),n("error"),a((m=t.message)!=null&&m.includes("expired")?"This confirmation link has expired. Please request a new one.":t.message||"We could not confirm your email. Please request a new link.");return}if(c==="recovery"){s("/reset-password#type=recovery",{replace:!0});return}s(l.startsWith("/")?l:"/profile",{replace:!0})}catch(t){console.error("AuthConfirm error",t),n("error"),a("Something went wrong. Please try again or request a new link.")}})()},[r,s]),e.jsx("div",{className:"min-h-screen flex items-center justify-center bg-zinc-950 text-zinc-100 px-6",children:e.jsx("div",{className:"max-w-md w-full text-center",children:u==="verifying"?e.jsxs(e.Fragment,{children:[e.jsx(p,{className:"h-8 w-8 mx-auto mb-4 animate-spin text-orange-500"}),e.jsx("h1",{className:"text-2xl font-serif mb-2",children:"Confirming your emailâ¦"}),e.jsx("p",{className:"text-sm text-zinc-400",children:"Hang tight, this only takes a second."})]}):e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:"text-2xl font-serif mb-3",children:"Confirmation link not valid"}),e.jsx("p",{className:"text-sm text-zinc-400 mb-6",children:x}),e.jsx("button",{onClick:()=>s("/login",{replace:!0}),className:"px-5 py-2.5 rounded-md bg-orange-500 hover:bg-orange-600 text-white text-sm font-medium transition-colors",children:"Go to login"})]})})})};export{N 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.