@visitscotland/component-library 5.73.0 → 5.75.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -505,4 +505,4 @@ uniform `+R+" "+F+" u_"+O+`;
505
505
  </div>
506
506
  `:`
507
507
  <p class="vs-map__popup-title">${y.properties.title}</p>
508
- `},setupMarkerListeners(y){document.body.addEventListener("keyup",x=>{(x.key==="Escape"||x.key==="Tab")&&(this.removeMapPopup(y),this.showMarkerPopups&&Hs.setActivePlace({mapId:this.mapId,activeFeature:null}))}),y.getElement().addEventListener("keyup",x=>{x.key==="Enter"&&(y._popup.isOpen()||y._popup.addTo(this.mapbox.map))})},fitToBounds(){this.mapbox.map.fitBounds(qw(this.geojsonData),{padding:{top:100,bottom:100,left:100,right:100}})},initialiseMapComponent(){this.addMap(),this.addMapControls(),this.places.length&&this.initialiseMapFeatures(),this.geojsonData.features.length&&(this.initialiseMapMarkers(),this.fitToMarkers&&this.fitToBounds())},lazyloadMapComponent(){if(fo.supported({failIfMajorPerformanceCaveat:!0}),!("IntersectionObserver"in window)){this.initialiseMapComponent();return}this.observer=new IntersectionObserver(y=>{y[0].intersectionRatio>0&&(this.observer.unobserve(this.$el),this.initialiseMapComponent())}),this.observer.observe(this.$el)},onResize(){this.isTablet=window.innerWidth>=768},getBoundsFromPolygon(){const y=this.boundsData.coordinates[0];return y.reduce((_,x)=>_.extend(x),new fo.LngLatBounds(y[0],y[0]))},checkPointIsVisible(){return this.mapbox.map.getBounds().contains(this.activeMarkerPostion)},centreMapOnPoint(y){this.mapbox.map.flyTo({center:y})},calculateBoundingBox(){let y;if(typeof this.boundsData>"u"||this.boundsData.type==="undefined")y=[[-7.555827,54.608836],[-.778285,60.880894]];else if(this.boundsData.type==="bounds"){const _=new fo.LngLat(this.boundsData.coordinates[1][0],this.boundsData.coordinates[1][1]),x=new fo.LngLat(this.boundsData.coordinates[0][0],this.boundsData.coordinates[0][1]);y=new fo.LngLatBounds(_,x)}else this.boundsData.type==="Polygon"?y=this.getBoundsFromPolygon():y=[[-7.555827,54.608836],[-.778285,60.880894]];return y}}},Xw={class:"vs-map","data-test":"vs-map"},Kw={class:"vs-map__message-box"},Jw={class:"vs-map__message-text"},Yw={ref:"mapboxOuter",class:"vs-map__map-outer"},Qw=["id"];function e2(y,_,x,k,E,D){const u=q.resolveComponent("VsLoading"),U=q.resolveComponent("VsWarning");return q.openBlock(),q.createElementBlock("div",Xw,[E.showMapMessage?(q.openBlock(),q.createElementBlock("div",{key:0,class:q.normalizeClass(["vs-map__message",E.showZoomMessage?"":"vs-map__message--with-overlay"]),"data-test":"vs-map__message"},[q.createElementVNode("div",Kw,[E.isLoading?(q.openBlock(),q.createBlock(u,{key:0,class:"vs-map__loading"})):q.createCommentVNode("",!0),q.createElementVNode("p",Jw,[E.isLoading?q.renderSlot(y.$slots,"map-loading-text",{key:0}):x.showInfoMessage?q.renderSlot(y.$slots,"info-message",{key:1}):E.showZoomMessage==="too-close"?q.renderSlot(y.$slots,"zoom-too-close",{key:2}):E.showZoomMessage==="too-far"?q.renderSlot(y.$slots,"zoom-too-far",{key:3}):q.createCommentVNode("",!0)])])],2)):q.createCommentVNode("",!0),q.createElementVNode("div",Yw,[q.createElementVNode("div",{id:x.mapId,class:"vs-map__map",ref:"mapbox"},null,8,Qw)],512),q.createVNode(U,{class:"vs-map__no-js"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"no-js")]),_:3})])}const tb=wt._export_sfc(Hw,[["render",e2]]),t2={name:"VsMapWithSidebarCategories",status:"prototype",release:"0.0.1",components:{VsMapMarkerIcon:Ec,VsIcon:wt.VsIcon},props:{categoryName:{type:String,required:!0},type:{type:String,required:!0},hasSubCat:{type:Boolean,default:!1}},data(){return{isHovered:!1}},methods:{selectCategory(y){this.hasSubCat?this.$parent.$emit("set-subcategory",y):(this.$parent.$emit("set-category",y),this.$parent.$emit("set-stage",1))}}},r2={class:"vs-main-map-category","data-test":"vs-main-map-category"};function i2(y,_,x,k,E,D){const u=q.resolveComponent("VsMapMarkerIcon"),U=q.resolveComponent("VsIcon");return q.openBlock(),q.createElementBlock("div",r2,[q.createElementVNode("button",{type:"button",class:q.normalizeClass(["vs-main-map-category__button",`vs-main-map-category__button--${x.type}`]),"data-test":"vs-main-map-category__button",onClick:_[0]||(_[0]=M=>D.selectCategory(x.type)),onMouseover:_[1]||(_[1]=M=>E.isHovered=!0),onMouseout:_[2]||(_[2]=M=>E.isHovered=!1),onFocusin:_[3]||(_[3]=M=>E.isHovered=!0),onFocusout:_[4]||(_[4]=M=>E.isHovered=!1)},[q.createElementVNode("div",null,[q.createVNode(u,{class:"vs-main-map-category__icon",id:x.type,"is-hovered":E.isHovered},null,8,["id","is-hovered"]),q.createTextVNode(" "+q.toDisplayString(x.categoryName),1)]),q.createVNode(U,{icon:"fa-regular fa-arrow-right",variant:"highlight",size:"xs",class:"vs-main-map-category__icon align-self-center me-0"})],34)])}const n2=wt._export_sfc(t2,[["render",i2]]);let xc=null;const o2={name:"VsMapWithSidebarSubCategories",status:"prototype",release:"0.0.1",components:{BFormGroup:wt.BFormGroup_default,BFormCheckboxGroup:wt.BFormCheckboxGroup_default,BFormCheckbox:wt.BFormCheckbox_default,VsMapMarkerIcon:Ec},props:{data:{type:Array,required:!0},selectedSubCategory:{type:String,required:!0}},data(){return{selected:[]}},computed:{activeSubcatFilters(){return xc?xc.activeSubcatFilters:null},...pa.mapState(Sn,{activeSubcatFilters(y){return y.activeSubcatFilters}})},mounted(){xc=Sn(),this.selected=this.activeSubcatFilters,this.emitter&&(this.emitter.on("clearSelectedSubcats",()=>{this.selected=[]}),this.emitter.on("submitCheckboxData",()=>{this.checkboxesChangeSubmit()}));const y=document.getElementsByClassName("vs-main-map-subcategory")[0];y&&y.querySelectorAll('input[type="checkbox"]')[0].focus()},beforeUnmount(){this.emitter&&this.emitter.off("submitCheckboxData")},methods:{checkboxesChangeSubmit(){xc.setActiveSubcatFilters(this.selected),this.$parent.$emit("subcategories-filtered",this.selected)},emitChange(){this.emitter&&this.emitter.emit("checkboxes-selected",this.selected)}}},a2={class:"vs-main-map-subcategory","data-test":"vs-main-map-subcategory"};function s2(y,_,x,k,E,D){const u=q.resolveComponent("VsMapMarkerIcon"),U=q.resolveComponent("BFormCheckbox"),M=q.resolveComponent("BFormCheckboxGroup"),Y=q.resolveComponent("BFormGroup");return q.openBlock(),q.createElementBlock("div",a2,[q.createVNode(Y,null,{default:q.withCtx(()=>[q.createVNode(M,{id:"checkbox-group-1",modelValue:E.selected,"onUpdate:modelValue":_[0]||(_[0]=X=>E.selected=X),name:x.data.name},{default:q.withCtx(()=>[(q.openBlock(!0),q.createElementBlock(q.Fragment,null,q.renderList(x.data,X=>(q.openBlock(),q.createBlock(U,{key:X.id,value:X.id,onChange:D.emitChange},{default:q.withCtx(()=>[q.createVNode(u,{class:"vs-main-map-subcategory__icon",id:x.selectedSubCategory},null,8,["id"]),q.createTextVNode(" "+q.toDisplayString(X.name),1)]),_:2},1032,["value","onChange"]))),128))]),_:1},8,["modelValue","name"])]),_:1})])}const u2=wt._export_sfc(o2,[["render",s2]]);let Hd=null;const l2={name:"VsMapWithSidebarListItem",status:"prototype",release:"0.0.1",components:{VsImg:wt.VsImg,VsIcon:wt.VsIcon},inject:["mapId"],props:{itemData:{type:Object,required:!0},fromEndpoint:{type:Boolean,default:!1},focussed:{type:Boolean,default:!1}},data(){return{formattedData:{}}},computed:{isActive(){return!!(this.highlightedPlace&&this.formattedData&&this.highlightedPlace.properties.id===this.formattedData.properties.id)},...pa.mapState(Sn,{highlightedPlace(y){return y.getHoveredStop(this.mapId)}})},created(){this.fromEndpoint?this.formatApiData():this.formattedData=this.itemData},mounted(){Hd=Sn(),this.focussed&&this.$refs.btn.focus()},methods:{showItemDetail(y){Hd.setActivePlace({mapId:this.mapId,activeFeature:y}),this.$parent.$emit("show-item-detail",y),this.$parent.$emit("set-stage",2)},itemHover(y){Hd.setHoveredPlace({mapId:this.mapId,hoveredFeature:y})},formatApiData(){this.formattedData={geometry:{coordinates:[this.itemData.longitude,this.itemData.latitude],type:"Point"},properties:{category:this.itemData.category[0],description:this.itemData.description,id:this.itemData.id,image:typeof this.itemData.images<"u"?this.itemData.images[0].mediaUrl:"",title:this.itemData.name,link:{label:this.itemData.website.label,link:this.itemData.website.link,type:this.itemData.website.type}},type:"Point"}}}},c2={class:"vs-map-with-sidebar-list-item__img-container"},p2={class:"vs-map-with-sidebar-list-item__text"};function h2(y,_,x,k,E,D){const u=q.resolveComponent("VsImg"),U=q.resolveComponent("VsIcon");return q.openBlock(),q.createElementBlock("button",{type:"button",class:q.normalizeClass(["vs-map-with-sidebar-list-item",D.isActive?"vs-map-with-sidebar-list-item--hovered":""]),"data-test":"vs-map-with-sidebar-list-item",onClick:_[0]||(_[0]=M=>D.showItemDetail(E.formattedData)),onKeyup:_[1]||(_[1]=q.withKeys(M=>D.showItemDetail(E.formattedData),["enter"])),onMouseover:_[2]||(_[2]=M=>D.itemHover(E.formattedData)),onMouseleave:_[3]||(_[3]=M=>D.itemHover("")),onFocusin:_[4]||(_[4]=M=>D.itemHover(E.formattedData)),onFocusout:_[5]||(_[5]=M=>D.itemHover("")),ref:"btn"},[q.createElementVNode("div",c2,[typeof E.formattedData.properties.image<"u"?(q.openBlock(),q.createBlock(u,{key:0,src:E.formattedData.properties.image,class:"vs-map-with-sidebar-list-item__img"},null,8,["src"])):q.createCommentVNode("",!0)]),q.createElementVNode("span",p2,q.toDisplayString(E.formattedData.properties.title),1),q.createVNode(U,{icon:"fa-regular fa-arrow-right",variant:"highlight",size:"xxs",class:"vs-map-with-sidebar-list-item__icon"})],34)}const f2=wt._export_sfc(l2,[["render",h2]]),d2={name:"VsMapWithSidebarDetail",status:"prototype",release:"0.0.1",components:{VsImg:wt.VsImg,VsHeading:wt.VsHeading},props:{contentData:{type:Object,required:!0},headingLevel:{type:String,default:"3"}},computed:{showTitle(){return typeof this.contentData.properties.title<"u"||typeof this.contentData.properties.placeTitle<"u"}}},m2={class:"vs-map-with-sidebar-detail","data-test":"vs-map-with-sidebar-detail"},y2={key:2,"data-test":"vs-map-with-sidebar-detail__address",class:"vs-map-with-sidebar-detail__address"},v2={key:3,class:"mt-100"},g2=["innerHTML"];function _2(y,_,x,k,E,D){const u=q.resolveComponent("VsImg"),U=q.resolveComponent("VsHeading");return q.openBlock(),q.createElementBlock("div",m2,[typeof x.contentData.properties.image<"u"?(q.openBlock(),q.createBlock(u,{key:0,src:x.contentData.properties.image,class:"vs-map-with-sidebar-detail__image mb-125 mb-lg-075"},null,8,["src"])):q.createCommentVNode("",!0),D.showTitle?(q.openBlock(),q.createBlock(U,{key:1,level:x.headingLevel,"heading-style":"heading-xxs",class:"vs-map-with-sidebar-detail__heading mt-0","data-test":"vs-map-with-sidebar-detail__heading"},{default:q.withCtx(()=>[typeof x.contentData.properties.placeTitle<"u"?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[q.createTextVNode(q.toDisplayString(x.contentData.properties.placeTitle),1)],64)):(q.openBlock(),q.createElementBlock(q.Fragment,{key:1},[q.createTextVNode(q.toDisplayString(x.contentData.properties.title),1)],64))]),_:1},8,["level"])):q.createCommentVNode("",!0),typeof x.contentData.properties.address<"u"?(q.openBlock(),q.createElementBlock("p",y2,q.toDisplayString(x.contentData.properties.address.shortAddress),1)):q.createCommentVNode("",!0),x.contentData.properties.subtitle?(q.openBlock(),q.createElementBlock("p",v2,q.toDisplayString(x.contentData.properties.subtitle),1)):q.createCommentVNode("",!0),q.createElementVNode("div",{"data-test":"vs-map-with-sidebar-detail__description",class:"vs-map-with-sidebar-detail__description mb-150",innerHTML:x.contentData.properties.description},null,8,g2)])}const x2=wt._export_sfc(d2,[["render",_2]]),b2={name:"VsMapWithSidebarButtons",status:"prototype",release:"0.0.1",components:{VsButton:wt.VsButton},inject:["filtersAppliedText","clearFiltersText"],props:{contentData:{type:Object,required:!0},filterCount:{type:Number,default:null}},emits:["clear-filters"],computed:{websiteDataExists(){return typeof this.contentData.properties.website<"u"&&this.contentData.properties.website.link!==this.contentData.properties.link.link}},methods:{filtersClick(){this.$parent.$emit("set-stage",0)},clearFiltersClick(){this.$emit("clear-filters")}}};function w2(y,_,x,k,E,D){const u=q.resolveComponent("VsButton");return q.openBlock(),q.createElementBlock("div",{class:q.normalizeClass(["vs-map-with-sidebar-buttons",x.filterCount!==null?"vs-map-with-sidebar-buttons--filters":""]),"data-test":"vs-map-with-sidebar-buttons"},[x.filterCount!==null?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[q.createVNode(u,{class:"vs-map-with-sidebar-buttons__clear-filters","data-test":"vs-map-with-sidebar-buttons__clear-filters",variant:"secondary",size:"sm",onClick:D.clearFiltersClick},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(D.clearFiltersText),1)]),_:1},8,["onClick"]),q.createVNode(u,{class:"vs-map-with-sidebar-buttons__filters","data-test":"vs-map-with-sidebar-buttons__filters",variant:"secondary",icon:"vs-icon-control-filters",size:"sm",onClick:D.filtersClick},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(x.filterCount)+" "+q.toDisplayString(D.filtersAppliedText),1)]),_:1},8,["onClick"])],64)):(q.openBlock(),q.createElementBlock(q.Fragment,{key:1},[q.createVNode(u,{href:x.contentData.properties.link.link,"data-test":"vs-map-with-sidebar-buttons__discover",class:"mb-050"},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(x.contentData.properties.link.label),1)]),_:1},8,["href"]),D.websiteDataExists?(q.openBlock(),q.createBlock(u,{key:0,href:x.contentData.properties.website.link,target:"_blank",rel:"noopener noreferrer","data-test":"vs-map-with-sidebar-buttons__website",variant:"secondary"},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(x.contentData.properties.website.label),1)]),_:1},8,["href"])):q.createCommentVNode("",!0)],64))],2)}const S2=wt._export_sfc(b2,[["render",w2]]),I2={name:"VsMapWithSidebarControls",status:"prototype",release:"0.0.1",components:{VsButton:wt.VsButton},inject:["clearSelectionText","applyFiltersText"],data(){return{isDisabled:!0}},computed:{...pa.mapState(Sn,{getSubcatFilters(y){return y.activeSubcatFilters}})},mounted(){this.disableSubmitButton()},methods:{clearSelection(){this.emitter&&this.emitter.emit("clearSelectedSubcats"),this.isDisabled=!0},submitCheckboxes(){this.emitter&&this.emitter.emit("submitCheckboxData")},disableSubmitButton(){this.emitter&&this.emitter.on("checkboxes-selected",y=>{y.length>0?this.isDisabled=!1:this.isDisabled=!0}),this.getSubcatFilters.length>0&&(this.isDisabled=!1)}}},T2={class:"vs-main-map-controls","data-test":"vs-main-map-controls"};function A2(y,_,x,k,E,D){const u=q.resolveComponent("VsButton");return q.openBlock(),q.createElementBlock("div",T2,[q.createVNode(u,{class:"vs-main-map-controls__clear-selection","data-test":"vs-main-map-subcategory__clear-selection",size:"sm",variant:"secondary",onClick:D.clearSelection,onKeyup:q.withKeys(D.clearSelection,["enter"])},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(D.clearSelectionText),1)]),_:1},8,["onClick","onKeyup"]),q.createVNode(u,{class:"vs-main-map-controls__apply-filters","data-test":"vs-main-map-subcategory__apply-filters",size:"sm",onKeypress:q.withKeys(D.submitCheckboxes,["enter"]),onClick:D.submitCheckboxes,"aria-disabled":E.isDisabled,disabled:E.isDisabled},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(D.applyFiltersText),1)]),_:1},8,["onKeypress","onClick","aria-disabled","disabled"])])}const E2=wt._export_sfc(I2,[["render",A2]]);let Xd=null;const P2={name:"VsMapWithSidebarPanel",status:"prototype",release:"0.0.1",components:{VsButton:wt.VsButton,VsMapWithSidebarCategory:n2,VsMapWithSidebarSubcategory:u2,VsHeading:wt.VsHeading,VsMapWithSidebarListItem:f2,VsMapWithSidebarDetail:x2,VsMapWithSidebarButtons:S2,VsMapWithSidebarControls:E2},inject:["filters","filtersWithLocations","placesData","regions","mapId","focussedListItem"],props:{categoryHeading:{type:String,default:""},headingLevel:{type:String,default:"2"},selectedCategory:{type:String,default:""},selectedSubcategory:{type:String,default:null},currentStage:{type:Number,required:!0},selectedItem:{type:Object,default:null},hovered:{type:String,default:""},subcategoryLocations:{type:Array,default:null},currentEndpointData:{type:Array,default:()=>[]},panelStatus:{type:String,default:null},panelMessage:{type:String,default:null},totalPins:{type:Number,default:0},currentListItemFocus:{type:Number,default:0}},emits:["close-panel","load-more-places","set-stage","set-subcategory"],data(){return{placesLoaded:1}},computed:{currentHeading(){let y="";if(this.selectedSubcategory!==null)y=this.selectedSubcategoryData[0].label;else switch(this.currentStage){case 0:y=this.categoryHeading;break;case 1:case 2:y=this.currentFilter.label;break}return y},currentData(){return this.selectedCategory==="regions"?this.regions:this.placesData},panelClasses(){let y="";return this.currentStage===2&&(y+=" vs-map-with-sidebar-panel--small-padding"),y},headerClasses(){return this.currentStage===1?"vs-map-with-sidebar-panel__header-section--with-spacer":this.currentStage===2?"vs-map-with-sidebar-panel__header-section--overlapped":""},currentFilter(){let y="";return this.filters.forEach(_=>{_.id===this.selectedCategory&&(y=_)}),y},currentPlaceData(){let y=this.placesData;return this.selectedCategory==="regions"&&(y=this.regions),this.currentEndpointData.length>0?this.refineEndpointData(this.currentEndpointData):y.filter(_=>typeof _.properties<"u"&&this.selectedItem?_.properties.id===this.selectedItem.properties.id:!1)},selectedSubcategoryData(){return this.selectedSubcategory?this.filters.filter(_=>_.id===this.selectedSubcategory):[]},...pa.mapState(Sn,{subCatFilterCount(y){return y.activeSubcatFilters.length}}),detailHeadingLevel(){return(parseInt(this.headingLevel,10)+1).toString()},showLoadMore(){return!(this.subcategoryLocations.length>=this.totalPins||this.subcategoryLocations.length===0)}},watch:{currentFilter(){this.placesLoaded=1}},mounted(){Xd=Sn()},methods:{closePanel(){this.$emit("close-panel"),window.innerWidth>=1292&&this.currentStage===2&&this.$emit("set-subcategory",null)},stageBack(){if(this.selectedSubcategory&&this.currentStage===0)this.$emit("set-subcategory",null);else if(this.selectedSubcategory!==null&&this.subcategoryLocations===null)this.setStage(0);else{const y=this.currentStage-1;this.setStage(y)}},resetPanel(){Xd.setSelectedSubcat(null),this.setStage(0)},setStage(y){y===0&&(this.placesLoaded=1),this.$emit("set-stage",y)},subCatExists(y){return typeof y.subCategory<"u"&&y.subCategory.length>0},refineEndpointData(y){const _=[{isEndpoint:!0,properties:{category:y[0].category[0].id,id:y[0].id,image:y[0].images[0].mediaUrl,placeTitle:y[0].name,description:y[0].description,link:{label:y[0].productLink.label,link:y[0].productLink.link,type:y[0].productLink.type},website:{label:y[0].website.label,link:y[0].website.link,type:y[0].website.type},address:{shortAddress:""}}}];return typeof y[0].address<"u"&&(_[0].properties.address.shortAddress=y[0].address.shortAddress),_},clearSubCatFilters(){Xd.setActiveSubcatFilters([]),this.setStage(0)},loadMorePlaces(){this.placesLoaded+=1,this.$emit("load-more-places",this.placesLoaded)}}},C2={class:"vs-map-with-sidebar-panel__buttons d-lg-none"},k2={key:0,class:"vs-map-with-sidebar-panel__back"},M2={key:1,class:"vs-map-with-sidebar-panel__back"},B2={class:"vs-map-with-sidebar-panel__close"},z2={key:0,class:"vs-map-with-sidebar-panel__back d-none d-lg-block"},D2={key:2,class:"vs-map-with-sidebar-panel__bottom-message"},R2={class:"vs-map-with-sidebar-panel__list-container"},L2={key:3,class:"vs-map-with-sidebar-panel__overlay"},F2={key:0,class:"vs-map-with-sidebar-panel__overlay-box"},O2={class:"vs-map-with-sidebar-panel__overlay-text"};function V2(y,_,x,k,E,D){const u=q.resolveComponent("VsButton"),U=q.resolveComponent("VsHeading"),M=q.resolveComponent("VsMapWithSidebarSubcategory"),Y=q.resolveComponent("VsMapWithSidebarControls"),X=q.resolveComponent("VsMapWithSidebarCategory"),ae=q.resolveComponent("VsMapWithSidebarListItem"),J=q.resolveComponent("VsMapWithSidebarButtons"),Se=q.resolveComponent("VsMapWithSidebarDetail");return q.openBlock(),q.createElementBlock("section",{"data-test":"vs-map-with-sidebar-panel",class:q.normalizeClass(["vs-map-with-sidebar-panel",D.panelClasses])},[q.createElementVNode("div",{class:q.normalizeClass(["vs-map-with-sidebar-panel__header-section",D.headerClasses])},[q.createElementVNode("div",C2,[x.currentStage>1||x.selectedSubcategory?(q.openBlock(),q.createElementBlock("div",k2,[q.createVNode(u,{class:"vs-map-with-sidebar-panel_menu",icon:"vs-icon-control-menu",size:"sm",onClick:D.stageBack,"data-test":"vs-map-with-sidebar__menu-toggle",variant:"secondary"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"menu-btn-text")]),_:3},8,["onClick"])])):q.createCommentVNode("",!0),x.currentStage===1||x.selectedSubcategory?(q.openBlock(),q.createElementBlock("div",M2,[q.createVNode(u,{"icon-only":"",icon:"fa-regular fa-arrow-left",size:"md",variant:"subtle",onClick:D.stageBack,"data-test":"vs-map-with-sidebar-panel--btn-back"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"back-btn-text")]),_:3},8,["onClick"])])):q.createCommentVNode("",!0),q.createElementVNode("div",B2,[q.createVNode(u,{"icon-only":"",icon:"vs-icon-control-dismiss",size:"md",variant:"subtle",onClick:D.closePanel,"data-test":"vs-map-with-sidebar-panel--btn-close"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"close-side-panel-text")]),_:3},8,["onClick"])])]),x.currentStage>0||x.selectedSubcategory?(q.openBlock(),q.createElementBlock("div",z2,[q.createVNode(u,{"icon-only":"",icon:"fa-regular fa-arrow-left",size:"md",variant:"subtle",onClick:D.stageBack,"data-test":"vs-map-with-sidebar-panel--btn-back"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"back-btn-text")]),_:3},8,["onClick"])])):q.createCommentVNode("",!0),D.currentHeading!==""?(q.openBlock(),q.createBlock(U,{key:1,level:x.headingLevel,"heading-style":x.currentStage===0?"heading-m":"heading-xs",class:q.normalizeClass(["vs-map-with-sidebar-panel__heading text-center mt-200 mt-lg-0",x.currentStage===2?"d-none d-lg-block":""]),"data-test":"vs-map-with-sidebar-panel__heading"},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(D.currentHeading),1)]),_:1},8,["level","heading-style","class"])):q.createCommentVNode("",!0),q.createElementVNode("div",{class:q.normalizeClass(["vs-map-with-sidebar-panel__reset",x.currentStage<2?"d-lg-none":""])},[q.createVNode(u,{"icon-only":"",icon:"vs-icon-control-dismiss",size:"md",variant:"subtle",onClick:D.resetPanel,"data-test":"vs-map-with-sidebar-panel--btn-reset"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"reset-side-panel-text")]),_:3},8,["onClick"])],2)],2),x.currentStage===0?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[x.selectedSubcategory!==null?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[q.createVNode(M,{data:D.selectedSubcategoryData[0].subCategory,"selected-sub-category":x.selectedSubcategory},null,8,["data","selected-sub-category"]),q.createVNode(Y)],64)):(q.openBlock(!0),q.createElementBlock(q.Fragment,{key:1},q.renderList(D.filtersWithLocations,be=>(q.openBlock(),q.createBlock(X,{key:be.id,"category-name":be.label,type:be.id,"has-sub-cat":D.subCatExists(be)},null,8,["category-name","type","has-sub-cat"]))),128)),x.panelMessage!==null?(q.openBlock(),q.createElementBlock("div",D2,[q.createElementVNode("p",null,q.toDisplayString(x.panelMessage),1)])):q.createCommentVNode("",!0)],64)):q.createCommentVNode("",!0),x.currentStage===1?(q.openBlock(),q.createElementBlock(q.Fragment,{key:1},[x.selectedSubcategory!==null?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[q.createElementVNode("div",R2,[(q.openBlock(!0),q.createElementBlock(q.Fragment,null,q.renderList(x.subcategoryLocations,(be,De)=>(q.openBlock(),q.createBlock(ae,{key:be.id,"item-data":be,"from-endpoint":!0,focussed:De===x.currentListItemFocus,onShowItemDetail:Ze=>y.showDetail(be)},null,8,["item-data","focussed","onShowItemDetail"]))),128)),D.showLoadMore?(q.openBlock(),q.createBlock(u,{key:0,class:"vs-map-with-sidebar-panel__load-more","data-test":"vs-map-with-sidebar-panel__load-more",onClick:_[0]||(_[0]=be=>D.loadMorePlaces()),onKeyup:_[1]||(_[1]=q.withKeys(be=>D.loadMorePlaces(),["enter"]))},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"load-more-text")]),_:3})):q.createCommentVNode("",!0)]),q.createVNode(J,{"content-data":{},"filter-count":y.subCatFilterCount,onClearFilters:D.clearSubCatFilters},null,8,["filter-count","onClearFilters"])],64)):(q.openBlock(!0),q.createElementBlock(q.Fragment,{key:1},q.renderList(D.currentData,be=>(q.openBlock(),q.createElementBlock("div",{key:be.id},[typeof be.properties<"u"&&be.properties.category.id===x.selectedCategory?(q.openBlock(),q.createBlock(ae,{key:0,"item-data":be,onShowItemDetail:De=>y.showDetail(be)},null,8,["item-data","onShowItemDetail"])):q.createCommentVNode("",!0)]))),128))],64)):q.createCommentVNode("",!0),x.currentStage===2?(q.openBlock(),q.createElementBlock(q.Fragment,{key:2},[q.createVNode(Se,{"heading-level":D.detailHeadingLevel,"content-data":D.currentPlaceData[0]},null,8,["heading-level","content-data"]),q.createVNode(J,{"content-data":D.currentPlaceData[0]},null,8,["content-data"])],64)):q.createCommentVNode("",!0),x.panelStatus!==null?(q.openBlock(),q.createElementBlock("div",L2,[y.$slots["panel-loading-message"]&&x.panelStatus!=="map-loading"?(q.openBlock(),q.createElementBlock("div",F2,[q.createElementVNode("p",O2,[q.renderSlot(y.$slots,"panel-loading-message")])])):q.createCommentVNode("",!0)])):q.createCommentVNode("",!0)],2)}const q2=wt._export_sfc(P2,[["render",V2]]);let bc=null;const U2={name:"VsMapWithSidebar",status:"deprecated",release:"0.0.1",components:{VsContainer:wt.VsContainer,VsRow:wt.VsRow,VsCol:wt.VsCol,VsMap:tb,VsButton:wt.VsButton,VsMapWithSidebarPanel:q2,VsButtonToggleGroup:wt.VsButtonToggleGroup,VsWarning:wt.VsWarning},provide(){return{filters:this.filters,filtersWithLocations:this.filtersWithLocations,placesData:this.placesData,mapId:this.mapId,regions:this.regionsData,clearSelectionText:this.clearSelectionText,applyFiltersText:this.applyFiltersText,subCatList:this.subCatList,filtersAppliedText:this.filtersAppliedText,clearFiltersText:this.clearFiltersText,focussedListItem:this.focussedListItem}},props:{categoryHeading:{type:String,default:""},filters:{type:Array,required:!0},placesData:{type:Array,required:!0},mapId:{type:String,required:!0},mainHeadingExists:{type:Boolean,default:!1},initialSelected:{type:String,default:""},toggleData:{type:Array,default:()=>[]},buttonsLabel:{type:String,default:""},clearSelectionText:{type:String,required:!0},applyFiltersText:{type:String,required:!0},detailsEndpoint:{type:String,default:""},regionBounds:{type:Object,default:()=>{}},clearFiltersText:{type:String,required:!0},filtersAppliedText:{type:String,required:!0},placeId:{type:String,default:null},mapFilterMessage:{type:String,required:!0},mapNoResultsMessage:{type:String,required:!0},panelMessage:{type:String,default:null},loadBrandingImmediately:{type:Boolean,default:!1}},data(){return{panelVisible:!1,selectedCategory:"",filterCategories:this.filters,selectedItem:null,activePins:this.placesData,currentlyHovered:"",showRegions:!1,regions:[],subCatList:null,selectedToggle:"",currentEndpointData:[],mapStatus:"",panelStatus:"map-loading",mapReady:!1,showPanelMessage:null,currentPanelEndpointFilters:"",totalEndpointPins:0,focussedListItem:0,resetZoom:!1,currentStage:0,selectedSubCategory:null}},computed:{mapDisplayClass(){return this.panelVisible?"d-none d-lg-block":""},panelDisplayClass(){return this.panelVisible?"":"d-none d-lg-block"},regionsData(){return this.placesData.filter(y=>y.geometry.type==="Polygon"||y.geometry.type==="MultiPolygon")},...pa.mapState(Sn,{subCatActiveFilters(y){return y.activeSubcatFilters}}),infoMessage(){let y="";switch(this.mapStatus){case"no-results":y=this.mapNoResultsMessage;break;case"filter-results":y=this.mapFilterMessage;break}return y},existingCategories(){return this.placesData?[...new Set(this.placesData.map(y=>y.properties.category.id))]:[]},filtersWithLocations(){return this.filters.filter(y=>!!(this.existingCategories.includes(y.id)||y.subCategory&&y.subCategory.length))},togglesWithLocations(){return this.existingCategories.indexOf("vics")===-1?this.toggleData.filter(y=>y.value!=="icentres"):this.toggleData}},watch:{selectedSubCategory(y){y===null&&(this.mapStatus="",this.resetZoom=!0)}},mounted(){bc=Sn(),this.selectedToggle=this.initialSelected,this.emitter&&this.emitter.on("clearSelectedSubcats",()=>{this.resetZoom=!0})},methods:{openMenu(){this.setStage(0),this.openPanel()},closePanel(){this.panelVisible=!1},openPanel(){this.panelVisible=!0},showDetail(y){document.fullscreenElement&&document.exitFullscreen(),this.selectedItem=y,this.setStage(2),this.openPanel(),this.selectedSubCategory===null&&this.filterPlaces(this.selectedCategory)},setCategory(y){this.selectedCategory=y,this.selectedSubCategory===null&&this.filterPlaces(y)},setSubCategory(y){bc.setSelectedSubcat(y),this.selectedSubCategory=y,y!==null?(this.getSubcatMarkerData(),this.selectedCategory=y):(bc.setActiveSubcatFilters([]),this.showAllPlaces())},filterSubCategories(y){let _="";y.forEach(x=>{const k=`&cat=${x}`;_+=k}),this.currentPanelEndpointFilters=_,this.getSubcatMarkerData(_),this.getSubcatPanelData(_,0)},getSubcatMarkerData(y){const _=this.filters.filter(x=>x.id===this.selectedSubCategory);if(_.length>0){let x=_[0].pinsEndpoint;typeof y<"u"&&(x+=y),this.activePins=[],typeof y>"u"?(this.activePins=[],this.mapStatus="filter-results"):wt.axios.get(x).then(k=>{this.totalEndpointPins=k.data.features.length,this.totalEndpointPins===0?this.mapStatus="no-results":(k.data.features.forEach(E=>{const D=E;D.properties.apiData=!0,this.activePins.push(D)}),this.mapStatus="")})}},getSubcatPanelData(y,_){let k=this.filters.filter(E=>E.id===this.selectedSubCategory)[0].listProductsEndPoint;typeof y<"u"&&(k+=y),_!==0&&(k+=`${y}&page=${_}`),this.panelStatus="loading-data",wt.axios.get(k).then(E=>{typeof E.data.data.products<"u"?(this.setStage(1),_===0?(this.subCatList=E.data.data.products,this.focussedListItem=0):(this.focussedListItem=_*24,this.subCatList=this.subCatList.concat(E.data.data.products))):this.mapStatus="no-results",this.panelStatus=null})},setStage(y){if(y===2&&this.detailsEndpoint!==""&&this.selectedSubCategory!==null){const _=`${this.detailsEndpoint}${this.selectedItem.properties.id}`;wt.axios.get(_).then(x=>{const k=[];k.push(x.data.data),this.currentEndpointData=k,this.currentStage=y})}else this.currentStage=y,this.currentStage===0?(this.currentEndpointData=[],this.selectedSubCategory===null?(this.resetZoom=!0,this.showAllPlaces(),this.mapStatus=""):this.getSubcatMarkerData(),this.selectedToggle="places"):this.currentStage===1&&this.selectedSubCategory===null&&this.filterPlaces(this.selectedCategory);y!==2&&(bc.setActivePlace({mapId:this.mapId,activeFeature:""}),this.selectedItem=null)},filterPlaces(y){if(y==="regions")this.showRegions=!0,this.activePins=[],this.selectedToggle="regions";else{this.showRegions=!1,this.selectedToggle="places";const _=this.placesData.filter(x=>typeof x.properties<"u"?x.properties.category.id===y:!1);this.activePins=_}},loadMorePlaces(y){this.getSubcatPanelData(this.currentPanelEndpointFilters,y)},showAllPlaces(){this.activePins=this.placesData,this.showRegions=!1},onToggleChanged(y){y==="regions"?(this.setCategory("regions"),this.setStage(1)):y==="icentres"?(this.setCategory("vics"),this.setStage(1)):y==="places-regional"?(this.setCategory("twnv"),this.setStage(1)):(this.showAllPlaces(),this.setStage(0))},setMapReady(y){this.mapReady=y,y?this.panelStatus=null:this.panelStatus="loading"},categoryHasData(y){return this.existingCategories.indexOf(y)!==-1}}};function N2(y,_,x,k,E,D){const u=q.resolveComponent("VsMapWithSidebarPanel"),U=q.resolveComponent("VsButton"),M=q.resolveComponent("VsMap"),Y=q.resolveComponent("VsButtonToggleGroup"),X=q.resolveComponent("VsWarning"),ae=q.resolveComponent("VsCol"),J=q.resolveComponent("VsRow"),Se=q.resolveComponent("VsContainer");return q.openBlock(),q.createBlock(Se,{"data-test":"vs-map-with-sidebar"},{default:q.withCtx(()=>[q.createVNode(J,null,{default:q.withCtx(()=>[q.createVNode(ae,null,{default:q.withCtx(()=>[q.createElementVNode("div",{class:"vs-map-with-sidebar",ref:x.mapId},[q.createElementVNode("div",{class:q.normalizeClass(["vs-map-with-sidebar__side-panel",D.panelDisplayClass]),"data-test":"vs-map-with-sidebar__side-panel"},[q.createVNode(u,{"category-heading":x.categoryHeading,"selected-category":E.selectedCategory,"selected-subcategory":E.selectedSubCategory,"current-stage":E.currentStage,"selected-item":E.selectedItem,"heading-level":x.mainHeadingExists?"3":"2","subcategory-locations":E.subCatList,"current-endpoint-data":E.currentEndpointData,"panel-status":E.panelStatus,"panel-message":E.currentStage===0?x.panelMessage:null,"total-pins":E.totalEndpointPins,"current-list-item-focus":E.focussedListItem,onSetCategory:D.setCategory,onSetSubcategory:D.setSubCategory,onSubcategoriesFiltered:D.filterSubCategories,onSetStage:D.setStage,onClosePanel:D.closePanel,onShowItemDetail:D.showDetail,onFilterPlaces:D.filterPlaces,onLoadMorePlaces:D.loadMorePlaces},{closePanelText:q.withCtx(()=>[q.renderSlot(y.$slots,"close-side-panel-text")]),"reset-side-panel-text":q.withCtx(()=>[q.renderSlot(y.$slots,"reset-side-panel-text")]),"menu-btn-text":q.withCtx(()=>[q.renderSlot(y.$slots,"menu-btn-text")]),"panel-loading-message":q.withCtx(()=>[q.renderSlot(y.$slots,"panel-loading-message")]),"load-more-text":q.withCtx(()=>[q.renderSlot(y.$slots,"load-more-text")]),_:3},8,["category-heading","selected-category","selected-subcategory","current-stage","selected-item","heading-level","subcategory-locations","current-endpoint-data","panel-status","panel-message","total-pins","current-list-item-focus","onSetCategory","onSetSubcategory","onSubcategoriesFiltered","onSetStage","onClosePanel","onShowItemDetail","onFilterPlaces","onLoadMorePlaces"])],2),q.createElementVNode("div",{class:q.normalizeClass(["vs-map-with-sidebar__map",D.mapDisplayClass])},[q.createVNode(U,{class:"vs-map-with-sidebar__map-toggle",icon:"vs-icon-control-menu",size:"sm",onClick:D.openMenu,"data-test":"vs-map-with-sidebar__map-toggle",variant:"secondary"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"open-side-panel-text")]),_:3},8,["onClick"]),q.createVNode(M,{"is-visible":!E.panelVisible,labels:{},filters:D.filtersWithLocations,places:E.activePins,"selected-item":E.selectedItem,"map-id":x.mapId,"show-polygons":E.showRegions,"show-info-message":E.mapStatus!=="",onShowDetail:D.showDetail,onSetCategory:D.setCategory,onMapReady:D.setMapReady,onZoomReset:_[0]||(_[0]=be=>E.resetZoom=!1),"bounds-data":x.regionBounds,"reset-zoom":E.resetZoom,"show-marker-popups":!1,"load-branding-immediately":x.loadBrandingImmediately},{"map-loading-text":q.withCtx(()=>[q.renderSlot(y.$slots,"map-loading-text")]),"info-message":q.withCtx(()=>[q.createTextVNode(q.toDisplayString(D.infoMessage),1)]),"zoom-too-close":q.withCtx(()=>[q.renderSlot(y.$slots,"zoom-too-close")]),"zoom-too-far":q.withCtx(()=>[q.renderSlot(y.$slots,"zoom-too-far")]),"no-js":q.withCtx(()=>[q.renderSlot(y.$slots,"no-js")]),_:3},8,["is-visible","filters","places","selected-item","map-id","show-polygons","show-info-message","onShowDetail","onSetCategory","onMapReady","bounds-data","reset-zoom","load-branding-immediately"]),D.togglesWithLocations.length>1?(q.openBlock(),q.createBlock(Y,{key:0,"data-test":"vs-map-with-sidebar__map-toggle-group","initial-selected":E.selectedToggle,options:D.togglesWithLocations,"buttons-label":x.buttonsLabel,onToggleChanged:D.onToggleChanged},null,8,["initial-selected","options","buttons-label","onToggleChanged"])):q.createCommentVNode("",!0)],2)],512),q.createVNode(X,{class:"vs-map-with-sidebar__no-js"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"no-js")]),_:3})]),_:3})]),_:3})]),_:3})}const j2=wt._export_sfc(U2,[["render",N2]]);exports.VsMap=tb;exports.VsMapMarker=eb;exports.VsMapMarkerIcon=Ec;exports.VsMapWithSidebar=j2;
508
+ `},setupMarkerListeners(y){document.body.addEventListener("keyup",x=>{(x.key==="Escape"||x.key==="Tab")&&(this.removeMapPopup(y),this.showMarkerPopups&&Hs.setActivePlace({mapId:this.mapId,activeFeature:null}))}),y.getElement().addEventListener("keyup",x=>{x.key==="Enter"&&(y._popup.isOpen()||y._popup.addTo(this.mapbox.map))})},fitToBounds(){this.mapbox.map.fitBounds(qw(this.geojsonData),{padding:{top:100,bottom:100,left:100,right:100}})},initialiseMapComponent(){this.addMap(),this.addMapControls(),this.places.length&&this.initialiseMapFeatures(),this.geojsonData.features.length&&(this.initialiseMapMarkers(),this.fitToMarkers&&this.fitToBounds())},lazyloadMapComponent(){if(fo.supported({failIfMajorPerformanceCaveat:!0}),!("IntersectionObserver"in window)){this.initialiseMapComponent();return}this.observer=new IntersectionObserver(y=>{y[0].intersectionRatio>0&&(this.observer.unobserve(this.$el),this.initialiseMapComponent())}),this.observer.observe(this.$el)},onResize(){this.isTablet=window.innerWidth>=768},getBoundsFromPolygon(){const y=this.boundsData.coordinates[0];return y.reduce((_,x)=>_.extend(x),new fo.LngLatBounds(y[0],y[0]))},checkPointIsVisible(){return this.mapbox.map.getBounds().contains(this.activeMarkerPostion)},centreMapOnPoint(y){this.mapbox.map.flyTo({center:y})},calculateBoundingBox(){let y;if(typeof this.boundsData>"u"||this.boundsData.type==="undefined")y=[[-7.555827,54.608836],[-.778285,60.880894]];else if(this.boundsData.type==="bounds"){const _=new fo.LngLat(this.boundsData.coordinates[1][0],this.boundsData.coordinates[1][1]),x=new fo.LngLat(this.boundsData.coordinates[0][0],this.boundsData.coordinates[0][1]);y=new fo.LngLatBounds(_,x)}else this.boundsData.type==="Polygon"?y=this.getBoundsFromPolygon():y=[[-7.555827,54.608836],[-.778285,60.880894]];return y}}},Xw={class:"vs-map","data-test":"vs-map"},Kw={class:"vs-map__message-box"},Jw={class:"vs-map__message-text"},Yw={ref:"mapboxOuter",class:"vs-map__map-outer"},Qw=["id"];function e2(y,_,x,k,E,D){const u=q.resolveComponent("VsLoading"),U=q.resolveComponent("VsWarning");return q.openBlock(),q.createElementBlock("div",Xw,[E.showMapMessage?(q.openBlock(),q.createElementBlock("div",{key:0,class:q.normalizeClass(["vs-map__message",E.showZoomMessage?"":"vs-map__message--with-overlay"]),"data-test":"vs-map__message"},[q.createElementVNode("div",Kw,[E.isLoading?(q.openBlock(),q.createBlock(u,{key:0,class:"vs-map__loading"})):q.createCommentVNode("",!0),q.createElementVNode("p",Jw,[E.isLoading?q.renderSlot(y.$slots,"map-loading-text",{},void 0,void 0,0):x.showInfoMessage?q.renderSlot(y.$slots,"info-message",{},void 0,void 0,1):E.showZoomMessage==="too-close"?q.renderSlot(y.$slots,"zoom-too-close",{},void 0,void 0,2):E.showZoomMessage==="too-far"?q.renderSlot(y.$slots,"zoom-too-far",{},void 0,void 0,3):q.createCommentVNode("",!0)])])],2)):q.createCommentVNode("",!0),q.createElementVNode("div",Yw,[q.createElementVNode("div",{id:x.mapId,class:"vs-map__map",ref:"mapbox"},null,8,Qw)],512),q.createVNode(U,{class:"vs-map__no-js"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"no-js")]),_:3})])}const tb=wt._export_sfc(Hw,[["render",e2]]),t2={name:"VsMapWithSidebarCategories",status:"prototype",release:"0.0.1",components:{VsMapMarkerIcon:Ec,VsIcon:wt.VsIcon},props:{categoryName:{type:String,required:!0},type:{type:String,required:!0},hasSubCat:{type:Boolean,default:!1}},data(){return{isHovered:!1}},methods:{selectCategory(y){this.hasSubCat?this.$parent.$emit("set-subcategory",y):(this.$parent.$emit("set-category",y),this.$parent.$emit("set-stage",1))}}},r2={class:"vs-main-map-category","data-test":"vs-main-map-category"};function i2(y,_,x,k,E,D){const u=q.resolveComponent("VsMapMarkerIcon"),U=q.resolveComponent("VsIcon");return q.openBlock(),q.createElementBlock("div",r2,[q.createElementVNode("button",{type:"button",class:q.normalizeClass(["vs-main-map-category__button",`vs-main-map-category__button--${x.type}`]),"data-test":"vs-main-map-category__button",onClick:_[0]||(_[0]=M=>D.selectCategory(x.type)),onMouseover:_[1]||(_[1]=M=>E.isHovered=!0),onMouseout:_[2]||(_[2]=M=>E.isHovered=!1),onFocusin:_[3]||(_[3]=M=>E.isHovered=!0),onFocusout:_[4]||(_[4]=M=>E.isHovered=!1)},[q.createElementVNode("div",null,[q.createVNode(u,{class:"vs-main-map-category__icon",id:x.type,"is-hovered":E.isHovered},null,8,["id","is-hovered"]),q.createTextVNode(" "+q.toDisplayString(x.categoryName),1)]),q.createVNode(U,{icon:"fa-regular fa-arrow-right",variant:"highlight",size:"xs",class:"vs-main-map-category__icon align-self-center me-0"})],34)])}const n2=wt._export_sfc(t2,[["render",i2]]);let xc=null;const o2={name:"VsMapWithSidebarSubCategories",status:"prototype",release:"0.0.1",components:{BFormGroup:wt.BFormGroup_default,BFormCheckboxGroup:wt.BFormCheckboxGroup_default,BFormCheckbox:wt.BFormCheckbox_default,VsMapMarkerIcon:Ec},props:{data:{type:Array,required:!0},selectedSubCategory:{type:String,required:!0}},data(){return{selected:[]}},computed:{activeSubcatFilters(){return xc?xc.activeSubcatFilters:null},...pa.mapState(Sn,{activeSubcatFilters(y){return y.activeSubcatFilters}})},mounted(){xc=Sn(),this.selected=this.activeSubcatFilters,this.emitter&&(this.emitter.on("clearSelectedSubcats",()=>{this.selected=[]}),this.emitter.on("submitCheckboxData",()=>{this.checkboxesChangeSubmit()}));const y=document.getElementsByClassName("vs-main-map-subcategory")[0];y&&y.querySelectorAll('input[type="checkbox"]')[0].focus()},beforeUnmount(){this.emitter&&this.emitter.off("submitCheckboxData")},methods:{checkboxesChangeSubmit(){xc.setActiveSubcatFilters(this.selected),this.$parent.$emit("subcategories-filtered",this.selected)},emitChange(){this.emitter&&this.emitter.emit("checkboxes-selected",this.selected)}}},a2={class:"vs-main-map-subcategory","data-test":"vs-main-map-subcategory"};function s2(y,_,x,k,E,D){const u=q.resolveComponent("VsMapMarkerIcon"),U=q.resolveComponent("BFormCheckbox"),M=q.resolveComponent("BFormCheckboxGroup"),Y=q.resolveComponent("BFormGroup");return q.openBlock(),q.createElementBlock("div",a2,[q.createVNode(Y,null,{default:q.withCtx(()=>[q.createVNode(M,{id:"checkbox-group-1",modelValue:E.selected,"onUpdate:modelValue":_[0]||(_[0]=X=>E.selected=X),name:x.data.name},{default:q.withCtx(()=>[(q.openBlock(!0),q.createElementBlock(q.Fragment,null,q.renderList(x.data,X=>(q.openBlock(),q.createBlock(U,{key:X.id,value:X.id,onChange:D.emitChange},{default:q.withCtx(()=>[q.createVNode(u,{class:"vs-main-map-subcategory__icon",id:x.selectedSubCategory},null,8,["id"]),q.createTextVNode(" "+q.toDisplayString(X.name),1)]),_:2},1032,["value","onChange"]))),128))]),_:1},8,["modelValue","name"])]),_:1})])}const u2=wt._export_sfc(o2,[["render",s2]]);let Hd=null;const l2={name:"VsMapWithSidebarListItem",status:"prototype",release:"0.0.1",components:{VsImg:wt.VsImg,VsIcon:wt.VsIcon},inject:["mapId"],props:{itemData:{type:Object,required:!0},fromEndpoint:{type:Boolean,default:!1},focussed:{type:Boolean,default:!1}},data(){return{formattedData:{}}},computed:{isActive(){return!!(this.highlightedPlace&&this.formattedData&&this.highlightedPlace.properties.id===this.formattedData.properties.id)},...pa.mapState(Sn,{highlightedPlace(y){return y.getHoveredStop(this.mapId)}})},created(){this.fromEndpoint?this.formatApiData():this.formattedData=this.itemData},mounted(){Hd=Sn(),this.focussed&&this.$refs.btn.focus()},methods:{showItemDetail(y){Hd.setActivePlace({mapId:this.mapId,activeFeature:y}),this.$parent.$emit("show-item-detail",y),this.$parent.$emit("set-stage",2)},itemHover(y){Hd.setHoveredPlace({mapId:this.mapId,hoveredFeature:y})},formatApiData(){this.formattedData={geometry:{coordinates:[this.itemData.longitude,this.itemData.latitude],type:"Point"},properties:{category:this.itemData.category[0],description:this.itemData.description,id:this.itemData.id,image:typeof this.itemData.images<"u"?this.itemData.images[0].mediaUrl:"",title:this.itemData.name,link:{label:this.itemData.website.label,link:this.itemData.website.link,type:this.itemData.website.type}},type:"Point"}}}},c2={class:"vs-map-with-sidebar-list-item__img-container"},p2={class:"vs-map-with-sidebar-list-item__text"};function h2(y,_,x,k,E,D){const u=q.resolveComponent("VsImg"),U=q.resolveComponent("VsIcon");return q.openBlock(),q.createElementBlock("button",{type:"button",class:q.normalizeClass(["vs-map-with-sidebar-list-item",D.isActive?"vs-map-with-sidebar-list-item--hovered":""]),"data-test":"vs-map-with-sidebar-list-item",onClick:_[0]||(_[0]=M=>D.showItemDetail(E.formattedData)),onKeyup:_[1]||(_[1]=q.withKeys(M=>D.showItemDetail(E.formattedData),["enter"])),onMouseover:_[2]||(_[2]=M=>D.itemHover(E.formattedData)),onMouseleave:_[3]||(_[3]=M=>D.itemHover("")),onFocusin:_[4]||(_[4]=M=>D.itemHover(E.formattedData)),onFocusout:_[5]||(_[5]=M=>D.itemHover("")),ref:"btn"},[q.createElementVNode("div",c2,[typeof E.formattedData.properties.image<"u"?(q.openBlock(),q.createBlock(u,{key:0,src:E.formattedData.properties.image,class:"vs-map-with-sidebar-list-item__img"},null,8,["src"])):q.createCommentVNode("",!0)]),q.createElementVNode("span",p2,q.toDisplayString(E.formattedData.properties.title),1),q.createVNode(U,{icon:"fa-regular fa-arrow-right",variant:"highlight",size:"xxs",class:"vs-map-with-sidebar-list-item__icon"})],34)}const f2=wt._export_sfc(l2,[["render",h2]]),d2={name:"VsMapWithSidebarDetail",status:"prototype",release:"0.0.1",components:{VsImg:wt.VsImg,VsHeading:wt.VsHeading},props:{contentData:{type:Object,required:!0},headingLevel:{type:String,default:"3"}},computed:{showTitle(){return typeof this.contentData.properties.title<"u"||typeof this.contentData.properties.placeTitle<"u"}}},m2={class:"vs-map-with-sidebar-detail","data-test":"vs-map-with-sidebar-detail"},y2={key:2,"data-test":"vs-map-with-sidebar-detail__address",class:"vs-map-with-sidebar-detail__address"},v2={key:3,class:"mt-100"},g2=["innerHTML"];function _2(y,_,x,k,E,D){const u=q.resolveComponent("VsImg"),U=q.resolveComponent("VsHeading");return q.openBlock(),q.createElementBlock("div",m2,[typeof x.contentData.properties.image<"u"?(q.openBlock(),q.createBlock(u,{key:0,src:x.contentData.properties.image,class:"vs-map-with-sidebar-detail__image mb-125 mb-lg-075"},null,8,["src"])):q.createCommentVNode("",!0),D.showTitle?(q.openBlock(),q.createBlock(U,{key:1,level:x.headingLevel,"heading-style":"heading-xxs",class:"vs-map-with-sidebar-detail__heading mt-0","data-test":"vs-map-with-sidebar-detail__heading"},{default:q.withCtx(()=>[typeof x.contentData.properties.placeTitle<"u"?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[q.createTextVNode(q.toDisplayString(x.contentData.properties.placeTitle),1)],64)):(q.openBlock(),q.createElementBlock(q.Fragment,{key:1},[q.createTextVNode(q.toDisplayString(x.contentData.properties.title),1)],64))]),_:1},8,["level"])):q.createCommentVNode("",!0),typeof x.contentData.properties.address<"u"?(q.openBlock(),q.createElementBlock("p",y2,q.toDisplayString(x.contentData.properties.address.shortAddress),1)):q.createCommentVNode("",!0),x.contentData.properties.subtitle?(q.openBlock(),q.createElementBlock("p",v2,q.toDisplayString(x.contentData.properties.subtitle),1)):q.createCommentVNode("",!0),q.createElementVNode("div",{"data-test":"vs-map-with-sidebar-detail__description",class:"vs-map-with-sidebar-detail__description mb-150",innerHTML:x.contentData.properties.description},null,8,g2)])}const x2=wt._export_sfc(d2,[["render",_2]]),b2={name:"VsMapWithSidebarButtons",status:"prototype",release:"0.0.1",components:{VsButton:wt.VsButton},inject:["filtersAppliedText","clearFiltersText"],props:{contentData:{type:Object,required:!0},filterCount:{type:Number,default:null}},emits:["clear-filters"],computed:{websiteDataExists(){return typeof this.contentData.properties.website<"u"&&this.contentData.properties.website.link!==this.contentData.properties.link.link}},methods:{filtersClick(){this.$parent.$emit("set-stage",0)},clearFiltersClick(){this.$emit("clear-filters")}}};function w2(y,_,x,k,E,D){const u=q.resolveComponent("VsButton");return q.openBlock(),q.createElementBlock("div",{class:q.normalizeClass(["vs-map-with-sidebar-buttons",x.filterCount!==null?"vs-map-with-sidebar-buttons--filters":""]),"data-test":"vs-map-with-sidebar-buttons"},[x.filterCount!==null?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[q.createVNode(u,{class:"vs-map-with-sidebar-buttons__clear-filters","data-test":"vs-map-with-sidebar-buttons__clear-filters",variant:"secondary",size:"sm",onClick:D.clearFiltersClick},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(D.clearFiltersText),1)]),_:1},8,["onClick"]),q.createVNode(u,{class:"vs-map-with-sidebar-buttons__filters","data-test":"vs-map-with-sidebar-buttons__filters",variant:"secondary",icon:"vs-icon-control-filters",size:"sm",onClick:D.filtersClick},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(x.filterCount)+" "+q.toDisplayString(D.filtersAppliedText),1)]),_:1},8,["onClick"])],64)):(q.openBlock(),q.createElementBlock(q.Fragment,{key:1},[q.createVNode(u,{href:x.contentData.properties.link.link,"data-test":"vs-map-with-sidebar-buttons__discover",class:"mb-050"},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(x.contentData.properties.link.label),1)]),_:1},8,["href"]),D.websiteDataExists?(q.openBlock(),q.createBlock(u,{key:0,href:x.contentData.properties.website.link,target:"_blank",rel:"noopener noreferrer","data-test":"vs-map-with-sidebar-buttons__website",variant:"secondary"},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(x.contentData.properties.website.label),1)]),_:1},8,["href"])):q.createCommentVNode("",!0)],64))],2)}const S2=wt._export_sfc(b2,[["render",w2]]),I2={name:"VsMapWithSidebarControls",status:"prototype",release:"0.0.1",components:{VsButton:wt.VsButton},inject:["clearSelectionText","applyFiltersText"],data(){return{isDisabled:!0}},computed:{...pa.mapState(Sn,{getSubcatFilters(y){return y.activeSubcatFilters}})},mounted(){this.disableSubmitButton()},methods:{clearSelection(){this.emitter&&this.emitter.emit("clearSelectedSubcats"),this.isDisabled=!0},submitCheckboxes(){this.emitter&&this.emitter.emit("submitCheckboxData")},disableSubmitButton(){this.emitter&&this.emitter.on("checkboxes-selected",y=>{y.length>0?this.isDisabled=!1:this.isDisabled=!0}),this.getSubcatFilters.length>0&&(this.isDisabled=!1)}}},T2={class:"vs-main-map-controls","data-test":"vs-main-map-controls"};function A2(y,_,x,k,E,D){const u=q.resolveComponent("VsButton");return q.openBlock(),q.createElementBlock("div",T2,[q.createVNode(u,{class:"vs-main-map-controls__clear-selection","data-test":"vs-main-map-subcategory__clear-selection",size:"sm",variant:"secondary",onClick:D.clearSelection,onKeyup:q.withKeys(D.clearSelection,["enter"])},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(D.clearSelectionText),1)]),_:1},8,["onClick","onKeyup"]),q.createVNode(u,{class:"vs-main-map-controls__apply-filters","data-test":"vs-main-map-subcategory__apply-filters",size:"sm",onKeypress:q.withKeys(D.submitCheckboxes,["enter"]),onClick:D.submitCheckboxes,"aria-disabled":E.isDisabled,disabled:E.isDisabled},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(D.applyFiltersText),1)]),_:1},8,["onKeypress","onClick","aria-disabled","disabled"])])}const E2=wt._export_sfc(I2,[["render",A2]]);let Xd=null;const P2={name:"VsMapWithSidebarPanel",status:"prototype",release:"0.0.1",components:{VsButton:wt.VsButton,VsMapWithSidebarCategory:n2,VsMapWithSidebarSubcategory:u2,VsHeading:wt.VsHeading,VsMapWithSidebarListItem:f2,VsMapWithSidebarDetail:x2,VsMapWithSidebarButtons:S2,VsMapWithSidebarControls:E2},inject:["filters","filtersWithLocations","placesData","regions","mapId","focussedListItem"],props:{categoryHeading:{type:String,default:""},headingLevel:{type:String,default:"2"},selectedCategory:{type:String,default:""},selectedSubcategory:{type:String,default:null},currentStage:{type:Number,required:!0},selectedItem:{type:Object,default:null},hovered:{type:String,default:""},subcategoryLocations:{type:Array,default:null},currentEndpointData:{type:Array,default:()=>[]},panelStatus:{type:String,default:null},panelMessage:{type:String,default:null},totalPins:{type:Number,default:0},currentListItemFocus:{type:Number,default:0}},emits:["close-panel","load-more-places","set-stage","set-subcategory"],data(){return{placesLoaded:1}},computed:{currentHeading(){let y="";if(this.selectedSubcategory!==null)y=this.selectedSubcategoryData[0].label;else switch(this.currentStage){case 0:y=this.categoryHeading;break;case 1:case 2:y=this.currentFilter.label;break}return y},currentData(){return this.selectedCategory==="regions"?this.regions:this.placesData},panelClasses(){let y="";return this.currentStage===2&&(y+=" vs-map-with-sidebar-panel--small-padding"),y},headerClasses(){return this.currentStage===1?"vs-map-with-sidebar-panel__header-section--with-spacer":this.currentStage===2?"vs-map-with-sidebar-panel__header-section--overlapped":""},currentFilter(){let y="";return this.filters.forEach(_=>{_.id===this.selectedCategory&&(y=_)}),y},currentPlaceData(){let y=this.placesData;return this.selectedCategory==="regions"&&(y=this.regions),this.currentEndpointData.length>0?this.refineEndpointData(this.currentEndpointData):y.filter(_=>typeof _.properties<"u"&&this.selectedItem?_.properties.id===this.selectedItem.properties.id:!1)},selectedSubcategoryData(){return this.selectedSubcategory?this.filters.filter(_=>_.id===this.selectedSubcategory):[]},...pa.mapState(Sn,{subCatFilterCount(y){return y.activeSubcatFilters.length}}),detailHeadingLevel(){return(parseInt(this.headingLevel,10)+1).toString()},showLoadMore(){return!(this.subcategoryLocations.length>=this.totalPins||this.subcategoryLocations.length===0)}},watch:{currentFilter(){this.placesLoaded=1}},mounted(){Xd=Sn()},methods:{closePanel(){this.$emit("close-panel"),window.innerWidth>=1292&&this.currentStage===2&&this.$emit("set-subcategory",null)},stageBack(){if(this.selectedSubcategory&&this.currentStage===0)this.$emit("set-subcategory",null);else if(this.selectedSubcategory!==null&&this.subcategoryLocations===null)this.setStage(0);else{const y=this.currentStage-1;this.setStage(y)}},resetPanel(){Xd.setSelectedSubcat(null),this.setStage(0)},setStage(y){y===0&&(this.placesLoaded=1),this.$emit("set-stage",y)},subCatExists(y){return typeof y.subCategory<"u"&&y.subCategory.length>0},refineEndpointData(y){const _=[{isEndpoint:!0,properties:{category:y[0].category[0].id,id:y[0].id,image:y[0].images[0].mediaUrl,placeTitle:y[0].name,description:y[0].description,link:{label:y[0].productLink.label,link:y[0].productLink.link,type:y[0].productLink.type},website:{label:y[0].website.label,link:y[0].website.link,type:y[0].website.type},address:{shortAddress:""}}}];return typeof y[0].address<"u"&&(_[0].properties.address.shortAddress=y[0].address.shortAddress),_},clearSubCatFilters(){Xd.setActiveSubcatFilters([]),this.setStage(0)},loadMorePlaces(){this.placesLoaded+=1,this.$emit("load-more-places",this.placesLoaded)}}},C2={class:"vs-map-with-sidebar-panel__buttons d-lg-none"},k2={key:0,class:"vs-map-with-sidebar-panel__back"},M2={key:1,class:"vs-map-with-sidebar-panel__back"},B2={class:"vs-map-with-sidebar-panel__close"},z2={key:0,class:"vs-map-with-sidebar-panel__back d-none d-lg-block"},D2={key:2,class:"vs-map-with-sidebar-panel__bottom-message"},R2={class:"vs-map-with-sidebar-panel__list-container"},L2={key:3,class:"vs-map-with-sidebar-panel__overlay"},F2={key:0,class:"vs-map-with-sidebar-panel__overlay-box"},O2={class:"vs-map-with-sidebar-panel__overlay-text"};function V2(y,_,x,k,E,D){const u=q.resolveComponent("VsButton"),U=q.resolveComponent("VsHeading"),M=q.resolveComponent("VsMapWithSidebarSubcategory"),Y=q.resolveComponent("VsMapWithSidebarControls"),X=q.resolveComponent("VsMapWithSidebarCategory"),ae=q.resolveComponent("VsMapWithSidebarListItem"),J=q.resolveComponent("VsMapWithSidebarButtons"),Se=q.resolveComponent("VsMapWithSidebarDetail");return q.openBlock(),q.createElementBlock("section",{"data-test":"vs-map-with-sidebar-panel",class:q.normalizeClass(["vs-map-with-sidebar-panel",D.panelClasses])},[q.createElementVNode("div",{class:q.normalizeClass(["vs-map-with-sidebar-panel__header-section",D.headerClasses])},[q.createElementVNode("div",C2,[x.currentStage>1||x.selectedSubcategory?(q.openBlock(),q.createElementBlock("div",k2,[q.createVNode(u,{class:"vs-map-with-sidebar-panel_menu",icon:"vs-icon-control-menu",size:"sm",onClick:D.stageBack,"data-test":"vs-map-with-sidebar__menu-toggle",variant:"secondary"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"menu-btn-text")]),_:3},8,["onClick"])])):q.createCommentVNode("",!0),x.currentStage===1||x.selectedSubcategory?(q.openBlock(),q.createElementBlock("div",M2,[q.createVNode(u,{"icon-only":"",icon:"fa-regular fa-arrow-left",size:"md",variant:"subtle",onClick:D.stageBack,"data-test":"vs-map-with-sidebar-panel--btn-back"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"back-btn-text")]),_:3},8,["onClick"])])):q.createCommentVNode("",!0),q.createElementVNode("div",B2,[q.createVNode(u,{"icon-only":"",icon:"vs-icon-control-dismiss",size:"md",variant:"subtle",onClick:D.closePanel,"data-test":"vs-map-with-sidebar-panel--btn-close"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"close-side-panel-text")]),_:3},8,["onClick"])])]),x.currentStage>0||x.selectedSubcategory?(q.openBlock(),q.createElementBlock("div",z2,[q.createVNode(u,{"icon-only":"",icon:"fa-regular fa-arrow-left",size:"md",variant:"subtle",onClick:D.stageBack,"data-test":"vs-map-with-sidebar-panel--btn-back"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"back-btn-text")]),_:3},8,["onClick"])])):q.createCommentVNode("",!0),D.currentHeading!==""?(q.openBlock(),q.createBlock(U,{key:1,level:x.headingLevel,"heading-style":x.currentStage===0?"heading-m":"heading-xs",class:q.normalizeClass(["vs-map-with-sidebar-panel__heading text-center mt-200 mt-lg-0",x.currentStage===2?"d-none d-lg-block":""]),"data-test":"vs-map-with-sidebar-panel__heading"},{default:q.withCtx(()=>[q.createTextVNode(q.toDisplayString(D.currentHeading),1)]),_:1},8,["level","heading-style","class"])):q.createCommentVNode("",!0),q.createElementVNode("div",{class:q.normalizeClass(["vs-map-with-sidebar-panel__reset",x.currentStage<2?"d-lg-none":""])},[q.createVNode(u,{"icon-only":"",icon:"vs-icon-control-dismiss",size:"md",variant:"subtle",onClick:D.resetPanel,"data-test":"vs-map-with-sidebar-panel--btn-reset"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"reset-side-panel-text")]),_:3},8,["onClick"])],2)],2),x.currentStage===0?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[x.selectedSubcategory!==null?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[q.createVNode(M,{data:D.selectedSubcategoryData[0].subCategory,"selected-sub-category":x.selectedSubcategory},null,8,["data","selected-sub-category"]),q.createVNode(Y)],64)):(q.openBlock(!0),q.createElementBlock(q.Fragment,{key:1},q.renderList(D.filtersWithLocations,be=>(q.openBlock(),q.createBlock(X,{key:be.id,"category-name":be.label,type:be.id,"has-sub-cat":D.subCatExists(be)},null,8,["category-name","type","has-sub-cat"]))),128)),x.panelMessage!==null?(q.openBlock(),q.createElementBlock("div",D2,[q.createElementVNode("p",null,q.toDisplayString(x.panelMessage),1)])):q.createCommentVNode("",!0)],64)):q.createCommentVNode("",!0),x.currentStage===1?(q.openBlock(),q.createElementBlock(q.Fragment,{key:1},[x.selectedSubcategory!==null?(q.openBlock(),q.createElementBlock(q.Fragment,{key:0},[q.createElementVNode("div",R2,[(q.openBlock(!0),q.createElementBlock(q.Fragment,null,q.renderList(x.subcategoryLocations,(be,De)=>(q.openBlock(),q.createBlock(ae,{key:be.id,"item-data":be,"from-endpoint":!0,focussed:De===x.currentListItemFocus,onShowItemDetail:Ze=>y.showDetail(be)},null,8,["item-data","focussed","onShowItemDetail"]))),128)),D.showLoadMore?(q.openBlock(),q.createBlock(u,{key:0,class:"vs-map-with-sidebar-panel__load-more","data-test":"vs-map-with-sidebar-panel__load-more",onClick:_[0]||(_[0]=be=>D.loadMorePlaces()),onKeyup:_[1]||(_[1]=q.withKeys(be=>D.loadMorePlaces(),["enter"]))},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"load-more-text")]),_:3})):q.createCommentVNode("",!0)]),q.createVNode(J,{"content-data":{},"filter-count":y.subCatFilterCount,onClearFilters:D.clearSubCatFilters},null,8,["filter-count","onClearFilters"])],64)):(q.openBlock(!0),q.createElementBlock(q.Fragment,{key:1},q.renderList(D.currentData,be=>(q.openBlock(),q.createElementBlock("div",{key:be.id},[typeof be.properties<"u"&&be.properties.category.id===x.selectedCategory?(q.openBlock(),q.createBlock(ae,{key:0,"item-data":be,onShowItemDetail:De=>y.showDetail(be)},null,8,["item-data","onShowItemDetail"])):q.createCommentVNode("",!0)]))),128))],64)):q.createCommentVNode("",!0),x.currentStage===2?(q.openBlock(),q.createElementBlock(q.Fragment,{key:2},[q.createVNode(Se,{"heading-level":D.detailHeadingLevel,"content-data":D.currentPlaceData[0]},null,8,["heading-level","content-data"]),q.createVNode(J,{"content-data":D.currentPlaceData[0]},null,8,["content-data"])],64)):q.createCommentVNode("",!0),x.panelStatus!==null?(q.openBlock(),q.createElementBlock("div",L2,[y.$slots["panel-loading-message"]&&x.panelStatus!=="map-loading"?(q.openBlock(),q.createElementBlock("div",F2,[q.createElementVNode("p",O2,[q.renderSlot(y.$slots,"panel-loading-message")])])):q.createCommentVNode("",!0)])):q.createCommentVNode("",!0)],2)}const q2=wt._export_sfc(P2,[["render",V2]]);let bc=null;const U2={name:"VsMapWithSidebar",status:"deprecated",release:"0.0.1",components:{VsContainer:wt.VsContainer,VsRow:wt.VsRow,VsCol:wt.VsCol,VsMap:tb,VsButton:wt.VsButton,VsMapWithSidebarPanel:q2,VsButtonToggleGroup:wt.VsButtonToggleGroup,VsWarning:wt.VsWarning},provide(){return{filters:this.filters,filtersWithLocations:this.filtersWithLocations,placesData:this.placesData,mapId:this.mapId,regions:this.regionsData,clearSelectionText:this.clearSelectionText,applyFiltersText:this.applyFiltersText,subCatList:this.subCatList,filtersAppliedText:this.filtersAppliedText,clearFiltersText:this.clearFiltersText,focussedListItem:this.focussedListItem}},props:{categoryHeading:{type:String,default:""},filters:{type:Array,required:!0},placesData:{type:Array,required:!0},mapId:{type:String,required:!0},mainHeadingExists:{type:Boolean,default:!1},initialSelected:{type:String,default:""},toggleData:{type:Array,default:()=>[]},buttonsLabel:{type:String,default:""},clearSelectionText:{type:String,required:!0},applyFiltersText:{type:String,required:!0},detailsEndpoint:{type:String,default:""},regionBounds:{type:Object,default:()=>{}},clearFiltersText:{type:String,required:!0},filtersAppliedText:{type:String,required:!0},placeId:{type:String,default:null},mapFilterMessage:{type:String,required:!0},mapNoResultsMessage:{type:String,required:!0},panelMessage:{type:String,default:null},loadBrandingImmediately:{type:Boolean,default:!1}},data(){return{panelVisible:!1,selectedCategory:"",filterCategories:this.filters,selectedItem:null,activePins:this.placesData,currentlyHovered:"",showRegions:!1,regions:[],subCatList:null,selectedToggle:"",currentEndpointData:[],mapStatus:"",panelStatus:"map-loading",mapReady:!1,showPanelMessage:null,currentPanelEndpointFilters:"",totalEndpointPins:0,focussedListItem:0,resetZoom:!1,currentStage:0,selectedSubCategory:null}},computed:{mapDisplayClass(){return this.panelVisible?"d-none d-lg-block":""},panelDisplayClass(){return this.panelVisible?"":"d-none d-lg-block"},regionsData(){return this.placesData.filter(y=>y.geometry.type==="Polygon"||y.geometry.type==="MultiPolygon")},...pa.mapState(Sn,{subCatActiveFilters(y){return y.activeSubcatFilters}}),infoMessage(){let y="";switch(this.mapStatus){case"no-results":y=this.mapNoResultsMessage;break;case"filter-results":y=this.mapFilterMessage;break}return y},existingCategories(){return this.placesData?[...new Set(this.placesData.map(y=>y.properties.category.id))]:[]},filtersWithLocations(){return this.filters.filter(y=>!!(this.existingCategories.includes(y.id)||y.subCategory&&y.subCategory.length))},togglesWithLocations(){return this.existingCategories.indexOf("vics")===-1?this.toggleData.filter(y=>y.value!=="icentres"):this.toggleData}},watch:{selectedSubCategory(y){y===null&&(this.mapStatus="",this.resetZoom=!0)}},mounted(){bc=Sn(),this.selectedToggle=this.initialSelected,this.emitter&&this.emitter.on("clearSelectedSubcats",()=>{this.resetZoom=!0})},methods:{openMenu(){this.setStage(0),this.openPanel()},closePanel(){this.panelVisible=!1},openPanel(){this.panelVisible=!0},showDetail(y){document.fullscreenElement&&document.exitFullscreen(),this.selectedItem=y,this.setStage(2),this.openPanel(),this.selectedSubCategory===null&&this.filterPlaces(this.selectedCategory)},setCategory(y){this.selectedCategory=y,this.selectedSubCategory===null&&this.filterPlaces(y)},setSubCategory(y){bc.setSelectedSubcat(y),this.selectedSubCategory=y,y!==null?(this.getSubcatMarkerData(),this.selectedCategory=y):(bc.setActiveSubcatFilters([]),this.showAllPlaces())},filterSubCategories(y){let _="";y.forEach(x=>{const k=`&cat=${x}`;_+=k}),this.currentPanelEndpointFilters=_,this.getSubcatMarkerData(_),this.getSubcatPanelData(_,0)},getSubcatMarkerData(y){const _=this.filters.filter(x=>x.id===this.selectedSubCategory);if(_.length>0){let x=_[0].pinsEndpoint;typeof y<"u"&&(x+=y),this.activePins=[],typeof y>"u"?(this.activePins=[],this.mapStatus="filter-results"):wt.axios.get(x).then(k=>{this.totalEndpointPins=k.data.features.length,this.totalEndpointPins===0?this.mapStatus="no-results":(k.data.features.forEach(E=>{const D=E;D.properties.apiData=!0,this.activePins.push(D)}),this.mapStatus="")})}},getSubcatPanelData(y,_){let k=this.filters.filter(E=>E.id===this.selectedSubCategory)[0].listProductsEndPoint;typeof y<"u"&&(k+=y),_!==0&&(k+=`${y}&page=${_}`),this.panelStatus="loading-data",wt.axios.get(k).then(E=>{typeof E.data.data.products<"u"?(this.setStage(1),_===0?(this.subCatList=E.data.data.products,this.focussedListItem=0):(this.focussedListItem=_*24,this.subCatList=this.subCatList.concat(E.data.data.products))):this.mapStatus="no-results",this.panelStatus=null})},setStage(y){if(y===2&&this.detailsEndpoint!==""&&this.selectedSubCategory!==null){const _=`${this.detailsEndpoint}${this.selectedItem.properties.id}`;wt.axios.get(_).then(x=>{const k=[];k.push(x.data.data),this.currentEndpointData=k,this.currentStage=y})}else this.currentStage=y,this.currentStage===0?(this.currentEndpointData=[],this.selectedSubCategory===null?(this.resetZoom=!0,this.showAllPlaces(),this.mapStatus=""):this.getSubcatMarkerData(),this.selectedToggle="places"):this.currentStage===1&&this.selectedSubCategory===null&&this.filterPlaces(this.selectedCategory);y!==2&&(bc.setActivePlace({mapId:this.mapId,activeFeature:""}),this.selectedItem=null)},filterPlaces(y){if(y==="regions")this.showRegions=!0,this.activePins=[],this.selectedToggle="regions";else{this.showRegions=!1,this.selectedToggle="places";const _=this.placesData.filter(x=>typeof x.properties<"u"?x.properties.category.id===y:!1);this.activePins=_}},loadMorePlaces(y){this.getSubcatPanelData(this.currentPanelEndpointFilters,y)},showAllPlaces(){this.activePins=this.placesData,this.showRegions=!1},onToggleChanged(y){y==="regions"?(this.setCategory("regions"),this.setStage(1)):y==="icentres"?(this.setCategory("vics"),this.setStage(1)):y==="places-regional"?(this.setCategory("twnv"),this.setStage(1)):(this.showAllPlaces(),this.setStage(0))},setMapReady(y){this.mapReady=y,y?this.panelStatus=null:this.panelStatus="loading"},categoryHasData(y){return this.existingCategories.indexOf(y)!==-1}}};function N2(y,_,x,k,E,D){const u=q.resolveComponent("VsMapWithSidebarPanel"),U=q.resolveComponent("VsButton"),M=q.resolveComponent("VsMap"),Y=q.resolveComponent("VsButtonToggleGroup"),X=q.resolveComponent("VsWarning"),ae=q.resolveComponent("VsCol"),J=q.resolveComponent("VsRow"),Se=q.resolveComponent("VsContainer");return q.openBlock(),q.createBlock(Se,{"data-test":"vs-map-with-sidebar"},{default:q.withCtx(()=>[q.createVNode(J,null,{default:q.withCtx(()=>[q.createVNode(ae,null,{default:q.withCtx(()=>[q.createElementVNode("div",{class:"vs-map-with-sidebar",ref:x.mapId},[q.createElementVNode("div",{class:q.normalizeClass(["vs-map-with-sidebar__side-panel",D.panelDisplayClass]),"data-test":"vs-map-with-sidebar__side-panel"},[q.createVNode(u,{"category-heading":x.categoryHeading,"selected-category":E.selectedCategory,"selected-subcategory":E.selectedSubCategory,"current-stage":E.currentStage,"selected-item":E.selectedItem,"heading-level":x.mainHeadingExists?"3":"2","subcategory-locations":E.subCatList,"current-endpoint-data":E.currentEndpointData,"panel-status":E.panelStatus,"panel-message":E.currentStage===0?x.panelMessage:null,"total-pins":E.totalEndpointPins,"current-list-item-focus":E.focussedListItem,onSetCategory:D.setCategory,onSetSubcategory:D.setSubCategory,onSubcategoriesFiltered:D.filterSubCategories,onSetStage:D.setStage,onClosePanel:D.closePanel,onShowItemDetail:D.showDetail,onFilterPlaces:D.filterPlaces,onLoadMorePlaces:D.loadMorePlaces},{closePanelText:q.withCtx(()=>[q.renderSlot(y.$slots,"close-side-panel-text")]),"reset-side-panel-text":q.withCtx(()=>[q.renderSlot(y.$slots,"reset-side-panel-text")]),"menu-btn-text":q.withCtx(()=>[q.renderSlot(y.$slots,"menu-btn-text")]),"panel-loading-message":q.withCtx(()=>[q.renderSlot(y.$slots,"panel-loading-message")]),"load-more-text":q.withCtx(()=>[q.renderSlot(y.$slots,"load-more-text")]),_:3},8,["category-heading","selected-category","selected-subcategory","current-stage","selected-item","heading-level","subcategory-locations","current-endpoint-data","panel-status","panel-message","total-pins","current-list-item-focus","onSetCategory","onSetSubcategory","onSubcategoriesFiltered","onSetStage","onClosePanel","onShowItemDetail","onFilterPlaces","onLoadMorePlaces"])],2),q.createElementVNode("div",{class:q.normalizeClass(["vs-map-with-sidebar__map",D.mapDisplayClass])},[q.createVNode(U,{class:"vs-map-with-sidebar__map-toggle",icon:"vs-icon-control-menu",size:"sm",onClick:D.openMenu,"data-test":"vs-map-with-sidebar__map-toggle",variant:"secondary"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"open-side-panel-text")]),_:3},8,["onClick"]),q.createVNode(M,{"is-visible":!E.panelVisible,labels:{},filters:D.filtersWithLocations,places:E.activePins,"selected-item":E.selectedItem,"map-id":x.mapId,"show-polygons":E.showRegions,"show-info-message":E.mapStatus!=="",onShowDetail:D.showDetail,onSetCategory:D.setCategory,onMapReady:D.setMapReady,onZoomReset:_[0]||(_[0]=be=>E.resetZoom=!1),"bounds-data":x.regionBounds,"reset-zoom":E.resetZoom,"show-marker-popups":!1,"load-branding-immediately":x.loadBrandingImmediately},{"map-loading-text":q.withCtx(()=>[q.renderSlot(y.$slots,"map-loading-text")]),"info-message":q.withCtx(()=>[q.createTextVNode(q.toDisplayString(D.infoMessage),1)]),"zoom-too-close":q.withCtx(()=>[q.renderSlot(y.$slots,"zoom-too-close")]),"zoom-too-far":q.withCtx(()=>[q.renderSlot(y.$slots,"zoom-too-far")]),"no-js":q.withCtx(()=>[q.renderSlot(y.$slots,"no-js")]),_:3},8,["is-visible","filters","places","selected-item","map-id","show-polygons","show-info-message","onShowDetail","onSetCategory","onMapReady","bounds-data","reset-zoom","load-branding-immediately"]),D.togglesWithLocations.length>1?(q.openBlock(),q.createBlock(Y,{key:0,"data-test":"vs-map-with-sidebar__map-toggle-group","initial-selected":E.selectedToggle,options:D.togglesWithLocations,"buttons-label":x.buttonsLabel,onToggleChanged:D.onToggleChanged},null,8,["initial-selected","options","buttons-label","onToggleChanged"])):q.createCommentVNode("",!0)],2)],512),q.createVNode(X,{class:"vs-map-with-sidebar__no-js"},{default:q.withCtx(()=>[q.renderSlot(y.$slots,"no-js")]),_:3})]),_:3})]),_:3})]),_:3})}const j2=wt._export_sfc(U2,[["render",N2]]);exports.VsMap=tb;exports.VsMapMarker=eb;exports.VsMapMarkerIcon=Ec;exports.VsMapWithSidebar=j2;
@@ -1,4 +1,4 @@
1
- import { aq as Bx, aM as Rx, aN as Qn, _ as ea, ab as fm, au as r1, ao as Lx, ap as i1, aO as n1, an as a1, ai as Fx, aa as Ox, a8 as Uc, aL as o1, ag as s1, af as u1, ae as l1, aj as Lp } from "./LoadingSpinner-ggrZC9Iu.mjs";
1
+ import { aq as Bx, aM as Rx, aN as Qn, _ as ea, ab as fm, ar as r1, ao as Lx, ap as i1, aO as n1, an as a1, ai as Fx, aa as Ox, a8 as Uc, aL as o1, ag as s1, af as u1, ae as l1, aj as Lp } from "./LoadingSpinner-AJLMaxu0.mjs";
2
2
  import { ref as pl, resolveComponent as lr, openBlock as St, createElementBlock as er, normalizeClass as zn, createVNode as vr, createElementVNode as Si, createTextVNode as Dn, toDisplayString as Fi, createBlock as bn, withKeys as fl, createCommentVNode as ai, renderSlot as Jr, withCtx as ar, h as c1, render as p1, Fragment as Mn, renderList as Fc } from "vue";
3
3
  import { defineStore as h1, mapState as os } from "pinia";
4
4
  let as = null;
@@ -19759,7 +19759,7 @@ function B2(y, _, x, k, E, B) {
19759
19759
  class: "vs-map__loading"
19760
19760
  })) : ai("", !0),
19761
19761
  Si("p", M2, [
19762
- E.isLoading ? Jr(y.$slots, "map-loading-text", { key: 0 }) : x.showInfoMessage ? Jr(y.$slots, "info-message", { key: 1 }) : E.showZoomMessage === "too-close" ? Jr(y.$slots, "zoom-too-close", { key: 2 }) : E.showZoomMessage === "too-far" ? Jr(y.$slots, "zoom-too-far", { key: 3 }) : ai("", !0)
19762
+ E.isLoading ? Jr(y.$slots, "map-loading-text", {}, void 0, void 0, 0) : x.showInfoMessage ? Jr(y.$slots, "info-message", {}, void 0, void 0, 1) : E.showZoomMessage === "too-close" ? Jr(y.$slots, "zoom-too-close", {}, void 0, void 0, 2) : E.showZoomMessage === "too-far" ? Jr(y.$slots, "zoom-too-far", {}, void 0, void 0, 3) : ai("", !0)
19763
19763
  ])
19764
19764
  ])
19765
19765
  ], 2)) : ai("", !0),