(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7695],{65125:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return m}});var r=n(50029),a=n(92777),s=n(82262),i=n(10748),o=n(45959),c=n(63553),l=n(37247),u=n(59499),p=n(87794),f=n.n(p),v=n(67294),d=n(8423),g=n(26629),y=(n(13092),n(61375)),h=n(76522),b=n(75182),T=n(90606),O=n(85893);function P(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function w(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?P(Object(n),!0).forEach((function(t){(0,u.Z)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):P(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Z(e){var t=function(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=(0,l.Z)(e);if(t){var a=(0,l.Z)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return(0,c.Z)(this,n)}}var j=function(e){(0,o.Z)(n,e);var t=Z(n);function n(){var e;(0,a.Z)(this,n);for(var s=arguments.length,o=new Array(s),c=0;c<s;c++)o[c]=arguments[c];return e=t.call.apply(t,[this].concat(o)),(0,u.Z)((0,i.Z)(e),"state",{activeTag:null,activeType:null}),(0,u.Z)((0,i.Z)(e),"onUpdateFilters",function(){var t=(0,r.Z)(f().mark((function t(n){var r,a,s,i,o,c,l,u,p;return f().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=n.type,a=n.tag,s=n.shallow,e.setState({activeType:r,activeTag:a}),s){t.next=5;break}return console.log("Refreshing page"),t.abrupt("return");case 5:return i=e.props,o=i.allTags,c=i.allTypes,i.author,l=i.page,u=(0,T.dz)({page:l,type:r,allTypes:c,tag:a,allTags:o}),t.next=9,(0,b.vw)(u);case 9:p=t.sent,e.setState({events:p.items,totalPages:Math.ceil(p.total/T.pi)});case 11:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()),e}return(0,s.Z)(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.activeTag,n=e.activeType,r=e.events,a=e.totalPages;this.setState({activeType:n,activeTag:t,events:r,totalPages:a})}},{key:"render",value:function(){var e,t,n,r=this.props,a=r.site,s=r.title,i=r.description,o=r.shareImage,c=r.sections,l=r.page,u=r.bannerText,p=r.bannerCta,f=r.bannerLink,b=this.state,T=b.activeTag,P=b.activeType,Z=b.events,j=b.totalPages,m=!!u,_=c[2],k=null===_||void 0===_||null===(e=_.fields.subsections)||void 0===e?void 0:e[0],x=null===_||void 0===_||null===(t=_.fields.subsections)||void 0===t?void 0:t[1],E=(null===k||void 0===k?void 0:k.fields.items)||[],S=(null===x||void 0===x?void 0:x.fields.items)||[];return(0,O.jsxs)(d.Z,{site:a,title:s,description:i,shareImage:o,bannerText:u,bannerLink:f,bannerCta:p,showBanner:m,transparentHeader:1===l&&(null===(n=c[0].fields.styling)||void 0===n?void 0:n.includes("transparent-header")),children:[c&&c[0]&&l>=2&&(0,O.jsx)(g.Z,{title:c[0].fields.header}),(0,O.jsxs)("div",{children:[l<2&&c.map((function(e,t){return 1===t?(0,v.createElement)(y.Z,w(w({},e.fields),{},{events:e.fields.subsections,key:e.sys.id})):null})),(0,O.jsx)(h.Z,{route:"/events",events:Z,page:l,totalPages:j,types:E,tags:S,activeTag:T,activeType:P,onUpdateFilters:this.onUpdateFilters})]})]})}}]),n}(v.Component);j.defaultProps={description:null,sections:[],categories:[],shareImage:null,events:[],page:1,totalPages:0,bannerText:null,bannerLink:null};var m=!0;t.default=j},53129:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/events",function(){return n(65125)}])}},function(e){e.O(0,[9774,9809,1812,9065,6283,6139,8423,7894,8013,3167,5529,2888,179],(function(){return t=53129,e(e.s=t);var t}));var t=e.O();_N_E=t}]);