1import{j as t}from"./react-D6Y9hML7.js";import{u as o}from"./useQuery-DtTYXR9K.js";import{L as c,a as i}from"./index-we3y_myF.js";import{V as d}from"./VerifyHeader-D0l5eRnw.js";import{F as m}from"./file-text-BsQzx5Ck.js";import"./supabase-CI_V8wt2.js";import"./LogoMark-DeHCpl4c.js";const l="founder-library";async function u(){const{data:e,error:r}=await i.storage.from(l).list("",{limit:200,sortBy:{column:"name",order:"asc"}});if(r)throw r;return(e||[]).filter(a=>a.name.toLowerCase().endsWith(".pdf"))}async function h(e){const{data:r,error:a}=await i.storage.from(l).createSignedUrl(e,3600);if(a)throw a;window.open(r.signedUrl,"_blank","noopener")}function x(e){return e.replace(/\.pdf$/i,"").replace(/-/g," ")}function p(e){return e?e>1024*1024?`${(e/(1024*1024)).toFixed(1)} MB`:`${Math.max(1,Math.round(e/1024))} KB`:""}function v(){const{data:e,isLoading:r,error:a}=o({queryKey:["founder-library"],queryFn:u});return t.jsxs("div",{className:"min-h-screen bg-[#0a0a0a] text-neutral-100",children:[t.jsx(d,{title:"Library",backTo:"/dashboard"}),t.jsxs("main",{className:"mx-auto w-full max-w-2xl px-5 pb-24 pt-10",children:[t.jsx("p",{className:"mb-8 text-sm leading-relaxed text-neutral-400",children:"Every internal document as a PDF. Start with the reading map; it is the 10-hour curriculum and everything else on this page appears in it."}),r&&t.jsxs("div",{className:"flex items-center gap-2 text-neutral-400",children:[t.jsx(c,{className:"h-4 w-4 animate-spin"}),t.jsx("span",{className:"text-sm",children:"Loading the shelf"})]}),a&&t.jsx("p",{className:"text-sm text-red-400",children:"Could not list the library. If you are signed in as the right account and this persists, the storage policy is the place to look."}),e&&e.length===0&&t.jsx("p",{className:"text-sm text-neutral-400",children:"Nothing here for this account. The library is read-locked server-side to one email."}),e&&e.length>0&&t.jsx("ul",{className:"divide-y divide-neutral-800 rounded-xl border border-neutral-800",children:e.map(s=>{var n;return t.jsx("li",{children:t.jsxs("button",{type:"button",onClick:()=>h(s.name).catch(()=>{}),className:"flex w-full items-center gap-3 px-4 py-3 text-left transition-colors hover:bg-neutral-900",children:[t.jsx(m,{className:"h-4 w-4 shrink-0 text-neutral-500"}),t.jsx("span",{className:"flex-1 text-sm lg:truncate",children:x(s.name)}),t.jsx("span",{className:"shrink-0 text-xs text-neutral-500",children:p((n=s.metadata)==null?void 0:n.size)})]})},s.name)})})]})]})}export{v 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.