PageSourceSearch

https://worldofdance.com/assets/NewsletterConfirm-PvvRdJKZ.js

js worldofdance.com collected 2026-09-24 21:16:17 UTC 2,435 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-ui-G-YrU37Q.js";import{h as j,r as t,L as m}from"./vendor-react-BM7Mjnmg.js";import{s as a,V as g,C as w,d as C,B as l}from"./index-CNMWMAwp.js";import{S as N}from"./SimpleNavigation-DGIrGLml.js";import{C as v}from"./circle-check-big-B6Z3w2Bs.js";import{C as y}from"./circle-x-fODZFLh6.js";import"./vendor-supabase-z-MrzYB5.js";import"./vendor-query-DVwyB0sA.js";import"./arrow-left-4ii7lShs.js";import"./house-Cjf-5B57.js";const q=()=>{const[d]=j(),o=d.get("token"),[u,s]=t.useState(!0),[f,n]=t.useState(!1),[x,i]=t.useState("");t.useEffect(()=>{h()},[o]);const h=async()=>{if(!o){i("Invalid confirmation link"),s(!1);return}try{const{data:r,error:p}=await a.from("newsletter_subscribers").select("*").eq("confirmation_token",o).single();if(p||!r){i("Invalid or expired confirmation link"),s(!1);return}if(r.status==="active"){n(!0),s(!1);return}const{error:c}=await a.from("newsletter_subscribers").update({status:"active",confirmed_at:new Date().toISOString()}).eq("id",r.id);if(c)throw c;try{await a.functions.invoke("send-welcome-email",{body:{subscriberId:r.id}})}catch(b){console.error("Error sending welcome email:",b)}n(!0),g.success("Your subscription has been confirmed!")}catch(r){console.error("Confirmation error:",r),i("Failed to confirm subscription. Please try again.")}finally{s(!1)}};return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(N,{}),e.jsx("main",{className:"container mx-auto px-4 py-16",children:e.jsx(w,{className:"max-w-2xl mx-auto",children:e.jsx(C,{className:"pt-6 text-center",children:u?e.jsx("p",{children:"Confirming your subscription..."}):f?e.jsxs(e.Fragment,{children:[e.jsx(v,{className:"w-16 h-16 text-success mx-auto mb-4"}),e.jsx("h2",{className:"text-2xl font-semibold mb-2",children:"You're all set!"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:"Your subscription to the World of Dance newsletter has been confirmed. You'll start receiving our monthly updates soon."}),e.jsx(m,{to:"/",children:e.jsx(l,{children:"Return to Home"})})]}):e.jsxs(e.Fragment,{children:[e.jsx(y,{className:"w-16 h-16 text-destructive mx-auto mb-4"}),e.jsx("h2",{className:"text-2xl font-semibold mb-2",children:"Confirmation Failed"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:x}),e.jsx(m,{to:"/newsletter/subscribe",children:e.jsx(l,{variant:"outline",children:"Try Subscribing Again"})})]})})})})]})};export{q 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.