1import{j as r}from"./index-Bi-eA3Wq.js";import{d as l,r as s}from"./vendor-GPGsv0WI.js";import{g as d,m as c}from"./ebookLead-5aZDegyu.js";import"./supabase-D2gm834s.js";async function u(e){try{await c(e)}catch{}}function p(){const{token:e}=l(),[o,t]=s.useState(null);return s.useEffect(()=>{if(!e){t("This download link is invalid or has expired.");return}let a=!1;return(async()=>{try{const n=await d(e);if(a)return;if(!n){t("This download link is invalid or has expired.");return}if(n.downloaded_at||await u(e),a)return;const i=n.pdf_url;if(!i){t("This ebook is currently unavailable. Please contact support.");return}window.location.replace(i)}catch{a||t("This download link is invalid or has expired.")}})(),()=>{a=!0}},[e]),o?r.jsx("div",{className:"min-h-screen flex items-center justify-center px-6 text-center",children:r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl font-bold text-dark mb-2",children:"Download unavailable"}),r.jsx("p",{className:"text-muted",children:o}),r.jsx("a",{href:"/resource",className:"inline-block mt-6 px-6 py-3 bg-brand-blue text-white rounded-lg font-bold",children:"Back to resources"})]})}):r.jsx("div",{className:"min-h-screen flex items-center justify-center text-muted",children:"Preparing your downloadâ¦"})}export{p 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.