1import{bW as y,j as l,b1 as S}from"./entry.client-BF1tJIhu.js";import{A as C}from"./ArticleCard-BdNvmt8s.js";import{C as j}from"./ChipGroup-INSy566i.js";import{R as N}from"./RichSelect-Bpdg6iaB.js";import{D as P}from"./DirectoryHeader-7ahek64K.js";import{R}from"./ResultList-DH3pAUG_.js";import{S as F}from"./Transition-BTIyssUe.js";import{u as A}from"./useSearchParams-eEjfaWaP.js";import"./ChipList-DQRPHu-0.js";import"./RouteFlipped-B4cBB0q3.js";import"./ResponsiveImage-CSPuaRWh.js";import"./dates-D-wmKt_5.js";import"./react-icons.esm-BrOTrqLX.js";import"./index-CWWd72kg.js";import"./index-CCDKe8Fw.js";import"./floating-ui.dom-D0RElrgj.js";import"./index-Btu-ytwD.js";import"./HR-B6amvMOY.js";import"./Toggle-DAyqQddl.js";import"./LoadingResults-BL-vfXql.js";import"./LoadingSensor-BfQ9saTp.js";import"./NoResults-B0C5vLHC.js";function B(s){var c,m,h,p,d,g,u,b;const a=(c=s.page)==null?void 0:c.discoverConfig;let f=s.branches.nodes.filter(e=>{var t,x;return(x=(t=e.branchSettings)==null?void 0:t.branchFlags)==null?void 0:x.includes("canSearch")});s.articleCategories.nodes;const o=(m=a==null?void 0:a.enableCollections)==null?void 0:m.map(e=>e==null?void 0:e.slug);let v=s.collections.nodes.filter(e=>o==null?void 0:o.includes(e.slug));const[i,r]=A({branch:"",category:[],collection:[],display:"card",search:""}),n=y({limit:24,search:i.search,branch:i.branch?[i.branch]:[],collection:i.collection.length===0?o:i.collection.filter(e=>o==null?void 0:o.includes(e)),category:i.category});return l.jsxs(F,{children:[l.jsx(P,{heading:(p=(h=s.page)==null?void 0:h.discoverConfig)==null?void 0:p.titleBar,displayMode:i.display,onDisplayModeChange:e=>{var t;(t=document.scrollingElement)==null||t.scrollTo({top:0,behavior:"instant"}),r.set("display",e)},tags:l.jsxs("div",{className:"stack-x-1",children:[((d=a==null?void 0:a.enableCollections)==null?void 0:d.length)>1&&l.jsx(j,{value:r.get("collection"),onValueChange:e=>{var t;(t=document.scrollingElement)==null||t.scrollTo({top:0,behavior:"instant"}),r.set("collection",e)},options:v.map(e=>{var t;return{value:e.slug,label:((t=e.collectionSettings)==null?void 0:t.filterLabel)||e.name}})}),(a==null?void 0:a.enableBranchFilter)&&l.jsx(N,{variant:"outline",size:"chip",placeholder:"Location",value:i.branch??"",onChange:e=>{e==="all"?r.set("branch",""):r.set("branch",e)},active:!!i.branch,options:[{value:"all",label:"All"},...f.map(e=>({value:e.slug,label:e.shortName}))]})]}),search:!!((u=(g=s.page)==null?void 0:g.discoverConfig)!=null&&u.enableSearch)&&l.jsx(S,{onSearch:r.setter("search"),placeholder:"Search articles..."})}),l.jsx(R,{mode:r.get("display"),items:(b=n.data)==null?void 0:b.nodes,hasNextPage:n.hasNextPage,loading:n.isLoading,loadingNextPage:n.isFetchingNextPage,onFetchMore:n.fetchNextPage,component:C,dynamicSizing:a!=null&&a.dynamicSizing?"totalDependant":!1,keyField:"uri",mobileMode:"row"})]})}B.displayName="View(template-discover)";export{B as default}; 2//# sourceMappingURL=template-discover-S1Ox2M4r.js.map
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.