(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[133,532,43],{10506:(_,w,i)=>{"use strict";i.r(w),i.d(w,{default:()=>K});var t=i(90985),T=i(38698);const C=n=>({id:n.sys.id??"",uri:n.sys.uri??void 0,title:n.entryTitle??""}),R=n=>{const m=n.dateAndTime.from?(0,T.Yq)(n.dateAndTime.from,"dddd, d MMMM yyyy"):null,d=n.dateAndTime.to?(0,T.Yq)(n.dateAndTime.to,"dddd, d MMMM yyyy"):null,r=(o,b)=>!o||!b?null:o===b?o:`${o} - ${b}`,u=n.dateAndTime.from?(0,T.Yq)(n.dateAndTime.from,"hh:mm tt"):null,x=n.dateAndTime.to?(0,T.Yq)(n.dateAndTime.to,"hh:mm tt"):null,h=(o,b)=>!o||!b?null:o===b?o:`${o} - ${b}`;return{...C(n),date:n.dateAndTime?r(m,d):null,location:n.location??null,summary:n.summary??null,time:n.dateAndTime?h(u,x):null}},B=n=>n.map(m=>{switch(m.sys.contentTypeId){case t.f.event:return R(m);default:return C(m)}});var $=i(64336),z=i(83692);const{getCurrent:J,getListing:O,getResults:j,getTotalCount:k,getPaging:F,getSelectedFilters:S,getSearchTerm:D,getFilters:P,getIsLoaded:A}=$.selectors.selectListing,W=n=>O(n)?.title,Q=n=>k(n),Y={searchTerm:n=>D(n),selectedFilters:n=>S(n),allFilters:n=>P(n),currentListing:n=>J(n),currentPageCount:n=>j(n).length,listingTitle:W,noResultsText:n=>Q(n)===0?"No results were found":"",resultsText:n=>{const m=F(n),{pageIndex:d,pageSize:r,totalCount:u,pagesLoaded:x}=m;if(!x)return null;const h=(x[0]||d)*r+1;let o=h+(x.length*r||r)-1;return o>u&&(o=u),`${h} - ${o} of ${u} results`},combinedFilterText:n=>{const m=S(n),d=P(n),r=F(n),u=G(r);return H(m,d,u)}},L=n=>({noResultsText:M(n),resultsText:(0,z.mapJson)(n,Y)}),G=n=>{const{pageIndex:m,pageSize:d,totalCount:r,pagesLoaded:u}=n;if(r===0)return"No results found";if(r===1)return"Showing 1 result";if(!u)return null;const x=(u[0]||m)*d+1;let h=x+(u.length*d||d)-1;return h>r&&(h=r),r<=d?`Showing all ${r} results`:`Showing ${x} - ${h} of ${r} results`},M=n=>{const m=A(n),d=k(n,void 0);return m&&d===0?{title:"No results found",message:"Suggestions",suggestions:["Make sure that all words are spelled correctly","Try different keywords","Try more general keywords"]}:void 0},H=(n,m,d)=>{const r=[`${d}`];return Object.keys(n).forEach(u=>{const x=m[u],h=n[u];if(h.length>0){const o=h.map(N=>{const I=x.items.find(V=>V.key===N);return I?`${I.title}`:""}).filter(Boolean),b=N=>N.toLowerCase();o.length>0&&r.push(`${x.title==="Date"?"during":"in the category"} ${b(o.join(" "))}`)}}),r.join(" ")},K={results:B,resultsInfo:L}},93216:(_,w,i)=>{"use strict";i.r(w),i.d(w,{ListingCard:()=>h,default:()=>N});var t=i(48322),T=i(70149),C=i(64336),R=i(10506),E=i(67115),B=i(67820),$=i(28203),z=i(47068);const O=({updateSelectedFilters:e,filters:a})=>t.createElement(j,null,Object.keys(a).map(g=>{const l=a[g];return t.createElement(k,{key:g},t.createElement(F,{defaultValue:"",onChange:s=>{e(g,s.target.value)}},t.createElement(S,{value:"",disabled:!0},`Filter by ${l.title}`),l.items.map(s=>t.createElement(S,{key:s.key,value:s.key},s.title))),t.createElement(D,null,t.createElement($.A,{icon:"arrowDown",size:24})))})),j=E.Ay.div` display: flex; gap: ${e=>e.theme.spacing.xs}; width: 100%; flex-direction: column; @media ${e=>e.theme.mq.min.em.tablet} { flex-direction: row; } `,k=E.Ay.div` position: relative; display: flex; align-items: center; height: 100%; width: 100%; `,F=E.Ay.select` position: relative; height: 100%; width: 100%; appearance: none; padding: 10px 48px 10px 10px; border: 1px solid ${e=>e.theme.colors.light.brand.lightGold}; background-color: ${e=>e.theme.colors.light.neutral.white}; font-size: 1rem; border-radius: 5px; cursor: pointer; &:focus { outline: none; box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.5); } @media ${e=>e.theme.mq.min.em.laptop} { min-width: 195px; } `,S=E.Ay.option` padding: 10px; background-color: ${e=>e.theme.colors.light.neutral.grey}; color: black; `,D=E.Ay.div` position: absolute; right: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; height: 20px; display: flex; align-items: center; `,A=({className:e,label:a,updatePageIndex:g,index:l,disabled:s})=>{const p=y=>{y>-1&&(g(y),c())},c=()=>{try{window.scroll({top:0,left:0})}catch{window.scrollTo(0,0)}};return t.createElement(W,{disabled:s,type:"button",className:e,onClick:()=>p(l)}," ",a==="Back"||a==="Next"?t.createElement("div",{className:"icon"},a==="Back"?"<":">"):a&&a.toString())},W=E.Ay.button` ${({theme:{colors:e}})=>(0,E.AH)` cursor: pointer; display: inline-flex; align-items: center; justify-content: center; background: white; width: 48px; height: 48px; border: 0.1rem solid ${e.dark.brand.midBlue}; text-align: center; font-size: 15px; color: ${e.dark.brand.midBlue}; font-weight: 600; border-radius: 5px; &:enabled:hover { background-color: ${e.dark.brand.midBlue}; color: ${e.dark.neutral.white}; } &:disabled { /* opacity: 0.5; */ cursor: default; } &.inactive { color: white; background-color: ${e.dark.brand.midBlue}; } &.active { } .icon { display: flex; align-items: center; justify-content: center; svg { height: 2.4rem; path { fill: black; } } } `} `,Y=({paging:e,updatePageIndex:a})=>{const{pageIndex:l,pageCount:s}={...e};let p=Math.max(0,l-Math.floor(3/2)),c=Math.min(s-1,p+3-1);c-p+1<3&&(p=Math.max(0,c-3+1)),c>s-1&&(c=s-1,p=s-3,p<0&&(p=0));const y=[];for(let f=p;f<=c;f++){const v=f===l;y.push(t.createElement("li",{key:f},t.createElement(A,{index:f,key:f,label:f+1,updatePageIndex:a,disabled:v,className:v?"inactive":"active"})))}return t.createElement(X,{className:"pagination"},s>1&&t.createElement(t.Fragment,null,l>0&&t.createElement("li",null,t.createElement(A,{className:`control prev ${l>0?"":"disabled"}`,disabled:!(l>0),index:l-1,label:"Back",updatePageIndex:a})),y,t.createElement("li",null,t.createElement(A,{className:`control next ${le.theme.spacing.xs}; width: 100%; align-items: center; justify-content: center; list-style: none; `;var L=i(69352),G=i(35241),M=i(98401),H=i(43266),K=i(52546);const n="#003B5C",m={overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",position:"absolute",inset:0,zIndex:9999,height:"100%",maxHeight:"100vh",backgroundColor:"white"},d=()=>t.createElement("div",{style:m},t.createElement("h3",{className:"sr-only",style:{margin:"0 0 16px 0",fontSize:"16px",color:n}},"Loading..."),t.createElement("svg",{width:"38",height:"38",style:{width:"40px",height:"40px"},viewBox:"0 0 38 38",xmlns:"http://www.w3.org/2000/svg"},t.createElement("defs",null,t.createElement("linearGradient",{x1:"8.042%",y1:"0%",x2:"65.682%",y2:"23.865%",id:"a"},t.createElement("stop",{stopColor:n,stopOpacity:"0",offset:"0%"}),t.createElement("stop",{stopColor:n,stopOpacity:".631",offset:"63.146%"}),t.createElement("stop",{stopColor:n,offset:"100%"}))),t.createElement("g",{fill:"none",fillRule:"evenodd"},t.createElement("g",{transform:"translate(1 1)"},t.createElement("path",{d:"M36 18c0-9.94-8.06-18-18-18",id:"Oval-2",stroke:"url(#a)",strokeWidth:"2"},t.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"0.9s",repeatCount:"indefinite"})),t.createElement("circle",{fill:n,cx:"36",cy:"18",r:"1"},t.createElement("animateTransform",{attributeName:"transform",type:"rotate",from:"0 18 18",to:"360 18 18",dur:"0.9s",repeatCount:"indefinite"})))))),u=({text:e,reset:a})=>t.createElement(x,{className:"no-results-container"},t.createElement("span",{className:"h3"},e?.title?e?.title:"No results found"),t.createElement("div",{className:"text-container"},e?.message&&t.createElement("p",null,e?.message),t.createElement("ul",null,e?.suggestions.map((g,l)=>t.createElement("li",{key:l},g)))),t.createElement(L.A,{className:"reset-btn",onClick:()=>a(),buttonTheme:"secondary",label:"Reset search"})),x=E.Ay.div` .text-container { margin-top: ${e=>e.theme.spacing.s}; p, ul { font-weight: 400; color: ${e=>e.theme.colors.dark.neutral}; } ul { margin-top: ${e=>e.theme.spacing.xs}; li { color: inherit; } } } .reset-btn { margin-top: ${e=>e.theme.spacing.m}; } `,h=({title:e,date:a,location:g,summary:l,time:s,uri:p,className:c,borderColor:y="blue",image:f})=>{const v=!!(a||s||g);return t.createElement(V,{path:p,className:`listing-card ${c||""}`,borderColor:y,$hasTags:v},f?.src&&t.createElement("div",{className:"listing-card__image"},t.createElement("img",{src:f.src,alt:f.alt})),t.createElement("div",{className:"listing-card__content"},t.createElement("p",{className:"h4"},e),t.createElement("p",null,l)),v&&t.createElement("div",{className:"listing-card__tags"},a&&t.createElement("span",{className:"listing-card__tag"},t.createElement($.A,{icon:"calendar",size:26}),a),s&&t.createElement("span",{className:"listing-card__tag"},t.createElement($.A,{icon:"clock",size:26}),s),g&&t.createElement("span",{className:"listing-card__tag"},t.createElement($.A,{icon:"globe",size:38}),g)))},o=({searchTerm:e,filters:a,updateSelectedFilters:g,handleReset:l,selectedFilters:s,updateSearchTerm:p})=>t.createElement(t.Fragment,null,t.createElement(z.A,{value:e,submit:p,placeholder:"Search events",isListing:!0}),t.createElement(O,{filters:a,updateSelectedFilters:g}),t.createElement(L.A,{label:"Reset",buttonTheme:"primary",disabled:!(!Object.values(s).every(c=>Array.isArray(c)&&c.length===0)||e!==""),onClick:l})),N=({mappedEntry:e})=>{const{title:a}=e||{},g=(0,H.d4)(K.DT.selectors.selectRouteLoading),[l,s]=t.useState(!1),{results:p,resultsInfo:c,searchTerm:y,filters:f,updateSearchTerm:v,updateSelectedFilters:Z,clearFilters:ee,paging:te,updatePageIndex:ne,selectedFilters:q}=(0,C.iQ)({mappers:R.default}),U=()=>{ee(),v(""),location.href=location.pathname},{width:ae}=(0,G.lW)();return g?t.createElement(d,null):t.createElement(T.A,{meta:{title:{title:a},description:`Find out about ${a} at Worcester`,pageTitle:`Search ${a}`}},t.createElement(I,null,t.createElement("div",{className:"u-container"},a&&t.createElement("h1",null,a),ae>786?t.createElement("div",{className:"listing__search-wrapper"},t.createElement("div",{className:"listing__search-container"},t.createElement(o,{searchTerm:y,filters:f,updateSelectedFilters:Z,handleReset:U,selectedFilters:q,updateSearchTerm:v})),c.resultsText.combinedFilterText&&t.createElement(M.VK,{text:c.resultsText.combinedFilterText})):t.createElement("div",{className:"listing__search-wrapper-mobile"},t.createElement("span",{className:"listing__mobile-button-container h4"},"Filter Events",t.createElement("button",{onClick:()=>s(!l),className:"mobile-search-button"},l?t.createElement($.A,{icon:"close",size:26}):t.createElement($.A,{icon:"dropdown",size:26}))),l&&t.createElement("div",{className:"listing__search-container"},t.createElement("div",{className:"listing__search-content"},t.createElement(o,{searchTerm:y,filters:f,updateSelectedFilters:Z,handleReset:U,selectedFilters:q,updateSearchTerm:v}),c.resultsText.combinedFilterText&&t.createElement(M.VK,{text:c.resultsText.combinedFilterText})))),t.createElement("div",{className:"listing__card-container"},g?t.createElement(d,null):p&&p.length>0?p.map((le,se)=>t.createElement(h,{key:se,...le})):t.createElement(u,{text:c.noResultsText,reset:U})),t.createElement(Y,{paging:te,updatePageIndex:ne}))))},I=E.Ay.div` .flow > * + * { margin-block-start: 2em; } .u-container { display: flex; flex-direction: column; gap: ${e=>e.theme.spacing.s}; max-width: var(--grid-max-width); padding-inline: var(--grid-gutter); margin-inline: auto; margin-block-start: var(--space-xl-2xl); margin-block-end: var(--space-l-xl); } .listing__card-container { display: grid; grid-template-columns: 1fr; gap: ${e=>e.theme.spacing.m}; @media ${e=>e.theme.mq.min.em.tablet} { grid-template-columns: 1fr 1fr; } @media ${e=>e.theme.mq.min.em.laptop} { grid-template-columns: 1fr 1fr 1fr; } } .listing__search-wrapper { display: flex; flex-direction: column; justify-content: space-between; gap: ${e=>e.theme.spacing.xxs}; background-color: ${e=>e.theme.colors.light.brand.lightestGold}; padding: ${e=>e.theme.spacing.m} ${e=>e.theme.spacing.s}; width: 100%; margin: 0 auto; @media ${e=>e.theme.mq.min.em.laptop} { padding: ${e=>e.theme.spacing.l} ${e=>e.theme.spacing.m}; } } .listing__search-container { display: flex; flex-direction: column; gap: ${e=>e.theme.spacing.xs}; width: 100%; @media ${e=>e.theme.mq.min.em.laptop} { flex-direction: row; height: 60px; } } .listing__search-content { display: flex; flex-direction: column; gap: ${e=>e.theme.spacing.xs}; width: 100%; @media ${e=>e.theme.mq.min.em.laptop} { flex-direction: row; gap: ${e=>e.theme.spacing.s}; } } .listing__search-wrapper-mobile { position: relative; display: flex; flex-direction: column; gap: ${e=>e.theme.spacing.xs}; padding: ${e=>e.theme.spacing.m} ${e=>e.theme.spacing.s}; &::before { content: ''; position: absolute; top: 0; left: calc(var(--grid-gutter) * -1); width: calc(100% + (var(--grid-gutter) * 2)); margin: 0 auto; height: 100%; z-index: -1; background-color: ${e=>e.theme.colors.light.brand.lightestGold}; } } .listing__mobile-button-container { display: flex; gap: ${e=>e.theme.spacing.xs}; width: 100%; justify-content: space-between; font-weight: 600; .mobile-search-button { background-color: transparent; border: none; cursor: pointer; } } `,V=(0,E.Ay)(B.A)` display: flex; flex-direction: column; cursor: pointer; border: 1px solid ${e=>e.borderColor==="gold"?e.theme.colors.light.brand.gold:e.theme.colors.light.brand.lightBlue}; border-bottom-left-radius: 50px; border-top-right-radius: 50px; overflow: hidden; text-decoration: none; color: ${e=>e.theme.colors.light.brand.darkBlue}; .listing-card__image { height: 200px; overflow: hidden; flex-shrink: 0; img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease-in-out; } } &:hover, &:focus-within { .listing-card__image img { transform: scale(1.05); } } .listing-card__content { display: flex; flex-direction: column; gap: ${e=>e.theme.spacing.xxs}; padding: ${e=>e.theme.spacing.m} ${e=>e.theme.spacing.m} ${e=>e.$hasTags?e.theme.spacing.xxs:e.theme.spacing.m}; ${e=>e.$hasTags&&`border-bottom: 1px solid ${e.theme.colors.light.brand.midBlue};`} .h4 { font-size: var(--step-2); font-weight: 800; color: ${e=>e.theme.colors.light.brand.darkBlue}; } } .listing-card__tags { display: flex; flex-direction: column; gap: ${e=>e.theme.spacing.xxxs}; padding: ${e=>e.theme.spacing.xxs} ${e=>e.theme.spacing.m} ${e=>e.theme.spacing.m}; } .listing-card__tag { display: flex; align-items: center; gap: ${e=>e.theme.spacing.xxs}; font-weight: 600; svg { min-width: 24px; min-height: 24px; max-width: 24px; max-height: 24px; color: ${e=>e.theme.colors.light.brand.midBlue}; } } `},42634:()=>{}}]);