1import{a as Me,c as $e,e as Ve,f as je,g as Q,h as L,i as He,o as ze}from"./chunk-3ZAUEJOX.js";import"./chunk-JEL6HJ7P.js";import{Aa as Ae,Ba as Pe,E as we,F as Ee,G as Le,Ka as Oe,La as Re,M,N as ke,O as Fe,R as De,V as Ie,a as _e,c as J,g as ie,k as Ce,n as ye,q as Te,u as Se,v as be,y as xe}from"./chunk-MKZZDWZM.js";import"./chunk-5P27VWSX.js";import{H as fe,I as ge,e as ue,g as me,m as Y,r as ve,s as te}from"./chunk-KRUKCWRD.js";import{A as K,D as X,Db as T,Eb as S,Gb as j,Hb as H,Ib as z,Jb as k,Kb as d,Lb as h,Mb as I,Tb as A,U as se,V as q,Wa as p,Xb as E,Y as N,Yb as b,ac as ce,bc as de,cc as he,ea as _,fa as C,fb as y,g as V,ic as m,ja as ae,jc as Z,kb as le,kc as ee,lb as G,p as re,ya as oe,zc as pe}from"./chunk-6I6YFGEM.js";import{a as R}from"./chunk-ODN5LVDJ.js";var W=(()=>{let l=class l{constructor(e,i,t){this.orderPipe=e,this.config=i,this.router=t,this.sideFilterContent=L}getFilterOptions(e,i,t=!1,n){let r=[],s=e[i];for(let o=0;o<s.length;o++){let u=null;u={label:`${s[o].value}`,filterString:this.getCategory(i),id:s[o].id,prechecked:n&&n.length?n.findIndex(v=>v.id===s[o].id)>-1:!1,total:t?s[o].total:0},r=[...r,u]}return r=this.orderPipe.transform(r,"label",!0),r}updateEventFilterContent(e){e&&Object.keys(e).forEach(i=>{let t=this.getFilterOptions(e,i,!1),n;i==="eventType"&&(n=this.sideFilterContent.categories.findIndex(r=>r.accordionTitle==="Event type"),n>-1&&(this.sideFilterContent.categories[n].options=t)),i==="eventTopic"&&(n=this.sideFilterContent.categories.findIndex(r=>r.accordionTitle==="Event topic"),n>-1&&(this.sideFilterContent.categories[n].options=t)),i==="eventDelivery"&&(n=this.sideFilterContent.categories.findIndex(r=>r.accordionTitle==="Event delivery"),n>-1&&(this.sideFilterContent.categories[n].options=t)),i==="audienceType"&&(n=this.sideFilterContent.categories.findIndex(r=>r.accordionTitle==="Audience type"),n>-1&&(this.sideFilterContent.categories[n].options=t))})}getPayload(e,i,t,n=!1){let r={from:e.from?e.from:i,size:e.size?e.size:t,suggest:e.suggest?e.suggest:n};return e.delivery&&(r.eventDelivery=e.delivery.split(",")),e.type&&(r.eventType=e.type.split(",")),e.audience&&(r.audienceType=e.audience.split(",")),e.topic&&(r.eventTopic=e.topic.split(",")),e.search&&(r.search=e.search),e.dateFrom&&(r.dateFrom=new Date(e.dateFrom).getTime()),e.dateTo&&(r.dateTo=new Date(e.dateTo).getTime()),e.location&&e.location.location&&(r.location=e.location),e.location&&!e.location.radius&&(r.location.radius="30mi"),e.sort?r.sort=e.sort:r.sort="eventDateAsc",e.dateFrom&&(r.dateFrom=e.dateFrom),e.dateTo&&(r.dateTo=e.dateTo),r}getCategory(e){let i;switch(e){case"eventDelivery":case"Event delivery":i="delivery";break;case"eventTopic":case"Event topic":i="topic";break;case"eventType":case"Event type":i="type";break;case"Audience type":case"audienceType":i="audience";break}return i}getGAtrackingContent(e,i,t,n,r,s){let o="",u="",v="",x="",P="",B,U;if(e==="content"&&(t.eventType?.forEach(g=>{o+=`${g.value},`}),t.topic?.forEach(g=>{u+=`${g.value},`}),t.delivery?.forEach(g=>{v+=`${g.value},`}),t.audienceType?.forEach(g=>{x+=`${g.value},`}),B=t.startDateTime?t.startDateTime.getHours().toString().length<2?`0${t.startDateTime.getHours()}`:`${t.startDateTime.getHours()}`:null,U=t.startDateTime?t.startDateTime?.getMinutes()===0?"00":`${t.startDateTime.getMinutes()}`:null),e==="params"){if(!r.length&&i!=="load_speed_request_complete"?P="no_results_event_search":P=i,t.type){let g=t.type.split(","),F=L.categories.findIndex(w=>w.accordionTitle==="Event type"),f=F>-1?L.categories[F].options:null;f&&f.length&&g.forEach(w=>{let D=f.findIndex(O=>O.id===w);D>-1&&(o+=`${f[D].label},`)})}if(t.topic){let g=t.topic.split(","),F=L.categories.findIndex(w=>w.accordionTitle==="Event topic"),f=F>-1?L.categories[F].options:null;f&&f.length&&g.forEach(w=>{let D=f.findIndex(O=>O.id===w);D>-1&&(u+=`${f[D].label},`)})}if(t.delivery){let g=t.delivery.split(","),F=L.categories.findIndex(w=>w.accordionTitle==="Event delivery"),f=F>-1?L.categories[F].options:null;f&&f.length&&g.forEach(w=>{let D=f.findIndex(O=>O.id===w);D>-1&&(v+=`${f[D].label},`)})}
1if(t.audience){let g=t.audience.split(","),F=L.categories.findIndex(w=>w.accordionTitle==="Audience type"),f=F>-1?L.categories[F].options:null;f&&f.length&&g.forEach(w=>{let D=f.findIndex(O=>O.id===w);D>-1&&(x+=`${f[D].label},`)})}}let $={event:e==="params"?P:i,url:`${this.config.environment.BASE_URL}${this.router.url}`,searchTerm:t.search??null,eventSearchMode:n==="list"?"list":"map",eventSearchLocation:t.location?.location??null,eventSearchRadiusMiles:t.location?.radius??null,eventSearchStartDate:t.dateFrom?`${new Date(t.dateFrom*1e3).getFullYear()}-${new Date(t.dateFrom*1e3).getMonth()+1}-${new Date(t.dateFrom*1e3).getDate()-1}`:null,eventSearchEndDate:t.dateTo?`${new Date(t.dateTo*1e3).getFullYear()}-${new Date(t.dateTo*1e3).getMonth()+1}-${new Date(t.dateTo*1e3).getDate()-1}`:null,eventSearchSortBy:t.sort??null,eventSearchTopic:u?.length?u:null,eventSearchType:o?.length?o:null,eventSearchDelivery:v?.length?v:null,eventSearchAudienceType:x?.length?x:null,eventSearchResultsReturned:r.length||null,tileFeatured:t.featured?"TRUE":"FALSE",tilePosition:s||null,tileEventDate:t.startDateTime?`${t.startDateTime.getFullYear()}-${t.startDateTime.getMonth()+1}-${t.startDateTime.getDate()}`:null,tileEventTime:e==="content"?`${B}.${U}`:null,tileEventDelivery:e==="content"&&v&&v.length?v:null,tileEventLocation:e==="content"?t.venue?.name:null,tileEventTopic:e==="content"&&u&&u.length?u:null,tileEventType:e==="content"&&o&&o.length?o:null,tileAudienceType:e==="content"&&x&&x.length?x:null,tileListSize:e==="content"?r.length:null,tileName:e==="content"?t.title:null,tileLink:e==="content"?t.eventURL:null,requestLoadTime:i==="load_speed_request_complete"?(s+1)*100:null,requestName:i==="load_speed_request_complete"?"event_search":null};return $=this._gaEventObjectFormatter($,P==="no_results_event_search"?P:i),$}_gaEventObjectFormatter(e,i){let t=["searchTerm","eventSearchMode","eventSearchLocation","eventSearchRadiusMiles","eventSearchStartDate","eventSearchEndDate","eventSearchSortBy","eventSearchTopic","eventSearchType","eventSearchDelivery","eventSearchAudienceType","eventSearchResultsReturned"],n=["tileName","tilePosition","tileListSize","tileEventTime","tileFeatured","tileEventDate","tileEventType","searchTerm","eventSearchMode","eventSearchLocation","eventSearchRadiusMiles","eventSearchStartDate","eventSearchEndDate","eventSearchSortBy","eventSearchTopic","eventSearchType","eventSearchDelivery","eventSearchAudienceType","tileLink"],r=["searchTerm","eventSearchMode","eventSearchLocation","eventSearchRadiusMiles","eventSearchStartDate","eventSearchEndDate","eventSearchSortBy","eventSearchTopic","eventSearchType","eventSearchDelivery","eventSearchAudienceType"],s=["searchTerm","eventSearchMode","eventSearchLocation","eventSearchRadiusMiles","eventSearchStartDate","eventSearchEndDate","eventSearchSortBy","eventSearchTopic","eventSearchType","eventSearchDelivery","eventSearchAudienceType","requestName","requestLoadTime"],o=(u,v)=>{for(let x in u)!["event","url"].includes(x)&&!v.includes(x)&&delete u[x];return u};switch(i){case"event_search":return o(e,t);case"impression_event_search_tile":case"click_event_search_tile":return o(e,n);case"no_results_event_search":return o(e,r);case"load_speed_request_complete":return o(e,s);default:return e}}};l.\u0275fac=function(i){return new(i||l)(N(M),N("fabricServicesConfig"),N(J))},l.\u0275prov=se({token:l,factory:l.\u0275fac});let a=l;return a})();var Ye=["eventSortDd"],Je=a=>({selected:a});function Qe(a,l){a&1&&(d(0,"span"),m(1,"\u2193"),h())}function We(a,l){a&1&&(d(0,"span"),m(1,"\u2191"),h())}function Ke(a,l){a&1&&(d(0,"span"),m(1,"\u2193"),h())}function Xe(a,l){a&1&&(d(0,"span"),m(1,"\u2191"),h())}function Ze(a,l){if(a&1){let c=A();d(0,"div",33),E("click",function(){let i=_(c).$implicit,t=b();return C(t.selectSortOption(i))}),m(1),T(2,Ke,2,0,"span"),T(3,Xe,2,0,"span"),h()}if(a&2){let c=l.$implicit,e=l.$index,i=b();k("ngClass",pe(4,Je,e===i.selectedSortOptionIndex)),p(),ee(" ",c.label,"\xA0\xA0 "),p(),S(c.link==="desc"?2:-1),p(),S(c.link==="asc"?3:-1)}}function et(a,l){if(a&1){let c=A();d(0,"span",34)(1,"span"),m(2),h(),d(3,"span")(4,"i",37),E("click",function(){let i=_(c).$implicit,t=b(2);return i.selected=!1,C(t.deSelectFilter(i))}),h()()()}if(a&2){let c=l.$implicit;p(2),Z(c.label)}}function tt(a,l){if(a&1){let c=A();d(0,"div",28)(1,"p")(2,"strong"),m(3,"Filtering by: "),h()(),H(4,et,5,1,"span",34,j
1),d(6,"span"),m(7,"|"),h(),d(8,"span",35),E("click",function(){_(c);let i=b();return C(i.clearFilterList())}),d(9,"span"),I(10,"i",36),h(),d(11,"span"),m(12,"Clear All"),h()()()}if(a&2){let c=b();p(4),z(c.filterTermList)}}function it(a,l){a&1&&I(0,"hr")}function nt(a,l){a&1&&(d(0,"section"),I(1,"fab-loader"),h())}function rt(a,l){if(a&1){let c=A();d(0,"a",38),E("click",function(){_(c);let i=b(2);return C(i.switchView("map"))}),m(1,"View on map"),h()}}function st(a,l){if(a&1){let c=A();d(0,"a",38),E("click",function(){_(c);let i=b(2);return C(i.switchView("list"))}),m(1,"List view"),h()}}function at(a,l){if(a&1&&(d(0,"section",29),T(1,rt,2,0,"a"),T(2,st,2,0,"a"),h()),a&2){let c=b();p(),S(c.view==="list"&&c.markerPositions.length?1:-1),p(),S(c.view!=="list"?2:-1)}}function ot(a,l){if(a&1){let c=A();d(0,"app-event-card",40),E("eventClick",function(i){_(c);let t=b(2);return C(t.trackEvtCardClick("content","click_event_search_tile",i))}),h()}if(a&2){let c=l.$implicit;k("eventItem",c)}}function lt(a,l){if(a&1&&(d(0,"div",30),H(1,ot,1,1,"app-event-card",39,j),h()),a&2){let c=b();p(),z(c.featuredList)}}function ct(a,l){if(a&1){let c=A();d(0,"app-event-card",40),E("eventClick",function(i){_(c);let t=b(2);return C(t.trackEvtCardClick("content","click_event_search_tile",i))}),h()}if(a&2){let c=l.$implicit;k("eventItem",c)}}function dt(a,l){if(a&1&&(d(0,"div",41),I(1,"fab-button",15),h()),a&2){let c=b(2);p(),k("button",c.loadMoreButton)}}function ht(a,l){if(a&1&&(d(0,"div",30),H(1,ct,1,1,"app-event-card",39,j),T(3,dt,2,1,"div",41),h()),a&2){let c=b();p(),z(c.eventList),p(2),S((c.featuredList?c.featuredList.length:0)+(c.eventList?c.eventList.length:0)<c.totalHits&&c.view==="list"?3:-1)}}function pt(a,l){if(a&1){let c=A();d(0,"div",31)(1,"app-evt-map",42),E("eventMapClick",function(i){_(c);let t=b();return C(t.mapEventClick(i))}),h()()}if(a&2){let c=b();p(),k("mapOptions",c.mapOptions)("markerPositions",c.markerPositions)}}function ut(a,l){a&1&&(d(0,"div",32)(1,"p"),m(2,"Sorry, your search didn't return any results."),h(),d(3,"ul")(4,"strong"),m(5,"You could try:"),h(),d(6,"li"),m(7,"clearing and/or amending your filters"),h(),d(8,"li"),m(9,"a different search term"),h(),d(10,"li"),m(11,"using more general or fewer search terms"),h(),d(12,"li"),m(13,"checking your spelling"),h(),d(14,"li"),m(15,"removing any symbols."),h()()())}var Be=(()=>{let l=class l{constructor(e,i,t,n,r,s,o,u,v,x,P,B,U,$,g){this.searchSuggestionService=e,this.route=i,this.router=t,this.location=n,this.meta=r,this.metaDataService=s,this.resultHelper=o,this._headerTagService=u,this._titleService=v,this._datePipe=x,this.orderPipe=P,this.config=B,this.document=U,this.platform=$,this.eventConfig=g,this.eventFilterContent=JSON.parse(JSON.stringify(L)),this.view="list",this.searchTerm=null,this.locationSearchTerm=null,this.searchFrom=0,this.searchSize=27,this.isLoading=!0,this.placeholder="Search by keyword, topic",this.urlParams={},this.gaTileObserver=new V(null),this.gaTileObserver$=this.gaTileObserver.asObservable(),this.subscriptions=[],this.todayDate=new Date(new Date().setUTCHours(0,0,0,0)),this.mapOptions={mapId:"EVENT_MAP",center:{lat:52.478617682535884,lng:-.31154276641437484},zoom:6,zoomControl:!0,mapTypeControl:!1,fullscreenControl:!0,scaleControl:!1,rotateControl:!1,streetViewControl:!1},this.markerPositions=[],this.filterTermList=[],this.eventList=[],this.featuredList=[],this.sortOptionList=[{link:"asc",label:"Event date"},{link:"desc",label:"Event date"},{link:"relevance",label:"Relevance"}],this.selectedSortOptionIndex=0,this.selectedSortOption=this.sortOptionList[this.selectedSortOptionIndex],this.mobileFilterButton={text:"Additional filters",type:"primary",glyph:{icon:xe.FILTERS},action:{type:"callback",callback:()=>this.displayFilterOverlay(!0)},aria:"Additional filters"},this.loadMoreButton={text:"Load more",type:"primary",action:{type:"callback",callback:()=>this.loadMoreEvents()},aria:"Load more"},this.generalInfo={type:"error-warning",message:"There is currently a technical issue with the AAT events search. We apologise for any inconvenience this causes and we are working to get this resolved as quickly as possible.",fullWidth:!0}}ngOnInit(){this._updateCanonicalLink(),te(this.platform)&&(this.mainContent=this.document.querySelector(".main-content"),this.getEventData(),this.urlParam
1s$=new V({}),this.subscriptions.push(this.urlParams$.pipe(K(1200)).subscribe(e=>{if(e&&Object.keys(e).length){let i=this.resultHelper.getGAtrackingContent("params","event_search",e,this.view,[...this.featuredList,...this.eventList]);this.searchSuggestionService.eventGAtracking(i)}})),this.subscriptions.push(this.gaTileObserver$.pipe(K(1e3)).subscribe(e=>{this.searchSuggestionService.eventGAtracking(e)})),this.searchApiResponse$=new V(null),this.subscriptions.push(this.searchApiResponse$.subscribe(e=>{e&&this.updateSideFilterContent(e.attributes)})),this.observerEventCard$=new V(this.view==="list"),this.subscriptions.push(this.observerEventCard$.pipe(X(100)).subscribe(e=>{this.eventList&&this.eventList.length&&e&&this.observeEventCardSection()})),this.subscriptions.push(this.route.queryParamMap.subscribe(e=>{if(e.keys.length){let i=e.params;Object.keys(i).forEach(t=>{switch(t){case"type":this.urlParams.type=i.type;break;case"topic":this.urlParams.topic=i.topic;break;case"audience":this.urlParams.audience=i.audience;break;case"delivery":this.urlParams.delivery=i.delivery;break;case"search":this.urlParams.search=i.search;break;case"location":this.urlParams.location={location:i.location,radius:null};break}})}this.urlParams.size=27,this.urlParams.from=0,this.urlParams.suggest=!1})),this.mainContent&&this.mainContent.setAttribute("overflow","inherit"),this.setMetaData())}ngOnDestroy(){te(this.platform)&&(this.mainContent.setAttribute("overflow-x","hidden"),this.eventCardObserver&&this.eventCardObserver.disconnect()),this.subscriptions.forEach(e=>e.unsubscribe())}switchView(e){this.view=e,e==="list"&&this.eventList&&this.eventList.length&&this.observerEventCard$.next(this.view==="list")}getAATEvents(e){this.isLoading=!0,this.searchFrom=e&&e.from?e.from:0;let i=this.resultHelper.getPayload(e,this.searchFrom,this.searchSize,!1);this.searchFrom=i.from;let t=this.resultHelper.getGAtrackingContent("params","load_speed_request_complete",this.urlParams,this.view,[...this.featuredList,...this.eventList]);this.subscriptions.push(this.searchSuggestionService.search(i,t).subscribe({next:n=>{if(this.featuredList=[],this.searchFrom===0)this.markerPositions=[],this.eventList=[],this.eventList=n.events.map(r=>{let s=new Q(r);return typeof s.location=="object"&&Object.keys(s.location).length&&(this.markerPositions=[...this.markerPositions,[s.location,`${s.title}*${s.eventURL}*${s.eventId}`]]),s});else{let r=n.events.map(s=>{let o=new Q(s);return typeof o.location=="object"&&Object.keys(o.location).length&&(this.markerPositions=[...this.markerPositions,[o.location,`${o.title}*${o.eventURL}*${o.eventId}`]]),o});this.eventList=[...this.eventList,...r]}this.featuredList=n.featuredEvents.map(r=>{let s=new Q(r);return typeof s.location=="object"&&Object.keys(s.location).length&&(this.markerPositions=[...this.markerPositions,[s.location,`${s.title}*${s.eventURL}*${s.eventId}`]]),s}),this.totalHits=n.totalHits,this.mapOptions.center=this.markerPositions.length?this.markerPositions[0][0]:null,this.mapOptions=this.mapOptions,this.urlParams$.next(this.urlParams),this.searchApiResponse$.next(n),this.observerEventCard$.next(this.view==="list"),this.isLoading=!1},error:n=>{console.log(n),this.isLoading=!1}}))}getEventData(){this.searchSuggestionService.getEventData("").pipe(re(e=>{this.resultHelper.updateEventFilterContent(e)}),X(100)).subscribe(e=>{this.eventFilterContent=JSON.parse(JSON.stringify(L)),this.applyURLparamValues(this.urlParams)})}setMetaData(){let e="AAT events search: accounting and finance CPD events",i=this.eventConfig.eventMetaData,t={uri:this.eventConfig.eventImageBaseURL,alt:this.eventConfig.imageAltText,type:"image"},n=this.metaDataService.generateMetaData({seoTitle:e,summary:i,imageData:t});this.metaDataService.addMetaTags(n),this.metaDataService.setPageTitle(e)}searchTermChange(e){e&&e.length?(this.urlParams.search=e,this.urlParams.size=this.searchSize,this.searchFrom=0,this.urlParams.from=this.searchFrom,this.urlParams.suggest=!1,this.filterTermList=this.filterTermList.filter(i=>i.filter!=="search"),this.filterTermList.push({filter:"search",label:e}
1),this.getAATEvents(this.urlParams)):(delete this.urlParams.search,this.filterTermList=this.filterTermList.filter(i=>i.filter!=="search"),this.getAATEvents(this.urlParams),this.navigateTo("search",e))}locationChange(e){e.location&&e.location.length?(this.urlParams.location=e,this.urlParams.size=this.searchSize,this.searchFrom=0,this.urlParams.from=this.searchFrom,this.urlParams.suggest=!1,this.filterTermList=this.filterTermList.filter(i=>i.filter!=="location"),this.filterTermList.push({filter:"location",label:e.location}),this.getAATEvents(this.urlParams)):(this.filterTermList=this.filterTermList.filter(i=>i.filter!=="location"),delete this.urlParams.location,this.getAATEvents(this.urlParams),this.navigateTo("location",e.location))}locChange(e){this.urlParams.location={location:e,radius:this.urlParams.location&&this.urlParams.location.radius?this.urlParams.location.radius:"30mi"},this.locationChange(this.urlParams.location)}radiusChange(e){this.urlParams.location.radius=e?`${e}mi`:"30mi",this.locationChange(this.urlParams.location)}onCheckboxChange(e,i){let t=this.resultHelper.getCategory(i.category);if(e)t&&(i.filter=t,this.urlParams[t]?this.urlParams[t].includes(i.id)||(this.urlParams[t]=`${this.urlParams[t]},${i.id}`):this.urlParams[t]=i.id,this.urlParams.size=this.searchSize,this.searchFrom=0,this.urlParams.from=this.searchFrom,this.urlParams.suggest=!1,this.filterTermList.push(i));else{this.filterTermList.findIndex(o=>i.id===o.id)>-1&&(this.filterTermList=this.filterTermList.filter(o=>o.id!==i.id));let s=this.urlParams[t].split(",").filter(o=>o!==i.id);s.length?this.urlParams[t]=s.join(","):delete this.urlParams[t],this.navigateTo(t,i.id)}this.getAATEvents(this.urlParams)}onDateChange(e){if(!e?.[0]){delete this.urlParams.dateFrom,delete this.urlParams.dateTo,this.filterTermList=this.filterTermList.filter(o=>o.filter!=="date"),this.getAATEvents(this.urlParams);return}this.dateSelection=e;let i=new Date(this.dateSelection[0]);i.setUTCHours(0,0,0,0);let t=this.dateSelection[1]?new Date(this.dateSelection[1]):new Date(this.dateSelection[0]);t.setUTCHours(23,59,59,999),this.urlParams.dateFrom=Math.floor(i.getTime()/1e3),this.urlParams.dateTo=Math.floor(t.getTime()/1e3);let n=this._datePipe.transform(i,"dd MMM yyyy"),r=this._datePipe.transform(t,"dd MMM yyyy"),s=`${n} - ${r}`;this.filterTermList=this.filterTermList.filter(o=>o.filter!=="date"),this.filterTermList.push({filter:"date",label:s}),this.searchFrom=0,this.urlParams.from=this.searchFrom,this.getAATEvents(this.urlParams)}deSelectFilter(e){switch(e.filter){case"search":this.searchTerm=e.selected?e.label:null,this.searchTerm=Object.assign({},this.searchTerm),this.filterTermList=this.filterTermList.filter(i=>i.filter!=="search"),Object.keys(this.urlParams).length>3&&(delete this.urlParams.search,this.navigateTo("search",this.searchTerm)),this.getAATEvents(this.urlParams);break;case"location":this.locationSearchTerm=null,this.locationSearchTerm=Object.assign({},this.locationSearchTerm),this.filterTermList=this.filterTermList.filter(i=>i.filter!=="location"),Object.keys(this.urlParams).length>3&&(delete this.urlParams.location,this.navigateTo("location",this.locationSearchTerm)),this.getAATEvents(this.urlParams);break;case"date":this.dateSelection=null,this.filterTermList=this.filterTermList.filter(i=>i.filter!=="date"),delete this.urlParams.dateFrom,delete this.urlParams.dateTo,this.getAATEvents(this.urlParams);break;default:{this.filterTermList=this.filterTermList.filter(n=>n.id!==e.id);let i=e.filter||this.resultHelper.getCategory(e.category),t=this.urlParams[i].split(",");if(t&&t.length){t=t.filter(r=>r!==e.id);let n=t&&t.length?t.join(","):null;n&&n.length?this.urlParams[i]=n:delete this.urlParams[i],this.navigateTo(i,e.id),this.getAATEvents(this.urlParams)}}break}}clearFilterList(){this.filterTermList=[],this.searchTerm=null,this.searchTerm=Object.assign({},this.searchTerm),this.locationSearchTerm=Object.assign({},this.locationSearchTerm),this.dateSelection=null,this.urlParams={},this.searchFrom=0,this.selectedSortOptionIndex=0,this.selectedSortOption=this.sortOptionList[this.selectedSortOptionIndex];let e=this.router.createUrlTree([this.eventConfig.resultPageURL],{queryParams:null,relativeTo:this.route});this.location.replaceState(this.router.serializeUrl(e)),this.getAATEvents({size:this.searchSize,from:this.searchFrom,suggest:!1})}toggleSortDropdown(e){switch(e.key){case"Enter":this.selectSortOption(this.sortOptionList[this.selectedSortOptionIndex]),this.eventSortDd.nativeElement.classList.remove("show"),this.selectedSortOptionIndex=0,this.selectedSortOption=this.sortOptionList[this.selectedSortOptionIndex];break;case"ArrowDown":this.selectedSortOptionIndex<0&&this.eventSortDd.nativeElement.classList.add("show"),this.selectedSortOptionIndex++;break;case"ArrowUp":this.selectedSortOptionIndex--,this.selectedSortOptionIndex<0&&this.eventSortDd.nativeElement.classList.remove("show"),this.selectedSortOptionIndex=0,this.selectedSortOption=this.sortOptionList[this.selectedSortOptionIndex];break;case"Tab":break;default:break}}
1selectSortOption(e){this.selectedSortOption=e,this.urlParams.sort=He[e.link],this.urlParams.size=this.searchSize,this.searchFrom=0,this.urlParams.from=this.searchFrom,this.getAATEvents(this.urlParams)}displayFilterOverlay(e){e?this.mobileView=!0:this.mobileView=!1,e===!1?this.overlayOpen=e:this.overlayOpen=!0}applyURLparamValues(e,i=!1){i||(this.filterTermList=[],Object.keys(e).forEach(t=>{switch(t){case"search":{this.searchTerm=e[t];let n={filter:"search",label:this.searchTerm};this.filterTermList.push(n)}break;case"location":{this.locationSearchTerm=e[t];let n={filter:"location",label:this.locationSearchTerm.label?this.locationSearchTerm.label:this.locationSearchTerm.location};this.filterTermList.push(n)}break;case"size":case"from":case"suggest":break;case"type":case"delivery":case"audience":case"topic":this.addFilterTag(e,t);break;default:break}})),this.getAATEvents(e)}addFilterTag(e,i){let t=this.eventFilterContent.categories.findIndex(s=>s.accordionTitle===`Event ${i}`);t=t>-1?t:this.eventFilterContent.categories.findIndex(s=>s.accordionTitle==="Audience type");let r=e[i].split(",");for(let s=0;s<r.length;s++){let o=this.eventFilterContent.categories[t].options,u=o.findIndex(P=>P.id===r[s]),v;u>-1&&(v=o[u],this.eventFilterContent.categories[t].options[u].prechecked=!0);let x={id:r[s],filter:i,label:v?v.total>0?`${v.label} (${v.total})`:`${v.label}`:"invalid event",selected:!!v};this.filterTermList.push(x)}}updateSideFilterContent(e){if(this.eventFilterContent&&this.eventFilterContent.categories&&this.eventFilterContent.categories.length)for(let i=0;i<this.eventFilterContent.categories.length;i++){let t,n;switch(this.eventFilterContent.categories[i].accordionTitle){case"Event type":t=e.eventType||e.attribute.eventType,n="eventType";break;case"Event delivery":t=e.eventDelivery||e.attribute.eventDelivery,n="eventDelivery";break;case"Event topic":t=e.eventTopic||e.attributes.eventTopic,n="eventTopic";break;case"Audience type":t=e.audienceType||e.attribute.audienceType,n="audienceType";break;default:break}let r=[];if(n!=="eventTopic"&&n!=="audienceType"){let s=this.resultHelper.getFilterOptions(e,n,!0,this.filterTermList);for(let o=0;o<s.length;o++)if(s[o].total>0){r=[...r,s[o]];let u=this.filterTermList.findIndex(v=>v.id===s[o].id);u>-1&&(this.filterTermList[u].label=`${s[o].label} (${s[o].total})`)}}else r=this.resultHelper.getFilterOptions(e,n,!1,this.filterTermList);r=r.filter(s=>s.id!=="ae52eb9e-9dbe-ed11-80df-00155dfba849"),this.eventFilterContent.categories[i].options=this.orderPipe.transform(r,"label",!0)}}navigateTo(e,i){let t={};Object.keys(this.route.queryParams).length>0&&this.subscriptions.push(this.route.queryParams.subscribe(n=>{Object.keys(n).forEach(r=>{if(r===e&&i&&i.length){let s=n[r].split(",");s=s.filter(u=>u!==i);let o=s&&s.length?s.join():null;o&&(t[r]=o)}else r===e&&!(i&&i.length)||(t[r]=n[r])})})),this.router.navigate([this.eventConfig.resultPageURL],{queryParams:t,relativeTo:this.route})}loadMoreEvents(){this.searchFrom+=27,this.urlParams.from=this.searchFrom,this.getAATEvents(this.urlParams)}mapEventClick(e){let i=e&&e.type==="click"?"click_event_search_tile":"impression_event_search_tile",t=this.eventList.findIndex(n=>n.eventId===e.id);t>-1?this.resultHelper.getGAtrackingContent("content",i,this.eventList[t],this.view,[...this.featuredList,...this.eventList]):(t=this.featuredList.findIndex(n=>n.eventId===e.id),t>-1&&this.resultHelper.getGAtrackingContent("content",i,this.featuredList[t],this.view,[...this.featuredList,...this.eventList]))}trackEvtCardClick(e,i,t,n){let r=R(R({},this.urlParams),t),s=[...this.eventList,...this.featuredList],o=this.view,u=this.resultHelper.getGAtrackingContent(e,i,r,o,s,n);this.updateGAtracking(u)}observeEventCardSection(){this.eventCardObserver=new IntersectionObserver(i=>{i.forEach(t=>{if(t.isIntersecting&&t.boundingClientRect.y>0){let n=this.eventList.findIndex(r=>r.eventId===t.target.id);if(n>-1){let r=this.featuredList&&this.featuredList.length?this.featuredList.length:0,s=R(R({},this.urlParams),this.eventList[n]),o=this.resultHelper.getGAtrackingContent("content","impression_event_search_tile",s,this.view,[...this.featuredList,...this.eventList],n+1+r);this.gaTileObserver.next(o)}else if(n=this.featuredList.findIndex(r=>r.eventId===t.target.id),n>-1){let r=R(R({}
1,this.urlParams),this.featuredList[n]),s=this.resultHelper.getGAtrackingContent("content","impression_event_search_tile",r,this.view,[...this.featuredList,...this.eventList],n+1);this.gaTileObserver.next(s)}}})},{rootMargin:"0px",threshold:.5});let e=this.document.getElementsByClassName("event-card");for(let i=0;i<e.length;i++)e[i]&&this.eventCardObserver.observe(e[i])}updateGAtracking(e){this.searchSuggestionService.eventGAtracking(e)}_updateCanonicalLink(){this._headerTagService.updateHeaderTagLinks(this.config.environment.BASE_URL+this.location.path().split("/results")[0])}};l.\u0275fac=function(i){return new(i||l)(y(Me),y(_e),y(J),y(ue),y(fe),y(Ee),y(W),y(we),y(ge),y(Y),y(M),y("fabricServicesConfig"),y(ae),y(oe),y("EVENT_SEARCH_CONFIG"))},l.\u0275cmp=le({type:l,selectors:[["app-event-result"]],viewQuery:function(i,t){if(i&1&&ce(Ye,5),i&2){let n;de(n=he())&&(t.eventSortDd=n.first)}},standalone:!1,decls:55,vars:24,consts:[["searchBoxContainer",""],["leftPanel",""],["eventResultFilterPanel",""],["eventSortDd",""],[1,"hidden"],[3,"notification"],[1,"event-results"],[1,"component-wrapper","event-results-container"],[1,"search-box-container"],[3,"searchTermChange","reloadonclear","searchTerm","placeholder"],[3,"locationChange","maxDistanceChange","location"],[1,"w-full"],["ateFormat","dd/mm/yyyy","inputId","date_range_picker","data-auto","dateRangePicker","selectionMode","range","fluid","",3,"ngModelChange","showIcon","minDate","ngModel"],[1,"event-results-left-panel"],[1,"event-result-filter-toggle-btn"],[3,"button"],[1,"event-results-filter-panel"],[3,"selection","overlayClosed","content","isMobile","openOverlay"],[1,"event-results-grid-gap"],[1,"event-results-right-panel"],[1,"event-results-sort"],[1,"event-results-sort-count"],[1,"event-results-sort-panel"],[1,"event-results-sort-panel-dropdown"],[1,"event-results-sort-panel-dropdown-btn",3,"keyup"],[1,"icon","icon-arrow-down"],[1,"event-results-sort-panel-dropdown-content"],[1,"event-results-sort-panel-dropdown-options",3,"ngClass"],[1,"event-results-filter-term"],[1,"event-results-toggle-view"],[1,"event-results-list"],[1,"event-results-map-view"],[1,"event-results-nolist"],[1,"event-results-sort-panel-dropdown-options",3,"click","ngClass"],[1,"event-results-filter-term-tag"],[1,"event-results-filter-term-tag","transparent",3,"click"],[1,"icon","icon-cross"],[1,"icon","icon-cross",3,"click"],[3,"click"],[3,"eventItem"],[3,"eventClick","eventItem"],["event-results-list-load-more-btn","",1,"event-results-list-load-more"],[3,"eventMapClick","mapOptions","markerPositions"]],template:function(i,t){if(i&1){let n=A();d(0,"div",4),I(1,"fab-notification",5),h(),d(2,"div",6)(3,"div",7)(4,"div",8,0)(6,"h3")(7,"strong"),m(8,"Find an event"),h()(),d(9,"h4"),m(10,"Your search filters"),h(),d(11,"app-search-input",9),E("searchTermChange",function(s){return _(n),C(t.searchTermChange(s))}),h(),d(12,"fab-location-search",10),E("locationChange",function(s){return _(n),C(t.locChange(s))})("maxDistanceChange",function(s){return _(n),C(t.radiusChange(s))}),h(),d(13,"div",11)(14,"p-datepicker",12),E("ngModelChange",function(s){return _(n),C(t.onDateChange(s))}),h()()(),d(15,"div",13,1)(17,"div",14),I(18,"fab-button",15),h(),d(19,"div",16,2)(21,"fab-side-filter",17),E("selection",function(s){return _(n),C(t.onCheckboxChange(s.selected,s))})("overlayClosed",function(s){return _(n),C(t.displayFilterOverlay(s))}),h()()(),I(22,"div",18),d(23,"div",19)(24,"div",20)(25,"span",21)(26,"h3"),m(27," Showing "),d(28,"strong"),m(29),h(),m(30," results "),h()(),d(31,"span",22)(32,"span"),m(33,"Sort by:"),h(),d(34,"div",23)(35,"button",24),E("keyup",function(s){return _(n),C(t.toggleSortDropdown(s))}),d(36,"span")(37,"strong"),m(38),T(39,Qe,2,0,"span"),T(40,We,2,0,"span"),h()(),I(41,"i",25),h(),d(42,"div",26,3),H(44,Ze,4,6,"div",27,j),h()()()(),I(46,"hr"),T(47,tt,13,0,"div",28),T(48,it,1,0,"hr"),T(49,nt,2,0,"section"),T(50,at,3,2,"section",29),T(51,lt,3,0,"div",30),T(52,ht,4,1,"div",30),T(53,pt,2,2,"div",31),T(54,ut,16,0,"div",32),h()()()}i&2&&(p(),k("notification",t.generalInfo),p(10),k("reloadonclear",!0)("searchTerm",t.searchTerm)("placeholder",t.placeholder),p(),k("location",t.locationSearchTerm),p(2),k("showIcon",!0)("minDate",t.todayDate)("ngModel",t.dateSelection),p(4),k("button",t.mobileFilterButton),p(3),k("content",t.eventFilterContent)("isMobile",t.mobileView)("openOverlay",t.overlayOpen),p(8),Z(t.eventList.length+t.featuredList.length),p(9),ee("",t.selectedSortOption.label," "),p(),S(t.selectedSortOption.link==="desc"?39:-1),p(),S(t.selectedSortOption.link==="asc"?40:-1),p(4),z(t.sortOptionList),p(3),S(t.filterTermList.length?47:-1),p(),S(t.filterTermList.length?48:-1),p(),S(t.isLoading?49:-1),p(),S(t.isLoading?-1:50),p(),S(t.featuredList&&t.featuredList.length&&!t.isLoading&&t.view==="list"?51:-1),p(),S(t.eventList&&t.eventList.length&&t.view==="list"&&!t.isLoading?52:-1),p(),S((t.eventList&&t.eventList.length||t.featuredList&&t.featuredList.length)&&t.view!=="list"&&!t.isLoading?53:-1),p(),S(!t.isLoading&&!t.featuredList.length&&!t.eventList.length?54:-1))},dependencies:[me,Ce,ye,Ie,Fe,$e,je,Ve,Le,Ae,Oe,Se],styles:[`:root{--aat-ui-grey-25: #bfbfbf;--aat-ui-grey-55: #737373;--aat-slate: #3a5066;--aat-ui-grey-05: #f2f2f2}.event-results{width:100%}@media (min-width: 992px){.event-results{background-image:linear-gradient(90deg,#fff,#fff 60%,#f8f8f8 40%)}}@media (min-width: 1300px){.event-results{background-image:linear-gradient(90deg,#fff,#fff 50%,#f8f8f8 40%)}}.event-results .checkbox__input+label{font-weight:300}.event-results .component-wrapper{width:100%;max-width:1500px;margin:0 auto}@media (min-width: 992px){.event-results .component-wrapper{width:90%}}.event-results-container{margin:0 auto;position:relative;display:grid;grid-template-columns:1fr;grid-template-rows:300px auto auto auto}@media (min-width: 992px){.event-results-container{grid-template-columns:300px 5% auto;grid-template-rows:300px auto;background-image:linear-gradient(90deg,#fff,#fff 330px 15%,#f8f8f8 85%)}}.event-results .search-box-container{margin-top:50px;margin-bottom:20px;padding:20px 15px;height:300px;grid-row:1/2;grid-column:1/2}@media (min-width: 992px){.event-results .search-box-container{width:300px}}.event-results .search-box-container h3,.event-results .search-box-container h4{margin-bottom:20px}.event-results-left-panel{padding:20px;margin-top:50px;grid-row:2/3;grid-column:1/2}@media (min-width: 992px){.event-results-left-panel{padding:50px 15px;width:300px}}.event-results-left-panel hr{border:1px solid #e6e6e6}.event-results-left-panel .accordion{border:none!important}.event-results-left-panel .event-result-filter-toggle-btn{display:block;margin-left:auto;margin-right:auto}@media (min-width: 992px){.event-results-left-panel .event-result-filter-toggle-btn{display:none}}.event-results-filter-panel{position:absolute;
1left:-100%;transition:all 1s linear;background:#fff;min-height:500px}@media (min-width: 992px){.event-results-filter-panel{display:block;position:sticky;top:70px}}.event-results-grid-gap{display:none}@media (min-width: 992px){.event-results-grid-gap{display:block;grid-column:2/3;grid-row:1/3}}.event-results-filter{height:60px;width:inherit;position:relative}.event-results-right-panel{min-height:600px;padding:10px;grid-column:1/2;grid-row:4/5}.event-results-right-panel hr{border:1px solid rgb(230,230,230)}@media (min-width: 992px){.event-results-right-panel{padding:50px 40px;grid-row:1/3;grid-column:3/4;background:#f8f8f8}}.event-results-filter-term{display:flex;flex-wrap:wrap}.event-results-filter-term p{margin:2px 5px;display:inline-block}@media (min-width: 992px){.event-results-filter-term p{margin:0 10px 0 0}}.event-results-filter-term>span:nth-last-child(2){margin-left:5px}.event-results-filter-term-tag{background-color:#00ab4e;color:#fff;font-size:12px;padding:2px 5px;margin:2px 5px;border-radius:2px;white-space:nowrap}.event-results-filter-term-tag span:first-child{margin-right:10px}.event-results-filter-term-tag span:last-child:hover{cursor:pointer}.event-results-filter-term-tag.transparent{color:#000;font-weight:700;background-color:transparent}.event-results-sort{display:flex;flex-direction:row;justify-content:space-between;align-items:center;flex-wrap:wrap;padding:10px}.event-results-sort-count{margin-right:15px}.event-results-sort-panel{display:flex;align-items:center;margin-top:10px}.event-results-sort-panel span:last-child{font-size:1.5em}.event-results-sort-panel span:last-child i{padding:2px;margin-right:2px;box-shadow:0 1px 1px #0000004d}.event-results-sort-panel span:last-child i:hover{cursor:pointer;box-shadow:0 2px 2px #0000004d;transition:all .1s}.event-results-sort-panel span:last-child i:first-child{margin-right:10px}.event-results-sort-panel span:last-child i.disabled{color:#e6e6e6;cursor:not-allowed}.event-results-sort-panel span:first-child{display:inline-block;margin-top:-6px;margin-right:10px;white-space:nowrap}.event-results-sort-panel-dropdown{position:relative;background:transparent;border:none;width:160px}.event-results-sort-panel-dropdown-btn{border:none;background:transparent;padding:0;width:100%;height:100%;display:flex;justify-content:space-between;align-items:center}.event-results-sort-panel-dropdown-btn span{text-align:left}.event-results-sort-panel-dropdown-btn span strong{width:inherit}.event-results-sort-panel-dropdown-btn:hover{cursor:pointer}.event-results-sort-panel-dropdown-content{width:100%;background:#fff;border:1px solid #e6e6e6;border-radius:3px;height:0;z-index:1;position:absolute;top:23px;display:none}.event-results-sort-panel-dropdown-content>*{display:none}.event-results-sort-panel-dropdown-options{font-size:14px;padding:5px}.event-results-sort-panel-dropdown-options:hover,.event-results-sort-panel-dropdown-options.selected{cursor:pointer;background:#e6e6e6}.event-results-sort-panel-dropdown:hover .event-results-sort-panel-dropdown-content,.event-results-sort-panel-dropdown-content.show{display:block;height:120px;transition:all .5s}.event-results-sort-panel-dropdown:hover .event-results-sort-panel-dropdown-content>*,.event-results-sort-panel-dropdown-content.show>*{display:flex;height:30px;align-items:center}.event-results-sort-panel-dropdown:hover .event-results-sort-panel-dropdown-content>* span,.event-results-sort-panel-dropdown-content.show>* span{padding:0}.event-results-sort-panel-pipe{margin-right:5px;height:100%}.event-results-toggle-view{padding:10px 10px 0}.event-results-map-view{width:96%;height:100%;max-height:70vh;padding:10px;margin:auto}@media (min-width: 992px){.event-results-map-view{max-height:50vh;width:100%}}.event-results-list{padding:30px 10px}.event-results-list-load-more{display:flex;justify-content:center;align-items:center}.event-results-nolist{padding:10px}.event-results-nolist p{text-align:center}.event-results-nolist ul li:first-child{list-style-type:none}.event-results-nolist ul li{list-style-type:disc;margin-left:25px}.hidden{display:none}@keyframes fadeIn{0%{opacity:0}
125%{opacity:.25}50%{opacity:.5}75%{opacity:.75}to{opacity:1;display:block}}@keyframes fadeOut{0%{opacity:1}25%{opacity:.75}50%{opacity:.5}75%{opacity:.25}to{opacity:0;display:none}}.event-results-filter-item:nth-child(1){animation-delay:.25s}.event-results-filter-item:nth-child(2){animation-delay:.5s}.event-results-filter-item:nth-child(3){animation-delay:.75s}.event-results-filter-item:nth-child(4){animation-delay:1s}.event-results-filter-item:nth-child(5){animation-delay:1.25s}.event-results-filter-item:nth-child(6){animation-delay:1.5s}.event-results-filter-item:nth-child(7){animation-delay:1.75s} 2`],encapsulation:2});let a=l;return a})();var mt=[{path:"",component:Be}],Ue=(()=>{let l=class l{};l.\u0275fac=function(i){return new(i||l)},l.\u0275mod=G({type:l}),l.\u0275inj=q({imports:[ie.forChild(mt),ie]});let a=l;return a})();var Qt=(()=>{let l=class l{};l.\u0275fac=function(i){return new(i||l)},l.\u0275mod=G({type:l}),l.\u0275inj=q({providers:[M,W,Y],imports:[ve,Ue,ze,Pe,ke,De,Re,be,Te]});let a=l;return a})();export{Qt as EventResultModule};
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.