PageSourceSearch

https://app.superfuel.io/assets/verify-email-Tyt9ZNQd.js

js superfuel.io collected 2026-10-04 14:38:20 UTC 5,664 bytes, 1 lines download raw bytes

1import{w as y,b,r as l,j as e}from"./components-CVD5VjrI.js";import{L as c}from"./lib-BH0JPRKC.js";import{A as d}from"./alert-DUdGLjrQ.js";import{B as x}from"./button-WC2Sd3Es.js";import{T as v}from"./theme-toggle-BViJMw3v.js";import{t as m}from"./analytics-CwdYbx1N.js";import{v as j,V as u,b as w,M as g}from"./auth-api-8F3NsjzY.js";import{s as N}from"./auth-token-BwIyVttl.js";import{R}from"./refresh-cw-BksLxFgb.js";import{A as T}from"./arrow-right-DcYfk9hU.js";import"./errorBoundaries-DG5OSgJu.js";import"./createLucideIcon-C3p9ePf8.js";import"./index-Bb4qSo10.js";import"./typography-CKYfygSC.js";import"./theme-CZ2lX7II.js";import"./badge-CvZ_FbAd.js";import"./icon-DCS0ur00.js";import"./user-BmagxPLn.js";import"./useControlled-Dq0AJwtz.js";import"./useValueChanged-B6WVjUNz.js";import"./useAriaLabelledBy-D-6QKz77.js";import"./useLabelableId-DQ_MAEYi.js";import"./module-UELy-YiK.js";import"./constants-BsbqFlr4.js";import"./newrelic-ref-CRjx7Ux3.js";function ne(){return[{title:"Superfuel · Verify email"},{name:"description",content:"Confirm your email to continue."}]}let f;function V(){if(f!==void 0)return f;if(typeof window>"u")return null;const t=new URLSearchParams(window.location.search).get("token");if(t){const s=new URL(window.location.href);s.searchParams.delete("token"),window.history.replaceState({},"",`${s.pathname}${s.search}${s.hash}`)}return f=t,t}function P(){const[n]=l.useState(()=>V());return n}const ae=y(function(){const t=b(),s=P(),[i,a]=l.useState({kind:"idle"}),o=l.useRef(!1),p=l.useCallback(async()=>{if(!(!s||o.current)){o.current=!0,a({kind:"verifying"});try{const{token:r}=await j(s);if(!N(r)){m("onboarding:email_verify_fail",{reason:"session_storage_blocked"}),a({kind:"error",message:"Verified, but your browser blocked storing the session. Please log in.",canResend:!1});return}m("onboarding:email_verify_end"),t("/",{replace:!0})}catch(r){const k=r instanceof u&&r.reason==="expired";m("onboarding:email_verify_fail",{reason:r instanceof u?r.reason:"unknown"}),a({kind:"error",message:r instanceof Error?r.message:"This link is invalid or has expired. Please sign up again.",canResend:k})}finally{o.current=!1}}},[s,t]),h=l.useCallback(async()=>{if(!(!s||o.current)){o.current=!0,a(r=>({kind:"resending",message:r.kind==="error"?r.message:""}));try{const{status:r}=await w(s);a(r==="already_verified"?{kind:"already_verified"}:{kind:"resent"})}catch(r){a({kind:"error",message:r instanceof Error?r.message:"This link can't be renewed. Please sign up again.",canResend:!1})}finally{o.current=!1}}},[s]);return e.jsxs("main",{className:"relative grid min-h-dvh place-items-center bg-background px-4 text-foreground",children:[e.jsx("div",{className:"fixed right-3 top-3 z-50 rounded-lg border border-soft bg-card/80 backdrop-blur-sm sm:right-4 sm:top-4",children:e.jsx(v,{})}),e.jsxs("div",{className:"flex w-full max-w-sm flex-col items-center gap-6",children:[e.jsx("img",{src:"/brand/logos/superfuel-logo-light.svg",alt:"Superfuel",className:"block h-8 w-auto dark:hidden"}),e.jsx("img",{src:"/brand/logos/superfuel-logo-dark.svg",alt:"Superfuel",className:"hidden h-8 w-auto dark:block"}),s?i.kind==="resent"?e.jsx(E,{}):i.kind==="already_verified"?e.jsx(S,{}):i.kind==="error"||i.kind==="resending"?e.jsx(C,{message:i.message,isResending:i.kind==="resending",canResend:i.kind==="resending"||i.canResend,onResend:h}):e.jsx(_,{isBusy:i.kind==="verifying",busyText:"Verifying…",onVerify:p}):e.jsx(z,{})]})]})});function _({isBusy:n,busyText:t,onVerify:s}){return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-col items-center gap-1 text-center",children:[e.jsx("h1",{className:"text-lg font-semibold tracking-tight text-strong",children:"Verify your email"}),e.jsx("p",{className:"text-sm text-sub",children:"Confirm your email address to activate your account."})]}),e.jsx(x,{type:"button",size:"md",text:n?t:"Verify email",LeftIcon:g,RightIcon:n?void 0:T,disabled:n,onClick:s,className:"w-full"})]})}function C({message:n,isResending:t,canResend:s,onResend:i}){return e.jsxs("div",{className:"flex w-full flex-col gap-4",children:[e.jsx(d,{state:"error",style:"lighter",size:"sm",title:n||"This link is invali
1d or has expired."}),s?e.jsx(x,{type:"button",size:"md",text:t?"Sending…":"Resend verification link",LeftIcon:R,disabled:t,onClick:i,className:"w-full"}):null,e.jsx("p",{className:"text-center text-sm text-sub",children:e.jsx(c,{to:"/start",className:"text-primary-base hover:underline",children:"Back to sign up"})})]})}function E(){return e.jsxs("div",{className:"flex w-full flex-col gap-4",children:[e.jsx(d,{state:"info",style:"lighter",size:"sm",leftIcon:g,title:"New verification link sent. Check your email — it expires in 10 minutes."}),e.jsx("p",{className:"text-center text-sm text-sub",children:e.jsx(c,{to:"/start",className:"text-primary-base hover:underline",children:"Back to sign up"})})]})}function S(){return e.jsxs("div",{className:"flex w-full flex-col gap-4",children:[e.jsx(d,{state:"success",style:"lighter",size:"sm",title:"This email is already verified. Please log in to continue."}),e.jsx("p",{className:"text-center text-sm text-sub",children:e.jsx(c,{to:"/sign-in",className:"text-primary-base hover:underline",children:"Go to log in"})})]})}function z(){return e.jsxs("div",{className:"flex w-full flex-col gap-4",children:[e.jsx(d,{state:"error",style:"lighter",size:"sm",title:"This verification link is missing its token. Please sign up again."}),e.jsx("p",{className:"text-center text-sm text-sub",children:e.jsx(c,{to:"/start",className:"text-primary-base hover:underline",children:"Back to sign up"})})]})}export{ae as default,ne as meta};

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.