PageSourceSearch

https://agda.com.au/wp-content/themes/agda/dist/frontend/assets/template-awards-listing-C4MTvPV2.js

js agda.com.au collected 2026-10-02 03:40:18 UTC 11,299 bytes, 2 lines download raw bytes

1import{j as s,L as _,bS as z,bT as D,e as v,B as A,c as G,t as Y,b1 as U,bU as $,D as J,bV as K,W as Q,C as X,a5 as Z}from"./entry.client-BF1tJIhu.js";import{a as p}from"./RouteFlipped-B4cBB0q3.js";import{R as ee}from"./ResponsiveImage-CSPuaRWh.js";import{C as se}from"./ChipList-DQRPHu-0.js";import{H as ae}from"./HR-B6amvMOY.js";import{R as le}from"./ResultList-DH3pAUG_.js";import{S as te}from"./Transition-BTIyssUe.js";import{B as ie}from"./Toggle-DAyqQddl.js";import{u as ne}from"./useSearchParams-eEjfaWaP.js";import{S as re}from"./installGutenbergHooks-CakaDxut.js";import"./LoadingResults-BL-vfXql.js";import"./LoadingSensor-BfQ9saTp.js";import"./NoResults-B0C5vLHC.js";import"./index-CWWd72kg.js";import"./index-Btu-ytwD.js";function de(a){var i,c,n,l,m,g,o;return s.jsxs(_,{href:a.uri,className:"block mb-7 group",children:[s.jsx("div",{className:"w-full",children:!!((i=a.hero)!=null&&i.srcSet)&&s.jsx(p,{flipId:a.id,children:s.jsx(ee,{fadeOnLoad:!1,srcSet:(c=a.hero)==null?void 0:c.srcSet,aspect:(n=a.hero)==null?void 0:n.aspect})})}),s.jsxs("div",{className:"stack-y-1 pt-2",children:[s.jsxs("div",{className:"stack-y-2",children:[s.jsx("div",{className:"type-title-xs-medium md:type-title-s-medium antialiased text-pretty group-hover:text-grey-dark",children:a.title}),s.jsx(se,{noLinks:!0,chips:[{label:String(a.year)},{label:(m=(l=a.category)==null?void 0:l.parent)==null?void 0:m.title},{label:a.merit},{label:(g=a.studio)==null?void 0:g.name}].filter(x=>!!x.label)})]}),s.jsx("div",{className:"type-body-s-roman",children:(o=a.category)==null?void 0:o.title})]})]})}const oe=G({slots:{wrapper:"stack-y-5",section:"stack-y-2",label:"type-ui-s-roman-caps",buttons:"flex gap-1 flex-wrap"}});function ue(a){var o,x;const[i,c]=ne({student:!1,studio:0});!i.year&&!i.studio&&(i.year=(x=(o=a.options)==null?void 0:o.years)==null?void 0:x.reduce((f,{year:w})=>Math.max(w??0,f),0));const n=!!i.year||!!i.category||!!i.studio,l=i.studio&&!i.category?"year":"awardType",m=z({student:!!i.student,studio:i.studio?Number(i.studio):void 0,year:Number(i.year)?Number(i.year):void 0,types:i.types,orderType:l,categorySlug:i.category,limit:60,search:i.q},{enabled:n}),g=D(f=>m.isLoading?f??l:l,[m.isLoading,l]);return{lookup:m,params:i,filter:c,hasFilters:n,orderType:g}}function W(a){var x,f,w,y,k;const i=oe(),c=!1,n=(x=a.options.years)==null?void 0:x.find(e=>e.year==a.values.year),l=(f=n==null?void 0:n.categories)==null?void 0:f.filter(e=>a.values.student?(e==null?void 0:e.type)==="student":(e==null?void 0:e.type)==="common"||(e==null?void 0:e.type)==="nomination").sort((e,r)=>((e==null?void 0:e.title)??"").localeCompare((r==null?void 0:r.title)??"")).sort((e,r)=>{var N;return(N=(e==null?void 0:e.type)??"")==null?void 0:N.localeCompare((r==null?void 0:r.type)??"")}),m=l==null?void 0:l.find(e=>(e==null?void 0:e.slug)===a.values.category),g=(w=n==null?void 0:n.categories)==null?void 0:w.some(e=>(e==null?void 0:e.type)==="student"),o=(y=a.options.types)==null?void 0:y.filter(e=>{var r;return!m||((r=m==null?void 0:m.levels)==null?void 0:r.includes(e==null?void 0:e.label))});return v.useEffect(()=>{let e=a.values;a.values.student&&!g&&(e={...a.values,student:!1}),a.values.category&&!(l!=null&&l.find(r=>(r==null?void 0:r.slug)===a.values.category))&&(e={...a.values,category:void 0}),e!==a.values&&a.onValueChange(e)}),s.jsxs("div",{className:Y(i.wrapper(),a.className),children:[s.jsxs("div",{className:i.section(),children:[s.jsx("h4",{className:i.label(),children:"Year"}),s.jsx("div",{className:i.buttons(),children:(k=a.options.years)==null?void 0:k.map(e=>s.jsx(A,{variant:"outline",onClick:()=>{a.values.year==e.year?a.onValueChange({...a.values,year:void 0}):a.onValueChange({...a.values,year:e.year})},active:a.values.year==e.year,children:e.year},e.year))})]}),s.jsxs("div",{className:i.section(),children:[s.jsx("h4",{className:i.label(),children:"Category"}),s.jsx("div",{className:i.buttons(),children:l==null?void 0:l.map(e=>{var r;return s.jsx(A,{variant:"outline",onClick:()=>{a.values.category==(e==null?void 0:e.slug)?a.onValueChange({...a.values,category:void 0}):a.onValueChange({...a.values,category:e==null?void 0:e.slug})},active:a.values.category==(e==null?void 0:e.slug),children:(r=e==null?void 0:e.title)==null?void 0:r.replace(/^Student\ /,"")},e==null?void 0:e.title)})})]}),(n==null?void 0:n.status)==="winners"&&(o==null?void 0:o.length)>1&&s.jsxs("div",{className:i.section(),children:[s.jsx("h4",{className:i.label(),children:"Award"}),s.jsx("div",{className:i.buttons(),children:o==null?void 0:o.map(e=>{var r;return s.jsx(A,{variant:"outline",disabled:c,onClick:()=>{var N,S;(N=a.values.types)!=null&&N.includes(e==null?void 0:e.slug)?a.onValueChange({...a.values,types:(S=a.values.types)==null?void 0:S.filter(M=>M!=(e==null?void 0:e.slug))}):a.onValueChange({...a.values,types:[...a.values.types??[],e==null?void 0:e.slug]})},active:(r=a.values.types)==null?void 0:r.includes(e==null?void 0:e.slug),children:e==null?void 0:e.label},e==null?void 0:e.label)})})]}),g&&s.jsx("div",{children:s.jsx(ie,{left:{label:"Professional",value:!1},right:{label:"Student",value:!0},value:!!a.values.student,onToggle:e=>{a.onValueChange({...a.values,student:e,studio:void 0})}})}),s.jsx("div",{className:"flex-auto"}),s.jsx(U,{defaultValue:a.values.q,onSearch:e=>{a.onValueChange({...a.values,studio:void 0,q:e})},placeholder:"Search awards..."})]})}function ce(a){const[i,c]=v.useState(a.values);return v.useEffect(()=>{c(a.values)},[a.values]),s.jsxs("div",{className:"flex flex-col gap-7",children:[s.jsx(W,{...a,className:"stack-y-2",values:i,onValueChange:n=>{c(n)}}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx(A,{variant:"outline",onClick:()=>{a.onClose(),c({}),a.onValueChange({})},children:"Reset"}),s.jsx(A,{onClick:()=>{a.onValueChange(i),a.onClose()},children:"Apply"})]})]})}
1function me(a){var S,M,R,T,B,P,q;const i=v.useRef(null),c=ue({options:a.awardFilters}),{lookup:n,params:l,filter:m}=c,g=$({id:String(l.studio)},{enabled:!!l.studio}),o=D(t=>{var j,F,V,L,C,E,I,H;let d,h;const u=l.category&&((V=(F=(j=a.awardFilters)==null?void 0:j.categories)==null?void 0:F.find(b=>(b==null?void 0:b.slug)===l.category))==null?void 0:V.label);return n.isLoading&&t?t:(l.studio&&!g.isLoading&&g.data?(d=(L=g.data.studio)==null?void 0:L.title,h=u):l.year&&(d=l.year,h=((C=l.category)==null?void 0:C.replace("student-",""))&&((H=(I=(E=a.awardFilters)==null?void 0:E.categories)==null?void 0:I.find(b=>{var O;return(b==null?void 0:b.slug)===((O=l.category)==null?void 0:O.replace("student-",""))}))==null?void 0:H.label)),d||h?s.jsxs(s.Fragment,{children:[d&&s.jsx("div",{className:"type-title-l-medium",children:d}),h&&s.jsxs("div",{className:"type-title-l-roman",children:[l.student?"Student ":"",h]})]}):null)},[l,n.isLoading,g.isLoading,g.data]),[x,f]=v.useState(!1),w=v.useMemo(()=>{var d,h;const t=[];if(l.year&&t.push(l.year),l.category){const u=(h=(d=a.awardFilters)==null?void 0:d.categories)==null?void 0:h.find(j=>(j==null?void 0:j.slug)===l.category);t.push(u==null?void 0:u.label)}if(l.types){const u=l.types.map(j=>{var F,V,L;return(L=(V=(F=a.awardFilters)==null?void 0:F.types)==null?void 0:V.find(C=>(C==null?void 0:C.slug)===j))==null?void 0:L.label});t.push(u.join(", "))}return l.q&&t.push(`"${l.q}"`),l.student&&t.push("Student"),t.join(", ")},[l]),y=v.useMemo(()=>{var t,d;if(l.year&&!l.category&&!l.q&&!l.studio&&!l.types)return(d=(t=a.awards)==null?void 0:t.nodes.find(h=>{var u;return((u=h.info)==null?void 0:u.awardYear)==l.year}))==null?void 0:d.contentBlocks},[l]),k=v.useMemo(()=>{var d;const t=[];return(d=n.data)==null||d.nodes.forEach(h=>{var u;t.includes((u=h.category)==null?void 0:u.title)||t.push(h.category.title)}),t},[(S=n.data)==null?void 0:S.nodes]),[e,r]=v.useState(null),N=v.useMemo(()=>{var t,d;return e?(d=n.data)==null?void 0:d.nodes.filter(h=>{var u;return((u=h.category)==null?void 0:u.title)===e}):(t=n.data)==null?void 0:t.nodes},[(M=n.data)==null?void 0:M.nodes,e]);return s.jsx(te,{children:s.jsxs("div",{className:"pb-8 min-h-[80vh]",children:[s.jsx("div",{className:"w-grid mx-auto md:hidden flex flex-col gap-7",children:s.jsxs("div",{className:"bg-grey-light rounded-md",children:[s.jsxs("button",{className:"px-4 py-3 w-full flex items-center justify-between",onClick:()=>f(!x),children:[s.jsx("div",{className:"type-title-xs-medium",children:x?"Filter":w}),x?s.jsx(J,{}):s.jsx(K,{})]}),s.jsx(Q.div,{className:"overflow-hidden",variants:{expanded:{height:"auto"},collapsed:{height:0}},initial:"collapsed",animate:x?"expanded":"collapsed",children:s.jsx("div",{className:"border-t px-4 py-4",children:s.jsx(ce,{options:a.awardFilters,values:l,onValueChange:t=>{window.scrollTo({top:0,behavior:"instant"}),m.setAll(t)},onClose:()=>f(!1)})})})]})}),s.jsxs("div",{"data-transition":"children/fade",className:"grid-auto",children:[s.jsx("div",{className:"hidden md:block col-span-12 md:col-span-3",children:s.jsx("div",{className:"sticky top-headerHeight pt-7 md:min-h-pageMin pb-8 flex align-stretch",children:s.jsx(W,{options:a.awardFilters,values:l,onValueChange:t=>{window.scrollTo({top:0,behavior:"instant"}),m.setAll(t),r(null)}})})}),s.jsxs("div",{ref:i,className:"col-span-12 md:col-span-9 pt-7",children:[!!o&&s.jsx(s.Fragment,{children:c.orderType==="year"?s.jsx(s.Fragment,{children:s.jsxs("div",{className:"stack-x-2 items-start pb-1",children:[s.jsx("div",{className:"stack-y-1 flex-auto",children:o}),s.jsx("div",{className:"flex-none type-title-xs-roman",children:((R=n.data)==null?void 0:R.total)>1?((T=n.data)==null?void 0:T.total)+" results":""})]})}):s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"stack-x-2 items-end pb-4",children:[s.jsx("div",{className:"stack-y-1 flex-auto",children:o}),s.jsx("div",{className:"flex-none type-title-xs-roman",children:((B=n.data)==null?void 0:B.total)>1?((P=n.data)==null?void 0:P.total)+" results":""})]}),s.jsx(ae,{}),((q=c.params)==null?void 0:q.category)&&k.length>0&&s.jsx("div",{className:"w-full flex flex-wrap gap-1 mt-3",children:k.map((t,d)=>s.jsx(X,{active:t===e,onClick:()=>{r(t===e?null:t)},children:t},d))}),s.jsx("div",{className:"h-6"})]})}),(y==null?void 0:y.length)>0&&s.jsxs("div",{children:[s.jsx("h3",{className:"type-title-s-medium mb-4",children:"Overview"}),s.jsx("div",{className:"grid-auto gap-y-4 mb-7 items-stretch",children:y==null?void 0:y.map((t,d)=>s.jsx("div",{className:"col-span-12 sm:col-span-6 md:col-span-3 flex items-stretch",children:s.jsx(re,{block:t,index:d},d)},d))})]}),s.jsx(le,{mode:"card",items:N,component:de,dynamicSizing:!1,keyField:"id",mobileMode:"row",loading:n.isLoading,loadingNextPage:n.isFetchingNextPage,hasNextPage:n.hasNextPage,onFetchMore:()=>n.fetchNextPage(),colSizes:"col-span-12 sm:col-span-6 md:col-span-3 lg:col-span-3",getGroupHeading:t=>
1c.orderType==="year"?"year:"+t.year:!m.get("category")&&t.merit==="Winner"?"Distinction":t.merit,renderGroupHeading:t=>t.startsWith("year:")?s.jsx("div",{className:"stack-x-2 items-center type-title-l-roman border-b pb-3",children:s.jsx("div",{children:t.replace("year:","")})}):s.jsxs("div",{className:"stack-x-2 items-center",children:[s.jsx(Z,{}),s.jsx("div",{children:t})]})})]})]})]})})}me.displayName="View(template-awards-listing)";export{me as default};
2//# sourceMappingURL=template-awards-listing-C4MTvPV2.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.