PageSourceSearch

https://nexusgeoengenharia.com.br/assets/Unsubscribe-GAEjkAFd.js

js nexusgeoengenharia.com.br collected 2026-10-09 22:44:53 UTC 3,221 bytes, 1 lines download raw bytes

1import{a as u}from"./rolldown-runtime-DS2seoW7.js";import{y as x}from"./vendor-charts-BLlC71g6.js";import{d as p}from"./vendor-markdown-BnDz3YsI.js";import{t as f}from"./client-G18cNx3L.js";import{E as h}from"./index-C3yrWq7m.js";import{t as b}from"./SEOHead-Cm23nFig.js";var c=u(x(),1),e=p(),S=()=>{const[l]=h(),r=l.get("token"),[s,a]=(0,c.useState)("loading"),[o,d]=(0,c.useState)(!1);(0,c.useEffect)(()=>{if(!r){a("invalid");return}(async()=>{try{const i=await fetch(`https://ckickvhaccxglqeuryix.supabase.co/functions/v1/handle-email-unsubscribe?token=${r}`,{headers:{apikey:"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImNraWNrdmhhY2N4Z2xxZXVyeWl4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NjI4ODI1OTUsImV4cCI6MjA3ODQ1ODU5NX0.OtV1wYse3UsSE2pSdCFQac2UCukHy6ftIPjftLub3h4"}}),n=await i.json();i.ok?n.valid===!1&&n.reason==="already_unsubscribed"?a("already_unsubscribed"):n.valid?a("valid"):a("invalid"):a("invalid")}catch{a("error")}})()},[r]);const m=async()=>{if(r){d(!0);try{const{data:t,error:i}=await f.functions.invoke("handle-email-unsubscribe",{body:{token:r}});i?a("error"):t?.success?a("success"):t?.reason==="already_unsubscribed"?a("already_unsubscribed"):a("error")}catch{a("error")}finally{d(!1)}}};return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(b,{title:"Cancelar inscrição | NEXUS GeoEngenharia",description:"Cancelar inscrição de e-mails da NEXUS GeoEngenharia",canonical:"/unsubscribe"}),(0,e.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-muted px-4",children:(0,e.jsxs)("div",{className:"max-w-md w-full bg-card rounded-lg shadow-lg p-8 text-center",children:[(0,e.jsx)("h1",{className:"text-2xl font-bold text-primary mb-2",children:"NEXUS"}),(0,e.jsx)("p",{className:"text-xs text-secondary uppercase tracking-widest mb-6",children:"GeoEngenharia"}),s==="loading"&&(0,e.jsx)("p",{className:"text-muted-foreground",children:"Verificando..."}),s==="valid"&&(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)("p",{className:"text-foreground",children:"Deseja cancelar o recebimento de e-mails da NEXUS GeoEngenharia?"}),(0,e.jsx)("button",{onClick:m,disabled:o,className:"w-full py-3 px-6 rounded-md bg-primary text-primary-foreground font-medium hover:opacity-90 disabled:opacity-50 transition-opacity",children:o?"Processando...":"Confirmar cancelamento"})]}),s==="success"&&(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("p",{className:"text-lg font-medium text-foreground",children:"Inscrição cancelada ✓"}),(0,e.jsx)("p",{className:"text-muted-foreground text-sm",children:"Você não receberá mais e-mails da NEXUS GeoEngenharia."})]}),s==="already_unsubscribed"&&(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)("p",{className:"text-lg font-medium text-foreground",children:"Já cancelado"}),(0,e.jsx)("p",{className:"text-muted-foreground text-sm",children:"Sua inscrição já foi cancelada anteriormente."})]}),s==="invalid"&&(0,e.jsx)("p",{className:"text-destructive",children:"Link inválido ou expirado. Se precisar de ajuda, entre em contato conosco."}),s==="error"&&(0,e.jsx)("p",{className:"text-destructive",children:"Ocorreu um erro. Tente novamente mais tarde."})]})})]})};export{S 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.