1import{c as v,a as N,$ as g,r as a,j as e,L as p,B as t,a0 as S}from"./main-Culg7Cil.js";import{u as k}from"./useServerFn-BMv6TG2K.js";import{L as C,I as E}from"./label-MYpEiHCa.js";const R=v({method:"POST"}).handler(N("e664dddbc9a7e1a486360b279f2035cb138c6debd0cca0fefc25aa9889a1a9d6"));function V(){const{email:r,token:l,setup_intent_id:c}=g.useSearch(),[h,o]=a.useState(!1),[s,f]=a.useState(r),[d,n]=a.useState(null),[y,m]=a.useState(!1),j=k(R),u=!!(l&&c.length>0),b=async i=>{if(i.preventDefault(),n(null),!(!u||!s.trim()))try{await j({data:{token:l,setup_intent_id:c,new_email:s.trim()}}),m(!0)}catch(x){n(x instanceof Error?x.message:"Unable to resend verification email.")}};return e.jsxs("main",{className:"mx-auto max-w-(--breakpoint-md) px-4 py-24 space-y-6",children:[e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx("h1",{className:"text-3xl font-semibold",children:"Confirm your email"}),e.jsxs("p",{className:"text-gray-600",children:["We've sent a verification link",r?` to ${r}`:"",". Click it to finish setting up your account and access your dashboard."]})]}),e.jsxs("div",{className:"rounded-xl border border-border bg-muted/20 p-4 space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-foreground",children:"Didn't receive the email?"}),e.jsxs("ul",{className:"mt-2 list-disc space-y-2 pl-5 text-sm text-muted-foreground",children:[e.jsx("li",{children:"If you don't see your email, check your spam folder and make sure there are no typos."}),e.jsxs("li",{children:["If you still don't see it,"," ",e.jsx(p,{to:"/contact",className:"text-primary underline hover:no-underline",children:"contact support"})," ","and we'll help you out."]})]})]}),u?e.jsx("div",{className:"space-y-4",children:h?e.jsxs("form",{onSubmit:b,className:"space-y-4 rounded-xl border border-border p-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(C,{htmlFor:"email",children:"Email address"}),e.jsx(E,{id:"email",type:"email",value:s,onChange:i=>f(i.target.value),placeholder:"[email protected]",autoComplete:"email",required:!0})]}),d?e.jsx("p",{className:"text-sm text-red-600",children:d}):y?e.jsx("p",{className:"text-sm text-green-600",children:"Verification email sent. Check your inbox (and spam folder)."}):null,e.jsxs("div",{className:"flex gap-2",children:[e.jsx(t,{type:"submit",disabled:!s.trim(),children:"Resend verification email"}),e.jsx(t,{type:"button",variant:"outline",onClick:()=>{o(!1),n(null),m(!1)},children:"Cancel"})]})]}):e.jsx("div",{className:"flex justify-center",children:e.jsx(t,{type:"button",variant:"outline",onClick:()=>o(!0),children:"Re-enter email"})})}):e.jsx("div",{className:"flex justify-center",children:e.jsx(t,{asChild:!0,variant:"outline",children:e.jsx(p,{to:"/signup",search:S,children:"Re-enter email"})})})]})}export{V as component};
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.