1import{t as e}from"./jsx-runtime-Cx0BB4qO.js";import{t}from"./link-DY6jQ3bG.js";import{t as n}from"./SiteNav-GsSHbd8G.js";import{t as r}from"./answers-BVzILf0K.js";import{xt as i}from"./index-CVaRTFk8.js";import{n as a,r as o,t as s}from"./search-B47UkyiH.js";var c=e();function l({hit:e,query:t}){return(0,c.jsx)(`p`,{className:`measure mt-3 leading-7 text-foreground/75`,children:o(e.snippet,t).map((e,t)=>e.match?(0,c.jsx)(`mark`,{className:`bg-primary/20 text-foreground`,children:e.text},t):(0,c.jsx)(`span`,{children:e.text},t))})}function u(){let{query:e,groups:o,total:u}=i.useLoaderData(),d=o.filter(e=>e.hits.length>0);return(0,c.jsxs)(`div`,{className:`min-h-screen bg-background`,children:[(0,c.jsx)(n,{}),(0,c.jsxs)(`main`,{className:`mx-auto max-w-7xl px-5 pb-24 sm:px-8`,children:[(0,c.jsx)(`p`,{className:`label text-primary`,children:`Search`}),(0,c.jsx)(`h1`,{className:`brutal-heading mt-5 text-4xl sm:text-6xl`,children:`Search the archive`}),(0,c.jsx)(`p`,{className:`measure mt-6 text-lg leading-8 text-foreground/80`,children:`Every episode transcript, every article and every page, searched by meaning as well as by word. Episode results link to the exact moment in the audio.`}),(0,c.jsxs)(`form`,{method:`get`,action:`/search`,className:`mt-10 flex flex-wrap gap-3`,children:[(0,c.jsx)(`label`,{htmlFor:`site-search`,className:`sr-only`,children:`Search the archive`}),(0,c.jsx)(`input`,{id:`site-search`,type:`search`,name:`q`,defaultValue:e,placeholder:`how much protein should I eat`,className:`w-full max-w-xl border-2 border-foreground bg-background px-4 py-3 text-base`}),(0,c.jsx)(`button`,{type:`submit`,className:`border-2 border-foreground bg-foreground px-6 py-3 text-base font-semibold text-background`,children:`Search`})]}),e.length<2?(0,c.jsxs)(`div`,{className:`mt-12`,children:[(0,c.jsx)(`p`,{className:`text-base text-foreground/70`,children:`Type a question the way you would say it out loud, or start with one of these.`}),(0,c.jsx)(`ul`,{className:`mt-6 grid gap-3 sm:grid-cols-2`,children:r.map(e=>(0,c.jsx)(`li`,{children:(0,c.jsx)(t,{to:`/answers/$slug`,params:{slug:e.slug},className:`text-base text-primary underline underline-offset-4`,children:e.question})},e.slug))})]}):u===0?(0,c.jsxs)(`div`,{className:`mt-10 border-2 border-foreground p-6`,children:[(0,c.jsxs)(`p`,{className:`text-base font-semibold`,children:[`Nothing in the archive matches "`,e,`".`]}
1),(0,c.jsxs)(`p`,{className:`measure mt-3 leading-7 text-foreground/75`,children:[`Try fewer words, or browse the`,` `,(0,c.jsx)(t,{to:`/podcast`,className:`text-primary underline underline-offset-4`,children:`podcast archive`}),` `,`and the`,` `,(0,c.jsx)(t,{to:`/articles`,className:`text-primary underline underline-offset-4`,children:`articles`}),`.`]})]}):(0,c.jsxs)(`div`,{className:`mt-12 space-y-14`,children:[(0,c.jsxs)(`p`,{className:`label text-muted-foreground`,children:[u,` passage`,u===1?``:`s`,` for "`,e,`"`]}),d.map(t=>(0,c.jsxs)(`section`,{className:`border-t-2 border-foreground pt-8`,children:[(0,c.jsxs)(`h2`,{className:`brutal-heading text-2xl sm:text-3xl`,children:[s[t.sourceType],` `,(0,c.jsxs)(`span`,{className:`text-foreground/50`,children:[`(`,t.count,`)`]})]}),(0,c.jsx)(`ul`,{className:`mt-6 divide-y divide-border border-y border-border`,children:t.hits.map(t=>(0,c.jsxs)(`li`,{className:`py-6`,children:[(0,c.jsxs)(`a`,{href:t.url,className:`group block`,children:[(0,c.jsxs)(`p`,{className:`label text-primary`,children:[s[t.sourceType].replace(/s$/,``),t.startSeconds!==null&&t.startSeconds>0?` · jump to ${a(t.startSeconds)}`:``,t.heading?` · ${t.heading}`:``]}),(0,c.jsx)(`h3`,{className:`editorial-heading mt-3 text-xl group-hover:text-primary`,children:t.sourceTitle})]}),(0,c.jsx)(l,{hit:t,query:e})]},t.id))})]},t.sourceType))]})]})]})}export{u as component};
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.