1import{_ as k,r as s,j as e,L as p,bd as j,B as i,y as w,ab as N,aK as E,s as v}from"./index-DocTL6Xp.js";import{D as S}from"./download-Bljni_8c.js";import{B as D}from"./book-open-DVrlRLly.js";function G(){const[h]=k(),t=h.get("token"),a=s.useRef(!1),[c,d]=s.useState(!1),[o,y]=s.useState(""),[n,u]=s.useState(""),[b,m]=s.useState(!1),g=async()=>{if(!(!t||a.current)){a.current=!0,d(!0),u("");try{const{data:r,error:x}=await v.functions.invoke("newsletter-ebook",{body:{action:"confirm",token:t}});if(x){const f=x.context,l=f instanceof Response?await f.json().catch(()=>null):null;throw new Error((l==null?void 0:l.error)||"We could not confirm your email. Please try again.")}if(!(r!=null&&r.downloadUrl))throw new Error((r==null?void 0:r.error)||"Please request a fresh confirmation link.");y(r.downloadUrl);try{localStorage.setItem("gx_ebook_signed_up","true")}catch{}window.history.replaceState(null,"","/newsletter-guide")}catch(r){u(r instanceof Error?r.message:"Please try again.")}finally{d(!1),a.current=!1}}};return e.jsxs("main",{className:"gx-ebook-theme min-h-screen bg-background px-6 py-12",children:[e.jsxs("div",{className:"mx-auto max-w-3xl",children:[e.jsx(p,{to:"/",className:"text-primary text-xl font-bold",children:"GoExpired"}),e.jsxs("div",{className:"grid md:grid-cols-[220px_1fr] gap-10 items-center mt-16",children:[e.jsx("img",{src:j.url,alt:"Sounds Like a Great Domain. But Will It Sell?",className:"ebook-cover w-40 md:w-full mx-auto -rotate-3 rounded-sm"}),e.jsxs("div",{className:"space-y-5",children:[e.jsx("p",{className:"text-xs font-bold text-primary",children:"YOUR FREE DOMAIN INVESTING GUIDE"}),e.jsx("h1",{className:"text-3xl font-bold leading-tight",children:o?"Your free guide is ready.":"Great name. But will it sell?"}),e.jsx("p",{className:"text-muted-foreground leading-relaxed",children:o?"Your email is confirmed. We've also sent your private download link to your inbox. It expires in 48 hours.":"Confirm your newsletter signup to receive your free e-book and daily domain auction picks. Unsubscribe anytime."}),n&&e.jsx("p",{role:"alert",className:"text-destructive text-sm",children:n}),o?e.jsx(i,{asChild:!0,className:"ebook-primary min-h-12",children:e.jsxs("a",{href:o,rel:"noreferrer",children:[e.jsx(S,{}),"Download your free e-book (PDF)"]})}):t&&!n?e.jsxs(i,{onClick:g,disabled:c,className:"ebook-primary min-h-12",children:[c?e.jsx(w,{className:"animate-spin"}):e.jsx(N,{}),"Confirm & get my free e-book"]}):e.jsxs(i,{onClick:()=>m(!0),className:"ebook-primary min-h-12",children:[e.jsx(D,{}),"Request a fresh e-book link"]}),e.jsx("p",{className:"text-xs text-muted-foreground leading-relaxed",children:"Sounds Like a Great Domain. But Will It Sell? - 20 pages, including a printable before-you-bid scorecard."}),e.jsx(p,{to:"/privacy",className:"inline-block text-xs text-primary underline",children:"Privacy policy"})]})]})]}),b&&e.jsx(E,{onClose:()=>m(!1)})]})}export{G 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.