1import{Controller}from"@hotwired/stimulus";export default class extends Controller{static get targets(){return["frame","venueCardInner","cardArrowBtn"]}static get classes(){return["active"]}connect(){window.mapkit&&0!==window.mapkit.loadedLibraries.length?this.loadWhenAvailable():(this.mapKitLoadedHandler=()=>this.loadWhenAvailable(),document.addEventListener("MapKitLoaded",this.mapKitLoadedHandler))}disconnect(){this.mapKitLoadedHandler&&(document.removeEventListener("MapKitLoaded",this.mapKitLoadedHandler),this.mapKitLoadedHandler=null),this.teardownMap()}teardownMap(){this.map&&(this.map.destroy(),this.map=null),this.frameTarget.innerHTML=""}loadWhenAvailable(){this.teardownMap();const e=this.venueCardInnerTargets.map(function(e){const t=new window.mapkit.MarkerAnnotation(new window.mapkit.Coordinate(parseFloat(e.dataset.latitude),parseFloat(e.dataset.longitude)),{color:"#ED2273",id:e.id});return t.landmark=e,t}),t=new window.mapkit.Map(this.frameTarget);this.map=t,t.showItems(e),t.showsCompass=window.mapkit.FeatureVisibility.Hidden,1===this.venueCardInnerTargets.length&&(t._impl.zoomLevel=this.venueCardInnerTarget.dataset.zoom),t.addEventListener("select",e=>{const t=e.annotation.landmark;this.updateVenueCard(t)}),e[0].selected=!0,this.cardArrowBtnTargets.forEach(t=>{t.addEventListener("click",a=>{a.preventDefault(),e.forEach(e=>{e.selected=!1}),e[t.dataset.targetIndex].selected=!0})})}updateVenueCard(e){this.venueCardInnerTargets.forEach(t=>{t.classList.remove(this.activeClass),e.id===t.id&&t.classList.add(this.activeClass)})}}
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.