1import{p as x,r as a,s as p,j as e,g as y,o as t,t as g}from"./index-BokBcvef.js";import{C as j}from"./Card-DuADMCgg.js";import{s}from"./ResetPassword.module-C-wnmOXO.js";function N(){const u=x(),[i,n]=a.useState({id:"verifying"}),[o,c]=a.useState(!1),[l,f]=a.useState(!1);a.useEffect(()=>{const r=new URLSearchParams(window.location.search).get("token");if(!r){n({id:"error",message:"This link is missing its token."});return}let d=!1;return(async()=>{const m=await p(r);d||("error"in m?n({id:"error",message:m.error}):n({id:"success"}))})(),()=>{d=!0}},[]);async function h(){c(!0);const r=await g();if(c(!1),"error"in r){u.error(`Couldn't send verification email: ${r.error}`);return}f(!0)}return e.jsx("div",{className:s.page,children:e.jsxs(j,{padding:"lg",className:s.card,children:[i.id==="verifying"&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:s.title,children:"Verifying your emailâ¦"}),e.jsx("div",{className:s["spinner-row"],children:e.jsx(y,{size:"md"})})]}),i.id==="success"&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:s.title,children:"Email verified"}),e.jsx("p",{className:s.body,children:"Thanks. You can now invite teammates, connect OAuth providers, and reset your password."}),e.jsx(t,{variant:"primary",size:"lg",className:s.submit,onClick:()=>{window.location.href="/"},children:"Continue"})]}),i.id==="error"&&e.jsxs(e.Fragment,{children:[e.jsx("h1",{className:s.title,children:"We couldn't verify your email"}),e.jsx("p",{className:s.body,children:i.message}),e.jsx("p",{className:s.body,children:"Verification links expire after 24 hours and can only be used once. Ask for a fresh one below."}),e.jsx(t,{variant:"primary",size:"lg",className:s.submit,onClick:h,disabled:o||l,loading:o,children:l?"Email sent, check your inbox":"Send a new verification email"}),e.jsx(t,{variant:"secondary",size:"lg",onClick:()=>{window.location.href="/"},children:"Back to app"})]})]})})}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.