1import{b3 as v,e as p,j as r,b1 as x}from"./entry.client-BF1tJIhu.js";import{E as b}from"./EventCard-BKeAkzjZ.js";import{C as g}from"./ChipGroup-INSy566i.js";import{T as D}from"./Tabs-C0Soz9TM.js";import{D as j}from"./DirectoryHeader-7ahek64K.js";import{R as C}from"./ResultList-DH3pAUG_.js";import{S as M}from"./Transition-BTIyssUe.js";import{d as N,b as S}from"./dates-D-wmKt_5.js";import{u as k}from"./useSearchParams-eEjfaWaP.js";import"./ResponsiveImage-CSPuaRWh.js";import"./RouteFlipped-B4cBB0q3.js";import"./HR-B6amvMOY.js";import"./Toggle-DAyqQddl.js";import"./index-CWWd72kg.js";import"./index-Btu-ytwD.js";import"./LoadingResults-BL-vfXql.js";import"./LoadingSensor-BfQ9saTp.js";import"./NoResults-B0C5vLHC.js";function P(m){let u=m.branches.nodes.filter(e=>{var n,t;return(t=(n=e.branchSettings)==null?void 0:n.branchFlags)==null?void 0:t.includes("canSearch")}),h=m.eventCategories.nodes;const[a,o]=k({branch:[],category:[],mode:"upcoming",display:"card",search:""}),s=v({limit:30,search:o.get("search"),branch:o.get("branch"),category:o.get("category"),mode:o.get("mode")});let y=p.useMemo(()=>{var n;let e=(n=s.data)==null?void 0:n.nodes.flatMap(t=>a.display==="row"&&a.mode==="upcoming"?t.dates.flatMap(i=>({...t,keyDate:i.startDate,dates:[i]})):{...t,keyDate:a.mode==="upcoming"?t.dates[0].startDate:t.dates[0].endDate});return N().format("YYYY-MM-DD"),e=e==null?void 0:e.sort((t,i)=>{var d,c;const l=(d=t.eventInfo)!=null&&d.featured?"":t.keyDate,f=(c=i.eventInfo)!=null&&c.featured?"":i.keyDate;return(l==null?void 0:l.localeCompare(f??""))??0}),a.mode,e},[s.data,a.display,a.mode]);return r.jsxs(M,{children:[r.jsx(j,{heading:r.jsx(D,{id:"mode",items:[{label:"Upcoming events",value:"upcoming"},{label:"Past events",value:"past"}],value:a.mode,onValueChange:o.setter("mode"),className:"border-none pb-1"}),displayMode:a.display,onDisplayModeChange:o.setter("display"),tags:r.jsxs("div",{className:"stack-y-1",children:[r.jsx(g,{value:a.branch,onValueChange:o.setter("branch"),options:u.map(e=>({value:e.slug,label:e.shortName}))}),r.jsx(g,{value:a.category,onValueChange:o.setter("category"),options:h.map(e=>({value:e.slug,label:e.name}))})]}),search:r.jsx(x,{onSearch:o.setter("search"),placeholder:"Search events..."})}),r.jsx(C,{mode:a.display,items:y,hasNextPage:s.hasNextPage,loading:s.isLoading,loadingNextPage:s.isFetchingNextPage,onFetchMore:p.useCallback(()=>
1s.fetchNextPage(),[s]),component:b,dynamicSizing:"totalDependant",keyField:"uri",mobileMode:"row",getGroupHeading:a.display==="row"&&a.mode==="upcoming"?e=>S((e.keyDate??"")+Math.random()):void 0}),r.jsx("div",{className:"h-10"})]})}P.displayName="View(archive-event)";export{P as default}; 2//# sourceMappingURL=archive-event-N8K2YxLs.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.