@visitscotland/component-library 5.53.1 → 5.55.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.
- package/dist/components/LoadingSpinner-DV2HOq5V.js +41 -0
- package/dist/components/LoadingSpinner-DWuFTQ1G.mjs +13673 -0
- package/dist/components/src/components/accordion/components/AccordionItem.vue.d.ts +4 -0
- package/dist/components/src/components/accordion/components/AccordionToggle.vue.d.ts +2 -0
- package/dist/components/src/components/address/Address.vue.d.ts +2 -0
- package/dist/components/src/components/alert/Alert.vue.d.ts +2 -0
- package/dist/components/src/components/article-details/ArticleDetails.vue.d.ts +2 -0
- package/dist/components/src/components/banner/Banner.vue.d.ts +4 -0
- package/dist/components/src/components/button/Button.vue.d.ts +2 -0
- package/dist/components/src/components/button-toggle-group/ButtonToggleGroup.vue.d.ts +2 -0
- package/dist/components/src/components/canned-search/CannedSearch.vue.d.ts +8 -0
- package/dist/components/src/components/canned-search/components/CannedSearchLogos.vue.d.ts +2 -0
- package/dist/components/src/components/canned-search/components/CannedSearchProductCard.vue.d.ts +2 -0
- package/dist/components/src/components/canned-search/components/CannedSearchSummaryBox.vue.d.ts +2 -0
- package/dist/components/src/components/caption/Caption.vue.d.ts +2 -0
- package/dist/components/src/components/carbon-calculator/CarbonCalculator.vue.d.ts +16 -0
- package/dist/components/src/components/carbon-calculator/components/CarbonCalculatorQuestion.vue.d.ts +2 -0
- package/dist/components/src/components/carbon-calculator/components/CarbonCalculatorResults.vue.d.ts +4 -0
- package/dist/components/src/components/carbon-calculator/components/CarbonCalculatorRunningTotal.vue.d.ts +2 -0
- package/dist/components/src/components/carbon-calculator/components/CarbonCalculatorTip.vue.d.ts +2 -0
- package/dist/components/src/components/card/Card.vue.d.ts +2 -0
- package/dist/components/src/components/carousel/Carousel.vue.d.ts +2 -0
- package/dist/components/src/components/carousel/components/CarouselSlide.vue.d.ts +10 -0
- package/dist/components/src/components/content-swiper/ContentSwiper.vue.d.ts +1656 -0
- package/dist/components/src/components/content-swiper/components/ContentSwiperSlide.d.ts +2 -0
- package/dist/components/src/components/detail/Detail.vue.d.ts +2 -0
- package/dist/components/src/components/dropdown/Dropdown.vue.d.ts +6 -6
- package/dist/components/src/components/embed-wrapper/EmbedWrapper.vue.d.ts +4 -0
- package/dist/components/src/components/event-card/EventCard.vue.d.ts +2 -0
- package/dist/components/src/components/footer/components/FooterAccordionItem.vue.d.ts +4 -0
- package/dist/components/src/components/footer/components/FooterCopyright.vue.d.ts +2 -0
- package/dist/components/src/components/footer/components/FooterNavListItem.vue.d.ts +2 -0
- package/dist/components/src/components/footer/components/FooterSocialItem.vue.d.ts +4 -0
- package/dist/components/src/components/form/Form.vue.d.ts +8 -0
- package/dist/components/src/components/global-menu/components/GlobalMenuLanguage.vue.d.ts +8 -6
- package/dist/components/src/components/hero-section/HeroSection.vue.d.ts +8 -0
- package/dist/components/src/components/icon/Icon.vue.d.ts +2 -0
- package/dist/components/src/components/icon-list/components/IconListItem.vue.d.ts +2 -0
- package/dist/components/src/components/image-with-caption/ImageWithCaption.vue.d.ts +14 -0
- package/dist/components/src/components/index.d.ts +2 -0
- package/dist/components/src/components/input/Input.vue.d.ts +2 -0
- package/dist/components/src/components/itineraries/Itinerary.vue.d.ts +2 -0
- package/dist/components/src/components/itineraries/components/ItineraryDay.vue.d.ts +6 -0
- package/dist/components/src/components/itineraries/components/ItineraryStop.vue.d.ts +4 -0
- package/dist/components/src/components/itineraries/components/ItineraryStopInfo.vue.d.ts +4 -0
- package/dist/components/src/components/link/Link.vue.d.ts +2 -0
- package/dist/components/src/components/link-list/components/LinkListItem.vue.d.ts +2 -0
- package/dist/components/src/components/listicle/ListicleItem.vue.d.ts +2 -0
- package/dist/components/src/components/map/Map.vue.d.ts +4 -0
- package/dist/components/src/components/map/components/MapMarker.vue.d.ts +2 -0
- package/dist/components/src/components/map-marker-icon/MapMarkerIcon.vue.d.ts +2 -0
- package/dist/components/src/components/map-with-sidebar/MapWithSidebar.vue.d.ts +26 -0
- package/dist/components/src/components/map-with-sidebar/components/MapWithSidebarButtons.vue.d.ts +2 -0
- package/dist/components/src/components/map-with-sidebar/components/MapWithSidebarCategory.vue.d.ts +4 -0
- package/dist/components/src/components/map-with-sidebar/components/MapWithSidebarControls.vue.d.ts +2 -0
- package/dist/components/src/components/map-with-sidebar/components/MapWithSidebarListItem.vue.d.ts +2 -0
- package/dist/components/src/components/map-with-sidebar/components/MapWithSidebarPanel.vue.d.ts +14 -0
- package/dist/components/src/components/map-with-sidebar/components/MapWithSidebarSubcategory.vue.d.ts +2 -0
- package/dist/components/src/components/mega-nav/MegaNav.vue.d.ts +14 -0
- package/dist/components/src/components/mega-nav/components/MegaNavAccordionItem.vue.d.ts +6 -0
- package/dist/components/src/components/mega-nav/components/MegaNavDropdown.vue.d.ts +8 -6
- package/dist/components/src/components/mega-nav/components/MegaNavDropdownContainer.vue.d.ts +10 -6
- package/dist/components/src/components/mega-nav/components/MegaNavFeaturedEvent.vue.d.ts +8 -0
- package/dist/components/src/components/mega-nav/components/MegaNavFeaturedItem.vue.d.ts +8 -0
- package/dist/components/src/components/mega-nav/components/MegaNavListItem.vue.d.ts +2 -0
- package/dist/components/src/components/mega-nav/components/MegaNavStaticLink.vue.d.ts +2 -0
- package/dist/components/src/components/megalinks/Megalinks.vue.d.ts +2 -0
- package/dist/components/src/components/megalinks/components/megalink-link-list/MegalinkLinkList.vue.d.ts +10 -0
- package/dist/components/src/components/megalinks/components/megalink-multi-image/MegalinkMultiImage.vue.d.ts +10 -0
- package/dist/components/src/components/megalinks/components/megalink-single-image/MegalinkSingleImage.vue.d.ts +2 -0
- package/dist/components/src/components/modal/Modal.vue.d.ts +2 -0
- package/dist/components/src/components/navigation-bar/NavigationBar.vue.d.ts +6 -0
- package/dist/components/src/components/navigation-bar/components/NavigationBarMenuDropdown.vue.d.ts +6 -6
- package/dist/components/src/components/navigation-bar/components/NavigationBarSearch.vue.d.ts +8 -0
- package/dist/components/src/components/navigation-bar/components/NavigationBarSidebar.vue.d.ts +2 -0
- package/dist/components/src/components/navigation-bar/components/NavigationBarSidebarButton.vue.d.ts +4 -0
- package/dist/components/src/components/number-input/NumberInput.vue.d.ts +2 -0
- package/dist/components/src/components/pagination/VsPagination.vue.d.ts +2 -2
- package/dist/components/src/components/product-search/ProductSearch.vue.d.ts +4 -0
- package/dist/components/src/components/site-search/SiteSearch.vue.d.ts +2 -0
- package/dist/components/src/components/site-search/components/SiteSearchForm.vue.d.ts +6 -0
- package/dist/components/src/components/ski-scotland/ski-scotland-card/SkiScotlandCard.vue.d.ts +8 -0
- package/dist/components/src/components/ski-scotland/ski-scotland-status/SkiScotlandStatus.vue.d.ts +14 -0
- package/dist/components/src/components/skip-to/SkipTo.vue.d.ts +2 -0
- package/dist/components/src/components/social-credit-link/SocialCreditLink.vue.d.ts +4 -0
- package/dist/components/src/components/social-share/SocialShare.vue.d.ts +8 -6
- package/dist/components/src/components/social-share/components/SocialShareItem.vue.d.ts +4 -0
- package/dist/components/src/components/spotlight-section/SpotlightSection.vue.d.ts +2 -0
- package/dist/components/src/components/stretched-link-card/StretchedLinkCard.vue.d.ts +8 -0
- package/dist/components/src/components/stretched-link-card/components/StretchedLinkPanels.vue.d.ts +2 -0
- package/dist/components/src/components/summary-box/components/SummaryBoxListItem.vue.d.ts +2 -0
- package/dist/components/src/components/svg-link/SvgLink.vue.d.ts +2 -0
- package/dist/components/src/components/tag/Tag.vue.d.ts +2 -0
- package/dist/components/src/components/toggle-button/ToggleButton.vue.d.ts +4 -0
- package/dist/components/src/components/tooltip/Tooltip.vue.d.ts +2 -0
- package/dist/components/src/components/video/Video.vue.d.ts +8 -0
- package/dist/components/src/components/video/components/VideoHtml5.vue.d.ts +4 -0
- package/dist/components/src/components/video/components/VideoYoutube.vue.d.ts +4 -0
- package/dist/components/src/components/video-caption/VideoCaption.vue.d.ts +10 -0
- package/dist/components/src/components/warning/Warning.vue.d.ts +4 -0
- package/dist/components/src/custom-components/maps/MainMap.vue.d.ts +2 -2
- package/dist/components/src/custom-components/maps/index.d.ts +2 -2
- package/dist/components/style.css +1 -1
- package/dist/components/vs-component-library-maps.js +28 -28
- package/dist/components/vs-component-library-maps.mjs +4147 -4126
- package/dist/components/vs-component-library.js +9 -9
- package/dist/components/vs-component-library.mjs +8109 -4115
- package/package.json +2 -1
- package/dist/components/LoadingSpinner-D0Xf9MWc.mjs +0 -13477
- package/dist/components/LoadingSpinner-GwEp7vJg.js +0 -41
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const st=require("./LoadingSpinner-GwEp7vJg.js"),F=require("vue"),aa=require("pinia");let Ka=null;typeof window<"u"&&(Ka=document.currentScript);const dy={options:{div:"map",logo:"os-logo-maps",statement:"Contains OS data © Crown copyright and database rights YYYY",prefix:"",suffix:""},init(d){if(typeof window<"u"){Ka&&(this.options.div=Ka.getAttribute("data-div")||this.options.div,this.options.logo=Ka.getAttribute("data-logo")||this.options.logo,this.options.statement=Ka.getAttribute("data-statement")||this.options.statement,this.options.prefix=Ka.getAttribute("data-prefix")||this.options.prefix,this.options.suffix=Ka.getAttribute("data-suffix")||this.options.suffix),d=typeof d<"u"?d:{},Object.assign(this.options,d);const h=document.getElementById(this.options.div);let _="os-api-branding logo";this.options.logo==="os-logo-maps-white"&&(_="os-api-branding logo white");let E=this.options.statement;E=E.replace("YYYY",new Date().getFullYear()),this.options.prefix!==""&&(E=`${this.options.prefix}<span>|</span>${E}`),this.options.suffix!==""&&(E=`${E}<span>|</span>${this.options.suffix}`),document.querySelectorAll(`#${this.options.div} .os-api-branding`).forEach(l=>l.remove());const k=document.createElement("div");k.className=_,h.appendChild(k);const V=document.createElement("div");V.className="os-api-branding copyright",V.innerHTML=E,h.appendChild(V)}}},Xi=aa.defineStore("map",()=>{const d=F.ref([]),h=F.ref([]),_=F.ref(null),E=F.ref(null),k=F.ref(null);function V(ke){d.value.push({id:ke.id,filters:ke.filters,places:ke.places,activePins:ke.activePins,hovered:"",activePlace:null})}function l(ke){d.value.forEach(Xe=>{Xe.id===ke.mapId&&(Xe.hovered=ke.hoveredFeature)})}function re(ke){d.value.forEach(Xe=>{Xe.id===ke.mapId&&(Xe.activePlace=ke.activeFeature)})}function G(ke){h.value=ke}function me(ke){_.value=ke}function pe(ke){E.value=ke}function Ce(ke){return d.value.find(Xe=>Xe.id===ke)}function ae(ke){return d.value.find($e=>$e.id===ke).hovered}function ve(ke){return d.value.find($e=>$e.id===ke).activePlace}return{maps:d,activeSubcatFilters:h,selectedSubCategory:_,activeMarkerPos:E,activePlace:k,addMapInstance:V,setHoveredPlace:l,setActivePlace:re,setActiveSubcatFilters:G,setSelectedSubcat:me,setActiveMarkerPos:pe,getMapById:Ce,getHoveredStop:ae,getActivePlace:ve}});var Xg={exports:{}};(function(d,h){(function(_,E){d.exports=E()})(st.commonjsGlobal,function(){var _,E,k;function V(l,re){if(!_)_=re;else if(!E)E=re;else{var G="var sharedChunk = {}; ("+_+")(sharedChunk); ("+E+")(sharedChunk);",me={};_(me),k=re(me),typeof window<"u"&&(k.workerUrl=window.URL.createObjectURL(new Blob([G],{type:"text/javascript"})))}}return V(["exports"],function(l){function re(e,t){return e(t={exports:{}},t.exports),t.exports}var G=me;function me(e,t,r,a){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(a-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=a,this.p2x=r,this.p2y=a}me.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},me.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},me.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},me.prototype.solveCurveX=function(e,t){var r,a,u,c,f;for(t===void 0&&(t=1e-6),u=e,f=0;f<8;f++){if(c=this.sampleCurveX(u)-e,Math.abs(c)<t)return u;var v=this.sampleCurveDerivativeX(u);if(Math.abs(v)<1e-6)break;u-=c/v}if((u=e)<(r=0))return r;if(u>(a=1))return a;for(;r<a;){if(c=this.sampleCurveX(u),Math.abs(c-e)<t)return u;e>c?r=u:a=u,u=.5*(a-r)+r}return u},me.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var pe=Ce;function Ce(e,t){this.x=e,this.y=t}Ce.prototype={clone:function(){return new Ce(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),a=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=a,this},_rotateAround:function(e,t){var r=Math.cos(e),a=Math.sin(e),u=t.y+a*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-a*(this.y-t.y),this.y=u,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},Ce.convert=function(e){return e instanceof Ce?e:Array.isArray(e)?new Ce(e[0],e[1]):e};var ae=typeof self<"u"?self:{},ve=Math.pow(2,53)-1;function ke(e,t,r,a){var u=new G(e,t,r,a);return function(c){return u.solve(c)}}var Xe=ke(.25,.1,.25,1);function $e(e,t,r){return Math.min(r,Math.max(t,e))}function At(e,t,r){var a=r-t,u=((e-t)%a+a)%a+t;return u===t?r:u}function et(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var a=0,u=t;a<u.length;a+=1){var c=u[a];for(var f in c)e[f]=c[f]}return e}var dt=1;function Rt(){return dt++}function Gt(){return function e(t){return t?(t^16*Math.random()>>t/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()}function Qt(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function fr(e,t){e.forEach(function(r){t[r]&&(t[r]=t[r].bind(t))})}function Er(e,t){return e.indexOf(t,e.length-t.length)!==-1}function dr(e,t,r){var a={};for(var u in e)a[u]=t.call(r||this,e[u],u,e);return a}function ei(e,t,r){var a={};for(var u in e)t.call(r||this,e[u],u,e)&&(a[u]=e[u]);return a}function wr(e){return Array.isArray(e)?e.map(wr):typeof e=="object"&&e?dr(e,wr):e}var Si={};function Ft(e){Si[e]||(typeof console<"u"&&console.warn(e),Si[e]=!0)}function Pr(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function Bo(e){for(var t=0,r=0,a=e.length,u=a-1,c=void 0,f=void 0;r<a;u=r++)t+=((f=e[u]).x-(c=e[r]).x)*(c.y+f.y);return t}function li(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function Do(e){var t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(a,u,c,f){var v=c||f;return t[u]=!v||v.toLowerCase(),""}),t["max-age"]){var r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t}var Lo=null;function ns(e){if(Lo==null){var t=e.navigator?e.navigator.userAgent:null;Lo=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return Lo}function xn(e){try{var t=ae[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch{return!1}}var Oi,Ki,Hn,Xn,bn=ae.performance&&ae.performance.now?ae.performance.now.bind(ae.performance):Date.now.bind(Date),_l=ae.requestAnimationFrame||ae.mozRequestAnimationFrame||ae.webkitRequestAnimationFrame||ae.msRequestAnimationFrame,jr=ae.cancelAnimationFrame||ae.mozCancelAnimationFrame||ae.webkitCancelAnimationFrame||ae.msCancelAnimationFrame,ln={now:bn,frame:function(e){var t=_l(e);return{cancel:function(){return jr(t)}}},getImageData:function(e,t){t===void 0&&(t=0);var r=ae.document.createElement("canvas"),a=r.getContext("2d");if(!a)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,a.drawImage(e,0,0,e.width,e.height),a.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:function(e){return Oi||(Oi=ae.document.createElement("a")),Oi.href=e,Oi.href},hardwareConcurrency:ae.navigator&&ae.navigator.hardwareConcurrency||4,get devicePixelRatio(){return ae.devicePixelRatio},get prefersReducedMotion(){return!!ae.matchMedia&&(Ki==null&&(Ki=ae.matchMedia("(prefers-reduced-motion: reduce)")),Ki.matches)}},Ot={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Ji={supported:!1,testSupport:function(e){!Ro&&Xn&&(Vi?yt(e):Hn=e)}},Ro=!1,Vi=!1;function yt(e){var t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,Xn),e.isContextLost())return;Ji.supported=!0}catch{}e.deleteTexture(t),Ro=!0}ae.document&&((Xn=ae.document.createElement("img")).onload=function(){Hn&&yt(Hn),Hn=null,Vi=!0},Xn.onerror=function(){Ro=!0,Hn=null},Xn.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var wn="01",ti=function(e,t){this._transformRequestFn=e,this._customAccessToken=t,this._createSkuToken()};function Ti(e){return e.indexOf("mapbox:")===0}ti.prototype._createSkuToken=function(){var e=function(){for(var t="",r=0;r<10;r++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",wn,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt},ti.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},ti.prototype.transformRequest=function(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}},ti.prototype.normalizeStyleURL=function(e,t){if(!Ti(e))return e;var r=Ii(e);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},ti.prototype.normalizeGlyphsURL=function(e,t){if(!Ti(e))return e;var r=Ii(e);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},ti.prototype.normalizeSourceURL=function(e,t){if(!Ti(e))return e;var r=Ii(e);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||t)},ti.prototype.normalizeSpriteURL=function(e,t,r,a){var u=Ii(e);return Ti(e)?(u.path="/styles/v1"+u.path+"/sprite"+t+r,this._makeAPIURL(u,this._customAccessToken||a)):(u.path+=""+t+r,Kn(u))},ti.prototype.normalizeTileURL=function(e,t){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!Ti(e))return e;var r=Ii(e);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(ln.devicePixelRatio>=2||t===512?"@2x":"")+(Ji.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var a=this._customAccessToken||function(u){for(var c=0,f=u;c<f.length;c+=1){var v=f[c].match(/^access_token=(.*)$/);if(v)return v[1]}return null}(r.params)||Ot.ACCESS_TOKEN;return Ot.REQUIRE_ACCESS_TOKEN&&a&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,a)},ti.prototype.canonicalizeTileURL=function(e,t){var r=Ii(e);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return e;var a="mapbox://tiles/";a+=r.path.replace("/v4/","");var u=r.params;return t&&(u=u.filter(function(c){return!c.match(/^access_token=/)})),u.length&&(a+="?"+u.join("&")),a},ti.prototype.canonicalizeTileset=function(e,t){for(var r=!!t&&Ti(t),a=[],u=0,c=e.tiles||[];u<c.length;u+=1){var f=c[u];Ui(f)?a.push(this.canonicalizeTileURL(f,r)):a.push(f)}return a},ti.prototype._makeAPIURL=function(e,t){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",a=Ii(Ot.API_URL);if(e.protocol=a.protocol,e.authority=a.authority,e.protocol==="http"){var u=e.params.indexOf("secure");u>=0&&e.params.splice(u,1)}if(a.path!=="/"&&(e.path=""+a.path+e.path),!Ot.REQUIRE_ACCESS_TOKEN)return Kn(e);if(!(t=t||Ot.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if(t[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return e.params=e.params.filter(function(c){return c.indexOf("access_token")===-1}),e.params.push("access_token="+t),Kn(e)};var xl=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Ui(e){return xl.test(e)}var pa=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Ii(e){var t=e.match(pa);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function Kn(e){var t=e.params.length?"?"+e.params.join("&"):"";return e.protocol+"://"+e.authority+e.path+t}function Fo(e){if(!e)return null;var t=e.split(".");if(!t||t.length!==3)return null;try{return JSON.parse(decodeURIComponent(ae.atob(t[1]).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join("")))}catch{return null}}var Ai=function(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};Ai.prototype.getStorageKey=function(e){var t,r=Fo(Ot.ACCESS_TOKEN);return t=r&&r.u?ae.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,function(a,u){return String.fromCharCode(+("0x"+u))})):Ot.ACCESS_TOKEN||"",e?"mapbox.eventData."+e+":"+t:"mapbox.eventData:"+t},Ai.prototype.fetchEventData=function(){var e=xn("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{var a=ae.localStorage.getItem(t);a&&(this.eventData=JSON.parse(a));var u=ae.localStorage.getItem(r);u&&(this.anonId=u)}catch{Ft("Unable to read from LocalStorage")}},Ai.prototype.saveEventData=function(){var e=xn("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{ae.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&ae.localStorage.setItem(t,JSON.stringify(this.eventData))}catch{Ft("Unable to write to LocalStorage")}},Ai.prototype.processRequests=function(e){},Ai.prototype.postEvent=function(e,t,r,a){var u=this;if(Ot.EVENTS_URL){var c=Ii(Ot.EVENTS_URL);c.params.push("access_token="+(a||Ot.ACCESS_TOKEN||""));var f={event:this.type,created:new Date(e).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.3",skuId:wn,userId:this.anonId},v=t?et(f,t):f,x={url:Kn(c),headers:{"Content-Type":"text/plain"},body:JSON.stringify([v])};this.pendingRequest=or(x,function(b){u.pendingRequest=null,r(b),u.saveEventData(),u.processRequests(a)})}},Ai.prototype.queueRequest=function(e,t){this.queue.push(e),this.processRequests(t)};var Ei,Jn,Ni=function(e){function t(){e.call(this,"map.load"),this.success={},this.skuToken=""}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.postMapLoadEvent=function(r,a,u,c){this.skuToken=u;var f=!(!c&&!Ot.ACCESS_TOKEN),v=Array.isArray(r)&&r.some(function(x){return Ti(x)||Ui(x)});Ot.EVENTS_URL&&f&&v&&this.queueRequest({id:a,timestamp:Date.now()},c)},t.prototype.processRequests=function(r){var a=this;if(!this.pendingRequest&&this.queue.length!==0){var u=this.queue.shift(),c=u.id,f=u.timestamp;c&&this.success[c]||(this.anonId||this.fetchEventData(),Qt(this.anonId)||(this.anonId=Gt()),this.postEvent(f,{skuToken:this.skuToken},function(v){v||c&&(a.success[c]=!0)},r))}},t}(Ai),os=new(function(e){function t(r){e.call(this,"appUserTurnstile"),this._customAccessToken=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.postTurnstileEvent=function(r,a){Ot.EVENTS_URL&&Ot.ACCESS_TOKEN&&Array.isArray(r)&&r.some(function(u){return Ti(u)||Ui(u)})&&this.queueRequest(Date.now(),a)},t.prototype.processRequests=function(r){var a=this;if(!this.pendingRequest&&this.queue.length!==0){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var u=Fo(Ot.ACCESS_TOKEN),c=u?u.u:Ot.ACCESS_TOKEN,f=c!==this.eventData.tokenU;Qt(this.anonId)||(this.anonId=Gt(),f=!0);var v=this.queue.shift();if(this.eventData.lastSuccess){var x=new Date(this.eventData.lastSuccess),b=new Date(v),S=(v-this.eventData.lastSuccess)/864e5;f=f||S>=1||S<-1||x.getDate()!==b.getDate()}else f=!0;if(!f)return this.processRequests();this.postEvent(v,{"enabled.telemetry":!1},function(T){T||(a.eventData.lastSuccess=v,a.eventData.tokenU=c)},r)}},t}(Ai)),as=os.postTurnstileEvent.bind(os),ha=new Ni,fa=ha.postMapLoadEvent.bind(ha),Oo=500,ss=50;function Vo(){ae.caches&&!Ei&&(Ei=ae.caches.open("mapbox-tiles"))}function da(e){var t=e.indexOf("?");return t<0?e:e.slice(0,t)}var Yn,ma=1/0;function ya(){return Yn==null&&(Yn=ae.OffscreenCanvas&&new ae.OffscreenCanvas(1,1).getContext("2d")&&typeof ae.createImageBitmap=="function"),Yn}var ls={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(ls);var us=function(e){function t(r,a,u){a===401&&Ui(u)&&(r+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),e.call(this,r),this.status=a,this.url=u,this.name=this.constructor.name,this.message=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},t}(Error),Qn=li()?function(){return self.worker&&self.worker.referrer}:function(){return(ae.location.protocol==="blob:"?ae.parent:ae).location.href},un,cn,Uo=function(e,t){if(!(/^file:/.test(r=e.url)||/^file:/.test(Qn())&&!/^\w+:/.test(r))){if(ae.fetch&&ae.Request&&ae.AbortController&&ae.Request.prototype.hasOwnProperty("signal"))return function(a,u){var c,f=new ae.AbortController,v=new ae.Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,referrer:Qn(),signal:f.signal}),x=!1,b=!1,S=(c=v.url).indexOf("sku=")>0&&Ui(c);a.type==="json"&&v.headers.set("Accept","application/json");var T=function(z,N,$){if(!b){if(z&&z.message!=="SecurityError"&&Ft(z),N&&$)return C(N);var J=Date.now();ae.fetch(v).then(function(H){if(H.ok){var te=S?H.clone():null;return C(H,te,J)}return u(new us(H.statusText,H.status,a.url))}).catch(function(H){H.code!==20&&u(new Error(H.message))})}},C=function(z,N,$){(a.type==="arrayBuffer"?z.arrayBuffer():a.type==="json"?z.json():z.text()).then(function(J){b||(N&&$&&function(H,te,oe){if(Vo(),Ei){var se={status:te.status,statusText:te.statusText,headers:new ae.Headers};te.headers.forEach(function(ye,we){return se.headers.set(we,ye)});var ue=Do(te.headers.get("Cache-Control")||"");ue["no-store"]||(ue["max-age"]&&se.headers.set("Expires",new Date(oe+1e3*ue["max-age"]).toUTCString()),new Date(se.headers.get("Expires")).getTime()-oe<42e4||function(ye,we){if(Jn===void 0)try{new Response(new ReadableStream),Jn=!0}catch{Jn=!1}Jn?we(ye.body):ye.blob().then(we)}(te,function(ye){var we=new ae.Response(ye,se);Vo(),Ei&&Ei.then(function(Ie){return Ie.put(da(H.url),we)}).catch(function(Ie){return Ft(Ie.message)})}))}}(v,N,$),x=!0,u(null,J,z.headers.get("Cache-Control"),z.headers.get("Expires")))}).catch(function(J){b||u(new Error(J.message))})};return S?function(z,N){if(Vo(),!Ei)return N(null);var $=da(z.url);Ei.then(function(J){J.match($).then(function(H){var te=function(oe){if(!oe)return!1;var se=new Date(oe.headers.get("Expires")||0),ue=Do(oe.headers.get("Cache-Control")||"");return se>Date.now()&&!ue["no-cache"]}(H);J.delete($),te&&J.put($,H.clone()),N(null,H,te)}).catch(N)}).catch(N)}(v,T):T(null,null),{cancel:function(){b=!0,x||f.abort()}}}(e,t);if(li()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var r;return function(a,u){var c=new ae.XMLHttpRequest;for(var f in c.open(a.method||"GET",a.url,!0),a.type==="arrayBuffer"&&(c.responseType="arraybuffer"),a.headers)c.setRequestHeader(f,a.headers[f]);return a.type==="json"&&(c.responseType="text",c.setRequestHeader("Accept","application/json")),c.withCredentials=a.credentials==="include",c.onerror=function(){u(new Error(c.statusText))},c.onload=function(){if((c.status>=200&&c.status<300||c.status===0)&&c.response!==null){var v=c.response;if(a.type==="json")try{v=JSON.parse(c.response)}catch(x){return u(x)}u(null,v,c.getResponseHeader("Cache-Control"),c.getResponseHeader("Expires"))}else u(new us(c.statusText,c.status,a.url))},c.send(a.body),{cancel:function(){return c.abort()}}}(e,t)},va=function(e,t){return Uo(et(e,{type:"arrayBuffer"}),t)},or=function(e,t){return Uo(et(e,{method:"POST"}),t)},I="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";un=[],cn=0;var P=function(e,t){if(Ji.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),cn>=Ot.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:e,callback:t,cancelled:!1,cancel:function(){this.cancelled=!0}};return un.push(r),r}cn++;var a=!1,u=function(){if(!a)for(a=!0,cn--;un.length&&cn<Ot.MAX_PARALLEL_IMAGE_REQUESTS;){var f=un.shift();f.cancelled||(f.cancel=P(f.requestParameters,f.callback).cancel)}},c=va(e,function(f,v,x,b){u(),f?t(f):v&&(ya()?function(S,T){var C=new ae.Blob([new Uint8Array(S)],{type:"image/png"});ae.createImageBitmap(C).then(function(z){T(null,z)}).catch(function(z){T(new Error("Could not load image because of "+z.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}(v,t):function(S,T,C,z){var N=new ae.Image,$=ae.URL;N.onload=function(){T(null,N),$.revokeObjectURL(N.src),N.onload=null,ae.requestAnimationFrame(function(){N.src=I})},N.onerror=function(){return T(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var J=new ae.Blob([new Uint8Array(S)],{type:"image/png"});N.cacheControl=C,N.expires=z,N.src=S.byteLength?$.createObjectURL(J):I}(v,t,x,b))});return{cancel:function(){c.cancel(),u()}}};function M(e,t,r){r[e]&&r[e].indexOf(t)!==-1||(r[e]=r[e]||[],r[e].push(t))}function O(e,t,r){if(r&&r[e]){var a=r[e].indexOf(t);a!==-1&&r[e].splice(a,1)}}var q=function(e,t){t===void 0&&(t={}),et(this,t),this.type=e},Y=function(e){function t(r,a){a===void 0&&(a={}),e.call(this,"error",et({error:r},a))}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(q),ee=function(){};ee.prototype.on=function(e,t){return this._listeners=this._listeners||{},M(e,t,this._listeners),this},ee.prototype.off=function(e,t){return O(e,t,this._listeners),O(e,t,this._oneTimeListeners),this},ee.prototype.once=function(e,t){return this._oneTimeListeners=this._oneTimeListeners||{},M(e,t,this._oneTimeListeners),this},ee.prototype.fire=function(e,t){typeof e=="string"&&(e=new q(e,t||{}));var r=e.type;if(this.listens(r)){e.target=this;for(var a=0,u=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];a<u.length;a+=1)u[a].call(this,e);for(var c=0,f=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];c<f.length;c+=1){var v=f[c];O(r,v,this._oneTimeListeners),v.call(this,e)}var x=this._eventedParent;x&&(et(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),x.fire(e))}else e instanceof Y&&console.error(e.error);return this},ee.prototype.listens=function(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)},ee.prototype.setEventedParent=function(e,t){return this._eventedParent=e,this._eventedParentData=t,this};var D={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},W=function(e,t,r,a){this.message=(e?e+": ":"")+r,a&&(this.identifier=a),t!=null&&t.__line__&&(this.line=t.__line__)};function ne(e){var t=e.value;return t?[new W(e.key,t,"constants have been deprecated as of v8")]:[]}function _e(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var a=0,u=t;a<u.length;a+=1){var c=u[a];for(var f in c)e[f]=c[f]}return e}function be(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function fe(e){if(Array.isArray(e))return e.map(fe);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){var t={};for(var r in e)t[r]=fe(e[r]);return t}return be(e)}var xe=function(e){function t(r,a){e.call(this,a),this.message=a,this.key=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(Error),Ve=function(e,t){t===void 0&&(t=[]),this.parent=e,this.bindings={};for(var r=0,a=t;r<a.length;r+=1){var u=a[r];this.bindings[u[0]]=u[1]}};Ve.prototype.concat=function(e){return new Ve(this,e)},Ve.prototype.get=function(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(e+" not found in scope.")},Ve.prototype.has=function(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)};var Fe={kind:"null"},de={kind:"number"},De={kind:"string"},Ae={kind:"boolean"},Pe={kind:"color"},ut={kind:"object"},ze={kind:"value"},vt={kind:"collator"},Vt={kind:"formatted"},pt={kind:"resolvedImage"};function Et(e,t){return{kind:"array",itemType:e,N:t}}function _t(e){if(e.kind==="array"){var t=_t(e.itemType);return typeof e.N=="number"?"array<"+t+", "+e.N+">":e.itemType.kind==="value"?"array":"array<"+t+">"}return e.kind}var qr=[Fe,de,De,Ae,Pe,Vt,ut,Et(ze),pt];function Mt(e,t){if(t.kind==="error")return null;if(e.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!Mt(e.itemType,t.itemType))&&(typeof e.N!="number"||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if(e.kind==="value"){for(var r=0,a=qr;r<a.length;r+=1)if(!Mt(a[r],t))return null}}return"Expected "+_t(e)+" but found "+_t(t)+" instead."}function ar(e,t){return t.some(function(r){return r.kind===e.kind})}function Dt(e,t){return t.some(function(r){return r==="null"?e===null:r==="array"?Array.isArray(e):r==="object"?e&&!Array.isArray(e)&&typeof e=="object":r===typeof e})}var mt=re(function(e,t){var r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function a(v){return(v=Math.round(v))<0?0:v>255?255:v}function u(v){return a(v[v.length-1]==="%"?parseFloat(v)/100*255:parseInt(v))}function c(v){return(x=v[v.length-1]==="%"?parseFloat(v)/100:parseFloat(v))<0?0:x>1?1:x;var x}function f(v,x,b){return b<0?b+=1:b>1&&(b-=1),6*b<1?v+(x-v)*b*6:2*b<1?x:3*b<2?v+(x-v)*(2/3-b)*6:v}try{t.parseCSSColor=function(v){var x,b=v.replace(/ /g,"").toLowerCase();if(b in r)return r[b].slice();if(b[0]==="#")return b.length===4?(x=parseInt(b.substr(1),16))>=0&&x<=4095?[(3840&x)>>4|(3840&x)>>8,240&x|(240&x)>>4,15&x|(15&x)<<4,1]:null:b.length===7&&(x=parseInt(b.substr(1),16))>=0&&x<=16777215?[(16711680&x)>>16,(65280&x)>>8,255&x,1]:null;var S=b.indexOf("("),T=b.indexOf(")");if(S!==-1&&T+1===b.length){var C=b.substr(0,S),z=b.substr(S+1,T-(S+1)).split(","),N=1;switch(C){case"rgba":if(z.length!==4)return null;N=c(z.pop());case"rgb":return z.length!==3?null:[u(z[0]),u(z[1]),u(z[2]),N];case"hsla":if(z.length!==4)return null;N=c(z.pop());case"hsl":if(z.length!==3)return null;var $=(parseFloat(z[0])%360+360)%360/360,J=c(z[1]),H=c(z[2]),te=H<=.5?H*(J+1):H+J-H*J,oe=2*H-te;return[a(255*f(oe,te,$+1/3)),a(255*f(oe,te,$)),a(255*f(oe,te,$-1/3)),N];default:return null}}return null}}catch{}}).parseCSSColor,Pt=function(e,t,r,a){a===void 0&&(a=1),this.r=e,this.g=t,this.b=r,this.a=a};Pt.parse=function(e){if(e){if(e instanceof Pt)return e;if(typeof e=="string"){var t=mt(e);if(t)return new Pt(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},Pt.prototype.toString=function(){var e=this.toArray(),t=e[1],r=e[2],a=e[3];return"rgba("+Math.round(e[0])+","+Math.round(t)+","+Math.round(r)+","+a+")"},Pt.prototype.toArray=function(){var e=this.a;return e===0?[0,0,0,0]:[255*this.r/e,255*this.g/e,255*this.b/e,e]},Pt.black=new Pt(0,0,0,1),Pt.white=new Pt(1,1,1,1),Pt.transparent=new Pt(0,0,0,0),Pt.red=new Pt(1,0,0,1);var ri=function(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};ri.prototype.compare=function(e,t){return this.collator.compare(e,t)},ri.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ga=function(e,t,r,a,u){this.text=e,this.image=t,this.scale=r,this.fontStack=a,this.textColor=u},Cr=function(e){this.sections=e};Cr.fromString=function(e){return new Cr([new ga(e,null,null,null,null)])},Cr.prototype.isEmpty=function(){return this.sections.length===0||!this.sections.some(function(e){return e.text.length!==0||e.image&&e.image.name.length!==0})},Cr.factory=function(e){return e instanceof Cr?e:Cr.fromString(e)},Cr.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(e){return e.text}).join("")},Cr.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var a=r[t];if(a.image)e.push(["image",a.image.name]);else{e.push(a.text);var u={};a.fontStack&&(u["text-font"]=["literal",a.fontStack.split(",")]),a.scale&&(u["font-scale"]=a.scale),a.textColor&&(u["text-color"]=["rgba"].concat(a.textColor.toArray())),e.push(u)}}return e};var ii=function(e){this.name=e.name,this.available=e.available};function bl(e,t,r,a){return typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:"Invalid rgba value ["+[e,t,r,a].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+(typeof a=="number"?[e,t,r,a]:[e,t,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function _a(e){if(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||e instanceof Pt||e instanceof ri||e instanceof Cr||e instanceof ii)return!0;if(Array.isArray(e)){for(var t=0,r=e;t<r.length;t+=1)if(!_a(r[t]))return!1;return!0}if(typeof e=="object"){for(var a in e)if(!_a(e[a]))return!1;return!0}return!1}function sr(e){if(e===null)return Fe;if(typeof e=="string")return De;if(typeof e=="boolean")return Ae;if(typeof e=="number")return de;if(e instanceof Pt)return Pe;if(e instanceof ri)return vt;if(e instanceof Cr)return Vt;if(e instanceof ii)return pt;if(Array.isArray(e)){for(var t,r=e.length,a=0,u=e;a<u.length;a+=1){var c=sr(u[a]);if(t){if(t===c)continue;t=ze;break}t=c}return Et(t||ze,r)}return ut}function xa(e){var t=typeof e;return e===null?"":t==="string"||t==="number"||t==="boolean"?String(e):e instanceof Pt||e instanceof Cr||e instanceof ii?e.toString():JSON.stringify(e)}ii.prototype.toString=function(){return this.name},ii.fromString=function(e){return e?new ii({name:e,available:!1}):null},ii.prototype.serialize=function(){return["image",this.name]};var Gr=function(e,t){this.type=e,this.value=t};Gr.parse=function(e,t){if(e.length!==2)return t.error("'literal' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(!_a(e[1]))return t.error("invalid value");var r=e[1],a=sr(r),u=t.expectedType;return a.kind!=="array"||a.N!==0||!u||u.kind!=="array"||typeof u.N=="number"&&u.N!==0||(a=u),new Gr(a,r)},Gr.prototype.evaluate=function(){return this.value},Gr.prototype.eachChild=function(){},Gr.prototype.outputDefined=function(){return!0},Gr.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Pt?["rgba"].concat(this.value.toArray()):this.value instanceof Cr?this.value.serialize():this.value};var kr=function(e){this.name="ExpressionEvaluationError",this.message=e};kr.prototype.toJSON=function(){return this.message};var Pi={string:De,number:de,boolean:Ae,object:ut},Ht=function(e,t){this.type=e,this.args=t};Ht.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r,a=1,u=e[0];if(u==="array"){var c,f;if(e.length>2){var v=e[1];if(typeof v!="string"||!(v in Pi)||v==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);c=Pi[v],a++}else c=ze;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);f=e[2],a++}r=Et(c,f)}else r=Pi[u];for(var x=[];a<e.length;a++){var b=t.parse(e[a],a,ze);if(!b)return null;x.push(b)}return new Ht(r,x)},Ht.prototype.evaluate=function(e){for(var t=0;t<this.args.length;t++){var r=this.args[t].evaluate(e);if(!Mt(this.type,sr(r)))return r;if(t===this.args.length-1)throw new kr("Expected value to be of type "+_t(this.type)+", but found "+_t(sr(r))+" instead.")}return null},Ht.prototype.eachChild=function(e){this.args.forEach(e)},Ht.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},Ht.prototype.serialize=function(){var e=this.type,t=[e.kind];if(e.kind==="array"){var r=e.itemType;if(r.kind==="string"||r.kind==="number"||r.kind==="boolean"){t.push(r.kind);var a=e.N;(typeof a=="number"||this.args.length>1)&&t.push(a)}}return t.concat(this.args.map(function(u){return u.serialize()}))};var $i=function(e){this.type=Vt,this.sections=e};$i.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[1];if(!Array.isArray(r)&&typeof r=="object")return t.error("First argument must be an image or text section.");for(var a=[],u=!1,c=1;c<=e.length-1;++c){var f=e[c];if(u&&typeof f=="object"&&!Array.isArray(f)){u=!1;var v=null;if(f["font-scale"]&&!(v=t.parse(f["font-scale"],1,de)))return null;var x=null;if(f["text-font"]&&!(x=t.parse(f["text-font"],1,Et(De))))return null;var b=null;if(f["text-color"]&&!(b=t.parse(f["text-color"],1,Pe)))return null;var S=a[a.length-1];S.scale=v,S.font=x,S.textColor=b}else{var T=t.parse(e[c],1,ze);if(!T)return null;var C=T.type.kind;if(C!=="string"&&C!=="value"&&C!=="null"&&C!=="resolvedImage")return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");u=!0,a.push({content:T,scale:null,font:null,textColor:null})}}return new $i(a)},$i.prototype.evaluate=function(e){return new Cr(this.sections.map(function(t){var r=t.content.evaluate(e);return sr(r)===pt?new ga("",r,null,null,null):new ga(xa(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)}))},$i.prototype.eachChild=function(e){for(var t=0,r=this.sections;t<r.length;t+=1){var a=r[t];e(a.content),a.scale&&e(a.scale),a.font&&e(a.font),a.textColor&&e(a.textColor)}},$i.prototype.outputDefined=function(){return!1},$i.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var a=r[t];e.push(a.content.serialize());var u={};a.scale&&(u["font-scale"]=a.scale.serialize()),a.font&&(u["text-font"]=a.font.serialize()),a.textColor&&(u["text-color"]=a.textColor.serialize()),e.push(u)}return e};var vi=function(e){this.type=pt,this.input=e};vi.parse=function(e,t){if(e.length!==2)return t.error("Expected two arguments.");var r=t.parse(e[1],1,De);return r?new vi(r):t.error("No image name provided.")},vi.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=ii.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r},vi.prototype.eachChild=function(e){e(this.input)},vi.prototype.outputDefined=function(){return!1},vi.prototype.serialize=function(){return["image",this.input.serialize()]};var zu={"to-boolean":Ae,"to-color":Pe,"to-number":de,"to-string":De},Ci=function(e,t){this.type=e,this.args=t};Ci.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[0];if((r==="to-boolean"||r==="to-string")&&e.length!==2)return t.error("Expected one argument.");for(var a=zu[r],u=[],c=1;c<e.length;c++){var f=t.parse(e[c],c,ze);if(!f)return null;u.push(f)}return new Ci(a,u)},Ci.prototype.evaluate=function(e){if(this.type.kind==="boolean")return!!this.args[0].evaluate(e);if(this.type.kind==="color"){for(var t,r,a=0,u=this.args;a<u.length;a+=1){if(r=null,(t=u[a].evaluate(e))instanceof Pt)return t;if(typeof t=="string"){var c=e.parseColor(t);if(c)return c}else if(Array.isArray(t)&&!(r=t.length<3||t.length>4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":bl(t[0],t[1],t[2],t[3])))return new Pt(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new kr(r||"Could not parse color from value '"+(typeof t=="string"?t:String(JSON.stringify(t)))+"'")}if(this.type.kind==="number"){for(var f=null,v=0,x=this.args;v<x.length;v+=1){if((f=x[v].evaluate(e))===null)return 0;var b=Number(f);if(!isNaN(b))return b}throw new kr("Could not convert "+JSON.stringify(f)+" to number.")}return this.type.kind==="formatted"?Cr.fromString(xa(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?ii.fromString(xa(this.args[0].evaluate(e))):xa(this.args[0].evaluate(e))},Ci.prototype.eachChild=function(e){this.args.forEach(e)},Ci.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},Ci.prototype.serialize=function(){if(this.type.kind==="formatted")return new $i([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new vi(this.args[0]).serialize();var e=["to-"+this.type.kind];return this.eachChild(function(t){e.push(t.serialize())}),e};var zp=["Unknown","Point","LineString","Polygon"],pn=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};pn.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},pn.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?zp[this.feature.type]:this.feature.type:null},pn.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},pn.prototype.canonicalID=function(){return this.canonical},pn.prototype.properties=function(){return this.feature&&this.feature.properties||{}},pn.prototype.parseColor=function(e){var t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=Pt.parse(e)),t};var Rr=function(e,t,r,a){this.name=e,this.type=t,this._evaluate=r,this.args=a};Rr.prototype.evaluate=function(e){return this._evaluate(e,this.args)},Rr.prototype.eachChild=function(e){this.args.forEach(e)},Rr.prototype.outputDefined=function(){return!1},Rr.prototype.serialize=function(){return[this.name].concat(this.args.map(function(e){return e.serialize()}))},Rr.parse=function(e,t){var r,a=e[0],u=Rr.definitions[a];if(!u)return t.error('Unknown expression "'+a+'". If you wanted a literal array, use ["literal", [...]].',0);for(var c=Array.isArray(u)?u[0]:u.type,f=Array.isArray(u)?[[u[1],u[2]]]:u.overloads,v=f.filter(function(Ze){var Be=Ze[0];return!Array.isArray(Be)||Be.length===e.length-1}),x=null,b=0,S=v;b<S.length;b+=1){var T=S[b],C=T[0],z=T[1];x=new An(t.registry,t.path,null,t.scope);for(var N=[],$=!1,J=1;J<e.length;J++){var H=e[J],te=Array.isArray(C)?C[J-1]:C.type,oe=x.parse(H,1+N.length,te);if(!oe){$=!0;break}N.push(oe)}if(!$)if(Array.isArray(C)&&C.length!==N.length)x.error("Expected "+C.length+" arguments, but found "+N.length+" instead.");else{for(var se=0;se<N.length;se++){var ue=Array.isArray(C)?C[se]:C.type,ye=N[se];x.concat(se+1).checkSubtype(ue,ye.type)}if(x.errors.length===0)return new Rr(a,c,z,N)}}if(v.length===1)(r=t.errors).push.apply(r,x.errors);else{for(var we=(v.length?v:f).map(function(Ze){var Be;return Be=Ze[0],Array.isArray(Be)?"("+Be.map(_t).join(", ")+")":"("+_t(Be.type)+"...)"}).join(" | "),Ie=[],je=1;je<e.length;je++){var Me=t.parse(e[je],1+Ie.length);if(!Me)return null;Ie.push(_t(Me.type))}t.error("Expected arguments of type "+we+", but found ("+Ie.join(", ")+") instead.")}return null},Rr.register=function(e,t){for(var r in Rr.definitions=t,t)e[r]=Rr};var Yi=function(e,t,r){this.type=vt,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t};function Zr(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function eo(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function Bp(e,t){var r=(180+e[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,u=Math.pow(2,t.z);return[Math.round(r*u*8192),Math.round(a*u*8192)]}function Dp(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function wl(e,t){for(var r,a,u,c,f,v,x,b=!1,S=0,T=t.length;S<T;S++)for(var C=t[S],z=0,N=C.length;z<N-1;z++){if((c=(r=e)[0]-(a=C[z])[0])*(x=r[1]-(u=C[z+1])[1])-(v=r[0]-u[0])*(f=r[1]-a[1])==0&&c*v<=0&&f*x<=0)return!1;Dp(e,C[z],C[z+1])&&(b=!b)}return b}function Lp(e,t){for(var r=0;r<t.length;r++)if(wl(e,t[r]))return!0;return!1}function Bu(e,t,r,a){var u=a[0]-r[0],c=a[1]-r[1],f=(e[0]-r[0])*c-u*(e[1]-r[1]),v=(t[0]-r[0])*c-u*(t[1]-r[1]);return f>0&&v<0||f<0&&v>0}function Rp(e,t,r){for(var a=0,u=r;a<u.length;a+=1)for(var c=u[a],f=0;f<c.length-1;++f)if((T=[(S=c[f+1])[0]-(b=c[f])[0],S[1]-b[1]])[0]*(C=[(x=t)[0]-(v=e)[0],x[1]-v[1]])[1]-T[1]*C[0]!=0&&Bu(v,x,b,S)&&Bu(b,S,v,x))return!0;var v,x,b,S,T,C;return!1}function Du(e,t){for(var r=0;r<e.length;++r)if(!wl(e[r],t))return!1;for(var a=0;a<e.length-1;++a)if(Rp(e[a],e[a+1],t))return!1;return!0}function Lu(e,t){for(var r=0;r<t.length;r++)if(Du(e,t[r]))return!0;return!1}function No(e,t,r){for(var a=[],u=0;u<e.length;u++){for(var c=[],f=0;f<e[u].length;f++){var v=Bp(e[u][f],r);Zr(t,v),c.push(v)}a.push(c)}return a}function Sl(e,t,r){for(var a=[],u=0;u<e.length;u++){var c=No(e[u],t,r);a.push(c)}return a}function ba(e,t,r,a){if(e[0]<r[0]||e[0]>r[2]){var u=.5*a,c=e[0]-r[0]>u?-a:r[0]-e[0]>u?a:0;c===0&&(c=e[0]-r[2]>u?-a:r[2]-e[0]>u?a:0),e[0]+=c}Zr(t,e)}function Ru(e,t,r,a){for(var u=8192*Math.pow(2,a.z),c=[8192*a.x,8192*a.y],f=[],v=0,x=e;v<x.length;v+=1)for(var b=0,S=x[v];b<S.length;b+=1){var T=S[b],C=[T.x+c[0],T.y+c[1]];ba(C,t,r,u),f.push(C)}return f}function cs(e,t,r,a){for(var u,c=8192*Math.pow(2,a.z),f=[8192*a.x,8192*a.y],v=[],x=0,b=e;x<b.length;x+=1){for(var S=[],T=0,C=b[x];T<C.length;T+=1){var z=C[T],N=[z.x+f[0],z.y+f[1]];Zr(t,N),S.push(N)}v.push(S)}if(t[2]-t[0]<=c/2){(u=t)[0]=u[1]=1/0,u[2]=u[3]=-1/0;for(var $=0,J=v;$<J.length;$+=1)for(var H=0,te=J[$];H<te.length;H+=1)ba(te[H],t,r,c)}return v}Yi.parse=function(e,t){if(e.length!==2)return t.error("Expected one argument.");var r=e[1];if(typeof r!="object"||Array.isArray(r))return t.error("Collator options argument must be an object.");var a=t.parse(r["case-sensitive"]!==void 0&&r["case-sensitive"],1,Ae);if(!a)return null;var u=t.parse(r["diacritic-sensitive"]!==void 0&&r["diacritic-sensitive"],1,Ae);if(!u)return null;var c=null;return r.locale&&!(c=t.parse(r.locale,1,De))?null:new Yi(a,u,c)},Yi.prototype.evaluate=function(e){return new ri(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)},Yi.prototype.eachChild=function(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)},Yi.prototype.outputDefined=function(){return!1},Yi.prototype.serialize=function(){var e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]};var ki=function(e,t){this.type=Ae,this.geojson=e,this.geometries=t};function Sn(e){if(e instanceof Rr&&(e.name==="get"&&e.args.length===1||e.name==="feature-state"||e.name==="has"&&e.args.length===1||e.name==="properties"||e.name==="geometry-type"||e.name==="id"||/^filter-/.test(e.name))||e instanceof ki)return!1;var t=!0;return e.eachChild(function(r){t&&!Sn(r)&&(t=!1)}),t}function Tn(e){if(e instanceof Rr&&e.name==="feature-state")return!1;var t=!0;return e.eachChild(function(r){t&&!Tn(r)&&(t=!1)}),t}function to(e,t){if(e instanceof Rr&&t.indexOf(e.name)>=0)return!1;var r=!0;return e.eachChild(function(a){r&&!to(a,t)&&(r=!1)}),r}ki.parse=function(e,t){if(e.length!==2)return t.error("'within' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(_a(e[1])){var r=e[1];if(r.type==="FeatureCollection")for(var a=0;a<r.features.length;++a){var u=r.features[a].geometry.type;if(u==="Polygon"||u==="MultiPolygon")return new ki(r,r.features[a].geometry)}else if(r.type==="Feature"){var c=r.geometry.type;if(c==="Polygon"||c==="MultiPolygon")return new ki(r,r.geometry)}else if(r.type==="Polygon"||r.type==="MultiPolygon")return new ki(r,r)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")},ki.prototype.evaluate=function(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return function(t,r){var a=[1/0,1/0,-1/0,-1/0],u=[1/0,1/0,-1/0,-1/0],c=t.canonicalID();if(r.type==="Polygon"){var f=No(r.coordinates,u,c),v=Ru(t.geometry(),a,u,c);if(!eo(a,u))return!1;for(var x=0,b=v;x<b.length;x+=1)if(!wl(b[x],f))return!1}if(r.type==="MultiPolygon"){var S=Sl(r.coordinates,u,c),T=Ru(t.geometry(),a,u,c);if(!eo(a,u))return!1;for(var C=0,z=T;C<z.length;C+=1)if(!Lp(z[C],S))return!1}return!0}(e,this.geometries);if(e.geometryType()==="LineString")return function(t,r){var a=[1/0,1/0,-1/0,-1/0],u=[1/0,1/0,-1/0,-1/0],c=t.canonicalID();if(r.type==="Polygon"){var f=No(r.coordinates,u,c),v=cs(t.geometry(),a,u,c);if(!eo(a,u))return!1;for(var x=0,b=v;x<b.length;x+=1)if(!Du(b[x],f))return!1}if(r.type==="MultiPolygon"){var S=Sl(r.coordinates,u,c),T=cs(t.geometry(),a,u,c);if(!eo(a,u))return!1;for(var C=0,z=T;C<z.length;C+=1)if(!Lu(z[C],S))return!1}return!0}(e,this.geometries)}return!1},ki.prototype.eachChild=function(){},ki.prototype.outputDefined=function(){return!0},ki.prototype.serialize=function(){return["within",this.geojson]};var In=function(e,t){this.type=t.type,this.name=e,this.boundExpression=t};In.parse=function(e,t){if(e.length!==2||typeof e[1]!="string")return t.error("'var' expression requires exactly one string literal argument.");var r=e[1];return t.scope.has(r)?new In(r,t.scope.get(r)):t.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},In.prototype.evaluate=function(e){return this.boundExpression.evaluate(e)},In.prototype.eachChild=function(){},In.prototype.outputDefined=function(){return!1},In.prototype.serialize=function(){return["var",this.name]};var An=function(e,t,r,a,u){t===void 0&&(t=[]),a===void 0&&(a=new Ve),u===void 0&&(u=[]),this.registry=e,this.path=t,this.key=t.map(function(c){return"["+c+"]"}).join(""),this.scope=a,this.errors=u,this.expectedType=r};function ps(e,t){for(var r,a=e.length-1,u=0,c=a,f=0;u<=c;)if((r=e[f=Math.floor((u+c)/2)])<=t){if(f===a||t<e[f+1])return f;u=f+1}else{if(!(r>t))throw new kr("Input is not a number.");c=f-1}return 0}An.prototype.parse=function(e,t,r,a,u){return u===void 0&&(u={}),t?this.concat(t,r,a)._parse(e,u):this._parse(e,u)},An.prototype._parse=function(e,t){function r(b,S,T){return T==="assert"?new Ht(S,[b]):T==="coerce"?new Ci(S,[b]):b}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var a=e[0];if(typeof a!="string")return this.error("Expression name must be a string, but found "+typeof a+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var u=this.registry[a];if(u){var c=u.parse(e,this);if(!c)return null;if(this.expectedType){var f=this.expectedType,v=c.type;if(f.kind!=="string"&&f.kind!=="number"&&f.kind!=="boolean"&&f.kind!=="object"&&f.kind!=="array"||v.kind!=="value")if(f.kind!=="color"&&f.kind!=="formatted"&&f.kind!=="resolvedImage"||v.kind!=="value"&&v.kind!=="string"){if(this.checkSubtype(f,v))return null}else c=r(c,f,t.typeAnnotation||"coerce");else c=r(c,f,t.typeAnnotation||"assert")}if(!(c instanceof Gr)&&c.type.kind!=="resolvedImage"&&function b(S){if(S instanceof In)return b(S.boundExpression);if(S instanceof Rr&&S.name==="error"||S instanceof Yi||S instanceof ki)return!1;var T=S instanceof Ci||S instanceof Ht,C=!0;return S.eachChild(function(z){C=T?C&&b(z):C&&z instanceof Gr}),!!C&&Sn(S)&&to(S,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(c)){var x=new pn;try{c=new Gr(c.type,c.evaluate(x))}catch(b){return this.error(b.message),null}}return c}return this.error('Unknown expression "'+a+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof e+" instead.")},An.prototype.concat=function(e,t,r){var a=typeof e=="number"?this.path.concat(e):this.path,u=r?this.scope.concat(r):this.scope;return new An(this.registry,a,t||null,u,this.errors)},An.prototype.error=function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];var a=""+this.key+t.map(function(u){return"["+u+"]"}).join("");this.errors.push(new xe(a,e))},An.prototype.checkSubtype=function(e,t){var r=Mt(e,t);return r&&this.error(r),r};var ui=function(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var a=0,u=r;a<u.length;a+=1){var c=u[a],f=c[1];this.labels.push(c[0]),this.outputs.push(f)}};function mr(e,t,r){return e*(1-r)+t*r}ui.parse=function(e,t){if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");var r=t.parse(e[1],1,de);if(!r)return null;var a=[],u=null;t.expectedType&&t.expectedType.kind!=="value"&&(u=t.expectedType);for(var c=1;c<e.length;c+=2){var f=c===1?-1/0:e[c],v=e[c+1],x=c,b=c+1;if(typeof f!="number")return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',x);if(a.length&&a[a.length-1][0]>=f)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',x);var S=t.parse(v,b,u);if(!S)return null;u=u||S.type,a.push([f,S])}return new ui(u,r,a)},ui.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(t.length===1)return r[0].evaluate(e);var a=this.input.evaluate(e);if(a<=t[0])return r[0].evaluate(e);var u=t.length;return a>=t[u-1]?r[u-1].evaluate(e):r[ps(t,a)].evaluate(e)},ui.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},ui.prototype.outputDefined=function(){return this.outputs.every(function(e){return e.outputDefined()})},ui.prototype.serialize=function(){for(var e=["step",this.input.serialize()],t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var $o=Object.freeze({__proto__:null,number:mr,color:function(e,t,r){return new Pt(mr(e.r,t.r,r),mr(e.g,t.g,r),mr(e.b,t.b,r),mr(e.a,t.a,r))},array:function(e,t,r){return e.map(function(a,u){return mr(a,t[u],r)})}}),Fu=6/29*3*(6/29),Fp=Math.PI/180,Op=180/Math.PI;function Tl(e){return e>.008856451679035631?Math.pow(e,1/3):e/Fu+4/29}function Il(e){return e>6/29?e*e*e:Fu*(e-4/29)}function Al(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function El(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ou(e){var t=El(e.r),r=El(e.g),a=El(e.b),u=Tl((.4124564*t+.3575761*r+.1804375*a)/.95047),c=Tl((.2126729*t+.7151522*r+.072175*a)/1);return{l:116*c-16,a:500*(u-c),b:200*(c-Tl((.0193339*t+.119192*r+.9503041*a)/1.08883)),alpha:e.a}}function Vu(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,a=isNaN(e.b)?t:t-e.b/200;return t=1*Il(t),r=.95047*Il(r),a=1.08883*Il(a),new Pt(Al(3.2404542*r-1.5371385*t-.4985314*a),Al(-.969266*r+1.8760108*t+.041556*a),Al(.0556434*r-.2040259*t+1.0572252*a),e.alpha)}function Vp(e,t,r){var a=t-e;return e+r*(a>180||a<-180?a-360*Math.round(a/360):a)}var wa={forward:Ou,reverse:Vu,interpolate:function(e,t,r){return{l:mr(e.l,t.l,r),a:mr(e.a,t.a,r),b:mr(e.b,t.b,r),alpha:mr(e.alpha,t.alpha,r)}}},Sa={forward:function(e){var t=Ou(e),r=t.l,a=t.a,u=t.b,c=Math.atan2(u,a)*Op;return{h:c<0?c+360:c,c:Math.sqrt(a*a+u*u),l:r,alpha:e.a}},reverse:function(e){var t=e.h*Fp,r=e.c;return Vu({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:Vp(e.h,t.h,r),c:mr(e.c,t.c,r),l:mr(e.l,t.l,r),alpha:mr(e.alpha,t.alpha,r)}}},Uu=Object.freeze({__proto__:null,lab:wa,hcl:Sa}),Fr=function(e,t,r,a,u){this.type=e,this.operator=t,this.interpolation=r,this.input=a,this.labels=[],this.outputs=[];for(var c=0,f=u;c<f.length;c+=1){var v=f[c],x=v[1];this.labels.push(v[0]),this.outputs.push(x)}};function Pl(e,t,r,a){var u=a-r,c=e-r;return u===0?0:t===1?c/u:(Math.pow(t,c)-1)/(Math.pow(t,u)-1)}Fr.interpolationFactor=function(e,t,r,a){var u=0;if(e.name==="exponential")u=Pl(t,e.base,r,a);else if(e.name==="linear")u=Pl(t,1,r,a);else if(e.name==="cubic-bezier"){var c=e.controlPoints;u=new G(c[0],c[1],c[2],c[3]).solve(Pl(t,1,r,a))}return u},Fr.parse=function(e,t){var r=e[0],a=e[1],u=e[2],c=e.slice(3);if(!Array.isArray(a)||a.length===0)return t.error("Expected an interpolation type expression.",1);if(a[0]==="linear")a={name:"linear"};else if(a[0]==="exponential"){var f=a[1];if(typeof f!="number")return t.error("Exponential interpolation requires a numeric base.",1,1);a={name:"exponential",base:f}}else{if(a[0]!=="cubic-bezier")return t.error("Unknown interpolation type "+String(a[0]),1,0);var v=a.slice(1);if(v.length!==4||v.some(function(J){return typeof J!="number"||J<0||J>1}))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:v}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(!(u=t.parse(u,2,de)))return null;var x=[],b=null;r==="interpolate-hcl"||r==="interpolate-lab"?b=Pe:t.expectedType&&t.expectedType.kind!=="value"&&(b=t.expectedType);for(var S=0;S<c.length;S+=2){var T=c[S],C=c[S+1],z=S+3,N=S+4;if(typeof T!="number")return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',z);if(x.length&&x[x.length-1][0]>=T)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',z);var $=t.parse(C,N,b);if(!$)return null;b=b||$.type,x.push([T,$])}return b.kind==="number"||b.kind==="color"||b.kind==="array"&&b.itemType.kind==="number"&&typeof b.N=="number"?new Fr(b,r,a,u,x):t.error("Type "+_t(b)+" is not interpolatable.")},Fr.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(t.length===1)return r[0].evaluate(e);var a=this.input.evaluate(e);if(a<=t[0])return r[0].evaluate(e);var u=t.length;if(a>=t[u-1])return r[u-1].evaluate(e);var c=ps(t,a),f=Fr.interpolationFactor(this.interpolation,a,t[c],t[c+1]),v=r[c].evaluate(e),x=r[c+1].evaluate(e);return this.operator==="interpolate"?$o[this.type.kind.toLowerCase()](v,x,f):this.operator==="interpolate-hcl"?Sa.reverse(Sa.interpolate(Sa.forward(v),Sa.forward(x),f)):wa.reverse(wa.interpolate(wa.forward(v),wa.forward(x),f))},Fr.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},Fr.prototype.outputDefined=function(){return this.outputs.every(function(e){return e.outputDefined()})},Fr.prototype.serialize=function(){var e;e=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var t=[this.operator,e,this.input.serialize()],r=0;r<this.labels.length;r++)t.push(this.labels[r],this.outputs[r].serialize());return t};var En=function(e,t){this.type=e,this.args=t};En.parse=function(e,t){if(e.length<2)return t.error("Expectected at least one argument.");var r=null,a=t.expectedType;a&&a.kind!=="value"&&(r=a);for(var u=[],c=0,f=e.slice(1);c<f.length;c+=1){var v=t.parse(f[c],1+u.length,r,void 0,{typeAnnotation:"omit"});if(!v)return null;r=r||v.type,u.push(v)}var x=a&&u.some(function(b){return Mt(a,b.type)});return new En(x?ze:r,u)},En.prototype.evaluate=function(e){for(var t,r=null,a=0,u=0,c=this.args;u<c.length&&(a++,(r=c[u].evaluate(e))&&r instanceof ii&&!r.available&&(t||(t=r.name),r=null,a===this.args.length&&(r=t)),r===null);u+=1);return r},En.prototype.eachChild=function(e){this.args.forEach(e)},En.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},En.prototype.serialize=function(){var e=["coalesce"];return this.eachChild(function(t){e.push(t.serialize())}),e};var Pn=function(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t};Pn.prototype.evaluate=function(e){return this.result.evaluate(e)},Pn.prototype.eachChild=function(e){for(var t=0,r=this.bindings;t<r.length;t+=1)e(r[t][1]);e(this.result)},Pn.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found "+(e.length-1)+" instead.");for(var r=[],a=1;a<e.length-1;a+=2){var u=e[a];if(typeof u!="string")return t.error("Expected string, but found "+typeof u+" instead.",a);if(/[^a-zA-Z0-9_]/.test(u))return t.error("Variable names must contain only alphanumeric characters or '_'.",a);var c=t.parse(e[a+1],a+1);if(!c)return null;r.push([u,c])}var f=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return f?new Pn(r,f):null},Pn.prototype.outputDefined=function(){return this.result.outputDefined()},Pn.prototype.serialize=function(){for(var e=["let"],t=0,r=this.bindings;t<r.length;t+=1){var a=r[t];e.push(a[0],a[1].serialize())}return e.push(this.result.serialize()),e};var ro=function(e,t,r){this.type=e,this.index=t,this.input=r};ro.parse=function(e,t){if(e.length!==3)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,de),a=t.parse(e[2],2,Et(t.expectedType||ze));return r&&a?new ro(a.type.itemType,r,a):null},ro.prototype.evaluate=function(e){var t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new kr("Array index out of bounds: "+t+" < 0.");if(t>=r.length)throw new kr("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new kr("Array index must be an integer, but found "+t+" instead.");return r[t]},ro.prototype.eachChild=function(e){e(this.index),e(this.input)},ro.prototype.outputDefined=function(){return!1},ro.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var io=function(e,t){this.type=Ae,this.needle=e,this.haystack=t};io.parse=function(e,t){if(e.length!==3)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,ze),a=t.parse(e[2],2,ze);return r&&a?ar(r.type,[Ae,De,de,Fe,ze])?new io(r,a):t.error("Expected first argument to be of type boolean, string, number or null, but found "+_t(r.type)+" instead"):null},io.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!Dt(t,["boolean","string","number","null"]))throw new kr("Expected first argument to be of type boolean, string, number or null, but found "+_t(sr(t))+" instead.");if(!Dt(r,["string","array"]))throw new kr("Expected second argument to be of type array or string, but found "+_t(sr(r))+" instead.");return r.indexOf(t)>=0},io.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},io.prototype.outputDefined=function(){return!0},io.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Cn=function(e,t,r){this.type=de,this.needle=e,this.haystack=t,this.fromIndex=r};Cn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,ze),a=t.parse(e[2],2,ze);if(!r||!a)return null;if(!ar(r.type,[Ae,De,de,Fe,ze]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+_t(r.type)+" instead");if(e.length===4){var u=t.parse(e[3],3,de);return u?new Cn(r,a,u):null}return new Cn(r,a)},Cn.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Dt(t,["boolean","string","number","null"]))throw new kr("Expected first argument to be of type boolean, string, number or null, but found "+_t(sr(t))+" instead.");if(!Dt(r,["string","array"]))throw new kr("Expected second argument to be of type array or string, but found "+_t(sr(r))+" instead.");if(this.fromIndex){var a=this.fromIndex.evaluate(e);return r.indexOf(t,a)}return r.indexOf(t)},Cn.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},Cn.prototype.outputDefined=function(){return!1},Cn.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var no=function(e,t,r,a,u,c){this.inputType=e,this.type=t,this.input=r,this.cases=a,this.outputs=u,this.otherwise=c};no.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!=1)return t.error("Expected an even number of arguments.");var r,a;t.expectedType&&t.expectedType.kind!=="value"&&(a=t.expectedType);for(var u={},c=[],f=2;f<e.length-1;f+=2){var v=e[f],x=e[f+1];Array.isArray(v)||(v=[v]);var b=t.concat(f);if(v.length===0)return b.error("Expected at least one branch label.");for(var S=0,T=v;S<T.length;S+=1){var C=T[S];if(typeof C!="number"&&typeof C!="string")return b.error("Branch labels must be numbers or strings.");if(typeof C=="number"&&Math.abs(C)>Number.MAX_SAFE_INTEGER)return b.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof C=="number"&&Math.floor(C)!==C)return b.error("Numeric branch labels must be integer values.");if(r){if(b.checkSubtype(r,sr(C)))return null}else r=sr(C);if(u[String(C)]!==void 0)return b.error("Branch labels must be unique.");u[String(C)]=c.length}var z=t.parse(x,f,a);if(!z)return null;a=a||z.type,c.push(z)}var N=t.parse(e[1],1,ze);if(!N)return null;var $=t.parse(e[e.length-1],e.length-1,a);return $?N.type.kind!=="value"&&t.concat(1).checkSubtype(r,N.type)?null:new no(r,a,N,u,c,$):null},no.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(sr(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},no.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},no.prototype.outputDefined=function(){return this.outputs.every(function(e){return e.outputDefined()})&&this.otherwise.outputDefined()},no.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],r=[],a={},u=0,c=Object.keys(this.cases).sort();u<c.length;u+=1){var f=c[u];(T=a[this.cases[f]])===void 0?(a[this.cases[f]]=r.length,r.push([this.cases[f],[f]])):r[T][1].push(f)}for(var v=function(z){return e.inputType.kind==="number"?Number(z):z},x=0,b=r;x<b.length;x+=1){var S=b[x],T=S[0],C=S[1];t.push(C.length===1?v(C[0]):C.map(v)),t.push(this.outputs[outputIndex$1].serialize())}return t.push(this.otherwise.serialize()),t};var oo=function(e,t,r){this.type=e,this.branches=t,this.otherwise=r};oo.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found only "+(e.length-1)+".");if(e.length%2!=0)return t.error("Expected an odd number of arguments.");var r;t.expectedType&&t.expectedType.kind!=="value"&&(r=t.expectedType);for(var a=[],u=1;u<e.length-1;u+=2){var c=t.parse(e[u],u,Ae);if(!c)return null;var f=t.parse(e[u+1],u+1,r);if(!f)return null;a.push([c,f]),r=r||f.type}var v=t.parse(e[e.length-1],e.length-1,r);return v?new oo(r,a,v):null},oo.prototype.evaluate=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var a=r[t],u=a[1];if(a[0].evaluate(e))return u.evaluate(e)}return this.otherwise.evaluate(e)},oo.prototype.eachChild=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var a=r[t],u=a[1];e(a[0]),e(u)}e(this.otherwise)},oo.prototype.outputDefined=function(){return this.branches.every(function(e){return e[1].outputDefined()})&&this.otherwise.outputDefined()},oo.prototype.serialize=function(){var e=["case"];return this.eachChild(function(t){e.push(t.serialize())}),e};var kn=function(e,t,r,a){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=a};function Nu(e,t){return e==="=="||e==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function $u(e,t,r,a){return a.compare(t,r)===0}function Ut(e,t,r){var a=e!=="=="&&e!=="!=";return function(){function u(c,f,v){this.type=Ae,this.lhs=c,this.rhs=f,this.collator=v,this.hasUntypedArgument=c.type.kind==="value"||f.type.kind==="value"}return u.parse=function(c,f){if(c.length!==3&&c.length!==4)return f.error("Expected two or three arguments.");var v=c[0],x=f.parse(c[1],1,ze);if(!x)return null;if(!Nu(v,x.type))return f.concat(1).error('"'+v+`" comparisons are not supported for type '`+_t(x.type)+"'.");var b=f.parse(c[2],2,ze);if(!b)return null;if(!Nu(v,b.type))return f.concat(2).error('"'+v+`" comparisons are not supported for type '`+_t(b.type)+"'.");if(x.type.kind!==b.type.kind&&x.type.kind!=="value"&&b.type.kind!=="value")return f.error("Cannot compare types '"+_t(x.type)+"' and '"+_t(b.type)+"'.");a&&(x.type.kind==="value"&&b.type.kind!=="value"?x=new Ht(b.type,[x]):x.type.kind!=="value"&&b.type.kind==="value"&&(b=new Ht(x.type,[b])));var S=null;if(c.length===4){if(x.type.kind!=="string"&&b.type.kind!=="string"&&x.type.kind!=="value"&&b.type.kind!=="value")return f.error("Cannot use collator to compare non-string types.");if(!(S=f.parse(c[3],3,vt)))return null}return new u(x,b,S)},u.prototype.evaluate=function(c){var f=this.lhs.evaluate(c),v=this.rhs.evaluate(c);if(a&&this.hasUntypedArgument){var x=sr(f),b=sr(v);if(x.kind!==b.kind||x.kind!=="string"&&x.kind!=="number")throw new kr('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+x.kind+", "+b.kind+") instead.")}if(this.collator&&!a&&this.hasUntypedArgument){var S=sr(f),T=sr(v);if(S.kind!=="string"||T.kind!=="string")return t(c,f,v)}return this.collator?r(c,f,v,this.collator.evaluate(c)):t(c,f,v)},u.prototype.eachChild=function(c){c(this.lhs),c(this.rhs),this.collator&&c(this.collator)},u.prototype.outputDefined=function(){return!0},u.prototype.serialize=function(){var c=[e];return this.eachChild(function(f){c.push(f.serialize())}),c},u}()}kn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,ze),a=t.parse(e[2],2,de);if(!r||!a)return null;if(!ar(r.type,[Et(ze),De,ze]))return t.error("Expected first argument to be of type array or string, but found "+_t(r.type)+" instead");if(e.length===4){var u=t.parse(e[3],3,de);return u?new kn(r.type,r,a,u):null}return new kn(r.type,r,a)},kn.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!Dt(t,["string","array"]))throw new kr("Expected first argument to be of type array or string, but found "+_t(sr(t))+" instead.");if(this.endIndex){var a=this.endIndex.evaluate(e);return t.slice(r,a)}return t.slice(r)},kn.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},kn.prototype.outputDefined=function(){return!1},kn.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var Up=Ut("==",function(e,t,r){return t===r},$u),hs=Ut("!=",function(e,t,r){return t!==r},function(e,t,r,a){return!$u(0,t,r,a)}),ju=Ut("<",function(e,t,r){return t<r},function(e,t,r,a){return a.compare(t,r)<0}),qu=Ut(">",function(e,t,r){return t>r},function(e,t,r,a){return a.compare(t,r)>0}),Gu=Ut("<=",function(e,t,r){return t<=r},function(e,t,r,a){return a.compare(t,r)<=0}),Zu=Ut(">=",function(e,t,r){return t>=r},function(e,t,r,a){return a.compare(t,r)>=0}),ao=function(e,t,r,a,u){this.type=De,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=a,this.maxFractionDigits=u};ao.parse=function(e,t){if(e.length!==3)return t.error("Expected two arguments.");var r=t.parse(e[1],1,de);if(!r)return null;var a=e[2];if(typeof a!="object"||Array.isArray(a))return t.error("NumberFormat options argument must be an object.");var u=null;if(a.locale&&!(u=t.parse(a.locale,1,De)))return null;var c=null;if(a.currency&&!(c=t.parse(a.currency,1,De)))return null;var f=null;if(a["min-fraction-digits"]&&!(f=t.parse(a["min-fraction-digits"],1,de)))return null;var v=null;return a["max-fraction-digits"]&&!(v=t.parse(a["max-fraction-digits"],1,de))?null:new ao(r,u,c,f,v)},ao.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},ao.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},ao.prototype.outputDefined=function(){return!1},ao.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]};var Mn=function(e){this.type=de,this.input=e};Mn.parse=function(e,t){if(e.length!==2)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1);return r?r.type.kind!=="array"&&r.type.kind!=="string"&&r.type.kind!=="value"?t.error("Expected argument of type string or array, but found "+_t(r.type)+" instead."):new Mn(r):null},Mn.prototype.evaluate=function(e){var t=this.input.evaluate(e);if(typeof t=="string"||Array.isArray(t))return t.length;throw new kr("Expected value to be of type string or array, but found "+_t(sr(t))+" instead.")},Mn.prototype.eachChild=function(e){e(this.input)},Mn.prototype.outputDefined=function(){return!1},Mn.prototype.serialize=function(){var e=["length"];return this.eachChild(function(t){e.push(t.serialize())}),e};var so={"==":Up,"!=":hs,">":qu,"<":ju,">=":Zu,"<=":Gu,array:Ht,at:ro,boolean:Ht,case:oo,coalesce:En,collator:Yi,format:$i,image:vi,in:io,"index-of":Cn,interpolate:Fr,"interpolate-hcl":Fr,"interpolate-lab":Fr,length:Mn,let:Pn,literal:Gr,match:no,number:Ht,"number-format":ao,object:Ht,slice:kn,step:ui,string:Ht,"to-boolean":Ci,"to-color":Ci,"to-number":Ci,"to-string":Ci,var:In,within:ki};function Wu(e,t){var r=t[0],a=t[1],u=t[2],c=t[3];r=r.evaluate(e),a=a.evaluate(e),u=u.evaluate(e);var f=c?c.evaluate(e):1,v=bl(r,a,u,f);if(v)throw new kr(v);return new Pt(r/255*f,a/255*f,u/255*f,f)}function Hu(e,t){return e in t}function Cl(e,t){var r=t[e];return r===void 0?null:r}function lo(e){return{type:e}}function Xu(e){return{result:"success",value:e}}function uo(e){return{result:"error",value:e}}function co(e){return e["property-type"]==="data-driven"||e["property-type"]==="cross-faded-data-driven"}function Ku(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function Ta(e){return!!e.expression&&e.expression.interpolated}function $t(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":e===null?"null":typeof e}function fs(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Np(e){return e}function jo(e,t,r){return e!==void 0?e:t!==void 0?t:r!==void 0?r:void 0}function Ju(e,t,r,a,u){return jo(typeof r===u?a[r]:void 0,e.default,t.default)}function $p(e,t,r){if($t(r)!=="number")return jo(e.default,t.default);var a=e.stops.length;if(a===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[a-1][0])return e.stops[a-1][1];var u=ps(e.stops.map(function(c){return c[0]}),r);return e.stops[u][1]}function Yu(e,t,r){var a=e.base!==void 0?e.base:1;if($t(r)!=="number")return jo(e.default,t.default);var u=e.stops.length;if(u===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[u-1][0])return e.stops[u-1][1];var c=ps(e.stops.map(function(T){return T[0]}),r),f=function(T,C,z,N){var $=N-z,J=T-z;return $===0?0:C===1?J/$:(Math.pow(C,J)-1)/(Math.pow(C,$)-1)}(r,a,e.stops[c][0],e.stops[c+1][0]),v=e.stops[c][1],x=e.stops[c+1][1],b=$o[t.type]||Np;if(e.colorSpace&&e.colorSpace!=="rgb"){var S=Uu[e.colorSpace];b=function(T,C){return S.reverse(S.interpolate(S.forward(T),S.forward(C),f))}}return typeof v.evaluate=="function"?{evaluate:function(){for(var T=[],C=arguments.length;C--;)T[C]=arguments[C];var z=v.evaluate.apply(void 0,T),N=x.evaluate.apply(void 0,T);if(z!==void 0&&N!==void 0)return b(z,N,f)}}:b(v,x,f)}function ds(e,t,r){return t.type==="color"?r=Pt.parse(r):t.type==="formatted"?r=Cr.fromString(r.toString()):t.type==="resolvedImage"?r=ii.fromString(r.toString()):$t(r)===t.type||t.type==="enum"&&t.values[r]||(r=void 0),jo(r,e.default,t.default)}Rr.register(so,{error:[{kind:"error"},[De],function(e,t){throw new kr(t[0].evaluate(e))}],typeof:[De,[ze],function(e,t){return _t(sr(t[0].evaluate(e)))}],"to-rgba":[Et(de,4),[Pe],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[Pe,[de,de,de],Wu],rgba:[Pe,[de,de,de,de],Wu],has:{type:Ae,overloads:[[[De],function(e,t){return Hu(t[0].evaluate(e),e.properties())}],[[De,ut],function(e,t){var r=t[1];return Hu(t[0].evaluate(e),r.evaluate(e))}]]},get:{type:ze,overloads:[[[De],function(e,t){return Cl(t[0].evaluate(e),e.properties())}],[[De,ut],function(e,t){var r=t[1];return Cl(t[0].evaluate(e),r.evaluate(e))}]]},"feature-state":[ze,[De],function(e,t){return Cl(t[0].evaluate(e),e.featureState||{})}],properties:[ut,[],function(e){return e.properties()}],"geometry-type":[De,[],function(e){return e.geometryType()}],id:[ze,[],function(e){return e.id()}],zoom:[de,[],function(e){return e.globals.zoom}],"heatmap-density":[de,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[de,[],function(e){return e.globals.lineProgress||0}],accumulated:[ze,[],function(e){return e.globals.accumulated===void 0?null:e.globals.accumulated}],"+":[de,lo(de),function(e,t){for(var r=0,a=0,u=t;a<u.length;a+=1)r+=u[a].evaluate(e);return r}],"*":[de,lo(de),function(e,t){for(var r=1,a=0,u=t;a<u.length;a+=1)r*=u[a].evaluate(e);return r}],"-":{type:de,overloads:[[[de,de],function(e,t){var r=t[1];return t[0].evaluate(e)-r.evaluate(e)}],[[de],function(e,t){return-t[0].evaluate(e)}]]},"/":[de,[de,de],function(e,t){var r=t[1];return t[0].evaluate(e)/r.evaluate(e)}],"%":[de,[de,de],function(e,t){var r=t[1];return t[0].evaluate(e)%r.evaluate(e)}],ln2:[de,[],function(){return Math.LN2}],pi:[de,[],function(){return Math.PI}],e:[de,[],function(){return Math.E}],"^":[de,[de,de],function(e,t){var r=t[1];return Math.pow(t[0].evaluate(e),r.evaluate(e))}],sqrt:[de,[de],function(e,t){return Math.sqrt(t[0].evaluate(e))}],log10:[de,[de],function(e,t){return Math.log(t[0].evaluate(e))/Math.LN10}],ln:[de,[de],function(e,t){return Math.log(t[0].evaluate(e))}],log2:[de,[de],function(e,t){return Math.log(t[0].evaluate(e))/Math.LN2}],sin:[de,[de],function(e,t){return Math.sin(t[0].evaluate(e))}],cos:[de,[de],function(e,t){return Math.cos(t[0].evaluate(e))}],tan:[de,[de],function(e,t){return Math.tan(t[0].evaluate(e))}],asin:[de,[de],function(e,t){return Math.asin(t[0].evaluate(e))}],acos:[de,[de],function(e,t){return Math.acos(t[0].evaluate(e))}],atan:[de,[de],function(e,t){return Math.atan(t[0].evaluate(e))}],min:[de,lo(de),function(e,t){return Math.min.apply(Math,t.map(function(r){return r.evaluate(e)}))}],max:[de,lo(de),function(e,t){return Math.max.apply(Math,t.map(function(r){return r.evaluate(e)}))}],abs:[de,[de],function(e,t){return Math.abs(t[0].evaluate(e))}],round:[de,[de],function(e,t){var r=t[0].evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[de,[de],function(e,t){return Math.floor(t[0].evaluate(e))}],ceil:[de,[de],function(e,t){return Math.ceil(t[0].evaluate(e))}],"filter-==":[Ae,[De,ze],function(e,t){var r=t[0],a=t[1];return e.properties()[r.value]===a.value}],"filter-id-==":[Ae,[ze],function(e,t){var r=t[0];return e.id()===r.value}],"filter-type-==":[Ae,[De],function(e,t){var r=t[0];return e.geometryType()===r.value}],"filter-<":[Ae,[De,ze],function(e,t){var r=t[0],a=t[1],u=e.properties()[r.value],c=a.value;return typeof u==typeof c&&u<c}],"filter-id-<":[Ae,[ze],function(e,t){var r=t[0],a=e.id(),u=r.value;return typeof a==typeof u&&a<u}],"filter->":[Ae,[De,ze],function(e,t){var r=t[0],a=t[1],u=e.properties()[r.value],c=a.value;return typeof u==typeof c&&u>c}],"filter-id->":[Ae,[ze],function(e,t){var r=t[0],a=e.id(),u=r.value;return typeof a==typeof u&&a>u}],"filter-<=":[Ae,[De,ze],function(e,t){var r=t[0],a=t[1],u=e.properties()[r.value],c=a.value;return typeof u==typeof c&&u<=c}],"filter-id-<=":[Ae,[ze],function(e,t){var r=t[0],a=e.id(),u=r.value;return typeof a==typeof u&&a<=u}],"filter->=":[Ae,[De,ze],function(e,t){var r=t[0],a=t[1],u=e.properties()[r.value],c=a.value;return typeof u==typeof c&&u>=c}],"filter-id->=":[Ae,[ze],function(e,t){var r=t[0],a=e.id(),u=r.value;return typeof a==typeof u&&a>=u}],"filter-has":[Ae,[ze],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[Ae,[],function(e){return e.id()!==null&&e.id()!==void 0}],"filter-type-in":[Ae,[Et(De)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[Ae,[Et(ze)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[Ae,[De,Et(ze)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[Ae,[De,Et(ze)],function(e,t){var r=t[0],a=t[1];return function(u,c,f,v){for(;f<=v;){var x=f+v>>1;if(c[x]===u)return!0;c[x]>u?v=x-1:f=x+1}return!1}(e.properties()[r.value],a.value,0,a.value.length-1)}],all:{type:Ae,overloads:[[[Ae,Ae],function(e,t){var r=t[1];return t[0].evaluate(e)&&r.evaluate(e)}],[lo(Ae),function(e,t){for(var r=0,a=t;r<a.length;r+=1)if(!a[r].evaluate(e))return!1;return!0}]]},any:{type:Ae,overloads:[[[Ae,Ae],function(e,t){var r=t[1];return t[0].evaluate(e)||r.evaluate(e)}],[lo(Ae),function(e,t){for(var r=0,a=t;r<a.length;r+=1)if(a[r].evaluate(e))return!0;return!1}]]},"!":[Ae,[Ae],function(e,t){return!t[0].evaluate(e)}],"is-supported-script":[Ae,[De],function(e,t){var r=e.globals&&e.globals.isSupportedScript;return!r||r(t[0].evaluate(e))}],upcase:[De,[De],function(e,t){return t[0].evaluate(e).toUpperCase()}],downcase:[De,[De],function(e,t){return t[0].evaluate(e).toLowerCase()}],concat:[De,lo(ze),function(e,t){return t.map(function(r){return xa(r.evaluate(e))}).join("")}],"resolved-locale":[De,[vt],function(e,t){return t[0].evaluate(e).resolvedLocale()}]});var qo=function(e,t){this.expression=e,this._warningHistory={},this._evaluator=new pn,this._defaultValue=t?function(r){return r.type==="color"&&fs(r.default)?new Pt(0,0,0,0):r.type==="color"?Pt.parse(r.default)||null:r.default===void 0?null:r.default}(t):null,this._enumValues=t&&t.type==="enum"?t.values:null};function Ia(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"&&e[0]in so}function ms(e,t){var r=new An(so,[],t?function(u){var c={color:Pe,string:De,number:de,enum:De,boolean:Ae,formatted:Vt,resolvedImage:pt};return u.type==="array"?Et(c[u.value]||ze,u.length):c[u.type]}(t):void 0),a=r.parse(e,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?Xu(new qo(a,t)):uo(r.errors)}qo.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,u,c){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=a,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=c,this.expression.evaluate(this._evaluator)},qo.prototype.evaluate=function(e,t,r,a,u,c){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=a,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=c||null;try{var f=this.expression.evaluate(this._evaluator);if(f==null||typeof f=="number"&&f!=f)return this._defaultValue;if(this._enumValues&&!(f in this._enumValues))throw new kr("Expected value to be one of "+Object.keys(this._enumValues).map(function(v){return JSON.stringify(v)}).join(", ")+", but found "+JSON.stringify(f)+" instead.");return f}catch(v){return this._warningHistory[v.message]||(this._warningHistory[v.message]=!0,typeof console<"u"&&console.warn(v.message)),this._defaultValue}};var Aa=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!Tn(t.expression)};Aa.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,u,c){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,a,u,c)},Aa.prototype.evaluate=function(e,t,r,a,u,c){return this._styleExpression.evaluate(e,t,r,a,u,c)};var Go=function(e,t,r,a){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!Tn(t.expression),this.interpolationType=a};function Qu(e,t){if((e=ms(e,t)).result==="error")return e;var r=e.value.expression,a=Sn(r);if(!a&&!co(t))return uo([new xe("","data expressions not supported")]);var u=to(r,["zoom"]);if(!u&&!Ku(t))return uo([new xe("","zoom expressions not supported")]);var c=function f(v){var x=null;if(v instanceof Pn)x=f(v.result);else if(v instanceof En)for(var b=0,S=v.args;b<S.length&&!(x=f(S[b]));b+=1);else(v instanceof ui||v instanceof Fr)&&v.input instanceof Rr&&v.input.name==="zoom"&&(x=v);return x instanceof xe||v.eachChild(function(T){var C=f(T);C instanceof xe?x=C:!x&&C?x=new xe("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):x&&C&&x!==C&&(x=new xe("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),x}(r);return c||u?c instanceof xe?uo([c]):c instanceof Fr&&!Ta(t)?uo([new xe("",'"interpolate" expressions cannot be used with this property')]):Xu(c?new Go(a?"camera":"composite",e.value,c.labels,c instanceof Fr?c.interpolation:void 0):new Aa(a?"constant":"source",e.value)):uo([new xe("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Go.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,u,c){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,a,u,c)},Go.prototype.evaluate=function(e,t,r,a,u,c){return this._styleExpression.evaluate(e,t,r,a,u,c)},Go.prototype.interpolationFactor=function(e,t,r){return this.interpolationType?Fr.interpolationFactor(this.interpolationType,e,t,r):0};var Zo=function(e,t){this._parameters=e,this._specification=t,_e(this,function r(a,u){var c,f,v,x=u.type==="color",b=a.stops&&typeof a.stops[0][0]=="object",S=b||!(b||a.property!==void 0),T=a.type||(Ta(u)?"exponential":"interval");if(x&&((a=_e({},a)).stops&&(a.stops=a.stops.map(function(Me){return[Me[0],Pt.parse(Me[1])]})),a.default=Pt.parse(a.default?a.default:u.default)),a.colorSpace&&a.colorSpace!=="rgb"&&!Uu[a.colorSpace])throw new Error("Unknown color space: "+a.colorSpace);if(T==="exponential")c=Yu;else if(T==="interval")c=$p;else if(T==="categorical"){c=Ju,f=Object.create(null);for(var C=0,z=a.stops;C<z.length;C+=1){var N=z[C];f[N[0]]=N[1]}v=typeof a.stops[0][0]}else{if(T!=="identity")throw new Error('Unknown function type "'+T+'"');c=ds}if(b){for(var $={},J=[],H=0;H<a.stops.length;H++){var te=a.stops[H],oe=te[0].zoom;$[oe]===void 0&&($[oe]={zoom:oe,type:a.type,property:a.property,default:a.default,stops:[]},J.push(oe)),$[oe].stops.push([te[0].value,te[1]])}for(var se=[],ue=0,ye=J;ue<ye.length;ue+=1){var we=ye[ue];se.push([$[we].zoom,r($[we],u)])}var Ie={name:"linear"};return{kind:"composite",interpolationType:Ie,interpolationFactor:Fr.interpolationFactor.bind(void 0,Ie),zoomStops:se.map(function(Me){return Me[0]}),evaluate:function(Me,Ze){var Be=Me.zoom;return Yu({stops:se,base:a.base},u,Be).evaluate(Be,Ze)}}}if(S){var je=T==="exponential"?{name:"exponential",base:a.base!==void 0?a.base:1}:null;return{kind:"camera",interpolationType:je,interpolationFactor:Fr.interpolationFactor.bind(void 0,je),zoomStops:a.stops.map(function(Me){return Me[0]}),evaluate:function(Me){return c(a,u,Me.zoom,f,v)}}}return{kind:"source",evaluate:function(Me,Ze){var Be=Ze&&Ze.properties?Ze.properties[a.property]:void 0;return Be===void 0?jo(a.default,u.default):c(a,u,Be,f,v)}}}(this._parameters,this._specification))};function ji(e){var t=e.key,r=e.value,a=e.valueSpec||{},u=e.objectElementValidators||{},c=e.style,f=e.styleSpec,v=[],x=$t(r);if(x!=="object")return[new W(t,r,"object expected, "+x+" found")];for(var b in r){var S=b.split(".")[0],T=a[S]||a["*"],C=void 0;if(u[S])C=u[S];else if(a[S])C=gt;else if(u["*"])C=u["*"];else{if(!a["*"]){v.push(new W(t,r[b],'unknown property "'+b+'"'));continue}C=gt}v=v.concat(C({key:(t&&t+".")+b,value:r[b],valueSpec:T,style:c,styleSpec:f,object:r,objectKey:b},r))}for(var z in a)u[z]||a[z].required&&a[z].default===void 0&&r[z]===void 0&&v.push(new W(t,r,'missing required property "'+z+'"'));return v}function ec(e){var t=e.value,r=e.valueSpec,a=e.style,u=e.styleSpec,c=e.key,f=e.arrayElementValidator||gt;if($t(t)!=="array")return[new W(c,t,"array expected, "+$t(t)+" found")];if(r.length&&t.length!==r.length)return[new W(c,t,"array length "+r.length+" expected, length "+t.length+" found")];if(r["min-length"]&&t.length<r["min-length"])return[new W(c,t,"array length at least "+r["min-length"]+" expected, length "+t.length+" found")];var v={type:r.value,values:r.values};u.$version<7&&(v.function=r.function),$t(r.value)==="object"&&(v=r.value);for(var x=[],b=0;b<t.length;b++)x=x.concat(f({array:t,arrayIndex:b,value:t[b],valueSpec:v,style:a,styleSpec:u,key:c+"["+b+"]"}));return x}function tc(e){var t=e.key,r=e.value,a=e.valueSpec,u=$t(r);return u==="number"&&r!=r&&(u="NaN"),u!=="number"?[new W(t,r,"number expected, "+u+" found")]:"minimum"in a&&r<a.minimum?[new W(t,r,r+" is less than the minimum value "+a.minimum)]:"maximum"in a&&r>a.maximum?[new W(t,r,r+" is greater than the maximum value "+a.maximum)]:[]}function rc(e){var t,r,a,u=e.valueSpec,c=be(e.value.type),f={},v=c!=="categorical"&&e.value.property===void 0,x=!v,b=$t(e.value.stops)==="array"&&$t(e.value.stops[0])==="array"&&$t(e.value.stops[0][0])==="object",S=ji({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(z){if(c==="identity")return[new W(z.key,z.value,'identity function may not have a "stops" property')];var N=[],$=z.value;return N=N.concat(ec({key:z.key,value:$,valueSpec:z.valueSpec,style:z.style,styleSpec:z.styleSpec,arrayElementValidator:T})),$t($)==="array"&&$.length===0&&N.push(new W(z.key,$,"array must have at least one stop")),N},default:function(z){return gt({key:z.key,value:z.value,valueSpec:u,style:z.style,styleSpec:z.styleSpec})}}});return c==="identity"&&v&&S.push(new W(e.key,e.value,'missing required property "property"')),c==="identity"||e.value.stops||S.push(new W(e.key,e.value,'missing required property "stops"')),c==="exponential"&&e.valueSpec.expression&&!Ta(e.valueSpec)&&S.push(new W(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(x&&!co(e.valueSpec)?S.push(new W(e.key,e.value,"property functions not supported")):v&&!Ku(e.valueSpec)&&S.push(new W(e.key,e.value,"zoom functions not supported"))),c!=="categorical"&&!b||e.value.property!==void 0||S.push(new W(e.key,e.value,'"property" property is required')),S;function T(z){var N=[],$=z.value,J=z.key;if($t($)!=="array")return[new W(J,$,"array expected, "+$t($)+" found")];if($.length!==2)return[new W(J,$,"array length 2 expected, length "+$.length+" found")];if(b){if($t($[0])!=="object")return[new W(J,$,"object expected, "+$t($[0])+" found")];if($[0].zoom===void 0)return[new W(J,$,"object stop key must have zoom")];if($[0].value===void 0)return[new W(J,$,"object stop key must have value")];if(a&&a>be($[0].zoom))return[new W(J,$[0].zoom,"stop zoom values must appear in ascending order")];be($[0].zoom)!==a&&(a=be($[0].zoom),r=void 0,f={}),N=N.concat(ji({key:J+"[0]",value:$[0],valueSpec:{zoom:{}},style:z.style,styleSpec:z.styleSpec,objectElementValidators:{zoom:tc,value:C}}))}else N=N.concat(C({key:J+"[0]",value:$[0],style:z.style,styleSpec:z.styleSpec},$));return Ia(fe($[1]))?N.concat([new W(J+"[1]",$[1],"expressions are not allowed in function stops.")]):N.concat(gt({key:J+"[1]",value:$[1],valueSpec:u,style:z.style,styleSpec:z.styleSpec}))}function C(z,N){var $=$t(z.value),J=be(z.value),H=z.value!==null?z.value:N;if(t){if($!==t)return[new W(z.key,H,$+" stop domain type must match previous stop domain type "+t)]}else t=$;if($!=="number"&&$!=="string"&&$!=="boolean")return[new W(z.key,H,"stop domain value must be a number, string, or boolean")];if($!=="number"&&c!=="categorical"){var te="number expected, "+$+" found";return co(u)&&c===void 0&&(te+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new W(z.key,H,te)]}return c!=="categorical"||$!=="number"||isFinite(J)&&Math.floor(J)===J?c!=="categorical"&&$==="number"&&r!==void 0&&J<r?[new W(z.key,H,"stop domain values must appear in ascending order")]:(r=J,c==="categorical"&&J in f?[new W(z.key,H,"stop domain values must be unique")]:(f[J]=!0,[])):[new W(z.key,H,"integer expected, found "+J)]}}function po(e){var t=(e.expressionContext==="property"?Qu:ms)(fe(e.value),e.valueSpec);if(t.result==="error")return t.value.map(function(a){return new W(""+e.key+a.key,e.value,a.message)});var r=t.value.expression||t.value._styleExpression.expression;if(e.expressionContext==="property"&&e.propertyKey==="text-font"&&!r.outputDefined())return[new W(e.key,e.value,'Invalid data expression for "'+e.propertyKey+'". Output values must be contained as literals within the expression.')];if(e.expressionContext==="property"&&e.propertyType==="layout"&&!Tn(r))return[new W(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if(e.expressionContext==="filter"&&!Tn(r))return[new W(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&e.expressionContext.indexOf("cluster")===0){if(!to(r,["zoom","feature-state"]))return[new W(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(e.expressionContext==="cluster-initial"&&!Sn(r))return[new W(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Ea(e){var t=e.key,r=e.value,a=e.valueSpec,u=[];return Array.isArray(a.values)?a.values.indexOf(be(r))===-1&&u.push(new W(t,r,"expected one of ["+a.values.join(", ")+"], "+JSON.stringify(r)+" found")):Object.keys(a.values).indexOf(be(r))===-1&&u.push(new W(t,r,"expected one of ["+Object.keys(a.values).join(", ")+"], "+JSON.stringify(r)+" found")),u}function ys(e){if(e===!0||e===!1)return!0;if(!Array.isArray(e)||e.length===0)return!1;switch(e[0]){case"has":return e.length>=2&&e[1]!=="$id"&&e[1]!=="$type";case"in":return e.length>=3&&(typeof e[1]!="string"||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,r=e.slice(1);t<r.length;t+=1){var a=r[t];if(!ys(a)&&typeof a!="boolean")return!1}return!0;default:return!0}}Zo.deserialize=function(e){return new Zo(e._parameters,e._specification)},Zo.serialize=function(e){return{_parameters:e._parameters,_specification:e._specification}};var kl={type:"boolean",default:!1};function vs(e){if(e==null)return{filter:function(){return!0},needGeometry:!1};ys(e)||(e=gs(e));var t=ms(e,kl);if(t.result==="error")throw new Error(t.value.map(function(r){return r.key+": "+r.message}).join(", "));return{filter:function(r,a,u){return t.value.evaluate(r,a,{},u)},needGeometry:function r(a){if(!Array.isArray(a))return!1;if(a[0]==="within")return!0;for(var u=1;u<a.length;u++)if(r(a[u]))return!0;return!1}(e)}}function jp(e,t){return e<t?-1:e>t?1:0}function gs(e){if(!e)return!0;var t,r=e[0];return e.length<=1?r!=="any":r==="=="?Ml(e[1],e[2],"=="):r==="!="?_s(Ml(e[1],e[2],"==")):r==="<"||r===">"||r==="<="||r===">="?Ml(e[1],e[2],r):r==="any"?(t=e.slice(1),["any"].concat(t.map(gs))):r==="all"?["all"].concat(e.slice(1).map(gs)):r==="none"?["all"].concat(e.slice(1).map(gs).map(_s)):r==="in"?ic(e[1],e.slice(2)):r==="!in"?_s(ic(e[1],e.slice(2))):r==="has"?nc(e[1]):r==="!has"?_s(nc(e[1])):r!=="within"||e}function Ml(e,t,r){switch(e){case"$type":return["filter-type-"+r,t];case"$id":return["filter-id-"+r,t];default:return["filter-"+r,e,t]}}function ic(e,t){if(t.length===0)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(function(r){return typeof r!=typeof t[0]})?["filter-in-large",e,["literal",t.sort(jp)]]:["filter-in-small",e,["literal",t]]}}function nc(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function _s(e){return["!",e]}function zl(e){return ys(fe(e.value))?po(_e({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(r){var a=r.value,u=r.key;if($t(a)!=="array")return[new W(u,a,"array expected, "+$t(a)+" found")];var c,f=r.styleSpec,v=[];if(a.length<1)return[new W(u,a,"filter array must have at least 1 element")];switch(v=v.concat(Ea({key:u+"[0]",value:a[0],valueSpec:f.filter_operator,style:r.style,styleSpec:r.styleSpec})),be(a[0])){case"<":case"<=":case">":case">=":a.length>=2&&be(a[1])==="$type"&&v.push(new W(u,a,'"$type" cannot be use with operator "'+a[0]+'"'));case"==":case"!=":a.length!==3&&v.push(new W(u,a,'filter array for operator "'+a[0]+'" must have 3 elements'));case"in":case"!in":a.length>=2&&(c=$t(a[1]))!=="string"&&v.push(new W(u+"[1]",a[1],"string expected, "+c+" found"));for(var x=2;x<a.length;x++)c=$t(a[x]),be(a[1])==="$type"?v=v.concat(Ea({key:u+"["+x+"]",value:a[x],valueSpec:f.geometry_type,style:r.style,styleSpec:r.styleSpec})):c!=="string"&&c!=="number"&&c!=="boolean"&&v.push(new W(u+"["+x+"]",a[x],"string, number, or boolean expected, "+c+" found"));break;case"any":case"all":case"none":for(var b=1;b<a.length;b++)v=v.concat(t({key:u+"["+b+"]",value:a[b],style:r.style,styleSpec:r.styleSpec}));break;case"has":case"!has":c=$t(a[1]),a.length!==2?v.push(new W(u,a,'filter array for "'+a[0]+'" operator must have 2 elements')):c!=="string"&&v.push(new W(u+"[1]",a[1],"string expected, "+c+" found"));break;case"within":c=$t(a[1]),a.length!==2?v.push(new W(u,a,'filter array for "'+a[0]+'" operator must have 2 elements')):c!=="object"&&v.push(new W(u+"[1]",a[1],"object expected, "+c+" found"))}return v}(e)}function Bl(e,t){var r=e.key,a=e.style,u=e.styleSpec,c=e.value,f=e.objectKey,v=u[t+"_"+e.layerType];if(!v)return[];var x=f.match(/^(.*)-transition$/);if(t==="paint"&&x&&v[x[1]]&&v[x[1]].transition)return gt({key:r,value:c,valueSpec:u.transition,style:a,styleSpec:u});var b,S=e.valueSpec||v[f];if(!S)return[new W(r,c,'unknown property "'+f+'"')];if($t(c)==="string"&&co(S)&&!S.tokens&&(b=/^{([^}]+)}$/.exec(c)))return[new W(r,c,'"'+f+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(b[1])+" }`.")];var T=[];return e.layerType==="symbol"&&(f==="text-field"&&a&&!a.glyphs&&T.push(new W(r,c,'use of "text-field" requires a style "glyphs" property')),f==="text-font"&&fs(fe(c))&&be(c.type)==="identity"&&T.push(new W(r,c,'"text-font" does not support identity functions'))),T.concat(gt({key:e.key,value:c,valueSpec:S,style:a,styleSpec:u,expressionContext:"property",propertyType:t,propertyKey:f}))}function Dl(e){return Bl(e,"paint")}function Pa(e){return Bl(e,"layout")}function oc(e){var t=[],r=e.value,a=e.key,u=e.style,c=e.styleSpec;r.type||r.ref||t.push(new W(a,r,'either "type" or "ref" is required'));var f,v=be(r.type),x=be(r.ref);if(r.id)for(var b=be(r.id),S=0;S<e.arrayIndex;S++){var T=u.layers[S];be(T.id)===b&&t.push(new W(a,r.id,'duplicate layer id "'+r.id+'", previously used at line '+T.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach(function(N){N in r&&t.push(new W(a,r[N],'"'+N+'" is prohibited for ref layers'))}),u.layers.forEach(function(N){be(N.id)===x&&(f=N)}),f?f.ref?t.push(new W(a,r.ref,"ref cannot reference another ref layer")):v=be(f.type):t.push(new W(a,r.ref,'ref layer "'+x+'" not found'));else if(v!=="background")if(r.source){var C=u.sources&&u.sources[r.source],z=C&&be(C.type);C?z==="vector"&&v==="raster"?t.push(new W(a,r.source,'layer "'+r.id+'" requires a raster source')):z==="raster"&&v!=="raster"?t.push(new W(a,r.source,'layer "'+r.id+'" requires a vector source')):z!=="vector"||r["source-layer"]?z==="raster-dem"&&v!=="hillshade"?t.push(new W(a,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):v!=="line"||!r.paint||!r.paint["line-gradient"]||z==="geojson"&&C.lineMetrics||t.push(new W(a,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):t.push(new W(a,r,'layer "'+r.id+'" must specify a "source-layer"')):t.push(new W(a,r.source,'source "'+r.source+'" not found'))}else t.push(new W(a,r,'missing required property "source"'));return t=t.concat(ji({key:a,value:r,valueSpec:c.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return gt({key:a+".type",value:r.type,valueSpec:c.layer.type,style:e.style,styleSpec:e.styleSpec,object:r,objectKey:"type"})},filter:zl,layout:function(N){return ji({layer:r,key:N.key,value:N.value,style:N.style,styleSpec:N.styleSpec,objectElementValidators:{"*":function($){return Pa(_e({layerType:v},$))}}})},paint:function(N){return ji({layer:r,key:N.key,value:N.value,style:N.style,styleSpec:N.styleSpec,objectElementValidators:{"*":function($){return Dl(_e({layerType:v},$))}}})}}}))}function ho(e){var t=e.value,r=e.key,a=$t(t);return a!=="string"?[new W(r,t,"string expected, "+a+" found")]:[]}var Xt={promoteId:function(e){var t=e.key,r=e.value;if($t(r)==="string")return ho({key:t,value:r});var a=[];for(var u in r)a.push.apply(a,ho({key:t+"."+u,value:r[u]}));return a}};function xs(e){var t=e.value,r=e.key,a=e.styleSpec,u=e.style;if(!t.type)return[new W(r,t,'"type" is required')];var c,f=be(t.type);switch(f){case"vector":case"raster":case"raster-dem":return ji({key:r,value:t,valueSpec:a["source_"+f.replace("-","_")],style:e.style,styleSpec:a,objectElementValidators:Xt});case"geojson":if(c=ji({key:r,value:t,valueSpec:a.source_geojson,style:u,styleSpec:a,objectElementValidators:Xt}),t.cluster)for(var v in t.clusterProperties){var x=t.clusterProperties[v],b=x[0],S=typeof b=="string"?[b,["accumulated"],["get",v]]:b;c.push.apply(c,po({key:r+"."+v+".map",value:x[1],expressionContext:"cluster-map"})),c.push.apply(c,po({key:r+"."+v+".reduce",value:S,expressionContext:"cluster-reduce"}))}return c;case"video":return ji({key:r,value:t,valueSpec:a.source_video,style:u,styleSpec:a});case"image":return ji({key:r,value:t,valueSpec:a.source_image,style:u,styleSpec:a});case"canvas":return[new W(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ea({key:r+".type",value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function fo(e){var t=e.value,r=e.styleSpec,a=r.light,u=e.style,c=[],f=$t(t);if(t===void 0)return c;if(f!=="object")return c.concat([new W("light",t,"object expected, "+f+" found")]);for(var v in t){var x=v.match(/^(.*)-transition$/);c=c.concat(x&&a[x[1]]&&a[x[1]].transition?gt({key:v,value:t[v],valueSpec:r.transition,style:u,styleSpec:r}):a[v]?gt({key:v,value:t[v],valueSpec:a[v],style:u,styleSpec:r}):[new W(v,t[v],'unknown property "'+v+'"')])}return c}var zn={"*":function(){return[]},array:ec,boolean:function(e){var t=e.value,r=e.key,a=$t(t);return a!=="boolean"?[new W(r,t,"boolean expected, "+a+" found")]:[]},number:tc,color:function(e){var t=e.key,r=e.value,a=$t(r);return a!=="string"?[new W(t,r,"color expected, "+a+" found")]:mt(r)===null?[new W(t,r,'color expected, "'+r+'" found')]:[]},constants:ne,enum:Ea,filter:zl,function:rc,layer:oc,object:ji,source:xs,light:fo,string:ho,formatted:function(e){return ho(e).length===0?[]:po(e)},resolvedImage:function(e){return ho(e).length===0?[]:po(e)}};function gt(e){var t=e.value,r=e.valueSpec,a=e.styleSpec;return r.expression&&fs(be(t))?rc(e):r.expression&&Ia(fe(t))?po(e):r.type&&zn[r.type]?zn[r.type](e):ji(_e({},e,{valueSpec:r.type?a[r.type]:r}))}function jt(e){var t=e.value,r=e.key,a=ho(e);return a.length||(t.indexOf("{fontstack}")===-1&&a.push(new W(r,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&a.push(new W(r,t,'"glyphs" url must include a "{range}" token'))),a}function gi(e,t){t===void 0&&(t=D);var r=[];return r=r.concat(gt({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:jt,"*":function(){return[]}}})),e.constants&&(r=r.concat(ne({key:"constants",value:e.constants}))),Ca(r)}function Ca(e){return[].concat(e).sort(function(t,r){return t.line-r.line})}function Wo(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return Ca(e.apply(this,t))}}gi.source=Wo(xs),gi.light=Wo(fo),gi.layer=Wo(oc),gi.filter=Wo(zl),gi.paintProperty=Wo(Dl),gi.layoutProperty=Wo(Pa);var ka=gi,qp=ka.light,Gp=ka.paintProperty,Ma=ka.layoutProperty;function za(e,t){var r=!1;if(t&&t.length)for(var a=0,u=t;a<u.length;a+=1)e.fire(new Y(new Error(u[a].message))),r=!0;return r}var hn=gr;function gr(e,t,r){var a=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var u=new Int32Array(this.arrayBuffer);e=u[0],this.d=(t=u[1])+2*(r=u[2]);for(var c=0;c<this.d*this.d;c++){var f=u[3+c],v=u[3+c+1];a.push(f===v?null:u.subarray(f,v))}var x=u[3+a.length+1];this.keys=u.subarray(u[3+a.length],x),this.bboxes=u.subarray(x),this.insert=this._insertReadonly}else{this.d=t+2*r;for(var b=0;b<this.d*this.d;b++)a.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;var S=r/t*e;this.min=-S,this.max=e+S}gr.prototype.insert=function(e,t,r,a,u){this._forEachCell(t,r,a,u,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(a),this.bboxes.push(u)},gr.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},gr.prototype._insertCell=function(e,t,r,a,u,c){this.cells[u].push(c)},gr.prototype.query=function(e,t,r,a,u){var c=this.min,f=this.max;if(e<=c&&t<=c&&f<=r&&f<=a&&!u)return Array.prototype.slice.call(this.keys);var v=[];return this._forEachCell(e,t,r,a,this._queryCell,v,{},u),v},gr.prototype._queryCell=function(e,t,r,a,u,c,f,v){var x=this.cells[u];if(x!==null)for(var b=this.keys,S=this.bboxes,T=0;T<x.length;T++){var C=x[T];if(f[C]===void 0){var z=4*C;(v?v(S[z+0],S[z+1],S[z+2],S[z+3]):e<=S[z+2]&&t<=S[z+3]&&r>=S[z+0]&&a>=S[z+1])?(f[C]=!0,c.push(b[C])):f[C]=!1}}},gr.prototype._forEachCell=function(e,t,r,a,u,c,f,v){for(var x=this._convertToCellCoord(e),b=this._convertToCellCoord(t),S=this._convertToCellCoord(r),T=this._convertToCellCoord(a),C=x;C<=S;C++)for(var z=b;z<=T;z++){var N=this.d*z+C;if((!v||v(this._convertFromCellCoord(C),this._convertFromCellCoord(z),this._convertFromCellCoord(C+1),this._convertFromCellCoord(z+1)))&&u.call(this,e,t,r,a,N,c,f,v))return}},gr.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},gr.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},gr.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=3+this.cells.length+1+1,r=0,a=0;a<this.cells.length;a++)r+=this.cells[a].length;var u=new Int32Array(t+r+this.keys.length+this.bboxes.length);u[0]=this.extent,u[1]=this.n,u[2]=this.padding;for(var c=t,f=0;f<e.length;f++){var v=e[f];u[3+f]=c,u.set(v,c),c+=v.length}return u[3+e.length]=c,u.set(this.keys,c),u[3+e.length+1]=c+=this.keys.length,u.set(this.bboxes,c),c+=this.bboxes.length,u.buffer};var Ba=ae.ImageData,ac=ae.ImageBitmap,yr={};function Oe(e,t,r){r===void 0&&(r={}),Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),yr[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}for(var ci in Oe("Object",Object),hn.serialize=function(e,t){var r=e.toArrayBuffer();return t&&t.push(r),{buffer:r}},hn.deserialize=function(e){return new hn(e.buffer)},Oe("Grid",hn),Oe("Color",Pt),Oe("Error",Error),Oe("ResolvedImage",ii),Oe("StylePropertyFunction",Zo),Oe("StyleExpression",qo,{omit:["_evaluator"]}),Oe("ZoomDependentExpression",Go),Oe("ZoomConstantExpression",Aa),Oe("CompoundExpression",Rr,{omit:["_evaluate"]}),so)so[ci]._classRegistryKey||Oe("Expression_"+ci,so[ci]);function bs(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name==="ArrayBuffer")}function Ho(e){return ac&&e instanceof ac}function qi(e,t){if(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(bs(e)||Ho(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){var r=e;return t&&t.push(r.buffer),r}if(e instanceof Ba)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){for(var a=[],u=0,c=e;u<c.length;u+=1)a.push(qi(c[u],t));return a}if(typeof e=="object"){var f=e.constructor,v=f._classRegistryKey;if(!v)throw new Error("can't serialize object of unregistered class");var x=f.serialize?f.serialize(e,t):{};if(!f.serialize){for(var b in e)if(e.hasOwnProperty(b)&&!(yr[v].omit.indexOf(b)>=0)){var S=e[b];x[b]=yr[v].shallow.indexOf(b)>=0?S:qi(S,t)}e instanceof Error&&(x.message=e.message)}if(x.$name)throw new Error("$name property is reserved for worker serialization logic.");return v!=="Object"&&(x.$name=v),x}throw new Error("can't serialize object of type "+typeof e)}function pi(e){if(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||bs(e)||Ho(e)||ArrayBuffer.isView(e)||e instanceof Ba)return e;if(Array.isArray(e))return e.map(pi);if(typeof e=="object"){var t=e.$name||"Object",r=yr[t].klass;if(!r)throw new Error("can't deserialize unregistered class "+t);if(r.deserialize)return r.deserialize(e);for(var a=Object.create(r.prototype),u=0,c=Object.keys(e);u<c.length;u+=1){var f=c[u];if(f!=="$name"){var v=e[f];a[f]=yr[t].shallow.indexOf(f)>=0?v:pi(v)}}return a}throw new Error("can't deserialize object of type "+typeof e)}var Ll=function(){this.first=!0};Ll.prototype.update=function(e,t){var r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))};var Ee={"Latin-1 Supplement":function(e){return e>=128&&e<=255},Arabic:function(e){return e>=1536&&e<=1791},"Arabic Supplement":function(e){return e>=1872&&e<=1919},"Arabic Extended-A":function(e){return e>=2208&&e<=2303},"Hangul Jamo":function(e){return e>=4352&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return e>=5120&&e<=5759},Khmer:function(e){return e>=6016&&e<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(e){return e>=6320&&e<=6399},"General Punctuation":function(e){return e>=8192&&e<=8303},"Letterlike Symbols":function(e){return e>=8448&&e<=8527},"Number Forms":function(e){return e>=8528&&e<=8591},"Miscellaneous Technical":function(e){return e>=8960&&e<=9215},"Control Pictures":function(e){return e>=9216&&e<=9279},"Optical Character Recognition":function(e){return e>=9280&&e<=9311},"Enclosed Alphanumerics":function(e){return e>=9312&&e<=9471},"Geometric Shapes":function(e){return e>=9632&&e<=9727},"Miscellaneous Symbols":function(e){return e>=9728&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return e>=11008&&e<=11263},"CJK Radicals Supplement":function(e){return e>=11904&&e<=12031},"Kangxi Radicals":function(e){return e>=12032&&e<=12255},"Ideographic Description Characters":function(e){return e>=12272&&e<=12287},"CJK Symbols and Punctuation":function(e){return e>=12288&&e<=12351},Hiragana:function(e){return e>=12352&&e<=12447},Katakana:function(e){return e>=12448&&e<=12543},Bopomofo:function(e){return e>=12544&&e<=12591},"Hangul Compatibility Jamo":function(e){return e>=12592&&e<=12687},Kanbun:function(e){return e>=12688&&e<=12703},"Bopomofo Extended":function(e){return e>=12704&&e<=12735},"CJK Strokes":function(e){return e>=12736&&e<=12783},"Katakana Phonetic Extensions":function(e){return e>=12784&&e<=12799},"Enclosed CJK Letters and Months":function(e){return e>=12800&&e<=13055},"CJK Compatibility":function(e){return e>=13056&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return e>=13312&&e<=19903},"Yijing Hexagram Symbols":function(e){return e>=19904&&e<=19967},"CJK Unified Ideographs":function(e){return e>=19968&&e<=40959},"Yi Syllables":function(e){return e>=40960&&e<=42127},"Yi Radicals":function(e){return e>=42128&&e<=42191},"Hangul Jamo Extended-A":function(e){return e>=43360&&e<=43391},"Hangul Syllables":function(e){return e>=44032&&e<=55215},"Hangul Jamo Extended-B":function(e){return e>=55216&&e<=55295},"Private Use Area":function(e){return e>=57344&&e<=63743},"CJK Compatibility Ideographs":function(e){return e>=63744&&e<=64255},"Arabic Presentation Forms-A":function(e){return e>=64336&&e<=65023},"Vertical Forms":function(e){return e>=65040&&e<=65055},"CJK Compatibility Forms":function(e){return e>=65072&&e<=65103},"Small Form Variants":function(e){return e>=65104&&e<=65135},"Arabic Presentation Forms-B":function(e){return e>=65136&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return e>=65280&&e<=65519}};function Rl(e){for(var t=0,r=e;t<r.length;t+=1)if(ws(r[t].charCodeAt(0)))return!0;return!1}function ws(e){return!(e!==746&&e!==747&&(e<4352||!(Ee["Bopomofo Extended"](e)||Ee.Bopomofo(e)||Ee["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||Ee["CJK Compatibility Ideographs"](e)||Ee["CJK Compatibility"](e)||Ee["CJK Radicals Supplement"](e)||Ee["CJK Strokes"](e)||!(!Ee["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||e===12336)||Ee["CJK Unified Ideographs Extension A"](e)||Ee["CJK Unified Ideographs"](e)||Ee["Enclosed CJK Letters and Months"](e)||Ee["Hangul Compatibility Jamo"](e)||Ee["Hangul Jamo Extended-A"](e)||Ee["Hangul Jamo Extended-B"](e)||Ee["Hangul Jamo"](e)||Ee["Hangul Syllables"](e)||Ee.Hiragana(e)||Ee["Ideographic Description Characters"](e)||Ee.Kanbun(e)||Ee["Kangxi Radicals"](e)||Ee["Katakana Phonetic Extensions"](e)||Ee.Katakana(e)&&e!==12540||!(!Ee["Halfwidth and Fullwidth Forms"](e)||e===65288||e===65289||e===65293||e>=65306&&e<=65310||e===65339||e===65341||e===65343||e>=65371&&e<=65503||e===65507||e>=65512&&e<=65519)||!(!Ee["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||Ee["Unified Canadian Aboriginal Syllabics"](e)||Ee["Unified Canadian Aboriginal Syllabics Extended"](e)||Ee["Vertical Forms"](e)||Ee["Yijing Hexagram Symbols"](e)||Ee["Yi Syllables"](e)||Ee["Yi Radicals"](e))))}function Fl(e){return!(ws(e)||function(t){return!!(Ee["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||Ee["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||Ee["Letterlike Symbols"](t)||Ee["Number Forms"](t)||Ee["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||Ee["Control Pictures"](t)&&t!==9251||Ee["Optical Character Recognition"](t)||Ee["Enclosed Alphanumerics"](t)||Ee["Geometric Shapes"](t)||Ee["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Ee["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Ee["CJK Symbols and Punctuation"](t)||Ee.Katakana(t)||Ee["Private Use Area"](t)||Ee["CJK Compatibility Forms"](t)||Ee["Small Form Variants"](t)||Ee["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)}(e))}function Mi(e){return e>=1424&&e<=2303||Ee["Arabic Presentation Forms-A"](e)||Ee["Arabic Presentation Forms-B"](e)}function hi(e,t){return!(!t&&Mi(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||Ee.Khmer(e))}function Ss(e){for(var t=0,r=e;t<r.length;t+=1)if(Mi(r[t].charCodeAt(0)))return!0;return!1}var Ts=null,fi="unavailable",fn=null,sc=function(e){e&&typeof e=="string"&&e.indexOf("NetworkError")>-1&&(fi="error"),Ts&&Ts(e)};function Da(){Ol.fire(new q("pluginStateChange",{pluginStatus:fi,pluginURL:fn}))}var Ol=new ee,Vl=function(){return fi},Gi=function(){if(fi!=="deferred"||!fn)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");fi="loading",Da(),fn&&va({url:fn},function(e){e?sc(e):(fi="loaded",Da())})},_i={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return fi==="loaded"||_i.applyArabicShaping!=null},isLoading:function(){return fi==="loading"},setState:function(e){fi=e.pluginStatus,fn=e.pluginURL},isParsed:function(){return _i.applyArabicShaping!=null&&_i.processBidirectionalText!=null&&_i.processStyledBidirectionalText!=null},getPluginURL:function(){return fn}},ht=function(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Ll,this.transition={})};ht.prototype.isSupportedScript=function(e){return function(t,r){for(var a=0,u=t;a<u.length;a+=1)if(!hi(u[a].charCodeAt(0),r))return!1;return!0}(e,_i.isLoaded())},ht.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},ht.prototype.getCrossfadeParameters=function(){var e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}};var Qi=function(e,t){this.property=e,this.value=t,this.expression=function(r,a){if(fs(r))return new Zo(r,a);if(Ia(r)){var u=Qu(r,a);if(u.result==="error")throw new Error(u.value.map(function(f){return f.key+": "+f.message}).join(", "));return u.value}var c=r;return typeof r=="string"&&a.type==="color"&&(c=Pt.parse(r)),{kind:"constant",evaluate:function(){return c}}}(t===void 0?e.specification.default:t,e.specification)};Qi.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},Qi.prototype.possiblyEvaluate=function(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)};var zi=function(e){this.property=e,this.value=new Qi(e,void 0)};zi.prototype.transitioned=function(e,t){return new mo(this.property,this.value,t,et({},e.transition,this.transition),e.now)},zi.prototype.untransitioned=function(){return new mo(this.property,this.value,null,{},0)};var Or=function(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)};Or.prototype.getValue=function(e){return wr(this._values[e].value.value)},Or.prototype.setValue=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new zi(this._values[e].property)),this._values[e].value=new Qi(this._values[e].property,t===null?void 0:wr(t))},Or.prototype.getTransition=function(e){return wr(this._values[e].transition)},Or.prototype.setTransition=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new zi(this._values[e].property)),this._values[e].transition=wr(t)||void 0},Or.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t],u=this.getValue(a);u!==void 0&&(e[a]=u);var c=this.getTransition(a);c!==void 0&&(e[a+"-transition"]=c)}return e},Or.prototype.transitioned=function(e,t){for(var r=new Bn(this._properties),a=0,u=Object.keys(this._values);a<u.length;a+=1){var c=u[a];r._values[c]=this._values[c].transitioned(e,t._values[c])}return r},Or.prototype.untransitioned=function(){for(var e=new Bn(this._properties),t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t];e._values[a]=this._values[a].untransitioned()}return e};var mo=function(e,t,r,a,u){this.property=e,this.value=t,this.begin=u+a.delay||0,this.end=this.begin+a.duration||0,e.specification.transition&&(a.delay||a.duration)&&(this.prior=r)};mo.prototype.possiblyEvaluate=function(e,t,r){var a=e.now||0,u=this.value.possiblyEvaluate(e,t,r),c=this.prior;if(c){if(a>this.end)return this.prior=null,u;if(this.value.isDataDriven())return this.prior=null,u;if(a<this.begin)return c.possiblyEvaluate(e,t,r);var f=(a-this.begin)/(this.end-this.begin);return this.property.interpolate(c.possiblyEvaluate(e,t,r),u,function(v){if(v<=0)return 0;if(v>=1)return 1;var x=v*v,b=x*v;return 4*(v<.5?b:3*(v-x)+b-.75)}(f))}return u};var Bn=function(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)};Bn.prototype.possiblyEvaluate=function(e,t,r){for(var a=new La(this._properties),u=0,c=Object.keys(this._values);u<c.length;u+=1){var f=c[u];a._values[f]=this._values[f].possiblyEvaluate(e,t,r)}return a},Bn.prototype.hasTransition=function(){for(var e=0,t=Object.keys(this._values);e<t.length;e+=1)if(this._values[t[e]].prior)return!0;return!1};var Zi=function(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)};Zi.prototype.getValue=function(e){return wr(this._values[e].value)},Zi.prototype.setValue=function(e,t){this._values[e]=new Qi(this._values[e].property,t===null?void 0:wr(t))},Zi.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t],u=this.getValue(a);u!==void 0&&(e[a]=u)}return e},Zi.prototype.possiblyEvaluate=function(e,t,r){for(var a=new La(this._properties),u=0,c=Object.keys(this._values);u<c.length;u+=1){var f=c[u];a._values[f]=this._values[f].possiblyEvaluate(e,t,r)}return a};var Wr=function(e,t,r){this.property=e,this.value=t,this.parameters=r};Wr.prototype.isConstant=function(){return this.value.kind==="constant"},Wr.prototype.constantOr=function(e){return this.value.kind==="constant"?this.value.value:e},Wr.prototype.evaluate=function(e,t,r,a){return this.property.evaluate(this.value,this.parameters,e,t,r,a)};var La=function(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)};La.prototype.get=function(e){return this._values[e]};var qe=function(e){this.specification=e};qe.prototype.possiblyEvaluate=function(e,t){return e.expression.evaluate(t)},qe.prototype.interpolate=function(e,t,r){var a=$o[this.specification.type];return a?a(e,t,r):e};var Ue=function(e,t){this.specification=e,this.overrides=t};Ue.prototype.possiblyEvaluate=function(e,t,r,a){return new Wr(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(t,null,{},r,a)}:e.expression,t)},Ue.prototype.interpolate=function(e,t,r){if(e.value.kind!=="constant"||t.value.kind!=="constant")return e;if(e.value.value===void 0||t.value.value===void 0)return new Wr(this,{kind:"constant",value:void 0},e.parameters);var a=$o[this.specification.type];return a?new Wr(this,{kind:"constant",value:a(e.value.value,t.value.value,r)},e.parameters):e},Ue.prototype.evaluate=function(e,t,r,a,u,c){return e.kind==="constant"?e.value:e.evaluate(t,r,a,u,c)};var Is=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.possiblyEvaluate=function(r,a,u,c){if(r.value===void 0)return new Wr(this,{kind:"constant",value:void 0},a);if(r.expression.kind==="constant"){var f=r.expression.evaluate(a,null,{},u,c),v=r.property.specification.type==="resolvedImage"&&typeof f!="string"?f.name:f,x=this._calculate(v,v,v,a);return new Wr(this,{kind:"constant",value:x},a)}if(r.expression.kind==="camera"){var b=this._calculate(r.expression.evaluate({zoom:a.zoom-1}),r.expression.evaluate({zoom:a.zoom}),r.expression.evaluate({zoom:a.zoom+1}),a);return new Wr(this,{kind:"constant",value:b},a)}return new Wr(this,r.expression,a)},t.prototype.evaluate=function(r,a,u,c,f,v){if(r.kind==="source"){var x=r.evaluate(a,u,c,f,v);return this._calculate(x,x,x,a)}return r.kind==="composite"?this._calculate(r.evaluate({zoom:Math.floor(a.zoom)-1},u,c),r.evaluate({zoom:Math.floor(a.zoom)},u,c),r.evaluate({zoom:Math.floor(a.zoom)+1},u,c),a):r.value},t.prototype._calculate=function(r,a,u,c){return c.zoom>c.zoomHistory.lastIntegerZoom?{from:r,to:a}:{from:u,to:a}},t.prototype.interpolate=function(r){return r},t}(Ue),Hr=function(e){this.specification=e};Hr.prototype.possiblyEvaluate=function(e,t,r,a){if(e.value!==void 0){if(e.expression.kind==="constant"){var u=e.expression.evaluate(t,null,{},r,a);return this._calculate(u,u,u,t)}return this._calculate(e.expression.evaluate(new ht(Math.floor(t.zoom-1),t)),e.expression.evaluate(new ht(Math.floor(t.zoom),t)),e.expression.evaluate(new ht(Math.floor(t.zoom+1),t)),t)}},Hr.prototype._calculate=function(e,t,r,a){return a.zoom>a.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},Hr.prototype.interpolate=function(e){return e};var Wi=function(e){this.specification=e};Wi.prototype.possiblyEvaluate=function(e,t,r,a){return!!e.expression.evaluate(t,null,{},r,a)},Wi.prototype.interpolate=function(){return!1};var Vr=function(e){for(var t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){var r=e[t];r.specification.overridable&&this.overridableProperties.push(t);var a=this.defaultPropertyValues[t]=new Qi(r,void 0),u=this.defaultTransitionablePropertyValues[t]=new zi(r);this.defaultTransitioningPropertyValues[t]=u.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=a.possiblyEvaluate({})}};Oe("DataDrivenProperty",Ue),Oe("DataConstantProperty",qe),Oe("CrossFadedDataDrivenProperty",Is),Oe("CrossFadedProperty",Hr),Oe("ColorRampProperty",Wi);var en=function(e){function t(r,a){if(e.call(this),this.id=r.id,this.type=r.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},r.type!=="custom"&&(this.metadata=(r=r).metadata,this.minzoom=r.minzoom,this.maxzoom=r.maxzoom,r.type!=="background"&&(this.source=r.source,this.sourceLayer=r["source-layer"],this.filter=r.filter),a.layout&&(this._unevaluatedLayout=new Zi(a.layout)),a.paint)){for(var u in this._transitionablePaint=new Or(a.paint),r.paint)this.setPaintProperty(u,r.paint[u],{validate:!1});for(var c in r.layout)this.setLayoutProperty(c,r.layout[c],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new La(a.paint)}}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},t.prototype.getLayoutProperty=function(r){return r==="visibility"?this.visibility:this._unevaluatedLayout.getValue(r)},t.prototype.setLayoutProperty=function(r,a,u){u===void 0&&(u={}),a!=null&&this._validate(Ma,"layers."+this.id+".layout."+r,r,a,u)||(r!=="visibility"?this._unevaluatedLayout.setValue(r,a):this.visibility=a)},t.prototype.getPaintProperty=function(r){return Er(r,"-transition")?this._transitionablePaint.getTransition(r.slice(0,-11)):this._transitionablePaint.getValue(r)},t.prototype.setPaintProperty=function(r,a,u){if(u===void 0&&(u={}),a!=null&&this._validate(Gp,"layers."+this.id+".paint."+r,r,a,u))return!1;if(Er(r,"-transition"))return this._transitionablePaint.setTransition(r.slice(0,-11),a||void 0),!1;var c=this._transitionablePaint._values[r],f=c.property.specification["property-type"]==="cross-faded-data-driven",v=c.value.isDataDriven(),x=c.value;this._transitionablePaint.setValue(r,a),this._handleSpecialPaintPropertyUpdate(r);var b=this._transitionablePaint._values[r].value;return b.isDataDriven()||v||f||this._handleOverridablePaintPropertyUpdate(r,x,b)},t.prototype._handleSpecialPaintPropertyUpdate=function(r){},t.prototype._handleOverridablePaintPropertyUpdate=function(r,a,u){return!1},t.prototype.isHidden=function(r){return!!(this.minzoom&&r<this.minzoom)||!!(this.maxzoom&&r>=this.maxzoom)||this.visibility==="none"},t.prototype.updateTransitions=function(r){this._transitioningPaint=this._transitionablePaint.transitioned(r,this._transitioningPaint)},t.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},t.prototype.recalculate=function(r,a){r.getCrossfadeParameters&&(this._crossfadeParameters=r.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(r,void 0,a)),this.paint=this._transitioningPaint.possiblyEvaluate(r,void 0,a)},t.prototype.serialize=function(){var r={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(r.layout=r.layout||{},r.layout.visibility=this.visibility),ei(r,function(a,u){return!(a===void 0||u==="layout"&&!Object.keys(a).length||u==="paint"&&!Object.keys(a).length)})},t.prototype._validate=function(r,a,u,c,f){return f===void 0&&(f={}),(!f||f.validate!==!1)&&za(this,r.call(ka,{key:a,layerType:this.type,objectKey:u,value:c,styleSpec:D,style:{glyphs:!0,sprite:!0}}))},t.prototype.is3D=function(){return!1},t.prototype.isTileClipped=function(){return!1},t.prototype.hasOffscreenPass=function(){return!1},t.prototype.resize=function(){},t.prototype.isStateDependent=function(){for(var r in this.paint._values){var a=this.paint.get(r);if(a instanceof Wr&&co(a.property.specification)&&(a.value.kind==="source"||a.value.kind==="composite")&&a.value.isStateDependent)return!0}return!1},t}(ee),Ul={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},As=function(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},zt=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function Mr(e,t){t===void 0&&(t=1);var r=0,a=0;return{members:e.map(function(u){var c=Ul[u.type].BYTES_PER_ELEMENT,f=r=lc(r,Math.max(t,c)),v=u.components||1;return a=Math.max(a,c),r+=c*v,{name:u.name,type:u.type,components:v,offset:f}}),size:lc(r,Math.max(a,t)),alignment:t}}function lc(e,t){return Math.ceil(e/t)*t}zt.serialize=function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}},zt.deserialize=function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t},zt.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},zt.prototype.clear=function(){this.length=0},zt.prototype.resize=function(e){this.reserve(e),this.length=e},zt.prototype.reserve=function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}},zt.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var yo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var u=this.length;return this.resize(u+1),this.emplace(u,r,a)},t.prototype.emplace=function(r,a,u){var c=2*r;return this.int16[c+0]=a,this.int16[c+1]=u,r},t}(zt);yo.prototype.bytesPerElement=4,Oe("StructArrayLayout2i4",yo);var Nl=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c){var f=this.length;return this.resize(f+1),this.emplace(f,r,a,u,c)},t.prototype.emplace=function(r,a,u,c,f){var v=4*r;return this.int16[v+0]=a,this.int16[v+1]=u,this.int16[v+2]=c,this.int16[v+3]=f,r},t}(zt);Nl.prototype.bytesPerElement=8,Oe("StructArrayLayout4i8",Nl);var dn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,f,v){var x=this.length;return this.resize(x+1),this.emplace(x,r,a,u,c,f,v)},t.prototype.emplace=function(r,a,u,c,f,v,x){var b=6*r;return this.int16[b+0]=a,this.int16[b+1]=u,this.int16[b+2]=c,this.int16[b+3]=f,this.int16[b+4]=v,this.int16[b+5]=x,r},t}(zt);dn.prototype.bytesPerElement=12,Oe("StructArrayLayout2i4i12",dn);var di=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,f,v){var x=this.length;return this.resize(x+1),this.emplace(x,r,a,u,c,f,v)},t.prototype.emplace=function(r,a,u,c,f,v,x){var b=4*r,S=8*r;return this.int16[b+0]=a,this.int16[b+1]=u,this.uint8[S+4]=c,this.uint8[S+5]=f,this.uint8[S+6]=v,this.uint8[S+7]=x,r},t}(zt);di.prototype.bytesPerElement=8,Oe("StructArrayLayout2i4ub8",di);var Xo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var u=this.length;return this.resize(u+1),this.emplace(u,r,a)},t.prototype.emplace=function(r,a,u){var c=2*r;return this.float32[c+0]=a,this.float32[c+1]=u,r},t}(zt);Xo.prototype.bytesPerElement=8,Oe("StructArrayLayout2f8",Xo);var tn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,f,v,x,b,S,T){var C=this.length;return this.resize(C+1),this.emplace(C,r,a,u,c,f,v,x,b,S,T)},t.prototype.emplace=function(r,a,u,c,f,v,x,b,S,T,C){var z=10*r;return this.uint16[z+0]=a,this.uint16[z+1]=u,this.uint16[z+2]=c,this.uint16[z+3]=f,this.uint16[z+4]=v,this.uint16[z+5]=x,this.uint16[z+6]=b,this.uint16[z+7]=S,this.uint16[z+8]=T,this.uint16[z+9]=C,r},t}(zt);tn.prototype.bytesPerElement=20,Oe("StructArrayLayout10ui20",tn);var Es=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,f,v,x,b,S,T,C,z){var N=this.length;return this.resize(N+1),this.emplace(N,r,a,u,c,f,v,x,b,S,T,C,z)},t.prototype.emplace=function(r,a,u,c,f,v,x,b,S,T,C,z,N){var $=12*r;return this.int16[$+0]=a,this.int16[$+1]=u,this.int16[$+2]=c,this.int16[$+3]=f,this.uint16[$+4]=v,this.uint16[$+5]=x,this.uint16[$+6]=b,this.uint16[$+7]=S,this.int16[$+8]=T,this.int16[$+9]=C,this.int16[$+10]=z,this.int16[$+11]=N,r},t}(zt);Es.prototype.bytesPerElement=24,Oe("StructArrayLayout4i4ui4i24",Es);var Ko=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,u)},t.prototype.emplace=function(r,a,u,c){var f=3*r;return this.float32[f+0]=a,this.float32[f+1]=u,this.float32[f+2]=c,r},t}(zt);Ko.prototype.bytesPerElement=12,Oe("StructArrayLayout3f12",Ko);var Ra=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.uint32[1*r+0]=a,r},t}(zt);Ra.prototype.bytesPerElement=4,Oe("StructArrayLayout1ul4",Ra);var $l=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,f,v,x,b,S){var T=this.length;return this.resize(T+1),this.emplace(T,r,a,u,c,f,v,x,b,S)},t.prototype.emplace=function(r,a,u,c,f,v,x,b,S,T){var C=10*r,z=5*r;return this.int16[C+0]=a,this.int16[C+1]=u,this.int16[C+2]=c,this.int16[C+3]=f,this.int16[C+4]=v,this.int16[C+5]=x,this.uint32[z+3]=b,this.uint16[C+8]=S,this.uint16[C+9]=T,r},t}(zt);$l.prototype.bytesPerElement=20,Oe("StructArrayLayout6i1ul2ui20",$l);var Jo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,f,v){var x=this.length;return this.resize(x+1),this.emplace(x,r,a,u,c,f,v)},t.prototype.emplace=function(r,a,u,c,f,v,x){var b=6*r;return this.int16[b+0]=a,this.int16[b+1]=u,this.int16[b+2]=c,this.int16[b+3]=f,this.int16[b+4]=v,this.int16[b+5]=x,r},t}(zt);Jo.prototype.bytesPerElement=12,Oe("StructArrayLayout2i2i2i12",Jo);var vo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,f){var v=this.length;return this.resize(v+1),this.emplace(v,r,a,u,c,f)},t.prototype.emplace=function(r,a,u,c,f,v){var x=4*r,b=8*r;return this.float32[x+0]=a,this.float32[x+1]=u,this.float32[x+2]=c,this.int16[b+6]=f,this.int16[b+7]=v,r},t}(zt);vo.prototype.bytesPerElement=16,Oe("StructArrayLayout2f1f2i16",vo);var jl=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c){var f=this.length;return this.resize(f+1),this.emplace(f,r,a,u,c)},t.prototype.emplace=function(r,a,u,c,f){var v=12*r,x=3*r;return this.uint8[v+0]=a,this.uint8[v+1]=u,this.float32[x+1]=c,this.float32[x+2]=f,r},t}(zt);jl.prototype.bytesPerElement=12,Oe("StructArrayLayout2ub2f12",jl);var Dn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,u)},t.prototype.emplace=function(r,a,u,c){var f=3*r;return this.uint16[f+0]=a,this.uint16[f+1]=u,this.uint16[f+2]=c,r},t}(zt);Dn.prototype.bytesPerElement=6,Oe("StructArrayLayout3ui6",Dn);var Ln=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,f,v,x,b,S,T,C,z,N,$,J,H,te){var oe=this.length;return this.resize(oe+1),this.emplace(oe,r,a,u,c,f,v,x,b,S,T,C,z,N,$,J,H,te)},t.prototype.emplace=function(r,a,u,c,f,v,x,b,S,T,C,z,N,$,J,H,te,oe){var se=24*r,ue=12*r,ye=48*r;return this.int16[se+0]=a,this.int16[se+1]=u,this.uint16[se+2]=c,this.uint16[se+3]=f,this.uint32[ue+2]=v,this.uint32[ue+3]=x,this.uint32[ue+4]=b,this.uint16[se+10]=S,this.uint16[se+11]=T,this.uint16[se+12]=C,this.float32[ue+7]=z,this.float32[ue+8]=N,this.uint8[ye+36]=$,this.uint8[ye+37]=J,this.uint8[ye+38]=H,this.uint32[ue+10]=te,this.int16[se+22]=oe,r},t}(zt);Ln.prototype.bytesPerElement=48,Oe("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ln);var Ps=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,f,v,x,b,S,T,C,z,N,$,J,H,te,oe,se,ue,ye,we,Ie,je,Me,Ze,Be,lt){var Ye=this.length;return this.resize(Ye+1),this.emplace(Ye,r,a,u,c,f,v,x,b,S,T,C,z,N,$,J,H,te,oe,se,ue,ye,we,Ie,je,Me,Ze,Be,lt)},t.prototype.emplace=function(r,a,u,c,f,v,x,b,S,T,C,z,N,$,J,H,te,oe,se,ue,ye,we,Ie,je,Me,Ze,Be,lt,Ye){var Ne=34*r,ct=17*r;return this.int16[Ne+0]=a,this.int16[Ne+1]=u,this.int16[Ne+2]=c,this.int16[Ne+3]=f,this.int16[Ne+4]=v,this.int16[Ne+5]=x,this.int16[Ne+6]=b,this.int16[Ne+7]=S,this.uint16[Ne+8]=T,this.uint16[Ne+9]=C,this.uint16[Ne+10]=z,this.uint16[Ne+11]=N,this.uint16[Ne+12]=$,this.uint16[Ne+13]=J,this.uint16[Ne+14]=H,this.uint16[Ne+15]=te,this.uint16[Ne+16]=oe,this.uint16[Ne+17]=se,this.uint16[Ne+18]=ue,this.uint16[Ne+19]=ye,this.uint16[Ne+20]=we,this.uint16[Ne+21]=Ie,this.uint16[Ne+22]=je,this.uint32[ct+12]=Me,this.float32[ct+13]=Ze,this.float32[ct+14]=Be,this.float32[ct+15]=lt,this.float32[ct+16]=Ye,r},t}(zt);Ps.prototype.bytesPerElement=68,Oe("StructArrayLayout8i15ui1ul4f68",Ps);var Rn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.float32[1*r+0]=a,r},t}(zt);Rn.prototype.bytesPerElement=4,Oe("StructArrayLayout1f4",Rn);var Bi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,u)},t.prototype.emplace=function(r,a,u,c){var f=3*r;return this.int16[f+0]=a,this.int16[f+1]=u,this.int16[f+2]=c,r},t}(zt);Bi.prototype.bytesPerElement=6,Oe("StructArrayLayout3i6",Bi);var ql=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,u)},t.prototype.emplace=function(r,a,u,c){var f=4*r;return this.uint32[2*r+0]=a,this.uint16[f+2]=u,this.uint16[f+3]=c,r},t}(zt);ql.prototype.bytesPerElement=8,Oe("StructArrayLayout1ul2ui8",ql);var Fa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var u=this.length;return this.resize(u+1),this.emplace(u,r,a)},t.prototype.emplace=function(r,a,u){var c=2*r;return this.uint16[c+0]=a,this.uint16[c+1]=u,r},t}(zt);Fa.prototype.bytesPerElement=4,Oe("StructArrayLayout2ui4",Fa);var Gl=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.uint16[1*r+0]=a,r},t}(zt);Gl.prototype.bytesPerElement=2,Oe("StructArrayLayout1ui2",Gl);var Cs=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c){var f=this.length;return this.resize(f+1),this.emplace(f,r,a,u,c)},t.prototype.emplace=function(r,a,u,c,f){var v=4*r;return this.float32[v+0]=a,this.float32[v+1]=u,this.float32[v+2]=c,this.float32[v+3]=f,r},t}(zt);Cs.prototype.bytesPerElement=16,Oe("StructArrayLayout4f16",Cs);var i=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new pe(this.anchorPointX,this.anchorPointY)},Object.defineProperties(t.prototype,r),t}(As);i.prototype.size=20;var o=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new i(this,r)},t}($l);Oe("CollisionBoxArray",o);var n=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(a){this._structArray.uint8[this._pos1+37]=a},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(a){this._structArray.uint8[this._pos1+38]=a},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(a){this._structArray.uint32[this._pos4+10]=a},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(t.prototype,r),t}(As);n.prototype.size=48;var s=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new n(this,r)},t}(Ln);Oe("PlacedSymbolArray",s);var p=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(a){this._structArray.uint32[this._pos4+12]=a},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(t.prototype,r),t}(As);p.prototype.size=68;var m=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new p(this,r)},t}(Ps);Oe("SymbolInstanceArray",m);var y=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getoffsetX=function(r){return this.float32[1*r+0]},t}(Rn);Oe("GlyphOffsetArray",y);var g=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getx=function(r){return this.int16[3*r+0]},t.prototype.gety=function(r){return this.int16[3*r+1]},t.prototype.gettileUnitDistanceFromAnchor=function(r){return this.int16[3*r+2]},t}(Bi);Oe("SymbolLineVertexArray",g);var w=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(t.prototype,r),t}(As);w.prototype.size=8;var A=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new w(this,r)},t}(ql);Oe("FeatureIndexArray",A);var B=Mr([{name:"a_pos",components:2,type:"Int16"}],4).members,L=function(e){e===void 0&&(e=[]),this.segments=e};function R(e,t){return 256*(e=$e(Math.floor(e),0,255))+$e(Math.floor(t),0,255)}L.prototype.prepareSegment=function(e,t,r,a){var u=this.segments[this.segments.length-1];return e>L.MAX_VERTEX_ARRAY_LENGTH&&Ft("Max vertices per segment is "+L.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+e),(!u||u.vertexLength+e>L.MAX_VERTEX_ARRAY_LENGTH||u.sortKey!==a)&&(u={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},a!==void 0&&(u.sortKey=a),this.segments.push(u)),u},L.prototype.get=function(){return this.segments},L.prototype.destroy=function(){for(var e=0,t=this.segments;e<t.length;e+=1){var r=t[e];for(var a in r.vaos)r.vaos[a].destroy()}},L.simpleSegment=function(e,t,r,a){return new L([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:a,vaos:{},sortKey:0}])},L.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Oe("SegmentVector",L);var Z=Mr([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),j=re(function(e){e.exports=function(t,r){var a,u,c,f,v,x,b,S;for(u=t.length-(a=3&t.length),c=r,v=3432918353,x=461845907,S=0;S<u;)b=255&t.charCodeAt(S)|(255&t.charCodeAt(++S))<<8|(255&t.charCodeAt(++S))<<16|(255&t.charCodeAt(++S))<<24,++S,c=27492+(65535&(f=5*(65535&(c=(c^=b=(65535&(b=(b=(65535&b)*v+(((b>>>16)*v&65535)<<16)&4294967295)<<15|b>>>17))*x+(((b>>>16)*x&65535)<<16)&4294967295)<<13|c>>>19))+((5*(c>>>16)&65535)<<16)&4294967295))+((58964+(f>>>16)&65535)<<16);switch(b=0,a){case 3:b^=(255&t.charCodeAt(S+2))<<16;case 2:b^=(255&t.charCodeAt(S+1))<<8;case 1:c^=b=(65535&(b=(b=(65535&(b^=255&t.charCodeAt(S)))*v+(((b>>>16)*v&65535)<<16)&4294967295)<<15|b>>>17))*x+(((b>>>16)*x&65535)<<16)&4294967295}return c^=t.length,c=2246822507*(65535&(c^=c>>>16))+((2246822507*(c>>>16)&65535)<<16)&4294967295,c=3266489909*(65535&(c^=c>>>13))+((3266489909*(c>>>16)&65535)<<16)&4294967295,(c^=c>>>16)>>>0}}),K=re(function(e){e.exports=function(t,r){for(var a,u=t.length,c=r^u,f=0;u>=4;)a=1540483477*(65535&(a=255&t.charCodeAt(f)|(255&t.charCodeAt(++f))<<8|(255&t.charCodeAt(++f))<<16|(255&t.charCodeAt(++f))<<24))+((1540483477*(a>>>16)&65535)<<16),c=1540483477*(65535&c)+((1540483477*(c>>>16)&65535)<<16)^(a=1540483477*(65535&(a^=a>>>24))+((1540483477*(a>>>16)&65535)<<16)),u-=4,++f;switch(u){case 3:c^=(255&t.charCodeAt(f+2))<<16;case 2:c^=(255&t.charCodeAt(f+1))<<8;case 1:c=1540483477*(65535&(c^=255&t.charCodeAt(f)))+((1540483477*(c>>>16)&65535)<<16)}return c=1540483477*(65535&(c^=c>>>13))+((1540483477*(c>>>16)&65535)<<16),(c^=c>>>15)>>>0}}),U=j,X=K;U.murmur3=j,U.murmur2=X;var Q=function(){this.ids=[],this.positions=[],this.indexed=!1};Q.prototype.add=function(e,t,r,a){this.ids.push(ce(e)),this.positions.push(t,r,a)},Q.prototype.getPositions=function(e){for(var t=ce(e),r=0,a=this.ids.length-1;r<a;){var u=r+a>>1;this.ids[u]>=t?a=u:r=u+1}for(var c=[];this.ids[r]===t;)c.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return c},Q.serialize=function(e,t){var r=new Float64Array(e.ids),a=new Uint32Array(e.positions);return function u(c,f,v,x){for(;v<x;){for(var b=c[v+x>>1],S=v-1,T=x+1;;){do S++;while(c[S]<b);do T--;while(c[T]>b);if(S>=T)break;le(c,S,T),le(f,3*S,3*T),le(f,3*S+1,3*T+1),le(f,3*S+2,3*T+2)}T-v<x-T?(u(c,f,v,T),v=T+1):(u(c,f,T+1,x),x=T)}}(r,a,0,r.length-1),t&&t.push(r.buffer,a.buffer),{ids:r,positions:a}},Q.deserialize=function(e){var t=new Q;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t};var ie=Math.pow(2,53)-1;function ce(e){var t=+e;return!isNaN(t)&&t<=ie?t:U(String(e))}function le(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}Oe("FeaturePositionMap",Q);var he=function(e,t){this.gl=e.gl,this.location=t},ge=function(e){function t(r,a){e.call(this,r,a),this.current=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r))},t}(he),Te=function(e){function t(r,a){e.call(this,r,a),this.current=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){this.current!==r&&(this.current=r,this.gl.uniform1f(this.location,r))},t}(he),Se=function(e){function t(r,a){e.call(this,r,a),this.current=[0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]||(this.current=r,this.gl.uniform2f(this.location,r[0],r[1]))},t}(he),Le=function(e){function t(r,a){e.call(this,r,a),this.current=[0,0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]||(this.current=r,this.gl.uniform3f(this.location,r[0],r[1],r[2]))},t}(he),Ge=function(e){function t(r,a){e.call(this,r,a),this.current=[0,0,0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]&&r[3]===this.current[3]||(this.current=r,this.gl.uniform4f(this.location,r[0],r[1],r[2],r[3]))},t}(he),Ke=function(e){function t(r,a){e.call(this,r,a),this.current=Pt.transparent}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r.r===this.current.r&&r.g===this.current.g&&r.b===this.current.b&&r.a===this.current.a||(this.current=r,this.gl.uniform4f(this.location,r.r,r.g,r.b,r.a))},t}(he),He=new Float32Array(16),bt=function(e){function t(r,a){e.call(this,r,a),this.current=He}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){if(r[12]!==this.current[12]||r[0]!==this.current[0])return this.current=r,void this.gl.uniformMatrix4fv(this.location,!1,r);for(var a=1;a<16;a++)if(r[a]!==this.current[a]){this.current=r,this.gl.uniformMatrix4fv(this.location,!1,r);break}},t}(he);function Re(e){return[R(255*e.r,255*e.g),R(255*e.b,255*e.a)]}var it=function(e,t,r){this.value=e,this.uniformNames=t.map(function(a){return"u_"+a}),this.type=r};it.prototype.setUniform=function(e,t,r){e.set(r.constantOr(this.value))},it.prototype.getBinding=function(e,t,r){return this.type==="color"?new Ke(e,t):new Te(e,t)};var at=function(e,t){this.uniformNames=t.map(function(r){return"u_"+r}),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};at.prototype.setConstantPatternPositions=function(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr},at.prototype.setUniform=function(e,t,r,a){var u=a==="u_pattern_to"?this.patternTo:a==="u_pattern_from"?this.patternFrom:a==="u_pixel_ratio_to"?this.pixelRatioTo:a==="u_pixel_ratio_from"?this.pixelRatioFrom:null;u&&e.set(u)},at.prototype.getBinding=function(e,t,r){return r.substr(0,9)==="u_pattern"?new Ge(e,t):new Te(e,t)};var rt=function(e,t,r,a){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map(function(u){return{name:"a_"+u,type:"Float32",components:r==="color"?2:1,offset:0}}),this.paintVertexArray=new a};rt.prototype.populatePaintArray=function(e,t,r,a,u){var c=this.paintVertexArray.length,f=this.expression.evaluate(new ht(0),t,{},a,[],u);this.paintVertexArray.resize(e),this._setPaintValue(c,e,f)},rt.prototype.updatePaintArray=function(e,t,r,a){var u=this.expression.evaluate({zoom:0},r,a);this._setPaintValue(e,t,u)},rt.prototype._setPaintValue=function(e,t,r){if(this.type==="color")for(var a=Re(r),u=e;u<t;u++)this.paintVertexArray.emplace(u,a[0],a[1]);else{for(var c=e;c<t;c++)this.paintVertexArray.emplace(c,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}},rt.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},rt.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var tt=function(e,t,r,a,u,c){this.expression=e,this.uniformNames=t.map(function(f){return"u_"+f+"_t"}),this.type=r,this.useIntegerZoom=a,this.zoom=u,this.maxValue=0,this.paintVertexAttributes=t.map(function(f){return{name:"a_"+f,type:"Float32",components:r==="color"?4:2,offset:0}}),this.paintVertexArray=new c};tt.prototype.populatePaintArray=function(e,t,r,a,u){var c=this.expression.evaluate(new ht(this.zoom),t,{},a,[],u),f=this.expression.evaluate(new ht(this.zoom+1),t,{},a,[],u),v=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(v,e,c,f)},tt.prototype.updatePaintArray=function(e,t,r,a){var u=this.expression.evaluate({zoom:this.zoom},r,a),c=this.expression.evaluate({zoom:this.zoom+1},r,a);this._setPaintValue(e,t,u,c)},tt.prototype._setPaintValue=function(e,t,r,a){if(this.type==="color")for(var u=Re(r),c=Re(a),f=e;f<t;f++)this.paintVertexArray.emplace(f,u[0],u[1],c[0],c[1]);else{for(var v=e;v<t;v++)this.paintVertexArray.emplace(v,r,a);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(a))}},tt.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},tt.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},tt.prototype.setUniform=function(e,t){var r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,a=$e(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(a)},tt.prototype.getBinding=function(e,t,r){return new Te(e,t)};var ot=function(e,t,r,a,u,c){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=a,this.layerId=c,this.zoomInPaintVertexArray=new u,this.zoomOutPaintVertexArray=new u};ot.prototype.populatePaintArray=function(e,t,r){var a=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(a,e,t.patterns&&t.patterns[this.layerId],r)},ot.prototype.updatePaintArray=function(e,t,r,a,u){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],u)},ot.prototype._setPaintValues=function(e,t,r,a){if(a&&r){var u=a[r.min],c=a[r.mid],f=a[r.max];if(u&&c&&f)for(var v=e;v<t;v++)this.zoomInPaintVertexArray.emplace(v,c.tl[0],c.tl[1],c.br[0],c.br[1],u.tl[0],u.tl[1],u.br[0],u.br[1],c.pixelRatio,u.pixelRatio),this.zoomOutPaintVertexArray.emplace(v,c.tl[0],c.tl[1],c.br[0],c.br[1],f.tl[0],f.tl[1],f.br[0],f.br[1],c.pixelRatio,f.pixelRatio)}},ot.prototype.upload=function(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,Z.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,Z.members,this.expression.isStateDependent))},ot.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var Qe=function(e,t,r){this.binders={},this._buffers=[];var a=[];for(var u in e.paint._values)if(r(u)){var c=e.paint.get(u);if(c instanceof Wr&&co(c.property.specification)){var f=Sr(u,e.type),v=c.value,x=c.property.specification.type,b=c.property.useIntegerZoom,S=c.property.specification["property-type"],T=S==="cross-faded"||S==="cross-faded-data-driven";if(v.kind==="constant")this.binders[u]=T?new at(v.value,f):new it(v.value,f,x),a.push("/u_"+u);else if(v.kind==="source"||T){var C=rr(u,x,"source");this.binders[u]=T?new ot(v,x,b,t,C,e.id):new rt(v,f,x,C),a.push("/a_"+u)}else{var z=rr(u,x,"composite");this.binders[u]=new tt(v,f,x,b,t,z),a.push("/z_"+u)}}}this.cacheKey=a.sort().join("")};Qe.prototype.getMaxValue=function(e){var t=this.binders[e];return t instanceof rt||t instanceof tt?t.maxValue:0},Qe.prototype.populatePaintArrays=function(e,t,r,a,u){for(var c in this.binders){var f=this.binders[c];(f instanceof rt||f instanceof tt||f instanceof ot)&&f.populatePaintArray(e,t,r,a,u)}},Qe.prototype.setConstantPatternPositions=function(e,t){for(var r in this.binders){var a=this.binders[r];a instanceof at&&a.setConstantPatternPositions(e,t)}},Qe.prototype.updatePaintArrays=function(e,t,r,a,u){var c=!1;for(var f in e)for(var v=0,x=t.getPositions(f);v<x.length;v+=1){var b=x[v],S=r.feature(b.index);for(var T in this.binders){var C=this.binders[T];if((C instanceof rt||C instanceof tt||C instanceof ot)&&C.expression.isStateDependent===!0){var z=a.paint.get(T);C.expression=z.value,C.updatePaintArray(b.start,b.end,S,e[f],u),c=!0}}}return c},Qe.prototype.defines=function(){var e=[];for(var t in this.binders){var r=this.binders[t];(r instanceof it||r instanceof at)&&e.push.apply(e,r.uniformNames.map(function(a){return"#define HAS_UNIFORM_"+a}))}return e},Qe.prototype.getBinderAttributes=function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof rt||r instanceof tt)for(var a=0;a<r.paintVertexAttributes.length;a++)e.push(r.paintVertexAttributes[a].name);else if(r instanceof ot)for(var u=0;u<Z.members.length;u++)e.push(Z.members[u].name)}return e},Qe.prototype.getBinderUniforms=function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof it||r instanceof at||r instanceof tt)for(var a=0,u=r.uniformNames;a<u.length;a+=1)e.push(u[a])}return e},Qe.prototype.getPaintVertexBuffers=function(){return this._buffers},Qe.prototype.getUniforms=function(e,t){var r=[];for(var a in this.binders){var u=this.binders[a];if(u instanceof it||u instanceof at||u instanceof tt)for(var c=0,f=u.uniformNames;c<f.length;c+=1){var v=f[c];if(t[v]){var x=u.getBinding(e,t[v],v);r.push({name:v,property:a,binding:x})}}}return r},Qe.prototype.setUniforms=function(e,t,r,a){for(var u=0,c=t;u<c.length;u+=1){var f=c[u],v=f.name,x=f.property;this.binders[x].setUniform(f.binding,a,r.get(x),v)}},Qe.prototype.updatePaintBuffers=function(e){for(var t in this._buffers=[],this.binders){var r=this.binders[t];if(e&&r instanceof ot){var a=e.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;a&&this._buffers.push(a)}else(r instanceof rt||r instanceof tt)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}},Qe.prototype.upload=function(e){for(var t in this.binders){var r=this.binders[t];(r instanceof rt||r instanceof tt||r instanceof ot)&&r.upload(e)}this.updatePaintBuffers()},Qe.prototype.destroy=function(){for(var e in this.binders){var t=this.binders[e];(t instanceof rt||t instanceof tt||t instanceof ot)&&t.destroy()}};var Je=function(e,t,r){r===void 0&&(r=function(){return!0}),this.programConfigurations={};for(var a=0,u=e;a<u.length;a+=1){var c=u[a];this.programConfigurations[c.id]=new Qe(c,t,r)}this.needsUpload=!1,this._featureMap=new Q,this._bufferOffset=0};function Sr(e,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[e]||[e.replace(t+"-","").replace(/-/g,"_")]}function rr(e,t,r){var a={color:{source:Xo,composite:Cs},number:{source:Rn,composite:Xo}},u=function(c){return{"line-pattern":{source:tn,composite:tn},"fill-pattern":{source:tn,composite:tn},"fill-extrusion-pattern":{source:tn,composite:tn}}[c]}(e);return u&&u[r]||a[t][r]}Je.prototype.populatePaintArrays=function(e,t,r,a,u,c){for(var f in this.programConfigurations)this.programConfigurations[f].populatePaintArrays(e,t,a,u,c);t.id!==void 0&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0},Je.prototype.updatePaintArrays=function(e,t,r,a){for(var u=0,c=r;u<c.length;u+=1){var f=c[u];this.needsUpload=this.programConfigurations[f.id].updatePaintArrays(e,this._featureMap,t,f,a)||this.needsUpload}},Je.prototype.get=function(e){return this.programConfigurations[e]},Je.prototype.upload=function(e){if(this.needsUpload){for(var t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}},Je.prototype.destroy=function(){for(var e in this.programConfigurations)this.programConfigurations[e].destroy()},Oe("ConstantBinder",it),Oe("CrossFadedConstantBinder",at),Oe("SourceExpressionBinder",rt),Oe("CrossFadedCompositeBinder",ot),Oe("CompositeExpressionBinder",tt),Oe("ProgramConfiguration",Qe,{omit:["_buffers"]}),Oe("ProgramConfigurationSet",Je);var Ur=Math.pow(2,14)-1,zr=-Ur-1;function er(e){for(var t=8192/e.extent,r=e.loadGeometry(),a=0;a<r.length;a++)for(var u=r[a],c=0;c<u.length;c++){var f=u[c],v=Math.round(f.x*t),x=Math.round(f.y*t);f.x=$e(v,zr,Ur),f.y=$e(x,zr,Ur),(v<f.x||v>f.x+1||x<f.y||x>f.y+1)&&Ft("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function lr(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?er(e):[]}}function mi(e,t,r,a,u){e.emplaceBack(2*t+(a+1)/2,2*r+(u+1)/2)}var Xr=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new yo,this.indexArray=new Dn,this.segments=new L,this.programConfigurations=new Je(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};function Fn(e,t){for(var r=0;r<e.length;r++)if(rn(t,e[r]))return!0;for(var a=0;a<t.length;a++)if(rn(e,t[a]))return!0;return!!Oa(e,t)}function ni(e,t,r){return!!rn(e,t)||!!On(t,e,r)}function Hi(e,t){if(e.length===1)return Va(t,e[0]);for(var r=0;r<t.length;r++)for(var a=t[r],u=0;u<a.length;u++)if(rn(e,a[u]))return!0;for(var c=0;c<e.length;c++)if(Va(t,e[c]))return!0;for(var f=0;f<t.length;f++)if(Oa(e,t[f]))return!0;return!1}function Di(e,t,r){if(e.length>1){if(Oa(e,t))return!0;for(var a=0;a<t.length;a++)if(On(t[a],e,r))return!0}for(var u=0;u<e.length;u++)if(On(e[u],t,r))return!0;return!1}function Oa(e,t){if(e.length===0||t.length===0)return!1;for(var r=0;r<e.length-1;r++)for(var a=e[r],u=e[r+1],c=0;c<t.length-1;c++)if(Yo(a,u,t[c],t[c+1]))return!0;return!1}function Yo(e,t,r,a){return Pr(e,r,a)!==Pr(t,r,a)&&Pr(e,t,r)!==Pr(e,t,a)}function On(e,t,r){var a=r*r;if(t.length===1)return e.distSqr(t[0])<a;for(var u=1;u<t.length;u++)if(Qo(e,t[u-1],t[u])<a)return!0;return!1}function Qo(e,t,r){var a=t.distSqr(r);if(a===0)return e.distSqr(t);var u=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/a;return e.distSqr(u<0?t:u>1?r:r.sub(t)._mult(u)._add(t))}function Va(e,t){for(var r,a,u,c=!1,f=0;f<e.length;f++)for(var v=0,x=(r=e[f]).length-1;v<r.length;x=v++)(a=r[v]).y>t.y!=(u=r[x]).y>t.y&&t.x<(u.x-a.x)*(t.y-a.y)/(u.y-a.y)+a.x&&(c=!c);return c}function rn(e,t){for(var r=!1,a=0,u=e.length-1;a<e.length;u=a++){var c=e[a],f=e[u];c.y>t.y!=f.y>t.y&&t.x<(f.x-c.x)*(t.y-c.y)/(f.y-c.y)+c.x&&(r=!r)}return r}function Ua(e,t,r){var a=r[0],u=r[2];if(e.x<a.x&&t.x<a.x||e.x>u.x&&t.x>u.x||e.y<a.y&&t.y<a.y||e.y>u.y&&t.y>u.y)return!1;var c=Pr(e,t,r[0]);return c!==Pr(e,t,r[1])||c!==Pr(e,t,r[2])||c!==Pr(e,t,r[3])}function nn(e,t,r){var a=t.paint.get(e).value;return a.kind==="constant"?a.value:r.programConfigurations.get(t.id).getMaxValue(e)}function Tr(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function mn(e,t,r,a,u){if(!t[0]&&!t[1])return e;var c=pe.convert(t)._mult(u);r==="viewport"&&c._rotate(-a);for(var f=[],v=0;v<e.length;v++)f.push(e[v].sub(c));return f}Xr.prototype.populate=function(e,t,r){var a=this.layers[0],u=[],c=null;a.type==="circle"&&(c=a.layout.get("circle-sort-key"));for(var f=0,v=e;f<v.length;f+=1){var x=v[f],b=x.feature,S=x.id,T=x.index,C=x.sourceLayerIndex,z=this.layers[0]._featureFilter.needGeometry,N=lr(b,z);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),N,r)){var $=c?c.evaluate(N,{},r):void 0,J={id:S,properties:b.properties,type:b.type,sourceLayerIndex:C,index:T,geometry:z?N.geometry:er(b),patterns:{},sortKey:$};u.push(J)}}c&&u.sort(function(Ie,je){return Ie.sortKey-je.sortKey});for(var H=0,te=u;H<te.length;H+=1){var oe=te[H],se=oe.geometry,ue=oe.index,ye=oe.sourceLayerIndex,we=e[ue].feature;this.addFeature(oe,se,ue,r),t.featureIndex.insert(we,se,ue,ye,this.index)}},Xr.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},Xr.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Xr.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Xr.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,B),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},Xr.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Xr.prototype.addFeature=function(e,t,r,a){for(var u=0,c=t;u<c.length;u+=1)for(var f=0,v=c[u];f<v.length;f+=1){var x=v[f],b=x.x,S=x.y;if(!(b<0||b>=8192||S<0||S>=8192)){var T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),C=T.vertexLength;mi(this.layoutVertexArray,b,S,-1,-1),mi(this.layoutVertexArray,b,S,1,-1),mi(this.layoutVertexArray,b,S,1,1),mi(this.layoutVertexArray,b,S,-1,1),this.indexArray.emplaceBack(C,C+1,C+2),this.indexArray.emplaceBack(C,C+3,C+2),T.vertexLength+=4,T.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},a)},Oe("CircleBucket",Xr,{omit:["layers"]});var Vn=new Vr({"circle-sort-key":new Ue(D.layout_circle["circle-sort-key"])}),go={paint:new Vr({"circle-radius":new Ue(D.paint_circle["circle-radius"]),"circle-color":new Ue(D.paint_circle["circle-color"]),"circle-blur":new Ue(D.paint_circle["circle-blur"]),"circle-opacity":new Ue(D.paint_circle["circle-opacity"]),"circle-translate":new qe(D.paint_circle["circle-translate"]),"circle-translate-anchor":new qe(D.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new qe(D.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new qe(D.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ue(D.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ue(D.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ue(D.paint_circle["circle-stroke-opacity"])}),layout:Vn},Ct=typeof Float32Array<"u"?Float32Array:Array;function xi(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function oi(e,t,r){var a=t[0],u=t[1],c=t[2],f=t[3],v=t[4],x=t[5],b=t[6],S=t[7],T=t[8],C=t[9],z=t[10],N=t[11],$=t[12],J=t[13],H=t[14],te=t[15],oe=r[0],se=r[1],ue=r[2],ye=r[3];return e[0]=oe*a+se*v+ue*T+ye*$,e[1]=oe*u+se*x+ue*C+ye*J,e[2]=oe*c+se*b+ue*z+ye*H,e[3]=oe*f+se*S+ue*N+ye*te,e[4]=(oe=r[4])*a+(se=r[5])*v+(ue=r[6])*T+(ye=r[7])*$,e[5]=oe*u+se*x+ue*C+ye*J,e[6]=oe*c+se*b+ue*z+ye*H,e[7]=oe*f+se*S+ue*N+ye*te,e[8]=(oe=r[8])*a+(se=r[9])*v+(ue=r[10])*T+(ye=r[11])*$,e[9]=oe*u+se*x+ue*C+ye*J,e[10]=oe*c+se*b+ue*z+ye*H,e[11]=oe*f+se*S+ue*N+ye*te,e[12]=(oe=r[12])*a+(se=r[13])*v+(ue=r[14])*T+(ye=r[15])*$,e[13]=oe*u+se*x+ue*C+ye*J,e[14]=oe*c+se*b+ue*z+ye*H,e[15]=oe*f+se*S+ue*N+ye*te,e}Math.hypot||(Math.hypot=function(){for(var e=arguments,t=0,r=arguments.length;r--;)t+=e[r]*e[r];return Math.sqrt(t)});var _o,Zp=oi;function ks(e,t,r){var a=t[0],u=t[1],c=t[2],f=t[3];return e[0]=r[0]*a+r[4]*u+r[8]*c+r[12]*f,e[1]=r[1]*a+r[5]*u+r[9]*c+r[13]*f,e[2]=r[2]*a+r[6]*u+r[10]*c+r[14]*f,e[3]=r[3]*a+r[7]*u+r[11]*c+r[15]*f,e}_o=new Ct(3),Ct!=Float32Array&&(_o[0]=0,_o[1]=0,_o[2]=0),function(){var e=new Ct(4);Ct!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0)}();var Wp=(function(){var e=new Ct(2);Ct!=Float32Array&&(e[0]=0,e[1]=0)}(),function(e){function t(r){e.call(this,r,go)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new Xr(r)},t.prototype.queryRadius=function(r){var a=r;return nn("circle-radius",this,a)+nn("circle-stroke-width",this,a)+Tr(this.paint.get("circle-translate"))},t.prototype.queryIntersectsFeature=function(r,a,u,c,f,v,x,b){for(var S=mn(r,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),v.angle,x),T=this.paint.get("circle-radius").evaluate(a,u)+this.paint.get("circle-stroke-width").evaluate(a,u),C=this.paint.get("circle-pitch-alignment")==="map",z=C?S:function(we,Ie){return we.map(function(je){return Na(je,Ie)})}(S,b),N=C?T*x:T,$=0,J=c;$<J.length;$+=1)for(var H=0,te=J[$];H<te.length;H+=1){var oe=te[H],se=C?oe:Na(oe,b),ue=N,ye=ks([],[oe.x,oe.y,0,1],b);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?ue*=ye[3]/v.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(ue*=v.cameraToCenterDistance/ye[3]),ni(z,se,ue))return!0}return!1},t}(en));function Na(e,t){var r=ks([],[e.x,e.y,0,1],t);return new pe(r[0]/r[3],r[1]/r[3])}var uc=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(Xr);function ea(e,t,r,a){var u=t.width,c=t.height;if(a){if(a instanceof Uint8ClampedArray)a=new Uint8Array(a.buffer);else if(a.length!==u*c*r)throw new RangeError("mismatched image size")}else a=new Uint8Array(u*c*r);return e.width=u,e.height=c,e.data=a,e}function Ms(e,t,r){var a=t.width,u=t.height;if(a!==e.width||u!==e.height){var c=ea({},{width:a,height:u},r);Hp(e,c,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,a),height:Math.min(e.height,u)},r),e.width=a,e.height=u,e.data=c.data}}function Hp(e,t,r,a,u,c){if(u.width===0||u.height===0)return t;if(u.width>e.width||u.height>e.height||r.x>e.width-u.width||r.y>e.height-u.height)throw new RangeError("out of range source coordinates for image copy");if(u.width>t.width||u.height>t.height||a.x>t.width-u.width||a.y>t.height-u.height)throw new RangeError("out of range destination coordinates for image copy");for(var f=e.data,v=t.data,x=0;x<u.height;x++)for(var b=((r.y+x)*e.width+r.x)*c,S=((a.y+x)*t.width+a.x)*c,T=0;T<u.width*c;T++)v[S+T]=f[b+T];return t}Oe("HeatmapBucket",uc,{omit:["layers"]});var $a=function(e,t){ea(this,e,1,t)};$a.prototype.resize=function(e){Ms(this,e,1)},$a.prototype.clone=function(){return new $a({width:this.width,height:this.height},new Uint8Array(this.data))},$a.copy=function(e,t,r,a,u){Hp(e,t,r,a,u,1)};var yi=function(e,t){ea(this,e,4,t)};yi.prototype.resize=function(e){Ms(this,e,4)},yi.prototype.replace=function(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e},yi.prototype.clone=function(){return new yi({width:this.width,height:this.height},new Uint8Array(this.data))},yi.copy=function(e,t,r,a,u){Hp(e,t,r,a,u,4)},Oe("AlphaImage",$a),Oe("RGBAImage",yi);var Mx={paint:new Vr({"heatmap-radius":new Ue(D.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ue(D.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new qe(D.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Wi(D.paint_heatmap["heatmap-color"]),"heatmap-opacity":new qe(D.paint_heatmap["heatmap-opacity"])})};function Hd(e){var t={},r=e.resolution||256,a=e.clips?e.clips.length:1,u=e.image||new yi({width:r,height:a}),c=function(N,$,J){t[e.evaluationKey]=J;var H=e.expression.evaluate(t);u.data[N+$+0]=Math.floor(255*H.r/H.a),u.data[N+$+1]=Math.floor(255*H.g/H.a),u.data[N+$+2]=Math.floor(255*H.b/H.a),u.data[N+$+3]=Math.floor(255*H.a)};if(e.clips)for(var f=0,v=0;f<a;++f,v+=4*r)for(var x=0,b=0;x<r;x++,b+=4){var S=x/(r-1),T=e.clips[f];c(v,b,T.start*(1-S)+T.end*S)}else for(var C=0,z=0;C<r;C++,z+=4)c(0,z,C/(r-1));return u}var zx=function(e){function t(r){e.call(this,r,Mx),this._updateColorRamp()}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new uc(r)},t.prototype._handleSpecialPaintPropertyUpdate=function(r){r==="heatmap-color"&&this._updateColorRamp()},t.prototype._updateColorRamp=function(){this.colorRamp=Hd({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},t.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype.hasOffscreenPass=function(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"},t}(en),Bx={paint:new Vr({"hillshade-illumination-direction":new qe(D.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new qe(D.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new qe(D.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new qe(D.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new qe(D.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new qe(D.paint_hillshade["hillshade-accent-color"])})},Dx=function(e){function t(r){e.call(this,r,Bx)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.hasOffscreenPass=function(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"},t}(en),Lx=Mr([{name:"a_pos",components:2,type:"Int16"}],4).members,Xp=cc,Rx=cc;function cc(e,t,r){r=r||2;var a,u,c,f,v,x,b,S=t&&t.length,T=S?t[0]*r:e.length,C=Xd(e,0,T,r,!0),z=[];if(!C||C.next===C.prev)return z;if(S&&(C=function($,J,H,te){var oe,se,ue,ye=[];for(oe=0,se=J.length;oe<se;oe++)(ue=Xd($,J[oe]*te,oe<se-1?J[oe+1]*te:$.length,te,!1))===ue.next&&(ue.steiner=!0),ye.push(qx(ue));for(ye.sort(Nx),oe=0;oe<ye.length;oe++)$x(ye[oe],H),H=ta(H,H.next);return H}(e,t,C,r)),e.length>80*r){a=c=e[0],u=f=e[1];for(var N=r;N<T;N+=r)(v=e[N])<a&&(a=v),(x=e[N+1])<u&&(u=x),v>c&&(c=v),x>f&&(f=x);b=(b=Math.max(c-a,f-u))!==0?1/b:0}return Zl(C,z,r,a,u,b),z}function Xd(e,t,r,a,u){var c,f;if(u===Yp(e,t,r,a)>0)for(c=t;c<r;c+=a)f=Yd(c,e[c],e[c+1],f);else for(c=r-a;c>=t;c-=a)f=Yd(c,e[c],e[c+1],f);return f&&pc(f,f.next)&&(Hl(f),f=f.next),f}function ta(e,t){if(!e)return e;t||(t=e);var r,a=e;do if(r=!1,a.steiner||!pc(a,a.next)&&_r(a.prev,a,a.next)!==0)a=a.next;else{if(Hl(a),(a=t=a.prev)===a.next)break;r=!0}while(r||a!==t);return t}function Zl(e,t,r,a,u,c,f){if(e){!f&&c&&function(S,T,C,z){var N=S;do N.z===null&&(N.z=Kp(N.x,N.y,T,C,z)),N.prevZ=N.prev,N.nextZ=N.next,N=N.next;while(N!==S);N.prevZ.nextZ=null,N.prevZ=null,function($){var J,H,te,oe,se,ue,ye,we,Ie=1;do{for(H=$,$=null,se=null,ue=0;H;){for(ue++,te=H,ye=0,J=0;J<Ie&&(ye++,te=te.nextZ);J++);for(we=Ie;ye>0||we>0&&te;)ye!==0&&(we===0||!te||H.z<=te.z)?(oe=H,H=H.nextZ,ye--):(oe=te,te=te.nextZ,we--),se?se.nextZ=oe:$=oe,oe.prevZ=se,se=oe;H=te}se.nextZ=null,Ie*=2}while(ue>1)}(N)}(e,a,u,c);for(var v,x,b=e;e.prev!==e.next;)if(v=e.prev,x=e.next,c?Ox(e,a,u,c):Fx(e))t.push(v.i/r),t.push(e.i/r),t.push(x.i/r),Hl(e),e=x.next,b=x.next;else if((e=x)===b){f?f===1?Zl(e=Vx(ta(e),t,r),t,r,a,u,c,2):f===2&&Ux(e,t,r,a,u,c):Zl(ta(e),t,r,a,u,c,1);break}}}function Fx(e){var t=e.prev,r=e,a=e.next;if(_r(t,r,a)>=0)return!1;for(var u=e.next.next;u!==e.prev;){if(zs(t.x,t.y,r.x,r.y,a.x,a.y,u.x,u.y)&&_r(u.prev,u,u.next)>=0)return!1;u=u.next}return!0}function Ox(e,t,r,a){var u=e.prev,c=e,f=e.next;if(_r(u,c,f)>=0)return!1;for(var v=u.x>c.x?u.x>f.x?u.x:f.x:c.x>f.x?c.x:f.x,x=u.y>c.y?u.y>f.y?u.y:f.y:c.y>f.y?c.y:f.y,b=Kp(u.x<c.x?u.x<f.x?u.x:f.x:c.x<f.x?c.x:f.x,u.y<c.y?u.y<f.y?u.y:f.y:c.y<f.y?c.y:f.y,t,r,a),S=Kp(v,x,t,r,a),T=e.prevZ,C=e.nextZ;T&&T.z>=b&&C&&C.z<=S;){if(T!==e.prev&&T!==e.next&&zs(u.x,u.y,c.x,c.y,f.x,f.y,T.x,T.y)&&_r(T.prev,T,T.next)>=0||(T=T.prevZ,C!==e.prev&&C!==e.next&&zs(u.x,u.y,c.x,c.y,f.x,f.y,C.x,C.y)&&_r(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;T&&T.z>=b;){if(T!==e.prev&&T!==e.next&&zs(u.x,u.y,c.x,c.y,f.x,f.y,T.x,T.y)&&_r(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;C&&C.z<=S;){if(C!==e.prev&&C!==e.next&&zs(u.x,u.y,c.x,c.y,f.x,f.y,C.x,C.y)&&_r(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function Vx(e,t,r){var a=e;do{var u=a.prev,c=a.next.next;!pc(u,c)&&Kd(u,a,a.next,c)&&Wl(u,c)&&Wl(c,u)&&(t.push(u.i/r),t.push(a.i/r),t.push(c.i/r),Hl(a),Hl(a.next),a=e=c),a=a.next}while(a!==e);return ta(a)}function Ux(e,t,r,a,u,c){var f=e;do{for(var v=f.next.next;v!==f.prev;){if(f.i!==v.i&&Gx(f,v)){var x=Jd(f,v);return f=ta(f,f.next),x=ta(x,x.next),Zl(f,t,r,a,u,c),void Zl(x,t,r,a,u,c)}v=v.next}f=f.next}while(f!==e)}function Nx(e,t){return e.x-t.x}function $x(e,t){if(t=function(a,u){var c,f=u,v=a.x,x=a.y,b=-1/0;do{if(x<=f.y&&x>=f.next.y&&f.next.y!==f.y){var S=f.x+(x-f.y)*(f.next.x-f.x)/(f.next.y-f.y);if(S<=v&&S>b){if(b=S,S===v){if(x===f.y)return f;if(x===f.next.y)return f.next}c=f.x<f.next.x?f:f.next}}f=f.next}while(f!==u);if(!c)return null;if(v===b)return c;var T,C=c,z=c.x,N=c.y,$=1/0;f=c;do v>=f.x&&f.x>=z&&v!==f.x&&zs(x<N?v:b,x,z,N,x<N?b:v,x,f.x,f.y)&&(T=Math.abs(x-f.y)/(v-f.x),Wl(f,a)&&(T<$||T===$&&(f.x>c.x||f.x===c.x&&jx(c,f)))&&(c=f,$=T)),f=f.next;while(f!==C);return c}(e,t)){var r=Jd(t,e);ta(t,t.next),ta(r,r.next)}}function jx(e,t){return _r(e.prev,e,t.prev)<0&&_r(t.next,e,e.next)<0}function Kp(e,t,r,a,u){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*u)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-a)*u)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function qx(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function zs(e,t,r,a,u,c,f,v){return(u-f)*(t-v)-(e-f)*(c-v)>=0&&(e-f)*(a-v)-(r-f)*(t-v)>=0&&(r-f)*(c-v)-(u-f)*(a-v)>=0}function Gx(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(r,a){var u=r;do{if(u.i!==r.i&&u.next.i!==r.i&&u.i!==a.i&&u.next.i!==a.i&&Kd(u,u.next,r,a))return!0;u=u.next}while(u!==r);return!1}(e,t)&&(Wl(e,t)&&Wl(t,e)&&function(r,a){var u=r,c=!1,f=(r.x+a.x)/2,v=(r.y+a.y)/2;do u.y>v!=u.next.y>v&&u.next.y!==u.y&&f<(u.next.x-u.x)*(v-u.y)/(u.next.y-u.y)+u.x&&(c=!c),u=u.next;while(u!==r);return c}(e,t)&&(_r(e.prev,e,t.prev)||_r(e,t.prev,t))||pc(e,t)&&_r(e.prev,e,e.next)>0&&_r(t.prev,t,t.next)>0)}function _r(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function pc(e,t){return e.x===t.x&&e.y===t.y}function Kd(e,t,r,a){var u=fc(_r(e,t,r)),c=fc(_r(e,t,a)),f=fc(_r(r,a,e)),v=fc(_r(r,a,t));return u!==c&&f!==v||!(u!==0||!hc(e,r,t))||!(c!==0||!hc(e,a,t))||!(f!==0||!hc(r,e,a))||!(v!==0||!hc(r,t,a))}function hc(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function fc(e){return e>0?1:e<0?-1:0}function Wl(e,t){return _r(e.prev,e,e.next)<0?_r(e,t,e.next)>=0&&_r(e,e.prev,t)>=0:_r(e,t,e.prev)<0||_r(e,e.next,t)<0}function Jd(e,t){var r=new Jp(e.i,e.x,e.y),a=new Jp(t.i,t.x,t.y),u=e.next,c=t.prev;return e.next=t,t.prev=e,r.next=u,u.prev=r,a.next=r,r.prev=a,c.next=a,a.prev=c,a}function Yd(e,t,r,a){var u=new Jp(e,t,r);return a?(u.next=a.next,u.prev=a,a.next.prev=u,a.next=u):(u.prev=u,u.next=u),u}function Hl(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Jp(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Yp(e,t,r,a){for(var u=0,c=t,f=r-a;c<r;c+=a)u+=(e[f]-e[c])*(e[c+1]+e[f+1]),f=c;return u}function Zx(e,t,r,a,u){(function c(f,v,x,b,S){for(;b>x;){if(b-x>600){var T=b-x+1,C=v-x+1,z=Math.log(T),N=.5*Math.exp(2*z/3),$=.5*Math.sqrt(z*N*(T-N)/T)*(C-T/2<0?-1:1);c(f,v,Math.max(x,Math.floor(v-C*N/T+$)),Math.min(b,Math.floor(v+(T-C)*N/T+$)),S)}var J=f[v],H=x,te=b;for(Xl(f,x,v),S(f[b],J)>0&&Xl(f,x,b);H<te;){for(Xl(f,H,te),H++,te--;S(f[H],J)<0;)H++;for(;S(f[te],J)>0;)te--}S(f[x],J)===0?Xl(f,x,te):Xl(f,++te,b),te<=v&&(x=te+1),v<=te&&(b=te-1)}})(e,t,r,a||e.length-1,u||Wx)}function Xl(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function Wx(e,t){return e<t?-1:e>t?1:0}function Qp(e,t){var r=e.length;if(r<=1)return[e];for(var a,u,c=[],f=0;f<r;f++){var v=Bo(e[f]);v!==0&&(e[f].area=Math.abs(v),u===void 0&&(u=v<0),u===v<0?(a&&c.push(a),a=[e[f]]):a.push(e[f]))}if(a&&c.push(a),t>1)for(var x=0;x<c.length;x++)c[x].length<=t||(Zx(c[x],t,1,c[x].length-1,Hx),c[x]=c[x].slice(0,t));return c}function Hx(e,t){return t.area-e.area}function eh(e,t,r){for(var a=r.patternDependencies,u=!1,c=0,f=t;c<f.length;c+=1){var v=f[c].paint.get(e+"-pattern");v.isConstant()||(u=!0);var x=v.constantOr(null);x&&(u=!0,a[x.to]=!0,a[x.from]=!0)}return u}function th(e,t,r,a,u){for(var c=u.patternDependencies,f=0,v=t;f<v.length;f+=1){var x=v[f],b=x.paint.get(e+"-pattern").value;if(b.kind!=="constant"){var S=b.evaluate({zoom:a-1},r,{},u.availableImages),T=b.evaluate({zoom:a},r,{},u.availableImages),C=b.evaluate({zoom:a+1},r,{},u.availableImages);T=T&&T.name?T.name:T,C=C&&C.name?C.name:C,c[S=S&&S.name?S.name:S]=!0,c[T]=!0,c[C]=!0,r.patterns[x.id]={min:S,mid:T,max:C}}}return r}cc.deviation=function(e,t,r,a){var u=t&&t.length,c=Math.abs(Yp(e,0,u?t[0]*r:e.length,r));if(u)for(var f=0,v=t.length;f<v;f++)c-=Math.abs(Yp(e,t[f]*r,f<v-1?t[f+1]*r:e.length,r));var x=0;for(f=0;f<a.length;f+=3){var b=a[f]*r,S=a[f+1]*r,T=a[f+2]*r;x+=Math.abs((e[b]-e[T])*(e[S+1]-e[b+1])-(e[b]-e[S])*(e[T+1]-e[b+1]))}return c===0&&x===0?0:Math.abs((x-c)/c)},cc.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},a=0,u=0;u<e.length;u++){for(var c=0;c<e[u].length;c++)for(var f=0;f<t;f++)r.vertices.push(e[u][c][f]);u>0&&r.holes.push(a+=e[u-1].length)}return r},Xp.default=Rx;var yn=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new yo,this.indexArray=new Dn,this.indexArray2=new Fa,this.programConfigurations=new Je(e.layers,e.zoom),this.segments=new L,this.segments2=new L,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};yn.prototype.populate=function(e,t,r){this.hasPattern=eh("fill",this.layers,t);for(var a=this.layers[0].layout.get("fill-sort-key"),u=[],c=0,f=e;c<f.length;c+=1){var v=f[c],x=v.feature,b=v.id,S=v.index,T=v.sourceLayerIndex,C=this.layers[0]._featureFilter.needGeometry,z=lr(x,C);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),z,r)){var N=a?a.evaluate(z,{},r,t.availableImages):void 0,$={id:b,properties:x.properties,type:x.type,sourceLayerIndex:T,index:S,geometry:C?z.geometry:er(x),patterns:{},sortKey:N};u.push($)}}a&&u.sort(function(we,Ie){return we.sortKey-Ie.sortKey});for(var J=0,H=u;J<H.length;J+=1){var te=H[J],oe=te.geometry,se=te.index,ue=te.sourceLayerIndex;if(this.hasPattern){var ye=th("fill",this.layers,te,this.zoom,t);this.patternFeatures.push(ye)}else this.addFeature(te,oe,se,r,{});t.featureIndex.insert(e[se].feature,oe,se,ue,this.index)}},yn.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},yn.prototype.addFeatures=function(e,t,r){for(var a=0,u=this.patternFeatures;a<u.length;a+=1){var c=u[a];this.addFeature(c,c.geometry,c.index,t,r)}},yn.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},yn.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},yn.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Lx),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0},yn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},yn.prototype.addFeature=function(e,t,r,a,u){for(var c=0,f=Qp(t,500);c<f.length;c+=1){for(var v=f[c],x=0,b=0,S=v;b<S.length;b+=1)x+=S[b].length;for(var T=this.segments.prepareSegment(x,this.layoutVertexArray,this.indexArray),C=T.vertexLength,z=[],N=[],$=0,J=v;$<J.length;$+=1){var H=J[$];if(H.length!==0){H!==v[0]&&N.push(z.length/2);var te=this.segments2.prepareSegment(H.length,this.layoutVertexArray,this.indexArray2),oe=te.vertexLength;this.layoutVertexArray.emplaceBack(H[0].x,H[0].y),this.indexArray2.emplaceBack(oe+H.length-1,oe),z.push(H[0].x),z.push(H[0].y);for(var se=1;se<H.length;se++)this.layoutVertexArray.emplaceBack(H[se].x,H[se].y),this.indexArray2.emplaceBack(oe+se-1,oe+se),z.push(H[se].x),z.push(H[se].y);te.vertexLength+=H.length,te.primitiveLength+=H.length}}for(var ue=Xp(z,N),ye=0;ye<ue.length;ye+=3)this.indexArray.emplaceBack(C+ue[ye],C+ue[ye+1],C+ue[ye+2]);T.vertexLength+=x,T.primitiveLength+=ue.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,u,a)},Oe("FillBucket",yn,{omit:["layers","patternFeatures"]});var Xx=new Vr({"fill-sort-key":new Ue(D.layout_fill["fill-sort-key"])}),Kx={paint:new Vr({"fill-antialias":new qe(D.paint_fill["fill-antialias"]),"fill-opacity":new Ue(D.paint_fill["fill-opacity"]),"fill-color":new Ue(D.paint_fill["fill-color"]),"fill-outline-color":new Ue(D.paint_fill["fill-outline-color"]),"fill-translate":new qe(D.paint_fill["fill-translate"]),"fill-translate-anchor":new qe(D.paint_fill["fill-translate-anchor"]),"fill-pattern":new Is(D.paint_fill["fill-pattern"])}),layout:Xx},Jx=function(e){function t(r){e.call(this,r,Kx)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.recalculate=function(r,a){e.prototype.recalculate.call(this,r,a);var u=this.paint._values["fill-outline-color"];u.value.kind==="constant"&&u.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},t.prototype.createBucket=function(r){return new yn(r)},t.prototype.queryRadius=function(){return Tr(this.paint.get("fill-translate"))},t.prototype.queryIntersectsFeature=function(r,a,u,c,f,v,x){return Hi(mn(r,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),v.angle,x),c)},t.prototype.isTileClipped=function(){return!0},t}(en),Yx=Mr([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,Qd=Bs;function Bs(e,t,r,a,u){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=a,this._values=u,e.readFields(Qx,this,t)}function Qx(e,t,r){e==1?t.id=r.readVarint():e==2?function(a,u){for(var c=a.readVarint()+a.pos;a.pos<c;){var f=u._keys[a.readVarint()],v=u._values[a.readVarint()];u.properties[f]=v}}(r,t):e==3?t.type=r.readVarint():e==4&&(t._geometry=r.pos)}function eb(e){for(var t,r,a=0,u=0,c=e.length,f=c-1;u<c;f=u++)a+=((r=e[f]).x-(t=e[u]).x)*(t.y+r.y);return a}Bs.types=["Unknown","Point","LineString","Polygon"],Bs.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,a=1,u=0,c=0,f=0,v=[];e.pos<r;){if(u<=0){var x=e.readVarint();a=7&x,u=x>>3}if(u--,a===1||a===2)c+=e.readSVarint(),f+=e.readSVarint(),a===1&&(t&&v.push(t),t=[]),t.push(new pe(c,f));else{if(a!==7)throw new Error("unknown command "+a);t&&t.push(t[0].clone())}}return t&&v.push(t),v},Bs.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,a=0,u=0,c=0,f=1/0,v=-1/0,x=1/0,b=-1/0;e.pos<t;){if(a<=0){var S=e.readVarint();r=7&S,a=S>>3}if(a--,r===1||r===2)(u+=e.readSVarint())<f&&(f=u),u>v&&(v=u),(c+=e.readSVarint())<x&&(x=c),c>b&&(b=c);else if(r!==7)throw new Error("unknown command "+r)}return[f,x,v,b]},Bs.prototype.toGeoJSON=function(e,t,r){var a,u,c=this.extent*Math.pow(2,r),f=this.extent*e,v=this.extent*t,x=this.loadGeometry(),b=Bs.types[this.type];function S(z){for(var N=0;N<z.length;N++){var $=z[N];z[N]=[360*($.x+f)/c-180,360/Math.PI*Math.atan(Math.exp((180-360*($.y+v)/c)*Math.PI/180))-90]}}switch(this.type){case 1:var T=[];for(a=0;a<x.length;a++)T[a]=x[a][0];S(x=T);break;case 2:for(a=0;a<x.length;a++)S(x[a]);break;case 3:for(x=function(z){var N=z.length;if(N<=1)return[z];for(var $,J,H=[],te=0;te<N;te++){var oe=eb(z[te]);oe!==0&&(J===void 0&&(J=oe<0),J===oe<0?($&&H.push($),$=[z[te]]):$.push(z[te]))}return $&&H.push($),H}(x),a=0;a<x.length;a++)for(u=0;u<x[a].length;u++)S(x[a][u])}x.length===1?x=x[0]:b="Multi"+b;var C={type:"Feature",geometry:{type:b,coordinates:x},properties:this.properties};return"id"in this&&(C.id=this.id),C};var em=tm;function tm(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(tb,this,t),this.length=this._features.length}function tb(e,t,r){e===15?t.version=r.readVarint():e===1?t.name=r.readString():e===5?t.extent=r.readVarint():e===2?t._features.push(r.pos):e===3?t._keys.push(r.readString()):e===4&&t._values.push(function(a){for(var u=null,c=a.readVarint()+a.pos;a.pos<c;){var f=a.readVarint()>>3;u=f===1?a.readString():f===2?a.readFloat():f===3?a.readDouble():f===4?a.readVarint64():f===5?a.readVarint():f===6?a.readSVarint():f===7?a.readBoolean():null}return u}(r))}function rb(e,t,r){if(e===3){var a=new em(r,r.readVarint()+r.pos);a.length&&(t[a.name]=a)}}tm.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new Qd(this._pbf,t,this.extent,this._keys,this._values)};var Ds={VectorTile:function(e,t){this.layers=e.readFields(rb,{},t)},VectorTileFeature:Qd,VectorTileLayer:em},ib=Ds.VectorTileFeature.types,rh=Math.pow(2,13);function Kl(e,t,r,a,u,c,f,v){e.emplaceBack(t,r,2*Math.floor(a*rh)+f,u*rh*2,c*rh*2,Math.round(v))}var vn=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new dn,this.indexArray=new Dn,this.programConfigurations=new Je(e.layers,e.zoom),this.segments=new L,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};function nb(e,t){return e.x===t.x&&(e.x<0||e.x>8192)||e.y===t.y&&(e.y<0||e.y>8192)}vn.prototype.populate=function(e,t,r){this.features=[],this.hasPattern=eh("fill-extrusion",this.layers,t);for(var a=0,u=e;a<u.length;a+=1){var c=u[a],f=c.feature,v=c.id,x=c.index,b=c.sourceLayerIndex,S=this.layers[0]._featureFilter.needGeometry,T=lr(f,S);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),T,r)){var C={id:v,sourceLayerIndex:b,index:x,geometry:S?T.geometry:er(f),properties:f.properties,type:f.type,patterns:{}};this.hasPattern?this.features.push(th("fill-extrusion",this.layers,C,this.zoom,t)):this.addFeature(C,C.geometry,x,r,{}),t.featureIndex.insert(f,C.geometry,x,b,this.index,!0)}}},vn.prototype.addFeatures=function(e,t,r){for(var a=0,u=this.features;a<u.length;a+=1){var c=u[a];this.addFeature(c,c.geometry,c.index,t,r)}},vn.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},vn.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},vn.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},vn.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Yx),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},vn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},vn.prototype.addFeature=function(e,t,r,a,u){for(var c=0,f=Qp(t,500);c<f.length;c+=1){for(var v=f[c],x=0,b=0,S=v;b<S.length;b+=1)x+=S[b].length;for(var T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),C=0,z=v;C<z.length;C+=1){var N=z[C];if(N.length!==0&&!((ct=N).every(function(nt){return nt.x<0})||ct.every(function(nt){return nt.x>8192})||ct.every(function(nt){return nt.y<0})||ct.every(function(nt){return nt.y>8192})))for(var $=0,J=0;J<N.length;J++){var H=N[J];if(J>=1){var te=N[J-1];if(!nb(H,te)){T.vertexLength+4>L.MAX_VERTEX_ARRAY_LENGTH&&(T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var oe=H.sub(te)._perp()._unit(),se=te.dist(H);$+se>32768&&($=0),Kl(this.layoutVertexArray,H.x,H.y,oe.x,oe.y,0,0,$),Kl(this.layoutVertexArray,H.x,H.y,oe.x,oe.y,0,1,$),Kl(this.layoutVertexArray,te.x,te.y,oe.x,oe.y,0,0,$+=se),Kl(this.layoutVertexArray,te.x,te.y,oe.x,oe.y,0,1,$);var ue=T.vertexLength;this.indexArray.emplaceBack(ue,ue+2,ue+1),this.indexArray.emplaceBack(ue+1,ue+2,ue+3),T.vertexLength+=4,T.primitiveLength+=2}}}}if(T.vertexLength+x>L.MAX_VERTEX_ARRAY_LENGTH&&(T=this.segments.prepareSegment(x,this.layoutVertexArray,this.indexArray)),ib[e.type]==="Polygon"){for(var ye=[],we=[],Ie=T.vertexLength,je=0,Me=v;je<Me.length;je+=1){var Ze=Me[je];if(Ze.length!==0){Ze!==v[0]&&we.push(ye.length/2);for(var Be=0;Be<Ze.length;Be++){var lt=Ze[Be];Kl(this.layoutVertexArray,lt.x,lt.y,0,0,1,1,0),ye.push(lt.x),ye.push(lt.y)}}}for(var Ye=Xp(ye,we),Ne=0;Ne<Ye.length;Ne+=3)this.indexArray.emplaceBack(Ie+Ye[Ne],Ie+Ye[Ne+2],Ie+Ye[Ne+1]);T.primitiveLength+=Ye.length/3,T.vertexLength+=x}}var ct;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,u,a)},Oe("FillExtrusionBucket",vn,{omit:["layers","features"]});var ob={paint:new Vr({"fill-extrusion-opacity":new qe(D["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ue(D["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new qe(D["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new qe(D["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Is(D["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ue(D["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ue(D["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new qe(D["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},ab=function(e){function t(r){e.call(this,r,ob)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new vn(r)},t.prototype.queryRadius=function(){return Tr(this.paint.get("fill-extrusion-translate"))},t.prototype.is3D=function(){return!0},t.prototype.queryIntersectsFeature=function(r,a,u,c,f,v,x,b){var S=mn(r,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),v.angle,x),T=this.paint.get("fill-extrusion-height").evaluate(a,u),C=this.paint.get("fill-extrusion-base").evaluate(a,u),z=function($,J,H,te){for(var oe=[],se=0,ue=$;se<ue.length;se+=1){var ye=ue[se],we=[ye.x,ye.y,0,1];ks(we,we,J),oe.push(new pe(we[0]/we[3],we[1]/we[3]))}return oe}(S,b),N=function($,J,H,te){for(var oe=[],se=[],ue=te[8]*J,ye=te[9]*J,we=te[10]*J,Ie=te[11]*J,je=te[8]*H,Me=te[9]*H,Ze=te[10]*H,Be=te[11]*H,lt=0,Ye=$;lt<Ye.length;lt+=1){for(var Ne=[],ct=[],nt=0,xt=Ye[lt];nt<xt.length;nt+=1){var We=xt[nt],Tt=We.x,Jt=We.y,ir=te[0]*Tt+te[4]*Jt+te[12],tr=te[1]*Tt+te[5]*Jt+te[13],Yt=te[2]*Tt+te[6]*Jt+te[14],nr=te[3]*Tt+te[7]*Jt+te[15],Ir=Yt+we,Ar=nr+Ie,Jr=ir+je,Dr=tr+Me,Yr=Yt+Ze,ur=nr+Be,Lr=new pe((ir+ue)/Ar,(tr+ye)/Ar);Lr.z=Ir/Ar,Ne.push(Lr);var ft=new pe(Jr/ur,Dr/ur);ft.z=Yr/ur,ct.push(ft)}oe.push(Ne),se.push(ct)}return[oe,se]}(c,C,T,b);return function($,J,H){var te=1/0;Hi(H,J)&&(te=rm(H,J[0]));for(var oe=0;oe<J.length;oe++)for(var se=J[oe],ue=$[oe],ye=0;ye<se.length-1;ye++){var we=se[ye],Ie=[we,se[ye+1],ue[ye+1],ue[ye],we];Fn(H,Ie)&&(te=Math.min(te,rm(H,Ie)))}return te!==1/0&&te}(N[0],N[1],z)},t}(en);function Jl(e,t){return e.x*t.x+e.y*t.y}function rm(e,t){if(e.length===1){for(var r,a=0,u=t[a++];!r||u.equals(r);)if(!(r=t[a++]))return 1/0;for(;a<t.length;a++){var c=t[a],f=e[0],v=r.sub(u),x=c.sub(u),b=f.sub(u),S=Jl(v,v),T=Jl(v,x),C=Jl(x,x),z=Jl(b,v),N=Jl(b,x),$=S*C-T*T,J=(C*z-T*N)/$,H=(S*N-T*z)/$,te=u.z*(1-J-H)+r.z*J+c.z*H;if(isFinite(te))return te}return 1/0}for(var oe=1/0,se=0,ue=t;se<ue.length;se+=1)oe=Math.min(oe,ue[se].z);return oe}var sb=Mr([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,lb=Mr([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,ub=Ds.VectorTileFeature.types,cb=Math.cos(Math.PI/180*37.5),im=Math.pow(2,14)/.5,ai=function(e){var t=this;this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(r){return r.id}),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(function(r){t.gradients[r.id]={}}),this.layoutVertexArray=new di,this.layoutVertexArray2=new Xo,this.indexArray=new Dn,this.programConfigurations=new Je(e.layers,e.zoom),this.segments=new L,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(function(r){return r.isStateDependent()}).map(function(r){return r.id})};ai.prototype.populate=function(e,t,r){this.hasPattern=eh("line",this.layers,t);for(var a=this.layers[0].layout.get("line-sort-key"),u=[],c=0,f=e;c<f.length;c+=1){var v=f[c],x=v.feature,b=v.id,S=v.index,T=v.sourceLayerIndex,C=this.layers[0]._featureFilter.needGeometry,z=lr(x,C);if(this.layers[0]._featureFilter.filter(new ht(this.zoom),z,r)){var N=a?a.evaluate(z,{},r):void 0,$={id:b,properties:x.properties,type:x.type,sourceLayerIndex:T,index:S,geometry:C?z.geometry:er(x),patterns:{},sortKey:N};u.push($)}}a&&u.sort(function(we,Ie){return we.sortKey-Ie.sortKey});for(var J=0,H=u;J<H.length;J+=1){var te=H[J],oe=te.geometry,se=te.index,ue=te.sourceLayerIndex;if(this.hasPattern){var ye=th("line",this.layers,te,this.zoom,t);this.patternFeatures.push(ye)}else this.addFeature(te,oe,se,r,{});t.featureIndex.insert(e[se].feature,oe,se,ue,this.index)}},ai.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},ai.prototype.addFeatures=function(e,t,r){for(var a=0,u=this.patternFeatures;a<u.length;a+=1){var c=u[a];this.addFeature(c,c.geometry,c.index,t,r)}},ai.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},ai.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ai.prototype.upload=function(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,lb)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,sb),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},ai.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},ai.prototype.lineFeatureClips=function(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}},ai.prototype.addFeature=function(e,t,r,a,u){var c=this.layers[0].layout,f=c.get("line-join").evaluate(e,{}),v=c.get("line-cap"),x=c.get("line-miter-limit"),b=c.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(var S=0,T=t;S<T.length;S+=1)this.addLine(T[S],e,f,v,x,b);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,u,a)},ai.prototype.addLine=function(e,t,r,a,u,c){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var f=0;f<e.length-1;f++)this.totalDistance+=e[f].dist(e[f+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var v=ub[t.type]==="Polygon",x=e.length;x>=2&&e[x-1].equals(e[x-2]);)x--;for(var b=0;b<x-1&&e[b].equals(e[b+1]);)b++;if(!(x<(v?3:2))){r==="bevel"&&(u=1.05);var S,T=this.overscaling<=16?122880/(512*this.overscaling):0,C=this.segments.prepareSegment(10*x,this.layoutVertexArray,this.indexArray),z=void 0,N=void 0,$=void 0,J=void 0;this.e1=this.e2=-1,v&&(J=e[b].sub(S=e[x-2])._unit()._perp());for(var H=b;H<x;H++)if(!(N=H===x-1?v?e[b+1]:void 0:e[H+1])||!e[H].equals(N)){J&&($=J),S&&(z=S),S=e[H],J=N?N.sub(S)._unit()._perp():$;var te=($=$||J).add(J);te.x===0&&te.y===0||te._unit();var oe=$.x*J.x+$.y*J.y,se=te.x*J.x+te.y*J.y,ue=se!==0?1/se:1/0,ye=2*Math.sqrt(2-2*se),we=se<cb&&z&&N,Ie=$.x*J.y-$.y*J.x>0;if(we&&H>b){var je=S.dist(z);if(je>2*T){var Me=S.sub(S.sub(z)._mult(T/je)._round());this.updateDistance(z,Me),this.addCurrentVertex(Me,$,0,0,C),z=Me}}var Ze=z&&N,Be=Ze?r:v?"butt":a;if(Ze&&Be==="round"&&(ue<c?Be="miter":ue<=2&&(Be="fakeround")),Be==="miter"&&ue>u&&(Be="bevel"),Be==="bevel"&&(ue>2&&(Be="flipbevel"),ue<u&&(Be="miter")),z&&this.updateDistance(z,S),Be==="miter")te._mult(ue),this.addCurrentVertex(S,te,0,0,C);else if(Be==="flipbevel"){if(ue>100)te=J.mult(-1);else{var lt=ue*$.add(J).mag()/$.sub(J).mag();te._perp()._mult(lt*(Ie?-1:1))}this.addCurrentVertex(S,te,0,0,C),this.addCurrentVertex(S,te.mult(-1),0,0,C)}else if(Be==="bevel"||Be==="fakeround"){var Ye=-Math.sqrt(ue*ue-1),Ne=Ie?Ye:0,ct=Ie?0:Ye;if(z&&this.addCurrentVertex(S,$,Ne,ct,C),Be==="fakeround")for(var nt=Math.round(180*ye/Math.PI/20),xt=1;xt<nt;xt++){var We=xt/nt;if(We!==.5){var Tt=We-.5;We+=We*Tt*(We-1)*((1.0904+oe*(oe*(3.55645-1.43519*oe)-3.2452))*Tt*Tt+(.848013+oe*(.215638*oe-1.06021)))}var Jt=J.sub($)._mult(We)._add($)._unit()._mult(Ie?-1:1);this.addHalfVertex(S,Jt.x,Jt.y,!1,Ie,0,C)}N&&this.addCurrentVertex(S,J,-Ne,-ct,C)}else if(Be==="butt")this.addCurrentVertex(S,te,0,0,C);else if(Be==="square"){var ir=z?1:-1;this.addCurrentVertex(S,te,ir,ir,C)}else Be==="round"&&(z&&(this.addCurrentVertex(S,$,0,0,C),this.addCurrentVertex(S,$,1,1,C,!0)),N&&(this.addCurrentVertex(S,J,-1,-1,C,!0),this.addCurrentVertex(S,J,0,0,C)));if(we&&H<x-1){var tr=S.dist(N);if(tr>2*T){var Yt=S.add(N.sub(S)._mult(T/tr)._round());this.updateDistance(S,Yt),this.addCurrentVertex(Yt,J,0,0,C),S=Yt}}}}},ai.prototype.addCurrentVertex=function(e,t,r,a,u,c){c===void 0&&(c=!1);var f=t.y*a-t.x,v=-t.y-t.x*a;this.addHalfVertex(e,t.x+t.y*r,t.y-t.x*r,c,!1,r,u),this.addHalfVertex(e,f,v,c,!0,-a,u),this.distance>im/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(e,t,r,a,u,c))},ai.prototype.addHalfVertex=function(e,t,r,a,u,c,f){var v=.5*(this.lineClips?this.scaledDistance*(im-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e.x<<1)+(a?1:0),(e.y<<1)+(u?1:0),Math.round(63*t)+128,Math.round(63*r)+128,1+(c===0?0:c<0?-1:1)|(63&v)<<2,v>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var x=f.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,x),f.primitiveLength++),u?this.e2=x:this.e1=x},ai.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},ai.prototype.updateDistance=function(e,t){this.distance+=e.dist(t),this.updateScaledDistance()},Oe("LineBucket",ai,{omit:["layers","patternFeatures"]});var pb=new Vr({"line-cap":new qe(D.layout_line["line-cap"]),"line-join":new Ue(D.layout_line["line-join"]),"line-miter-limit":new qe(D.layout_line["line-miter-limit"]),"line-round-limit":new qe(D.layout_line["line-round-limit"]),"line-sort-key":new Ue(D.layout_line["line-sort-key"])}),nm={paint:new Vr({"line-opacity":new Ue(D.paint_line["line-opacity"]),"line-color":new Ue(D.paint_line["line-color"]),"line-translate":new qe(D.paint_line["line-translate"]),"line-translate-anchor":new qe(D.paint_line["line-translate-anchor"]),"line-width":new Ue(D.paint_line["line-width"]),"line-gap-width":new Ue(D.paint_line["line-gap-width"]),"line-offset":new Ue(D.paint_line["line-offset"]),"line-blur":new Ue(D.paint_line["line-blur"]),"line-dasharray":new Hr(D.paint_line["line-dasharray"]),"line-pattern":new Is(D.paint_line["line-pattern"]),"line-gradient":new Wi(D.paint_line["line-gradient"])}),layout:pb},om=new(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.possiblyEvaluate=function(r,a){return a=new ht(Math.floor(a.zoom),{now:a.now,fadeDuration:a.fadeDuration,zoomHistory:a.zoomHistory,transition:a.transition}),e.prototype.possiblyEvaluate.call(this,r,a)},t.prototype.evaluate=function(r,a,u,c){return a=et({},a,{zoom:Math.floor(a.zoom)}),e.prototype.evaluate.call(this,r,a,u,c)},t}(Ue))(nm.paint.properties["line-width"].specification);om.useIntegerZoom=!0;var hb=function(e){function t(r){e.call(this,r,nm),this.gradientVersion=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(r){r==="line-gradient"&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof ui,this.gradientVersion=(this.gradientVersion+1)%ve)},t.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},t.prototype.recalculate=function(r,a){e.prototype.recalculate.call(this,r,a),this.paint._values["line-floorwidth"]=om.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,r)},t.prototype.createBucket=function(r){return new ai(r)},t.prototype.queryRadius=function(r){var a=r,u=am(nn("line-width",this,a),nn("line-gap-width",this,a)),c=nn("line-offset",this,a);return u/2+Math.abs(c)+Tr(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(r,a,u,c,f,v,x){var b=mn(r,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),v.angle,x),S=x/2*am(this.paint.get("line-width").evaluate(a,u),this.paint.get("line-gap-width").evaluate(a,u)),T=this.paint.get("line-offset").evaluate(a,u);return T&&(c=function(C,z){for(var N=[],$=new pe(0,0),J=0;J<C.length;J++){for(var H=C[J],te=[],oe=0;oe<H.length;oe++){var se=H[oe],ue=H[oe+1],ye=oe===0?$:se.sub(H[oe-1])._unit()._perp(),we=oe===H.length-1?$:ue.sub(se)._unit()._perp(),Ie=ye._add(we)._unit();Ie._mult(1/(Ie.x*we.x+Ie.y*we.y)),te.push(Ie._mult(z)._add(se))}N.push(te)}return N}(c,T*x)),function(C,z,N){for(var $=0;$<z.length;$++){var J=z[$];if(C.length>=3){for(var H=0;H<J.length;H++)if(rn(C,J[H]))return!0}if(Di(C,J,N))return!0}return!1}(b,c,S)},t.prototype.isTileClipped=function(){return!0},t}(en);function am(e,t){return t>0?t+2*e:e}var fb=Mr([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),db=Mr([{name:"a_projected_pos",components:3,type:"Float32"}],4),mb=(Mr([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Mr([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),sm=(Mr([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),Mr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),yb=Mr([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function vb(e,t,r){return e.sections.forEach(function(a){a.text=function(u,c,f){var v=c.layout.get("text-transform").evaluate(f,{});return v==="uppercase"?u=u.toLocaleUpperCase():v==="lowercase"&&(u=u.toLocaleLowerCase()),_i.applyArabicShaping&&(u=_i.applyArabicShaping(u)),u}(a.text,t,r)}),e}Mr([{name:"triangle",components:3,type:"Uint16"}]),Mr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),Mr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),Mr([{type:"Float32",name:"offsetX"}]),Mr([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Yl={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},lm=function(e,t,r,a,u){var c,f,v=8*u-a-1,x=(1<<v)-1,b=x>>1,S=-7,T=u-1,C=-1,z=e[t+T];for(T+=C,c=z&(1<<-S)-1,z>>=-S,S+=v;S>0;c=256*c+e[t+T],T+=C,S-=8);for(f=c&(1<<-S)-1,c>>=-S,S+=a;S>0;f=256*f+e[t+T],T+=C,S-=8);if(c===0)c=1-b;else{if(c===x)return f?NaN:1/0*(z?-1:1);f+=Math.pow(2,a),c-=b}return(z?-1:1)*f*Math.pow(2,c-a)},um=function(e,t,r,a,u,c){var f,v,x,b=8*c-u-1,S=(1<<b)-1,T=S>>1,C=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,z=0,N=1,$=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(v=isNaN(t)?1:0,f=S):(f=Math.floor(Math.log(t)/Math.LN2),t*(x=Math.pow(2,-f))<1&&(f--,x*=2),(t+=f+T>=1?C/x:C*Math.pow(2,1-T))*x>=2&&(f++,x/=2),f+T>=S?(v=0,f=S):f+T>=1?(v=(t*x-1)*Math.pow(2,u),f+=T):(v=t*Math.pow(2,T-1)*Math.pow(2,u),f=0));u>=8;e[r+z]=255&v,z+=N,v/=256,u-=8);for(f=f<<u|v,b+=u;b>0;e[r+z]=255&f,z+=N,f/=256,b-=8);e[r+z-N]|=128*$},dc=qt;function qt(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}qt.Varint=0,qt.Fixed64=1,qt.Bytes=2,qt.Fixed32=5;var cm=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function xo(e){return e.type===qt.Bytes?e.readVarint()+e.pos:e.pos+1}function Ls(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function pm(e,t,r){var a=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(a);for(var u=r.pos-1;u>=e;u--)r.buf[u+a]=r.buf[u]}function gb(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function _b(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function xb(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function bb(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function wb(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function Sb(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function Tb(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Ib(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function Ab(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function mc(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function Rs(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function hm(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function Eb(e,t,r){e===1&&r.readMessage(Pb,t)}function Pb(e,t,r){if(e===3){var a=r.readMessage(Cb,{}),u=a.width,c=a.height,f=a.left,v=a.top,x=a.advance;t.push({id:a.id,bitmap:new $a({width:u+6,height:c+6},a.bitmap),metrics:{width:u,height:c,left:f,top:v,advance:x}})}}function Cb(e,t,r){e===1?t.id=r.readVarint():e===2?t.bitmap=r.readBytes():e===3?t.width=r.readVarint():e===4?t.height=r.readVarint():e===5?t.left=r.readSVarint():e===6?t.top=r.readSVarint():e===7&&(t.advance=r.readVarint())}function fm(e){for(var t=0,r=0,a=0,u=e;a<u.length;a+=1){var c=u[a];t+=c.w*c.h,r=Math.max(r,c.w)}e.sort(function($,J){return J.h-$.h});for(var f=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],v=0,x=0,b=0,S=e;b<S.length;b+=1)for(var T=S[b],C=f.length-1;C>=0;C--){var z=f[C];if(!(T.w>z.w||T.h>z.h)){if(T.x=z.x,T.y=z.y,x=Math.max(x,T.y+T.h),v=Math.max(v,T.x+T.w),T.w===z.w&&T.h===z.h){var N=f.pop();C<f.length&&(f[C]=N)}else T.h===z.h?(z.x+=T.w,z.w-=T.w):T.w===z.w?(z.y+=T.h,z.h-=T.h):(f.push({x:z.x+T.w,y:z.y,w:z.w-T.w,h:T.h}),z.y+=T.h,z.h-=T.h);break}}return{w:v,h:x,fill:t/(v*x)||0}}qt.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var a=this.readVarint(),u=a>>3,c=this.pos;this.type=7&a,e(u,t,this),this.pos===c&&this.skip(a)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=mc(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=hm(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=mc(this.buf,this.pos)+4294967296*mc(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=mc(this.buf,this.pos)+4294967296*hm(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=lm(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=lm(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,a=this.buf;return t=127&(r=a[this.pos++]),r<128?t:(t|=(127&(r=a[this.pos++]))<<7,r<128?t:(t|=(127&(r=a[this.pos++]))<<14,r<128?t:(t|=(127&(r=a[this.pos++]))<<21,r<128?t:function(u,c,f){var v,x,b=f.buf;if(v=(112&(x=b[f.pos++]))>>4,x<128||(v|=(127&(x=b[f.pos++]))<<3,x<128)||(v|=(127&(x=b[f.pos++]))<<10,x<128)||(v|=(127&(x=b[f.pos++]))<<17,x<128)||(v|=(127&(x=b[f.pos++]))<<24,x<128)||(v|=(1&(x=b[f.pos++]))<<31,x<128))return Ls(u,v,c);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=a[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&cm?function(r,a,u){return cm.decode(r.subarray(a,u))}(this.buf,t,e):function(r,a,u){for(var c="",f=a;f<u;){var v,x,b,S=r[f],T=null,C=S>239?4:S>223?3:S>191?2:1;if(f+C>u)break;C===1?S<128&&(T=S):C===2?(192&(v=r[f+1]))==128&&(T=(31&S)<<6|63&v)<=127&&(T=null):C===3?(x=r[f+2],(192&(v=r[f+1]))==128&&(192&x)==128&&((T=(15&S)<<12|(63&v)<<6|63&x)<=2047||T>=55296&&T<=57343)&&(T=null)):C===4&&(x=r[f+2],b=r[f+3],(192&(v=r[f+1]))==128&&(192&x)==128&&(192&b)==128&&((T=(15&S)<<18|(63&v)<<12|(63&x)<<6|63&b)<=65535||T>=1114112)&&(T=null)),T===null?(T=65533,C=1):T>65535&&(T-=65536,c+=String.fromCharCode(T>>>10&1023|55296),T=56320|1023&T),c+=String.fromCharCode(T),f+=C}return c}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==qt.Bytes)return e.push(this.readVarint(t));var r=xo(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==qt.Bytes)return e.push(this.readSVarint());var t=xo(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==qt.Bytes)return e.push(this.readBoolean());var t=xo(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==qt.Bytes)return e.push(this.readFloat());var t=xo(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==qt.Bytes)return e.push(this.readDouble());var t=xo(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==qt.Bytes)return e.push(this.readFixed32());var t=xo(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==qt.Bytes)return e.push(this.readSFixed32());var t=xo(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==qt.Bytes)return e.push(this.readFixed64());var t=xo(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==qt.Bytes)return e.push(this.readSFixed64());var t=xo(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===qt.Varint)for(;this.buf[this.pos++]>127;);else if(t===qt.Bytes)this.pos=this.readVarint()+this.pos;else if(t===qt.Fixed32)this.pos+=4;else{if(t!==qt.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),Rs(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Rs(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Rs(this.buf,-1&e,this.pos),Rs(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Rs(this.buf,-1&e,this.pos),Rs(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(t,r){var a,u;if(t>=0?(a=t%4294967296|0,u=t/4294967296|0):(u=~(-t/4294967296),4294967295^(a=~(-t%4294967296))?a=a+1|0:(a=0,u=u+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),function(c,f,v){v.buf[v.pos++]=127&c|128,c>>>=7,v.buf[v.pos++]=127&c|128,c>>>=7,v.buf[v.pos++]=127&c|128,c>>>=7,v.buf[v.pos++]=127&c|128,v.buf[v.pos]=127&(c>>>=7)}(a,0,r),function(c,f){var v=(7&c)<<4;f.buf[f.pos++]|=v|((c>>>=3)?128:0),c&&(f.buf[f.pos++]=127&c|((c>>>=7)?128:0),c&&(f.buf[f.pos++]=127&c|((c>>>=7)?128:0),c&&(f.buf[f.pos++]=127&c|((c>>>=7)?128:0),c&&(f.buf[f.pos++]=127&c|((c>>>=7)?128:0),c&&(f.buf[f.pos++]=127&c)))))}(u,r)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(!!e)},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(a,u,c){for(var f,v,x=0;x<u.length;x++){if((f=u.charCodeAt(x))>55295&&f<57344){if(!v){f>56319||x+1===u.length?(a[c++]=239,a[c++]=191,a[c++]=189):v=f;continue}if(f<56320){a[c++]=239,a[c++]=191,a[c++]=189,v=f;continue}f=v-55296<<10|f-56320|65536,v=null}else v&&(a[c++]=239,a[c++]=191,a[c++]=189,v=null);f<128?a[c++]=f:(f<2048?a[c++]=f>>6|192:(f<65536?a[c++]=f>>12|224:(a[c++]=f>>18|240,a[c++]=f>>12&63|128),a[c++]=f>>6&63|128),a[c++]=63&f|128)}return c}(this.buf,e,this.pos);var r=this.pos-t;r>=128&&pm(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),um(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),um(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var a=this.pos-r;a>=128&&pm(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a},writeMessage:function(e,t,r){this.writeTag(e,qt.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,gb,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,_b,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,wb,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,xb,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,bb,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Sb,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,Tb,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Ib,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,Ab,t)},writeBytesField:function(e,t){this.writeTag(e,qt.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,qt.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,qt.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,qt.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,qt.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,qt.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,qt.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,qt.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,qt.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,qt.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,!!t)}};var yc=function(e,t){var r=t.pixelRatio,a=t.version,u=t.stretchX,c=t.stretchY,f=t.content;this.paddedRect=e,this.pixelRatio=r,this.stretchX=u,this.stretchY=c,this.content=f,this.version=a},Ql={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Ql.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Ql.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Ql.tlbr.get=function(){return this.tl.concat(this.br)},Ql.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(yc.prototype,Ql);var eu=function(e,t){var r={},a={};this.haveRenderCallbacks=[];var u=[];this.addImages(e,r,u),this.addImages(t,a,u);var c=fm(u),f=new yi({width:c.w||1,height:c.h||1});for(var v in e){var x=e[v],b=r[v].paddedRect;yi.copy(x.data,f,{x:0,y:0},{x:b.x+1,y:b.y+1},x.data)}for(var S in t){var T=t[S],C=a[S].paddedRect,z=C.x+1,N=C.y+1,$=T.data.width,J=T.data.height;yi.copy(T.data,f,{x:0,y:0},{x:z,y:N},T.data),yi.copy(T.data,f,{x:0,y:J-1},{x:z,y:N-1},{width:$,height:1}),yi.copy(T.data,f,{x:0,y:0},{x:z,y:N+J},{width:$,height:1}),yi.copy(T.data,f,{x:$-1,y:0},{x:z-1,y:N},{width:1,height:J}),yi.copy(T.data,f,{x:0,y:0},{x:z+$,y:N},{width:1,height:J})}this.image=f,this.iconPositions=r,this.patternPositions=a};eu.prototype.addImages=function(e,t,r){for(var a in e){var u=e[a],c={x:0,y:0,w:u.data.width+2,h:u.data.height+2};r.push(c),t[a]=new yc(c,u),u.hasRenderCallback&&this.haveRenderCallbacks.push(a)}},eu.prototype.patchUpdatedImages=function(e,t){for(var r in e.dispatchRenderCallbacks(this.haveRenderCallbacks),e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)},eu.prototype.patchUpdatedImage=function(e,t,r){if(e&&t&&e.version!==t.version){e.version=t.version;var a=e.tl;r.update(t.data,void 0,{x:a[0],y:a[1]})}},Oe("ImagePosition",yc),Oe("ImageAtlas",eu);var Li={horizontal:1,vertical:2,horizontalOnly:3},Fs=function(){this.scale=1,this.fontStack="",this.imageName=null};Fs.forText=function(e,t){var r=new Fs;return r.scale=e||1,r.fontStack=t,r},Fs.forImage=function(e){var t=new Fs;return t.imageName=e,t};var Kr=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function vc(e,t,r,a,u,c,f,v,x,b,S,T,C,z,N,$){var J,H=Kr.fromFeature(e,u);T===Li.vertical&&H.verticalizePunctuation();var te=_i.processBidirectionalText,oe=_i.processStyledBidirectionalText;if(te&&H.sections.length===1){J=[];for(var se=0,ue=te(H.toString(),ih(H,b,c,t,a,z,N));se<ue.length;se+=1){var ye=ue[se],we=new Kr;we.text=ye,we.sections=H.sections;for(var Ie=0;Ie<ye.length;Ie++)we.sectionIndex.push(0);J.push(we)}}else if(oe){J=[];for(var je=0,Me=oe(H.text,H.sectionIndex,ih(H,b,c,t,a,z,N));je<Me.length;je+=1){var Ze=Me[je],Be=new Kr;Be.text=Ze[0],Be.sectionIndex=Ze[1],Be.sections=H.sections,J.push(Be)}}else J=function(Ne,ct){for(var nt=[],xt=Ne.text,We=0,Tt=0,Jt=ct;Tt<Jt.length;Tt+=1){var ir=Jt[Tt];nt.push(Ne.substring(We,ir)),We=ir}return We<xt.length&&nt.push(Ne.substring(We,xt.length)),nt}(H,ih(H,b,c,t,a,z,N));var lt=[],Ye={positionedLines:lt,text:H.toString(),top:S[1],bottom:S[1],left:S[0],right:S[0],writingMode:T,iconsInText:!1,verticalizable:!1};return function(Ne,ct,nt,xt,We,Tt,Jt,ir,tr,Yt,nr,Ir){for(var Ar=0,Jr=-17,Dr=0,Yr=0,ur=ir==="right"?1:ir==="left"?0:.5,Lr=0,ft=0,Nt=We;ft<Nt.length;ft+=1){var Bt=Nt[ft];Bt.trim();var wt=Bt.getMaxScale(),si=24*(wt-1),Nr={positionedGlyphs:[],lineOffset:0};Ne.positionedLines[Lr]=Nr;var Zt=Nr.positionedGlyphs,vr=0;if(Bt.length()){for(var $r=0;$r<Bt.length();$r++){var It=Bt.getSection($r),Un=Bt.getSectionIndex($r),Ri=Bt.getCharCode($r),Nn=0,cr=null,$n=null,on=null,Gs=24,Za=!(tr===Li.horizontal||!nr&&!ws(Ri)||nr&&(gc[Ri]||(To=Ri,Ee.Arabic(To)||Ee["Arabic Supplement"](To)||Ee["Arabic Extended-A"](To)||Ee["Arabic Presentation Forms-A"](To)||Ee["Arabic Presentation Forms-B"](To))));if(It.imageName){var Zs=xt[It.imageName];if(!Zs)continue;on=It.imageName,Ne.iconsInText=Ne.iconsInText||!0,$n=Zs.paddedRect;var So=Zs.displaySize;It.scale=24*It.scale/Ir,Nn=si+(24-So[1]*It.scale),Gs=(cr={width:So[0],height:So[1],left:1,top:-3,advance:Za?So[1]:So[0]}).advance;var Ws=Za?So[0]*It.scale-24*wt:So[1]*It.scale-24*wt;Ws>0&&Ws>vr&&(vr=Ws)}else{var Ec=nt[It.fontStack],Hs=Ec&&Ec[Ri];if(Hs&&Hs.rect)$n=Hs.rect,cr=Hs.metrics;else{var iu=ct[It.fontStack],Pc=iu&&iu[Ri];if(!Pc)continue;cr=Pc.metrics}Nn=24*(wt-It.scale)}Za?(Ne.verticalizable=!0,Zt.push({glyph:Ri,imageName:on,x:Ar,y:Jr+Nn,vertical:Za,scale:It.scale,fontStack:It.fontStack,sectionIndex:Un,metrics:cr,rect:$n}),Ar+=Gs*It.scale+Yt):(Zt.push({glyph:Ri,imageName:on,x:Ar,y:Jr+Nn,vertical:Za,scale:It.scale,fontStack:It.fontStack,sectionIndex:Un,metrics:cr,rect:$n}),Ar+=cr.advance*It.scale+Yt)}Zt.length!==0&&(Dr=Math.max(Ar-Yt,Dr),Mb(Zt,0,Zt.length-1,ur,vr)),Ar=0;var Cc=Tt*wt+vr;Nr.lineOffset=Math.max(vr,si),Jr+=Cc,Yr=Math.max(Cc,Yr),++Lr}else Jr+=Tt,++Lr}var To,nu=Jr- -17,Xs=nh(Jt),ia=Xs.horizontalAlign,Ks=Xs.verticalAlign;(function(kc,Mc,ou,au,zc,su,lu,uu,Bc){var Js,Dc=(Mc-ou)*zc;Js=su!==lu?-uu*au- -17:(-au*Bc+.5)*lu;for(var Ys=0,cu=kc;Ys<cu.length;Ys+=1)for(var Wa=0,pu=cu[Ys].positionedGlyphs;Wa<pu.length;Wa+=1){var Qs=pu[Wa];Qs.x+=Dc,Qs.y+=Js}})(Ne.positionedLines,ur,ia,Ks,Dr,Yr,Tt,nu,We.length),Ne.top+=-Ks*nu,Ne.bottom=Ne.top+nu,Ne.left+=-ia*Dr,Ne.right=Ne.left+Dr}(Ye,t,r,a,J,f,v,x,T,b,C,$),!function(Ne){for(var ct=0,nt=Ne;ct<nt.length;ct+=1)if(nt[ct].positionedGlyphs.length!==0)return!1;return!0}(lt)&&Ye}Kr.fromFeature=function(e,t){for(var r=new Kr,a=0;a<e.sections.length;a++){var u=e.sections[a];u.image?r.addImageSection(u):r.addTextSection(u,t)}return r},Kr.prototype.length=function(){return this.text.length},Kr.prototype.getSection=function(e){return this.sections[this.sectionIndex[e]]},Kr.prototype.getSectionIndex=function(e){return this.sectionIndex[e]},Kr.prototype.getCharCode=function(e){return this.text.charCodeAt(e)},Kr.prototype.verticalizePunctuation=function(){this.text=function(e){for(var t="",r=0;r<e.length;r++){var a=e.charCodeAt(r+1)||null,u=e.charCodeAt(r-1)||null;t+=a&&Fl(a)&&!Yl[e[r+1]]||u&&Fl(u)&&!Yl[e[r-1]]||!Yl[e[r]]?e[r]:Yl[e[r]]}return t}(this.text)},Kr.prototype.trim=function(){for(var e=0,t=0;t<this.text.length&&gc[this.text.charCodeAt(t)];t++)e++;for(var r=this.text.length,a=this.text.length-1;a>=0&&a>=e&&gc[this.text.charCodeAt(a)];a--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)},Kr.prototype.substring=function(e,t){var r=new Kr;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r},Kr.prototype.toString=function(){return this.text},Kr.prototype.getMaxScale=function(){var e=this;return this.sectionIndex.reduce(function(t,r){return Math.max(t,e.sections[r].scale)},0)},Kr.prototype.addTextSection=function(e,t){this.text+=e.text,this.sections.push(Fs.forText(e.scale,e.fontStack||t));for(var r=this.sections.length-1,a=0;a<e.text.length;++a)this.sectionIndex.push(r)},Kr.prototype.addImageSection=function(e){var t=e.image?e.image.name:"";if(t.length!==0){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(Fs.forImage(t)),this.sectionIndex.push(this.sections.length-1)):Ft("Reached maximum number of images 6401")}else Ft("Can't add FormattedSection with an empty image.")},Kr.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var gc={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},bi={};function dm(e,t,r,a,u,c){if(t.imageName){var f=a[t.imageName];return f?f.displaySize[0]*t.scale*24/c+u:0}var v=r[t.fontStack],x=v&&v[e];return x?x.metrics.advance*t.scale+u:0}function mm(e,t,r,a){var u=Math.pow(e-t,2);return a?e<t?u/2:2*u:u+Math.abs(r)*r}function kb(e,t,r){var a=0;return e===10&&(a-=1e4),r&&(a+=150),e!==40&&e!==65288||(a+=50),t!==41&&t!==65289||(a+=50),a}function ym(e,t,r,a,u,c){for(var f=null,v=mm(t,r,u,c),x=0,b=a;x<b.length;x+=1){var S=b[x],T=mm(t-S.x,r,u,c)+S.badness;T<=v&&(f=S,v=T)}return{index:e,x:t,priorBreak:f,badness:v}}function ih(e,t,r,a,u,c,f){if(c!=="point")return[];if(!e)return[];for(var v,x=[],b=function(J,H,te,oe,se,ue){for(var ye=0,we=0;we<J.length();we++){var Ie=J.getSection(we);ye+=dm(J.getCharCode(we),Ie,oe,se,H,ue)}return ye/Math.max(1,Math.ceil(ye/te))}(e,t,r,a,u,f),S=e.text.indexOf("")>=0,T=0,C=0;C<e.length();C++){var z=e.getSection(C),N=e.getCharCode(C);if(gc[N]||(T+=dm(N,z,a,u,t,f)),C<e.length()-1){var $=!((v=N)<11904||!(Ee["Bopomofo Extended"](v)||Ee.Bopomofo(v)||Ee["CJK Compatibility Forms"](v)||Ee["CJK Compatibility Ideographs"](v)||Ee["CJK Compatibility"](v)||Ee["CJK Radicals Supplement"](v)||Ee["CJK Strokes"](v)||Ee["CJK Symbols and Punctuation"](v)||Ee["CJK Unified Ideographs Extension A"](v)||Ee["CJK Unified Ideographs"](v)||Ee["Enclosed CJK Letters and Months"](v)||Ee["Halfwidth and Fullwidth Forms"](v)||Ee.Hiragana(v)||Ee["Ideographic Description Characters"](v)||Ee["Kangxi Radicals"](v)||Ee["Katakana Phonetic Extensions"](v)||Ee.Katakana(v)||Ee["Vertical Forms"](v)||Ee["Yi Radicals"](v)||Ee["Yi Syllables"](v)));(bi[N]||$||z.imageName)&&x.push(ym(C+1,T,b,x,kb(N,e.getCharCode(C+1),$&&S),!1))}}return function J(H){return H?J(H.priorBreak).concat(H.index):[]}(ym(e.length(),T,b,x,0,!0))}function nh(e){var t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function Mb(e,t,r,a,u){if(a||u)for(var c=e[r],f=(e[r].x+c.metrics.advance*c.scale)*a,v=t;v<=r;v++)e[v].x-=f,e[v].y+=u}function vm(e,t,r,a,u,c){var f,v=e.image;if(v.content){var x=v.content,b=v.pixelRatio||1;f=[x[0]/b,x[1]/b,v.displaySize[0]-x[2]/b,v.displaySize[1]-x[3]/b]}var S,T,C,z,N=t.left*c,$=t.right*c;r==="width"||r==="both"?(z=u[0]+N-a[3],T=u[0]+$+a[1]):T=(z=u[0]+(N+$-v.displaySize[0])/2)+v.displaySize[0];var J=t.top*c,H=t.bottom*c;return r==="height"||r==="both"?(S=u[1]+J-a[0],C=u[1]+H+a[2]):C=(S=u[1]+(J+H-v.displaySize[1])/2)+v.displaySize[1],{image:v,top:S,right:T,bottom:C,left:z,collisionPadding:f}}bi[10]=!0,bi[32]=!0,bi[38]=!0,bi[40]=!0,bi[41]=!0,bi[43]=!0,bi[45]=!0,bi[47]=!0,bi[173]=!0,bi[183]=!0,bi[8203]=!0,bi[8208]=!0,bi[8211]=!0,bi[8231]=!0;var Os=function(e){function t(r,a,u,c){e.call(this,r,a),this.angle=u,c!==void 0&&(this.segment=c)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.clone=function(){return new t(this.x,this.y,this.angle,this.segment)},t}(pe);function oh(e,t){var r=t.expression;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new ht(e+1))};if(r.kind==="source")return{kind:"source"};for(var a=r.zoomStops,u=r.interpolationType,c=0;c<a.length&&a[c]<=e;)c++;for(var f=c=Math.max(0,c-1);f<a.length&&a[f]<e+1;)f++;f=Math.min(a.length-1,f);var v=a[c],x=a[f];return r.kind==="composite"?{kind:"composite",minZoom:v,maxZoom:x,interpolationType:u}:{kind:"camera",minZoom:v,maxZoom:x,minSize:r.evaluate(new ht(v)),maxSize:r.evaluate(new ht(x)),interpolationType:u}}function gm(e,t,r){var a=t.uSize,u=r.lowerSize;return e.kind==="source"?u/128:e.kind==="composite"?mr(u/128,r.upperSize/128,t.uSizeT):a}function _m(e,t){var r=0,a=0;if(e.kind==="constant")a=e.layoutSize;else if(e.kind!=="source"){var u=e.interpolationType,c=u?$e(Fr.interpolationFactor(u,t,e.minZoom,e.maxZoom),0,1):0;e.kind==="camera"?a=mr(e.minSize,e.maxSize,c):r=c}return{uSizeT:r,uSize:a}}Oe("Anchor",Os);var zb=Object.freeze({__proto__:null,getSizeData:oh,evaluateSizeForFeature:gm,evaluateSizeForZoom:_m,SIZE_PACK_FACTOR:128});function xm(e,t,r,a,u){if(t.segment===void 0)return!0;for(var c=t,f=t.segment+1,v=0;v>-r/2;){if(--f<0)return!1;v-=e[f].dist(c),c=e[f]}v+=e[f].dist(e[f+1]),f++;for(var x=[],b=0;v<r/2;){var S=e[f],T=e[f+1];if(!T)return!1;var C=e[f-1].angleTo(S)-S.angleTo(T);for(C=Math.abs((C+3*Math.PI)%(2*Math.PI)-Math.PI),x.push({distance:v,angleDelta:C}),b+=C;v-x[0].distance>a;)b-=x.shift().angleDelta;if(b>u)return!1;f++,v+=S.dist(T)}return!0}function bm(e){for(var t=0,r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function wm(e,t,r){return e?.6*t*r:0}function Sm(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function Bb(e,t,r,a,u,c){for(var f=wm(r,u,c),v=Sm(r,a)*c,x=0,b=bm(e)/2,S=0;S<e.length-1;S++){var T=e[S],C=e[S+1],z=T.dist(C);if(x+z>b){var N=(b-x)/z,$=mr(T.x,C.x,N),J=mr(T.y,C.y,N),H=new Os($,J,C.angleTo(T),S);return H._round(),!f||xm(e,H,v,f,t)?H:void 0}x+=z}}function Db(e,t,r,a,u,c,f,v,x){var b=wm(a,c,f),S=Sm(a,u),T=S*f,C=e[0].x===0||e[0].x===x||e[0].y===0||e[0].y===x;return t-T<t/4&&(t=T+t/4),function z(N,$,J,H,te,oe,se,ue,ye){for(var we=oe/2,Ie=bm(N),je=0,Me=$-J,Ze=[],Be=0;Be<N.length-1;Be++){for(var lt=N[Be],Ye=N[Be+1],Ne=lt.dist(Ye),ct=Ye.angleTo(lt);Me+J<je+Ne;){var nt=((Me+=J)-je)/Ne,xt=mr(lt.x,Ye.x,nt),We=mr(lt.y,Ye.y,nt);if(xt>=0&&xt<ye&&We>=0&&We<ye&&Me-we>=0&&Me+we<=Ie){var Tt=new Os(xt,We,ct,Be);Tt._round(),H&&!xm(N,Tt,oe,H,te)||Ze.push(Tt)}}je+=Ne}return ue||Ze.length||se||(Ze=z(N,je/2,J,H,te,oe,se,!0,ye)),Ze}(e,C?t/2*v%t:(S/2+2*c)*f*v%t,t,b,r,T,C,!1,x)}function Tm(e,t,r,a,u){for(var c=[],f=0;f<e.length;f++)for(var v=e[f],x=void 0,b=0;b<v.length-1;b++){var S=v[b],T=v[b+1];S.x<t&&T.x<t||(S.x<t?S=new pe(t,S.y+(t-S.x)/(T.x-S.x)*(T.y-S.y))._round():T.x<t&&(T=new pe(t,S.y+(t-S.x)/(T.x-S.x)*(T.y-S.y))._round()),S.y<r&&T.y<r||(S.y<r?S=new pe(S.x+(r-S.y)/(T.y-S.y)*(T.x-S.x),r)._round():T.y<r&&(T=new pe(S.x+(r-S.y)/(T.y-S.y)*(T.x-S.x),r)._round()),S.x>=a&&T.x>=a||(S.x>=a?S=new pe(a,S.y+(a-S.x)/(T.x-S.x)*(T.y-S.y))._round():T.x>=a&&(T=new pe(a,S.y+(a-S.x)/(T.x-S.x)*(T.y-S.y))._round()),S.y>=u&&T.y>=u||(S.y>=u?S=new pe(S.x+(u-S.y)/(T.y-S.y)*(T.x-S.x),u)._round():T.y>=u&&(T=new pe(S.x+(u-S.y)/(T.y-S.y)*(T.x-S.x),u)._round()),x&&S.equals(x[x.length-1])||c.push(x=[S]),x.push(T)))))}return c}function Im(e,t,r,a){var u=[],c=e.image,f=c.pixelRatio,v=c.paddedRect.w-2,x=c.paddedRect.h-2,b=e.right-e.left,S=e.bottom-e.top,T=c.stretchX||[[0,v]],C=c.stretchY||[[0,x]],z=function(xt,We){return xt+We[1]-We[0]},N=T.reduce(z,0),$=C.reduce(z,0),J=v-N,H=x-$,te=0,oe=N,se=0,ue=$,ye=0,we=J,Ie=0,je=H;if(c.content&&a){var Me=c.content;te=_c(T,0,Me[0]),se=_c(C,0,Me[1]),oe=_c(T,Me[0],Me[2]),ue=_c(C,Me[1],Me[3]),ye=Me[0]-te,Ie=Me[1]-se,we=Me[2]-Me[0]-oe,je=Me[3]-Me[1]-ue}var Ze=function(xt,We,Tt,Jt){var ir=xc(xt.stretch-te,oe,b,e.left),tr=bc(xt.fixed-ye,we,xt.stretch,N),Yt=xc(We.stretch-se,ue,S,e.top),nr=bc(We.fixed-Ie,je,We.stretch,$),Ir=xc(Tt.stretch-te,oe,b,e.left),Ar=bc(Tt.fixed-ye,we,Tt.stretch,N),Jr=xc(Jt.stretch-se,ue,S,e.top),Dr=bc(Jt.fixed-Ie,je,Jt.stretch,$),Yr=new pe(ir,Yt),ur=new pe(Ir,Yt),Lr=new pe(Ir,Jr),ft=new pe(ir,Jr),Nt=new pe(tr/f,nr/f),Bt=new pe(Ar/f,Dr/f),wt=t*Math.PI/180;if(wt){var si=Math.sin(wt),Nr=Math.cos(wt),Zt=[Nr,-si,si,Nr];Yr._matMult(Zt),ur._matMult(Zt),ft._matMult(Zt),Lr._matMult(Zt)}var vr=xt.stretch+xt.fixed,$r=We.stretch+We.fixed;return{tl:Yr,tr:ur,bl:ft,br:Lr,tex:{x:c.paddedRect.x+1+vr,y:c.paddedRect.y+1+$r,w:Tt.stretch+Tt.fixed-vr,h:Jt.stretch+Jt.fixed-$r},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:Nt,pixelOffsetBR:Bt,minFontScaleX:we/f/b,minFontScaleY:je/f/S,isSDF:r}};if(a&&(c.stretchX||c.stretchY))for(var Be=Am(T,J,N),lt=Am(C,H,$),Ye=0;Ye<Be.length-1;Ye++)for(var Ne=Be[Ye],ct=Be[Ye+1],nt=0;nt<lt.length-1;nt++)u.push(Ze(Ne,lt[nt],ct,lt[nt+1]));else u.push(Ze({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:v+1},{fixed:0,stretch:x+1}));return u}function _c(e,t,r){for(var a=0,u=0,c=e;u<c.length;u+=1){var f=c[u];a+=Math.max(t,Math.min(r,f[1]))-Math.max(t,Math.min(r,f[0]))}return a}function Am(e,t,r){for(var a=[{fixed:-1,stretch:0}],u=0,c=e;u<c.length;u+=1){var f=c[u],v=f[0],x=f[1],b=a[a.length-1];a.push({fixed:v-b.stretch,stretch:b.stretch}),a.push({fixed:v-b.stretch,stretch:b.stretch+(x-v)})}return a.push({fixed:t+1,stretch:r}),a}function xc(e,t,r,a){return e/t*r+a}function bc(e,t,r,a){return e-t*r/a}var wc=function(e,t,r,a,u,c,f,v,x,b){if(this.boxStartIndex=e.length,x){var S=c.top,T=c.bottom,C=c.collisionPadding;C&&(S-=C[1],T+=C[3]);var z=T-S;z>0&&(z=Math.max(10,z),this.circleDiameter=z)}else{var N=c.top*f-v,$=c.bottom*f+v,J=c.left*f-v,H=c.right*f+v,te=c.collisionPadding;if(te&&(J-=te[0]*f,N-=te[1]*f,H+=te[2]*f,$+=te[3]*f),b){var oe=new pe(J,N),se=new pe(H,N),ue=new pe(J,$),ye=new pe(H,$),we=b*Math.PI/180;oe._rotate(we),se._rotate(we),ue._rotate(we),ye._rotate(we),J=Math.min(oe.x,se.x,ue.x,ye.x),H=Math.max(oe.x,se.x,ue.x,ye.x),N=Math.min(oe.y,se.y,ue.y,ye.y),$=Math.max(oe.y,se.y,ue.y,ye.y)}e.emplaceBack(t.x,t.y,J,N,H,$,r,a,u)}this.boxEndIndex=e.length},Vs=function(e,t){if(e===void 0&&(e=[]),t===void 0&&(t=Lb),this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function Lb(e,t){return e<t?-1:e>t?1:0}function Rb(e,t,r){r===void 0&&(r=!1);for(var a=1/0,u=1/0,c=-1/0,f=-1/0,v=e[0],x=0;x<v.length;x++){var b=v[x];(!x||b.x<a)&&(a=b.x),(!x||b.y<u)&&(u=b.y),(!x||b.x>c)&&(c=b.x),(!x||b.y>f)&&(f=b.y)}var S=Math.min(c-a,f-u),T=S/2,C=new Vs([],Fb);if(S===0)return new pe(a,u);for(var z=a;z<c;z+=S)for(var N=u;N<f;N+=S)C.push(new Us(z+T,N+T,T,e));for(var $=function(te){for(var oe=0,se=0,ue=0,ye=te[0],we=0,Ie=ye.length,je=Ie-1;we<Ie;je=we++){var Me=ye[we],Ze=ye[je],Be=Me.x*Ze.y-Ze.x*Me.y;se+=(Me.x+Ze.x)*Be,ue+=(Me.y+Ze.y)*Be,oe+=3*Be}return new Us(se/oe,ue/oe,0,te)}(e),J=C.length;C.length;){var H=C.pop();(H.d>$.d||!$.d)&&($=H,r&&console.log("found best %d after %d probes",Math.round(1e4*H.d)/1e4,J)),H.max-$.d<=t||(C.push(new Us(H.p.x-(T=H.h/2),H.p.y-T,T,e)),C.push(new Us(H.p.x+T,H.p.y-T,T,e)),C.push(new Us(H.p.x-T,H.p.y+T,T,e)),C.push(new Us(H.p.x+T,H.p.y+T,T,e)),J+=4)}return r&&(console.log("num probes: "+J),console.log("best distance: "+$.d)),$.p}function Fb(e,t){return t.max-e.max}function Us(e,t,r,a){this.p=new pe(e,t),this.h=r,this.d=function(u,c){for(var f=!1,v=1/0,x=0;x<c.length;x++)for(var b=c[x],S=0,T=b.length,C=T-1;S<T;C=S++){var z=b[S],N=b[C];z.y>u.y!=N.y>u.y&&u.x<(N.x-z.x)*(u.y-z.y)/(N.y-z.y)+z.x&&(f=!f),v=Math.min(v,Qo(u,z,N))}return(f?1:-1)*Math.sqrt(v)}(this.p,a),this.max=this.d+this.h*Math.SQRT2}Vs.prototype.push=function(e){this.data.push(e),this.length++,this._up(this.length-1)},Vs.prototype.pop=function(){if(this.length!==0){var e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}},Vs.prototype.peek=function(){return this.data[0]},Vs.prototype._up=function(e){for(var t=this.data,r=this.compare,a=t[e];e>0;){var u=e-1>>1,c=t[u];if(r(a,c)>=0)break;t[e]=c,e=u}t[e]=a},Vs.prototype._down=function(e){for(var t=this.data,r=this.compare,a=this.length>>1,u=t[e];e<a;){var c=1+(e<<1),f=t[c],v=c+1;if(v<this.length&&r(t[v],f)<0&&(c=v,f=t[v]),r(f,u)>=0)break;t[e]=f,e=c}t[e]=u};var ah=Number.POSITIVE_INFINITY;function Em(e,t){return t[1]!==ah?function(r,a,u){var c=0,f=0;switch(a=Math.abs(a),u=Math.abs(u),r){case"top-right":case"top-left":case"top":f=u-7;break;case"bottom-right":case"bottom-left":case"bottom":f=7-u}switch(r){case"top-right":case"bottom-right":case"right":c=-a;break;case"top-left":case"bottom-left":case"left":c=a}return[c,f]}(e,t[0],t[1]):function(r,a){var u=0,c=0;a<0&&(a=0);var f=a/Math.sqrt(2);switch(r){case"top-right":case"top-left":c=f-7;break;case"bottom-right":case"bottom-left":c=7-f;break;case"bottom":c=7-a;break;case"top":c=a-7}switch(r){case"top-right":case"bottom-right":u=-f;break;case"top-left":case"bottom-left":u=f;break;case"left":u=a;break;case"right":u=-a}return[u,c]}(e,t[0])}function sh(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Pm(e,t,r,a,u,c,f,v,x,b,S,T,C,z,N){var $=function(se,ue,ye,we,Ie,je,Me,Ze){for(var Be=we.layout.get("text-rotate").evaluate(je,{})*Math.PI/180,lt=[],Ye=0,Ne=ue.positionedLines;Ye<Ne.length;Ye+=1)for(var ct=Ne[Ye],nt=0,xt=ct.positionedGlyphs;nt<xt.length;nt+=1){var We=xt[nt];if(We.rect){var Tt=We.rect||{},Jt=4,ir=!0,tr=1,Yt=0,nr=(Ie||Ze)&&We.vertical,Ir=We.metrics.advance*We.scale/2;if(Ze&&ue.verticalizable&&(Yt=ct.lineOffset/2-(We.imageName?-(24-We.metrics.width*We.scale)/2:24*(We.scale-1))),We.imageName){var Ar=Me[We.imageName];ir=Ar.sdf,Jt=1/(tr=Ar.pixelRatio)}var Jr=Ie?[We.x+Ir,We.y]:[0,0],Dr=Ie?[0,0]:[We.x+Ir+ye[0],We.y+ye[1]-Yt],Yr=[0,0];nr&&(Yr=Dr,Dr=[0,0]);var ur=(We.metrics.left-Jt)*We.scale-Ir+Dr[0],Lr=(-We.metrics.top-Jt)*We.scale+Dr[1],ft=ur+Tt.w*We.scale/tr,Nt=Lr+Tt.h*We.scale/tr,Bt=new pe(ur,Lr),wt=new pe(ft,Lr),si=new pe(ur,Nt),Nr=new pe(ft,Nt);if(nr){var Zt=new pe(-Ir,Ir- -17),vr=-Math.PI/2,$r=12-Ir,It=new pe(22-$r,-(We.imageName?$r:0)),Un=new(Function.prototype.bind.apply(pe,[null].concat(Yr)));Bt._rotateAround(vr,Zt)._add(It)._add(Un),wt._rotateAround(vr,Zt)._add(It)._add(Un),si._rotateAround(vr,Zt)._add(It)._add(Un),Nr._rotateAround(vr,Zt)._add(It)._add(Un)}if(Be){var Ri=Math.sin(Be),Nn=Math.cos(Be),cr=[Nn,-Ri,Ri,Nn];Bt._matMult(cr),wt._matMult(cr),si._matMult(cr),Nr._matMult(cr)}var $n=new pe(0,0),on=new pe(0,0);lt.push({tl:Bt,tr:wt,bl:si,br:Nr,tex:Tt,writingMode:ue.writingMode,glyphOffset:Jr,sectionIndex:We.sectionIndex,isSDF:ir,pixelOffsetTL:$n,pixelOffsetBR:on,minFontScaleX:0,minFontScaleY:0})}}return lt}(0,r,v,u,c,f,a,e.allowVerticalPlacement),J=e.textSizeData,H=null;J.kind==="source"?(H=[128*u.layout.get("text-size").evaluate(f,{})])[0]>32640&&Ft(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):J.kind==="composite"&&((H=[128*z.compositeTextSizes[0].evaluate(f,{},N),128*z.compositeTextSizes[1].evaluate(f,{},N)])[0]>32640||H[1]>32640)&&Ft(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),e.addSymbols(e.text,$,H,v,c,f,b,t,x.lineStartIndex,x.lineLength,C,N);for(var te=0,oe=S;te<oe.length;te+=1)T[oe[te]]=e.text.placedSymbolArray.length-1;return 4*$.length}function Cm(e){for(var t in e)return e[t];return null}function Ob(e,t,r,a){var u=e.compareText;if(t in u){for(var c=u[t],f=c.length-1;f>=0;f--)if(a.dist(c[f])<r)return!0}else u[t]=[];return u[t].push(a),!1}var Vb=Ds.VectorTileFeature.types,Ub=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Sc(e,t,r,a,u,c,f,v,x,b,S,T,C){var z=v?Math.min(32640,Math.round(v[0])):0,N=v?Math.min(32640,Math.round(v[1])):0;e.emplaceBack(t,r,Math.round(32*a),Math.round(32*u),c,f,(z<<1)+(x?1:0),N,16*b,16*S,256*T,256*C)}function lh(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function Nb(e){for(var t=0,r=e.sections;t<r.length;t+=1)if(Ss(r[t].text))return!0;return!1}var Ns=function(e){this.layoutVertexArray=new Es,this.indexArray=new Dn,this.programConfigurations=e,this.segments=new L,this.dynamicLayoutVertexArray=new Ko,this.opacityVertexArray=new Ra,this.placedSymbolArray=new s};Ns.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},Ns.prototype.upload=function(e,t,r,a){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,fb.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,db.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,Ub,!0),this.opacityVertexBuffer.itemSize=1),(r||a)&&this.programConfigurations.upload(e))},Ns.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Oe("SymbolBuffers",Ns);var tu=function(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new L,this.collisionVertexArray=new jl};tu.prototype.upload=function(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,mb.members,!0)},tu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Oe("CollisionBuffers",tu);var Lt=function(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(c){return c.id}),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=xi([]),this.placementViewportMatrix=xi([]);var t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=oh(this.zoom,t["text-size"]),this.iconSizeData=oh(this.zoom,t["icon-size"]);var r=this.layers[0].layout,a=r.get("symbol-sort-key"),u=r.get("symbol-z-order");this.canOverlap=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey=u!=="viewport-y"&&a.constantOr(1)!==void 0,this.sortFeaturesByY=(u==="viewport-y"||u==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,r.get("symbol-placement")==="point"&&(this.writingModes=r.get("text-writing-mode").map(function(c){return Li[c]})),this.stateDependentLayerIds=this.layers.filter(function(c){return c.isStateDependent()}).map(function(c){return c.id}),this.sourceID=e.sourceID};Lt.prototype.createArrays=function(){this.text=new Ns(new Je(this.layers,this.zoom,function(e){return/^text/.test(e)})),this.icon=new Ns(new Je(this.layers,this.zoom,function(e){return/^icon/.test(e)})),this.glyphOffsetArray=new y,this.lineVertexArray=new g,this.symbolInstances=new m},Lt.prototype.calculateGlyphDependencies=function(e,t,r,a,u){for(var c=0;c<e.length;c++)if(t[e.charCodeAt(c)]=!0,(r||a)&&u){var f=Yl[e.charAt(c)];f&&(t[f.charCodeAt(0)]=!0)}},Lt.prototype.populate=function(e,t,r){var a=this.layers[0],u=a.layout,c=u.get("text-font"),f=u.get("text-field"),v=u.get("icon-image"),x=(f.value.kind!=="constant"||f.value.value instanceof Cr&&!f.value.value.isEmpty()||f.value.value.toString().length>0)&&(c.value.kind!=="constant"||c.value.value.length>0),b=v.value.kind!=="constant"||!!v.value.value||Object.keys(v.parameters).length>0,S=u.get("symbol-sort-key");if(this.features=[],x||b){for(var T=t.iconDependencies,C=t.glyphDependencies,z=t.availableImages,N=new ht(this.zoom),$=0,J=e;$<J.length;$+=1){var H=J[$],te=H.feature,oe=H.id,se=H.index,ue=H.sourceLayerIndex,ye=a._featureFilter.needGeometry,we=lr(te,ye);if(a._featureFilter.filter(N,we,r)){ye||(we.geometry=er(te));var Ie=void 0;if(x){var je=a.getValueAndResolveTokens("text-field",we,r,z),Me=Cr.factory(je);Nb(Me)&&(this.hasRTLText=!0),(!this.hasRTLText||Vl()==="unavailable"||this.hasRTLText&&_i.isParsed())&&(Ie=vb(Me,a,we))}var Ze=void 0;if(b){var Be=a.getValueAndResolveTokens("icon-image",we,r,z);Ze=Be instanceof ii?Be:ii.fromString(Be)}if(Ie||Ze){var lt=this.sortFeaturesByKey?S.evaluate(we,{},r):void 0;if(this.features.push({id:oe,text:Ie,icon:Ze,index:se,sourceLayerIndex:ue,geometry:we.geometry,properties:te.properties,type:Vb[te.type],sortKey:lt}),Ze&&(T[Ze.name]=!0),Ie){var Ye=c.evaluate(we,{},r).join(","),Ne=u.get("text-rotation-alignment")==="map"&&u.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Li.vertical)>=0;for(var ct=0,nt=Ie.sections;ct<nt.length;ct+=1){var xt=nt[ct];if(xt.image)T[xt.image.name]=!0;else{var We=Rl(Ie.toString()),Tt=xt.fontStack||Ye,Jt=C[Tt]=C[Tt]||{};this.calculateGlyphDependencies(xt.text,Jt,Ne,this.allowVerticalPlacement,We)}}}}}}u.get("symbol-placement")==="line"&&(this.features=function(ir){var tr={},Yt={},nr=[],Ir=0;function Ar(Zt){nr.push(ir[Zt]),Ir++}function Jr(Zt,vr,$r){var It=Yt[Zt];return delete Yt[Zt],Yt[vr]=It,nr[It].geometry[0].pop(),nr[It].geometry[0]=nr[It].geometry[0].concat($r[0]),It}function Dr(Zt,vr,$r){var It=tr[vr];return delete tr[vr],tr[Zt]=It,nr[It].geometry[0].shift(),nr[It].geometry[0]=$r[0].concat(nr[It].geometry[0]),It}function Yr(Zt,vr,$r){var It=$r?vr[0][vr[0].length-1]:vr[0][0];return Zt+":"+It.x+":"+It.y}for(var ur=0;ur<ir.length;ur++){var Lr=ir[ur],ft=Lr.geometry,Nt=Lr.text?Lr.text.toString():null;if(Nt){var Bt=Yr(Nt,ft),wt=Yr(Nt,ft,!0);if(Bt in Yt&&wt in tr&&Yt[Bt]!==tr[wt]){var si=Dr(Bt,wt,ft),Nr=Jr(Bt,wt,nr[si].geometry);delete tr[Bt],delete Yt[wt],Yt[Yr(Nt,nr[Nr].geometry,!0)]=Nr,nr[si].geometry=null}else Bt in Yt?Jr(Bt,wt,ft):wt in tr?Dr(Bt,wt,ft):(Ar(ur),tr[Bt]=Ir-1,Yt[wt]=Ir-1)}else Ar(ur)}return nr.filter(function(Zt){return Zt.geometry})}(this.features)),this.sortFeaturesByKey&&this.features.sort(function(ir,tr){return ir.sortKey-tr.sortKey})}},Lt.prototype.update=function(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,r),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,r))},Lt.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},Lt.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Lt.prototype.upload=function(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},Lt.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},Lt.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},Lt.prototype.addToLineVertexArray=function(e,t){var r=this.lineVertexArray.length;if(e.segment!==void 0){for(var a=e.dist(t[e.segment+1]),u=e.dist(t[e.segment]),c={},f=e.segment+1;f<t.length;f++)c[f]={x:t[f].x,y:t[f].y,tileUnitDistanceFromAnchor:a},f<t.length-1&&(a+=t[f+1].dist(t[f]));for(var v=e.segment||0;v>=0;v--)c[v]={x:t[v].x,y:t[v].y,tileUnitDistanceFromAnchor:u},v>0&&(u+=t[v-1].dist(t[v]));for(var x=0;x<t.length;x++){var b=c[x];this.lineVertexArray.emplaceBack(b.x,b.y,b.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},Lt.prototype.addSymbols=function(e,t,r,a,u,c,f,v,x,b,S,T){for(var C=e.indexArray,z=e.layoutVertexArray,N=e.segments.prepareSegment(4*t.length,z,C,this.canOverlap?c.sortKey:void 0),$=this.glyphOffsetArray.length,J=N.vertexLength,H=this.allowVerticalPlacement&&f===Li.vertical?Math.PI/2:0,te=c.text&&c.text.sections,oe=0;oe<t.length;oe++){var se=t[oe],ue=se.tl,ye=se.tr,we=se.bl,Ie=se.br,je=se.tex,Me=se.pixelOffsetTL,Ze=se.pixelOffsetBR,Be=se.minFontScaleX,lt=se.minFontScaleY,Ye=se.glyphOffset,Ne=se.isSDF,ct=se.sectionIndex,nt=N.vertexLength,xt=Ye[1];Sc(z,v.x,v.y,ue.x,xt+ue.y,je.x,je.y,r,Ne,Me.x,Me.y,Be,lt),Sc(z,v.x,v.y,ye.x,xt+ye.y,je.x+je.w,je.y,r,Ne,Ze.x,Me.y,Be,lt),Sc(z,v.x,v.y,we.x,xt+we.y,je.x,je.y+je.h,r,Ne,Me.x,Ze.y,Be,lt),Sc(z,v.x,v.y,Ie.x,xt+Ie.y,je.x+je.w,je.y+je.h,r,Ne,Ze.x,Ze.y,Be,lt),lh(e.dynamicLayoutVertexArray,v,H),C.emplaceBack(nt,nt+1,nt+2),C.emplaceBack(nt+1,nt+2,nt+3),N.vertexLength+=4,N.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Ye[0]),oe!==t.length-1&&ct===t[oe+1].sectionIndex||e.programConfigurations.populatePaintArrays(z.length,c,c.index,{},T,te&&te[ct])}e.placedSymbolArray.emplaceBack(v.x,v.y,$,this.glyphOffsetArray.length-$,J,x,b,v.segment,r?r[0]:0,r?r[1]:0,a[0],a[1],f,0,!1,0,S)},Lt.prototype._addCollisionDebugVertex=function(e,t,r,a,u,c){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,a,u,Math.round(c.x),Math.round(c.y))},Lt.prototype.addCollisionDebugVertices=function(e,t,r,a,u,c,f){var v=u.segments.prepareSegment(4,u.layoutVertexArray,u.indexArray),x=v.vertexLength,b=u.layoutVertexArray,S=u.collisionVertexArray,T=f.anchorX,C=f.anchorY;this._addCollisionDebugVertex(b,S,c,T,C,new pe(e,t)),this._addCollisionDebugVertex(b,S,c,T,C,new pe(r,t)),this._addCollisionDebugVertex(b,S,c,T,C,new pe(r,a)),this._addCollisionDebugVertex(b,S,c,T,C,new pe(e,a)),v.vertexLength+=4;var z=u.indexArray;z.emplaceBack(x,x+1),z.emplaceBack(x+1,x+2),z.emplaceBack(x+2,x+3),z.emplaceBack(x+3,x),v.primitiveLength+=4},Lt.prototype.addDebugCollisionBoxes=function(e,t,r,a){for(var u=e;u<t;u++){var c=this.collisionBoxArray.get(u);this.addCollisionDebugVertices(c.x1,c.y1,c.x2,c.y2,a?this.textCollisionBox:this.iconCollisionBox,c.anchorPoint,r)}},Lt.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new tu(Jo,sm.members,Fa),this.iconCollisionBox=new tu(Jo,sm.members,Fa);for(var e=0;e<this.symbolInstances.length;e++){var t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}},Lt.prototype._deserializeCollisionBoxesForSymbol=function(e,t,r,a,u,c,f,v,x){for(var b={},S=t;S<r;S++){var T=e.get(S);b.textBox={x1:T.x1,y1:T.y1,x2:T.x2,y2:T.y2,anchorPointX:T.anchorPointX,anchorPointY:T.anchorPointY},b.textFeatureIndex=T.featureIndex;break}for(var C=a;C<u;C++){var z=e.get(C);b.verticalTextBox={x1:z.x1,y1:z.y1,x2:z.x2,y2:z.y2,anchorPointX:z.anchorPointX,anchorPointY:z.anchorPointY},b.verticalTextFeatureIndex=z.featureIndex;break}for(var N=c;N<f;N++){var $=e.get(N);b.iconBox={x1:$.x1,y1:$.y1,x2:$.x2,y2:$.y2,anchorPointX:$.anchorPointX,anchorPointY:$.anchorPointY},b.iconFeatureIndex=$.featureIndex;break}for(var J=v;J<x;J++){var H=e.get(J);b.verticalIconBox={x1:H.x1,y1:H.y1,x2:H.x2,y2:H.y2,anchorPointX:H.anchorPointX,anchorPointY:H.anchorPointY},b.verticalIconFeatureIndex=H.featureIndex;break}return b},Lt.prototype.deserializeCollisionBoxes=function(e){this.collisionArrays=[];for(var t=0;t<this.symbolInstances.length;t++){var r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},Lt.prototype.hasTextData=function(){return this.text.segments.get().length>0},Lt.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Lt.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Lt.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Lt.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Lt.prototype.addIndicesForPlacedSymbol=function(e,t){for(var r=e.placedSymbolArray.get(t),a=r.vertexStartIndex+4*r.numGlyphs,u=r.vertexStartIndex;u<a;u+=4)e.indexArray.emplaceBack(u,u+1,u+2),e.indexArray.emplaceBack(u+1,u+2,u+3)},Lt.prototype.getSortedSymbolIndexes=function(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var t=Math.sin(e),r=Math.cos(e),a=[],u=[],c=[],f=0;f<this.symbolInstances.length;++f){c.push(f);var v=this.symbolInstances.get(f);a.push(0|Math.round(t*v.anchorX+r*v.anchorY)),u.push(v.featureIndex)}return c.sort(function(x,b){return a[x]-a[b]||u[b]-u[x]}),c},Lt.prototype.addToSortKeyRanges=function(e,t){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})},Lt.prototype.sortFeatures=function(e){var t=this;if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,a=this.symbolInstanceIndexes;r<a.length;r+=1){var u=this.symbolInstances.get(a[r]);this.featureSortOrder.push(u.featureIndex),[u.rightJustifiedTextSymbolIndex,u.centerJustifiedTextSymbolIndex,u.leftJustifiedTextSymbolIndex].forEach(function(c,f,v){c>=0&&v.indexOf(c)===f&&t.addIndicesForPlacedSymbol(t.text,c)}),u.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,u.verticalPlacedTextSymbolIndex),u.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,u.placedIconSymbolIndex),u.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,u.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Oe("SymbolBucket",Lt,{omit:["layers","collisionBoxArray","features","compareText"]}),Lt.MAX_GLYPHS=65535,Lt.addDynamicAttributes=lh;var $b=new Vr({"symbol-placement":new qe(D.layout_symbol["symbol-placement"]),"symbol-spacing":new qe(D.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new qe(D.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ue(D.layout_symbol["symbol-sort-key"]),"symbol-z-order":new qe(D.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new qe(D.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new qe(D.layout_symbol["icon-ignore-placement"]),"icon-optional":new qe(D.layout_symbol["icon-optional"]),"icon-rotation-alignment":new qe(D.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ue(D.layout_symbol["icon-size"]),"icon-text-fit":new qe(D.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new qe(D.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ue(D.layout_symbol["icon-image"]),"icon-rotate":new Ue(D.layout_symbol["icon-rotate"]),"icon-padding":new qe(D.layout_symbol["icon-padding"]),"icon-keep-upright":new qe(D.layout_symbol["icon-keep-upright"]),"icon-offset":new Ue(D.layout_symbol["icon-offset"]),"icon-anchor":new Ue(D.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new qe(D.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new qe(D.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new qe(D.layout_symbol["text-rotation-alignment"]),"text-field":new Ue(D.layout_symbol["text-field"]),"text-font":new Ue(D.layout_symbol["text-font"]),"text-size":new Ue(D.layout_symbol["text-size"]),"text-max-width":new Ue(D.layout_symbol["text-max-width"]),"text-line-height":new qe(D.layout_symbol["text-line-height"]),"text-letter-spacing":new Ue(D.layout_symbol["text-letter-spacing"]),"text-justify":new Ue(D.layout_symbol["text-justify"]),"text-radial-offset":new Ue(D.layout_symbol["text-radial-offset"]),"text-variable-anchor":new qe(D.layout_symbol["text-variable-anchor"]),"text-anchor":new Ue(D.layout_symbol["text-anchor"]),"text-max-angle":new qe(D.layout_symbol["text-max-angle"]),"text-writing-mode":new qe(D.layout_symbol["text-writing-mode"]),"text-rotate":new Ue(D.layout_symbol["text-rotate"]),"text-padding":new qe(D.layout_symbol["text-padding"]),"text-keep-upright":new qe(D.layout_symbol["text-keep-upright"]),"text-transform":new Ue(D.layout_symbol["text-transform"]),"text-offset":new Ue(D.layout_symbol["text-offset"]),"text-allow-overlap":new qe(D.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new qe(D.layout_symbol["text-ignore-placement"]),"text-optional":new qe(D.layout_symbol["text-optional"])}),uh={paint:new Vr({"icon-opacity":new Ue(D.paint_symbol["icon-opacity"]),"icon-color":new Ue(D.paint_symbol["icon-color"]),"icon-halo-color":new Ue(D.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ue(D.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ue(D.paint_symbol["icon-halo-blur"]),"icon-translate":new qe(D.paint_symbol["icon-translate"]),"icon-translate-anchor":new qe(D.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ue(D.paint_symbol["text-opacity"]),"text-color":new Ue(D.paint_symbol["text-color"],{runtimeType:Pe,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new Ue(D.paint_symbol["text-halo-color"]),"text-halo-width":new Ue(D.paint_symbol["text-halo-width"]),"text-halo-blur":new Ue(D.paint_symbol["text-halo-blur"]),"text-translate":new qe(D.paint_symbol["text-translate"]),"text-translate-anchor":new qe(D.paint_symbol["text-translate-anchor"])}),layout:$b},$s=function(e){this.type=e.property.overrides?e.property.overrides.runtimeType:Fe,this.defaultValue=e};$s.prototype.evaluate=function(e){if(e.formattedSection){var t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default},$s.prototype.eachChild=function(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)},$s.prototype.outputDefined=function(){return!1},$s.prototype.serialize=function(){return null},Oe("FormatSectionOverride",$s,{omit:["defaultValue"]});var jb=function(e){function t(r){e.call(this,r,uh)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.recalculate=function(r,a){if(e.prototype.recalculate.call(this,r,a),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var u=this.layout.get("text-writing-mode");if(u){for(var c=[],f=0,v=u;f<v.length;f+=1){var x=v[f];c.indexOf(x)<0&&c.push(x)}this.layout._values["text-writing-mode"]=c}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},t.prototype.getValueAndResolveTokens=function(r,a,u,c){var f=this.layout.get(r).evaluate(a,{},u,c),v=this._unevaluatedLayout._values[r];return v.isDataDriven()||Ia(v.value)||!f?f:function(x,b){return b.replace(/{([^{}]+)}/g,function(S,T){return T in x?String(x[T]):""})}(a.properties,f)},t.prototype.createBucket=function(r){return new Lt(r)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype._setPaintOverrides=function(){for(var r=0,a=uh.paint.overridableProperties;r<a.length;r+=1){var u=a[r];if(t.hasPaintOverride(this.layout,u)){var c,f=this.paint.get(u),v=new $s(f),x=new qo(v,f.property.specification);c=f.value.kind==="constant"||f.value.kind==="source"?new Aa("source",x):new Go("composite",x,f.value.zoomStops,f.value._interpolationType),this.paint._values[u]=new Wr(f.property,c,f.parameters)}}},t.prototype._handleOverridablePaintPropertyUpdate=function(r,a,u){return!(!this.layout||a.isDataDriven()||u.isDataDriven())&&t.hasPaintOverride(this.layout,r)},t.hasPaintOverride=function(r,a){var u=r.get("text-field"),c=uh.paint.properties[a],f=!1,v=function(S){for(var T=0,C=S;T<C.length;T+=1)if(c.overrides&&c.overrides.hasOverride(C[T]))return void(f=!0)};if(u.value.kind==="constant"&&u.value.value instanceof Cr)v(u.value.value.sections);else if(u.value.kind==="source"){var x=function(S){f||(S instanceof Gr&&sr(S.value)===Vt?v(S.value.sections):S instanceof $i?v(S.sections):S.eachChild(x))},b=u.value;b._styleExpression&&x(b._styleExpression.expression)}return f},t}(en),qb={paint:new Vr({"background-color":new qe(D.paint_background["background-color"]),"background-pattern":new Hr(D.paint_background["background-pattern"]),"background-opacity":new qe(D.paint_background["background-opacity"])})},Gb=function(e){function t(r){e.call(this,r,qb)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(en),Zb={paint:new Vr({"raster-opacity":new qe(D.paint_raster["raster-opacity"]),"raster-hue-rotate":new qe(D.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new qe(D.paint_raster["raster-brightness-min"]),"raster-brightness-max":new qe(D.paint_raster["raster-brightness-max"]),"raster-saturation":new qe(D.paint_raster["raster-saturation"]),"raster-contrast":new qe(D.paint_raster["raster-contrast"]),"raster-resampling":new qe(D.paint_raster["raster-resampling"]),"raster-fade-duration":new qe(D.paint_raster["raster-fade-duration"])})},Wb=function(e){function t(r){e.call(this,r,Zb)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(en),Hb=function(e){function t(r){e.call(this,r,{}),this.implementation=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.is3D=function(){return this.implementation.renderingMode==="3d"},t.prototype.hasOffscreenPass=function(){return this.implementation.prerender!==void 0},t.prototype.recalculate=function(){},t.prototype.updateTransitions=function(){},t.prototype.hasTransition=function(){},t.prototype.serialize=function(){},t.prototype.onAdd=function(r){this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},t.prototype.onRemove=function(r){this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},t}(en),Xb={circle:Wp,heatmap:zx,hillshade:Dx,fill:Jx,"fill-extrusion":ab,line:hb,symbol:jb,background:Gb,raster:Wb},km=ae.HTMLImageElement,Mm=ae.HTMLCanvasElement,zm=ae.HTMLVideoElement,Bm=ae.ImageData,Tc=ae.ImageBitmap,ja=function(e,t,r,a){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(t,a)};ja.prototype.update=function(e,t,r){var a=e.width,u=e.height,c=!(this.size&&this.size[0]===a&&this.size[1]===u||r),f=this.context,v=f.gl;if(this.useMipmap=!!(t&&t.useMipmap),v.bindTexture(v.TEXTURE_2D,this.texture),f.pixelStoreUnpackFlipY.set(!1),f.pixelStoreUnpack.set(1),f.pixelStoreUnpackPremultiplyAlpha.set(this.format===v.RGBA&&(!t||t.premultiply!==!1)),c)this.size=[a,u],e instanceof km||e instanceof Mm||e instanceof zm||e instanceof Bm||Tc&&e instanceof Tc?v.texImage2D(v.TEXTURE_2D,0,this.format,this.format,v.UNSIGNED_BYTE,e):v.texImage2D(v.TEXTURE_2D,0,this.format,a,u,0,this.format,v.UNSIGNED_BYTE,e.data);else{var x=r||{x:0,y:0},b=x.x,S=x.y;e instanceof km||e instanceof Mm||e instanceof zm||e instanceof Bm||Tc&&e instanceof Tc?v.texSubImage2D(v.TEXTURE_2D,0,b,S,v.RGBA,v.UNSIGNED_BYTE,e):v.texSubImage2D(v.TEXTURE_2D,0,b,S,a,u,v.RGBA,v.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&v.generateMipmap(v.TEXTURE_2D)},ja.prototype.bind=function(e,t,r){var a=this.context.gl;a.bindTexture(a.TEXTURE_2D,this.texture),r!==a.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=a.LINEAR),e!==this.filter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,e),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,r||e),this.filter=e),t!==this.wrap&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,t),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,t),this.wrap=t)},ja.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},ja.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var ch=function(e){var t=this;this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){t._triggered=!1,t._callback()})};ch.prototype.trigger=function(){var e=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(function(){e._triggered=!1,e._callback()},0))},ch.prototype.remove=function(){delete this._channel,this._callback=function(){}};var js=function(e,t,r){this.target=e,this.parent=t,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},fr(["receive","process"],this),this.invoker=new ch(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=li()?e:ae};function Dm(e,t,r){var a=2*Math.PI*6378137/256/Math.pow(2,r);return[e*a-2*Math.PI*6378137/2,t*a-2*Math.PI*6378137/2]}js.prototype.send=function(e,t,r,a,u){var c=this;u===void 0&&(u=!1);var f=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[f]=r);var v=ns(this.globalScope)?void 0:[];return this.target.postMessage({id:f,type:e,hasCallback:!!r,targetMapId:a,mustQueue:u,sourceMapId:this.mapId,data:qi(t,v)},v),{cancel:function(){r&&delete c.callbacks[f],c.target.postMessage({id:f,type:"<cancel>",targetMapId:a,sourceMapId:c.mapId})}}},js.prototype.receive=function(e){var t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if(t.type==="<cancel>"){delete this.tasks[r];var a=this.cancelCallbacks[r];delete this.cancelCallbacks[r],a&&a()}else li()||t.mustQueue?(this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,t)},js.prototype.process=function(){if(this.taskQueue.length){var e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t&&this.processTask(e,t)}},js.prototype.processTask=function(e,t){var r=this;if(t.type==="<response>"){var a=this.callbacks[e];delete this.callbacks[e],a&&(t.error?a(pi(t.error)):a(null,pi(t.data)))}else{var u=!1,c=ns(this.globalScope)?void 0:[],f=t.hasCallback?function(S,T){u=!0,delete r.cancelCallbacks[e],r.target.postMessage({id:e,type:"<response>",sourceMapId:r.mapId,error:S?qi(S):null,data:qi(T,c)},c)}:function(S){u=!0},v=null,x=pi(t.data);if(this.parent[t.type])v=this.parent[t.type](t.sourceMapId,x,f);else if(this.parent.getWorkerSource){var b=t.type.split(".");v=this.parent.getWorkerSource(t.sourceMapId,b[0],x.source)[b[1]](x,f)}else f(new Error("Could not find function "+t.type));!u&&v&&v.cancel&&(this.cancelCallbacks[e]=v.cancel)}},js.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var xr=function(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))};xr.prototype.setNorthEast=function(e){return this._ne=e instanceof Kt?new Kt(e.lng,e.lat):Kt.convert(e),this},xr.prototype.setSouthWest=function(e){return this._sw=e instanceof Kt?new Kt(e.lng,e.lat):Kt.convert(e),this},xr.prototype.extend=function(e){var t,r,a=this._sw,u=this._ne;if(e instanceof Kt)t=e,r=e;else{if(!(e instanceof xr))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(xr.convert(e)):this.extend(Kt.convert(e)):this;if(r=e._ne,!(t=e._sw)||!r)return this}return a||u?(a.lng=Math.min(t.lng,a.lng),a.lat=Math.min(t.lat,a.lat),u.lng=Math.max(r.lng,u.lng),u.lat=Math.max(r.lat,u.lat)):(this._sw=new Kt(t.lng,t.lat),this._ne=new Kt(r.lng,r.lat)),this},xr.prototype.getCenter=function(){return new Kt((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},xr.prototype.getSouthWest=function(){return this._sw},xr.prototype.getNorthEast=function(){return this._ne},xr.prototype.getNorthWest=function(){return new Kt(this.getWest(),this.getNorth())},xr.prototype.getSouthEast=function(){return new Kt(this.getEast(),this.getSouth())},xr.prototype.getWest=function(){return this._sw.lng},xr.prototype.getSouth=function(){return this._sw.lat},xr.prototype.getEast=function(){return this._ne.lng},xr.prototype.getNorth=function(){return this._ne.lat},xr.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},xr.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},xr.prototype.isEmpty=function(){return!(this._sw&&this._ne)},xr.prototype.contains=function(e){var t=Kt.convert(e),r=t.lng,a=t.lat,u=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(u=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&u},xr.convert=function(e){return!e||e instanceof xr?e:new xr(e)};var Kt=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: ("+e+", "+t+")");if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Kt.prototype.wrap=function(){return new Kt(At(this.lng,-180,180),this.lat)},Kt.prototype.toArray=function(){return[this.lng,this.lat]},Kt.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Kt.prototype.distanceTo=function(e){var t=Math.PI/180,r=this.lat*t,a=e.lat*t,u=Math.sin(r)*Math.sin(a)+Math.cos(r)*Math.cos(a)*Math.cos((e.lng-this.lng)*t);return 63710088e-1*Math.acos(Math.min(u,1))},Kt.prototype.toBounds=function(e){e===void 0&&(e=0);var t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new xr(new Kt(this.lng-r,this.lat-t),new Kt(this.lng+r,this.lat+t))},Kt.convert=function(e){if(e instanceof Kt)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Kt(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Kt(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var Lm=2*Math.PI*63710088e-1;function Rm(e){return Lm*Math.cos(e*Math.PI/180)}function Fm(e){return(180+e)/360}function Om(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Vm(e,t){return e/Rm(t)}function ph(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}var qa=function(e,t,r){r===void 0&&(r=0),this.x=+e,this.y=+t,this.z=+r};qa.fromLngLat=function(e,t){t===void 0&&(t=0);var r=Kt.convert(e);return new qa(Fm(r.lng),Om(r.lat),Vm(t,r.lat))},qa.prototype.toLngLat=function(){return new Kt(360*this.x-180,ph(this.y))},qa.prototype.toAltitude=function(){return this.z*Rm(ph(this.y))},qa.prototype.meterInMercatorCoordinateUnits=function(){return 1/Lm*(e=ph(this.y),1/Math.cos(e*Math.PI/180));var e};var Ga=function(e,t,r){this.z=e,this.x=t,this.y=r,this.key=ru(0,e,e,t,r)};Ga.prototype.equals=function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y},Ga.prototype.url=function(e,t){var r,a,u,c,f,v=(a=this.y,u=this.z,c=Dm(256*(r=this.x),256*(a=Math.pow(2,u)-a-1),u),f=Dm(256*(r+1),256*(a+1),u),c[0]+","+c[1]+","+f[0]+","+f[1]),x=function(b,S,T){for(var C,z="",N=b;N>0;N--)z+=(S&(C=1<<N-1)?1:0)+(T&C?2:0);return z}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(t==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",x).replace("{bbox-epsg-3857}",v)},Ga.prototype.getTilePoint=function(e){var t=Math.pow(2,this.z);return new pe(8192*(e.x*t-this.x),8192*(e.y*t-this.y))},Ga.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Um=function(e,t){this.wrap=e,this.canonical=t,this.key=ru(e,t.z,t.z,t.x,t.y)},br=function(e,t,r,a,u){this.overscaledZ=e,this.wrap=t,this.canonical=new Ga(r,+a,+u),this.key=ru(t,e,r,a,u)};function ru(e,t,r,a,u){(e*=2)<0&&(e=-1*e-1);var c=1<<r;return(c*c*e+c*u+a).toString(36)+r.toString(36)+t.toString(36)}br.prototype.equals=function(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)},br.prototype.scaledTo=function(e){var t=this.canonical.z-e;return e>this.canonical.z?new br(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new br(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)},br.prototype.calculateScaledKey=function(e,t){var r=this.canonical.z-e;return e>this.canonical.z?ru(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):ru(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)},br.prototype.isChildOf=function(e){if(e.wrap!==this.wrap)return!1;var t=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t},br.prototype.children=function(e){if(this.overscaledZ>=e)return[new br(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var t=this.canonical.z+1,r=2*this.canonical.x,a=2*this.canonical.y;return[new br(t,this.wrap,t,r,a),new br(t,this.wrap,t,r+1,a),new br(t,this.wrap,t,r,a+1),new br(t,this.wrap,t,r+1,a+1)]},br.prototype.isLessThan=function(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))},br.prototype.wrapped=function(){return new br(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},br.prototype.unwrapTo=function(e){return new br(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)},br.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},br.prototype.toUnwrapped=function(){return new Um(this.wrap,this.canonical)},br.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},br.prototype.getTilePoint=function(e){return this.canonical.getTilePoint(new qa(e.x-this.wrap,e.y))},Oe("CanonicalTileID",Ga),Oe("OverscaledTileID",br,{omit:["posMatrix"]});var bo=function(e,t,r){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&r!=="mapbox"&&r!=="terrarium")return Ft('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=t.height;var a=this.dim=t.height-2;this.data=new Uint32Array(t.data.buffer),this.encoding=r||"mapbox";for(var u=0;u<a;u++)this.data[this._idx(-1,u)]=this.data[this._idx(0,u)],this.data[this._idx(a,u)]=this.data[this._idx(a-1,u)],this.data[this._idx(u,-1)]=this.data[this._idx(u,0)],this.data[this._idx(u,a)]=this.data[this._idx(u,a-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(a,-1)]=this.data[this._idx(a-1,0)],this.data[this._idx(-1,a)]=this.data[this._idx(0,a-1)],this.data[this._idx(a,a)]=this.data[this._idx(a-1,a-1)]};bo.prototype.get=function(e,t){var r=new Uint8Array(this.data.buffer),a=4*this._idx(e,t);return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(r[a],r[a+1],r[a+2])},bo.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},bo.prototype._idx=function(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)},bo.prototype._unpackMapbox=function(e,t,r){return(256*e*256+256*t+r)/10-1e4},bo.prototype._unpackTerrarium=function(e,t,r){return 256*e+t+r/256-32768},bo.prototype.getPixels=function(){return new yi({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},bo.prototype.backfillBorder=function(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");var a=t*this.dim,u=t*this.dim+this.dim,c=r*this.dim,f=r*this.dim+this.dim;switch(t){case-1:a=u-1;break;case 1:u=a+1}switch(r){case-1:c=f-1;break;case 1:f=c+1}for(var v=-t*this.dim,x=-r*this.dim,b=c;b<f;b++)for(var S=a;S<u;S++)this.data[this._idx(S,b)]=e.data[this._idx(S+v,b+x)]},Oe("DEMData",bo);var Ic=function(e){this._stringToNumber={},this._numberToString=[];for(var t=0;t<e.length;t++){var r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}};Ic.prototype.encode=function(e){return this._stringToNumber[e]},Ic.prototype.decode=function(e){return this._numberToString[e]};var Ac=function(e,t,r,a,u){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=r,e._y=a,this.properties=e.properties,this.id=u},hh={geometry:{configurable:!0}};hh.geometry.get=function(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},hh.geometry.set=function(e){this._geometry=e},Ac.prototype.toJSON=function(){var e={geometry:this.geometry};for(var t in this)t!=="_geometry"&&t!=="_vectorTileFeature"&&(e[t]=this[t]);return e},Object.defineProperties(Ac.prototype,hh);var qs=function(){this.state={},this.stateChanges={},this.deletedStates={}};qs.prototype.updateState=function(e,t,r){var a=String(t);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][a]=this.stateChanges[e][a]||{},et(this.stateChanges[e][a],r),this.deletedStates[e]===null)for(var u in this.deletedStates[e]={},this.state[e])u!==a&&(this.deletedStates[e][u]=null);else if(this.deletedStates[e]&&this.deletedStates[e][a]===null)for(var c in this.deletedStates[e][a]={},this.state[e][a])r[c]||(this.deletedStates[e][a][c]=null);else for(var f in r)this.deletedStates[e]&&this.deletedStates[e][a]&&this.deletedStates[e][a][f]===null&&delete this.deletedStates[e][a][f]},qs.prototype.removeFeatureState=function(e,t,r){if(this.deletedStates[e]!==null){var a=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&t!==void 0)this.deletedStates[e][a]!==null&&(this.deletedStates[e][a]=this.deletedStates[e][a]||{},this.deletedStates[e][a][r]=null);else if(t!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][a])for(r in this.deletedStates[e][a]={},this.stateChanges[e][a])this.deletedStates[e][a][r]=null;else this.deletedStates[e][a]=null;else this.deletedStates[e]=null}},qs.prototype.getState=function(e,t){var r=String(t),a=et({},(this.state[e]||{})[r],(this.stateChanges[e]||{})[r]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){var u=this.deletedStates[e][t];if(u===null)return{};for(var c in u)delete a[c]}return a},qs.prototype.initializeTileState=function(e,t){e.setFeatureState(this.state,t)},qs.prototype.coalesceChanges=function(e,t){var r={};for(var a in this.stateChanges){this.state[a]=this.state[a]||{};var u={};for(var c in this.stateChanges[a])this.state[a][c]||(this.state[a][c]={}),et(this.state[a][c],this.stateChanges[a][c]),u[c]=this.state[a][c];r[a]=u}for(var f in this.deletedStates){this.state[f]=this.state[f]||{};var v={};if(this.deletedStates[f]===null)for(var x in this.state[f])v[x]={},this.state[f][x]={};else for(var b in this.deletedStates[f]){if(this.deletedStates[f][b]===null)this.state[f][b]={};else for(var S=0,T=Object.keys(this.deletedStates[f][b]);S<T.length;S+=1)delete this.state[f][b][T[S]];v[b]=this.state[f][b]}r[f]=r[f]||{},et(r[f],v)}if(this.stateChanges={},this.deletedStates={},Object.keys(r).length!==0)for(var C in e)e[C].setFeatureState(r,t)};var wo=function(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new hn(8192,16,0),this.grid3D=new hn(8192,16,0),this.featureIndexArray=new A,this.promoteId=t};function Nm(e,t,r,a,u){return dr(e,function(c,f){var v=t instanceof La?t.get(f):null;return v&&v.evaluate?v.evaluate(r,a,u):v})}function $m(e){for(var t=1/0,r=1/0,a=-1/0,u=-1/0,c=0,f=e;c<f.length;c+=1){var v=f[c];t=Math.min(t,v.x),r=Math.min(r,v.y),a=Math.max(a,v.x),u=Math.max(u,v.y)}return{minX:t,minY:r,maxX:a,maxY:u}}function Kb(e,t){return t-e}wo.prototype.insert=function(e,t,r,a,u,c){var f=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,a,u);for(var v=c?this.grid3D:this.grid,x=0;x<t.length;x++){for(var b=t[x],S=[1/0,1/0,-1/0,-1/0],T=0;T<b.length;T++){var C=b[T];S[0]=Math.min(S[0],C.x),S[1]=Math.min(S[1],C.y),S[2]=Math.max(S[2],C.x),S[3]=Math.max(S[3],C.y)}S[0]<8192&&S[1]<8192&&S[2]>=0&&S[3]>=0&&v.insert(f,S[0],S[1],S[2],S[3])}},wo.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Ds.VectorTile(new dc(this.rawTileData)).layers,this.sourceLayerCoder=new Ic(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},wo.prototype.query=function(e,t,r,a){var u=this;this.loadVTLayers();for(var c=e.params||{},f=8192/e.tileSize/e.scale,v=vs(c.filter),x=e.queryGeometry,b=e.queryPadding*f,S=$m(x),T=this.grid.query(S.minX-b,S.minY-b,S.maxX+b,S.maxY+b),C=$m(e.cameraQueryGeometry),z=this.grid3D.query(C.minX-b,C.minY-b,C.maxX+b,C.maxY+b,function(se,ue,ye,we){return function(Ie,je,Me,Ze,Be){for(var lt=0,Ye=Ie;lt<Ye.length;lt+=1){var Ne=Ye[lt];if(je<=Ne.x&&Me<=Ne.y&&Ze>=Ne.x&&Be>=Ne.y)return!0}var ct=[new pe(je,Me),new pe(je,Be),new pe(Ze,Be),new pe(Ze,Me)];if(Ie.length>2){for(var nt=0,xt=ct;nt<xt.length;nt+=1)if(rn(Ie,xt[nt]))return!0}for(var We=0;We<Ie.length-1;We++)if(Ua(Ie[We],Ie[We+1],ct))return!0;return!1}(e.cameraQueryGeometry,se-b,ue-b,ye+b,we+b)}),N=0,$=z;N<$.length;N+=1)T.push($[N]);T.sort(Kb);for(var J,H={},te=function(se){var ue=T[se];if(ue!==J){J=ue;var ye=u.featureIndexArray.get(ue),we=null;u.loadMatchingFeature(H,ye.bucketIndex,ye.sourceLayerIndex,ye.featureIndex,v,c.layers,c.availableImages,t,r,a,function(Ie,je,Me){return we||(we=er(Ie)),je.queryIntersectsFeature(x,Ie,Me,we,u.z,e.transform,f,e.pixelPosMatrix)})}},oe=0;oe<T.length;oe++)te(oe);return H},wo.prototype.loadMatchingFeature=function(e,t,r,a,u,c,f,v,x,b,S){var T=this.bucketLayerIDs[t];if(!c||function(Ie,je){for(var Me=0;Me<Ie.length;Me++)if(je.indexOf(Ie[Me])>=0)return!0;return!1}(c,T)){var C=this.sourceLayerCoder.decode(r),z=this.vtLayers[C].feature(a);if(u.needGeometry){var N=lr(z,!0);if(!u.filter(new ht(this.tileID.overscaledZ),N,this.tileID.canonical))return}else if(!u.filter(new ht(this.tileID.overscaledZ),z))return;for(var $=this.getId(z,C),J=0;J<T.length;J++){var H=T[J];if(!(c&&c.indexOf(H)<0)){var te=v[H];if(te){var oe={};$!==void 0&&b&&(oe=b.getState(te.sourceLayer||"_geojsonTileLayer",$));var se=et({},x[H]);se.paint=Nm(se.paint,te.paint,z,oe,f),se.layout=Nm(se.layout,te.layout,z,oe,f);var ue=!S||S(z,te,oe);if(ue){var ye=new Ac(z,this.z,this.x,this.y,$);ye.layer=se;var we=e[H];we===void 0&&(we=e[H]=[]),we.push({featureIndex:a,feature:ye,intersectionZ:ue})}}}}}},wo.prototype.lookupSymbolFeatures=function(e,t,r,a,u,c,f,v){var x={};this.loadVTLayers();for(var b=vs(u),S=0,T=e;S<T.length;S+=1)this.loadMatchingFeature(x,r,a,T[S],b,c,f,v,t);return x},wo.prototype.hasLayer=function(e){for(var t=0,r=this.bucketLayerIDs;t<r.length;t+=1)for(var a=0,u=r[t];a<u.length;a+=1)if(e===u[a])return!0;return!1},wo.prototype.getId=function(e,t){var r=e.id;return this.promoteId&&typeof(r=e.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[t]])=="boolean"&&(r=Number(r)),r},Oe("FeatureIndex",wo,{omit:["rawTileData","sourceLayerCoder"]});var Br=function(e,t){this.tileID=e,this.uid=Rt(),this.uses=0,this.tileSize=t,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};Br.prototype.registerFadeDuration=function(e){var t=e+this.timeAdded;t<ln.now()||this.fadeEndTime&&t<this.fadeEndTime||(this.fadeEndTime=t)},Br.prototype.wasRequested=function(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"},Br.prototype.loadVectorData=function(e,t,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){for(var a in e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=function(b,S){var T={};if(!S)return T;for(var C=function(){var $=N[z],J=$.layerIds.map(function(oe){return S.getLayer(oe)}).filter(Boolean);if(J.length!==0){$.layers=J,$.stateDependentLayerIds&&($.stateDependentLayers=$.stateDependentLayerIds.map(function(oe){return J.filter(function(se){return se.id===oe})[0]}));for(var H=0,te=J;H<te.length;H+=1)T[te[H].id]=$}},z=0,N=b;z<N.length;z+=1)C();return T}(e.buckets,t.style),this.hasSymbolBuckets=!1,this.buckets){var u=this.buckets[a];if(u instanceof Lt){if(this.hasSymbolBuckets=!0,!r)break;u.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var c in this.buckets){var f=this.buckets[c];if(f instanceof Lt&&f.hasRTLText){this.hasRTLText=!0,_i.isLoading()||_i.isLoaded()||Vl()!=="deferred"||Gi();break}}for(var v in this.queryPadding=0,this.buckets){var x=this.buckets[v];this.queryPadding=Math.max(this.queryPadding,t.style.getLayer(v).queryRadius(x))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new o},Br.prototype.unloadVectorData=function(){for(var e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},Br.prototype.getBucket=function(e){return this.buckets[e.id]},Br.prototype.upload=function(e){for(var t in this.buckets){var r=this.buckets[t];r.uploadPending()&&r.upload(e)}var a=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new ja(e,this.imageAtlas.image,a.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new ja(e,this.glyphAtlasImage,a.ALPHA),this.glyphAtlasImage=null)},Br.prototype.prepare=function(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)},Br.prototype.queryRenderedFeatures=function(e,t,r,a,u,c,f,v,x,b){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:a,cameraQueryGeometry:u,scale:c,tileSize:this.tileSize,pixelPosMatrix:b,transform:v,params:f,queryPadding:this.queryPadding*x},e,t,r):{}},Br.prototype.querySourceFeatures=function(e,t){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var a=r.loadVTLayers(),u=t?t.sourceLayer:"",c=a._geojsonTileLayer||a[u];if(c)for(var f=vs(t&&t.filter),v=this.tileID.canonical,x=v.z,b=v.x,S=v.y,T={z:x,x:b,y:S},C=0;C<c.length;C++){var z=c.feature(C);if(f.needGeometry){var N=lr(z,!0);if(!f.filter(new ht(this.tileID.overscaledZ),N,this.tileID.canonical))continue}else if(!f.filter(new ht(this.tileID.overscaledZ),z))continue;var $=r.getId(z,u),J=new Ac(z,x,b,S,$);J.tile=T,e.push(J)}}},Br.prototype.hasData=function(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"},Br.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},Br.prototype.setExpiryData=function(e){var t=this.expirationTime;if(e.cacheControl){var r=Do(e.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){var a=Date.now(),u=!1;if(this.expirationTime>a)u=!1;else if(t)if(this.expirationTime<t)u=!0;else{var c=this.expirationTime-t;c?this.expirationTime=a+Math.max(c,3e4):u=!0}else u=!0;u?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},Br.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)},Br.prototype.setFeatureState=function(e,t){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&Object.keys(e).length!==0){var r=this.latestFeatureIndex.loadVTLayers();for(var a in this.buckets)if(t.style.hasLayer(a)){var u=this.buckets[a],c=u.layers[0].sourceLayer||"_geojsonTileLayer",f=r[c],v=e[c];if(f&&v&&Object.keys(v).length!==0){u.update(v,f,this.imageAtlas&&this.imageAtlas.patternPositions||{});var x=t&&t.style&&t.style.getLayer(a);x&&(this.queryPadding=Math.max(this.queryPadding,x.queryRadius(u)))}}}},Br.prototype.holdingForFade=function(){return this.symbolFadeHoldUntil!==void 0},Br.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<ln.now()},Br.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},Br.prototype.setHoldDuration=function(e){this.symbolFadeHoldUntil=ln.now()+e},Br.prototype.setDependencies=function(e,t){for(var r={},a=0,u=t;a<u.length;a+=1)r[u[a]]=!0;this.dependencies[e]=r},Br.prototype.hasDependency=function(e,t){for(var r=0,a=e;r<a.length;r+=1){var u=this.dependencies[a[r]];if(u){for(var c=0,f=t;c<f.length;c+=1)if(u[f[c]])return!0}}return!1};var ra=ae.performance,jm=function(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},ra.mark(this._marks.start)};jm.prototype.finish=function(){ra.mark(this._marks.end);var e=ra.getEntriesByName(this._marks.measure);return e.length===0&&(ra.measure(this._marks.measure,this._marks.start,this._marks.end),e=ra.getEntriesByName(this._marks.measure),ra.clearMarks(this._marks.start),ra.clearMarks(this._marks.end),ra.clearMeasures(this._marks.measure)),e},l.Actor=js,l.AlphaImage=$a,l.CanonicalTileID=Ga,l.CollisionBoxArray=o,l.Color=Pt,l.DEMData=bo,l.DataConstantProperty=qe,l.DictionaryCoder=Ic,l.EXTENT=8192,l.ErrorEvent=Y,l.EvaluationParameters=ht,l.Event=q,l.Evented=ee,l.FeatureIndex=wo,l.FillBucket=yn,l.FillExtrusionBucket=vn,l.ImageAtlas=eu,l.ImagePosition=yc,l.LineBucket=ai,l.LngLat=Kt,l.LngLatBounds=xr,l.MercatorCoordinate=qa,l.ONE_EM=24,l.OverscaledTileID=br,l.Point=pe,l.Point$1=pe,l.Properties=Vr,l.Protobuf=dc,l.RGBAImage=yi,l.RequestManager=ti,l.RequestPerformance=jm,l.ResourceType=ls,l.SegmentVector=L,l.SourceFeatureState=qs,l.StructArrayLayout1ui2=Gl,l.StructArrayLayout2f1f2i16=vo,l.StructArrayLayout2i4=yo,l.StructArrayLayout3ui6=Dn,l.StructArrayLayout4i8=Nl,l.SymbolBucket=Lt,l.Texture=ja,l.Tile=Br,l.Transitionable=Or,l.Uniform1f=Te,l.Uniform1i=ge,l.Uniform2f=Se,l.Uniform3f=Le,l.Uniform4f=Ge,l.UniformColor=Ke,l.UniformMatrix4f=bt,l.UnwrappedTileID=Um,l.ValidationError=W,l.WritingMode=Li,l.ZoomHistory=Ll,l.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e},l.addDynamicAttributes=lh,l.asyncAll=function(e,t,r){if(!e.length)return r(null,[]);var a=e.length,u=new Array(e.length),c=null;e.forEach(function(f,v){t(f,function(x,b){x&&(c=x),u[v]=b,--a==0&&r(c,u)})})},l.bezier=ke,l.bindAll=fr,l.browser=ln,l.cacheEntryPossiblyAdded=function(e){++ma>ss&&(e.getActor().send("enforceCacheSizeLimit",Oo),ma=0)},l.clamp=$e,l.clearTileCache=function(e){var t=ae.caches.delete("mapbox-tiles");e&&t.catch(e).then(function(){return e()})},l.clipLine=Tm,l.clone=function(e){var t=new Ct(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},l.clone$1=wr,l.clone$2=function(e){var t=new Ct(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},l.collisionCircleLayout=yb,l.config=Ot,l.create=function(){var e=new Ct(16);return Ct!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},l.create$1=function(){var e=new Ct(9);return Ct!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e},l.create$2=function(){var e=new Ct(4);return Ct!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},l.createCommonjsModule=re,l.createExpression=ms,l.createLayout=Mr,l.createStyleLayer=function(e){return e.type==="custom"?new Hb(e):new Xb[e.type](e)},l.cross=function(e,t,r){var a=t[0],u=t[1],c=t[2],f=r[0],v=r[1],x=r[2];return e[0]=u*x-c*v,e[1]=c*f-a*x,e[2]=a*v-u*f,e},l.deepEqual=function e(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(var a=0;a<t.length;a++)if(!e(t[a],r[a]))return!1;return!0}if(typeof t=="object"&&t!==null&&r!==null){if(typeof r!="object"||Object.keys(t).length!==Object.keys(r).length)return!1;for(var u in t)if(!e(t[u],r[u]))return!1;return!0}return t===r},l.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},l.dot$1=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},l.ease=Xe,l.emitValidationErrors=za,l.endsWith=Er,l.enforceCacheSizeLimit=function(e){Vo(),Ei&&Ei.then(function(t){t.keys().then(function(r){for(var a=0;a<r.length-e;a++)t.delete(r[a])})})},l.evaluateSizeForFeature=gm,l.evaluateSizeForZoom=_m,l.evaluateVariableOffset=Em,l.evented=Ol,l.extend=et,l.featureFilter=vs,l.filterObject=ei,l.fromRotation=function(e,t){var r=Math.sin(t),a=Math.cos(t);return e[0]=a,e[1]=r,e[2]=0,e[3]=-r,e[4]=a,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},l.getAnchorAlignment=nh,l.getAnchorJustification=sh,l.getArrayBuffer=va,l.getImage=P,l.getJSON=function(e,t){return Uo(et(e,{type:"json"}),t)},l.getRTLTextPluginStatus=Vl,l.getReferrer=Qn,l.getVideo=function(e,t){var r,a,u=ae.document.createElement("video");u.muted=!0,u.onloadstart=function(){t(null,u)};for(var c=0;c<e.length;c++){var f=ae.document.createElement("source");r=e[c],a=void 0,(a=ae.document.createElement("a")).href=r,(a.protocol!==ae.document.location.protocol||a.host!==ae.document.location.host)&&(u.crossOrigin="Anonymous"),f.src=e[c],u.appendChild(f)}return{cancel:function(){}}},l.identity=xi,l.invert=function(e,t){var r=t[0],a=t[1],u=t[2],c=t[3],f=t[4],v=t[5],x=t[6],b=t[7],S=t[8],T=t[9],C=t[10],z=t[11],N=t[12],$=t[13],J=t[14],H=t[15],te=r*v-a*f,oe=r*x-u*f,se=r*b-c*f,ue=a*x-u*v,ye=a*b-c*v,we=u*b-c*x,Ie=S*$-T*N,je=S*J-C*N,Me=S*H-z*N,Ze=T*J-C*$,Be=T*H-z*$,lt=C*H-z*J,Ye=te*lt-oe*Be+se*Ze+ue*Me-ye*je+we*Ie;return Ye?(e[0]=(v*lt-x*Be+b*Ze)*(Ye=1/Ye),e[1]=(u*Be-a*lt-c*Ze)*Ye,e[2]=($*we-J*ye+H*ue)*Ye,e[3]=(C*ye-T*we-z*ue)*Ye,e[4]=(x*Me-f*lt-b*je)*Ye,e[5]=(r*lt-u*Me+c*je)*Ye,e[6]=(J*se-N*we-H*oe)*Ye,e[7]=(S*we-C*se+z*oe)*Ye,e[8]=(f*Be-v*Me+b*Ie)*Ye,e[9]=(a*Me-r*Be-c*Ie)*Ye,e[10]=(N*ye-$*se+H*te)*Ye,e[11]=(T*se-S*ye-z*te)*Ye,e[12]=(v*je-f*Ze-x*Ie)*Ye,e[13]=(r*Ze-a*je+u*Ie)*Ye,e[14]=($*oe-N*ue-J*te)*Ye,e[15]=(S*ue-T*oe+C*te)*Ye,e):null},l.isChar=Ee,l.isMapboxURL=Ti,l.keysDifference=function(e,t){var r=[];for(var a in e)a in t||r.push(a);return r},l.makeRequest=Uo,l.mapObject=dr,l.mercatorXfromLng=Fm,l.mercatorYfromLat=Om,l.mercatorZfromAltitude=Vm,l.mul=Zp,l.multiply=oi,l.mvt=Ds,l.nextPowerOfTwo=function(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},l.normalize=function(e,t){var r=t[0],a=t[1],u=t[2],c=r*r+a*a+u*u;return c>0&&(c=1/Math.sqrt(c)),e[0]=t[0]*c,e[1]=t[1]*c,e[2]=t[2]*c,e},l.number=mr,l.offscreenCanvasSupported=ya,l.ortho=function(e,t,r,a,u,c,f){var v=1/(t-r),x=1/(a-u),b=1/(c-f);return e[0]=-2*v,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*x,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*b,e[11]=0,e[12]=(t+r)*v,e[13]=(u+a)*x,e[14]=(f+c)*b,e[15]=1,e},l.parseGlyphPBF=function(e){return new dc(e).readFields(Eb,[])},l.pbf=dc,l.performSymbolLayout=function(e,t,r,a,u,c,f){e.createArrays(),e.tilePixelRatio=8192/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;var v=e.layers[0].layout,x=e.layers[0]._unevaluatedLayout._values,b={};if(e.textSizeData.kind==="composite"){var S=e.textSizeData,T=S.maxZoom;b.compositeTextSizes=[x["text-size"].possiblyEvaluate(new ht(S.minZoom),f),x["text-size"].possiblyEvaluate(new ht(T),f)]}if(e.iconSizeData.kind==="composite"){var C=e.iconSizeData,z=C.maxZoom;b.compositeIconSizes=[x["icon-size"].possiblyEvaluate(new ht(C.minZoom),f),x["icon-size"].possiblyEvaluate(new ht(z),f)]}b.layoutTextSize=x["text-size"].possiblyEvaluate(new ht(e.zoom+1),f),b.layoutIconSize=x["icon-size"].possiblyEvaluate(new ht(e.zoom+1),f),b.textMaxSize=x["text-size"].possiblyEvaluate(new ht(18));for(var N=24*v.get("text-line-height"),$=v.get("text-rotation-alignment")==="map"&&v.get("symbol-placement")!=="point",J=v.get("text-keep-upright"),H=v.get("text-size"),te=function(){var ue=se[oe],ye=v.get("text-font").evaluate(ue,{},f).join(","),we=H.evaluate(ue,{},f),Ie=b.layoutTextSize.evaluate(ue,{},f),je=b.layoutIconSize.evaluate(ue,{},f),Me={horizontal:{},vertical:void 0},Ze=ue.text,Be=[0,0];if(Ze){var lt=Ze.toString(),Ye=24*v.get("text-letter-spacing").evaluate(ue,{},f),Ne=function(ft){for(var Nt=0,Bt=ft;Nt<Bt.length;Nt+=1)if(wt=Bt[Nt].charCodeAt(0),Ee.Arabic(wt)||Ee["Arabic Supplement"](wt)||Ee["Arabic Extended-A"](wt)||Ee["Arabic Presentation Forms-A"](wt)||Ee["Arabic Presentation Forms-B"](wt))return!1;var wt;return!0}(lt)?Ye:0,ct=v.get("text-anchor").evaluate(ue,{},f),nt=v.get("text-variable-anchor");if(!nt){var xt=v.get("text-radial-offset").evaluate(ue,{},f);Be=xt?Em(ct,[24*xt,ah]):v.get("text-offset").evaluate(ue,{},f).map(function(ft){return 24*ft})}var We=$?"center":v.get("text-justify").evaluate(ue,{},f),Tt=v.get("symbol-placement"),Jt=Tt==="point"?24*v.get("text-max-width").evaluate(ue,{},f):0,ir=function(){e.allowVerticalPlacement&&Rl(lt)&&(Me.vertical=vc(Ze,t,r,u,ye,Jt,N,ct,"left",Ne,Be,Li.vertical,!0,Tt,Ie,we))};if(!$&&nt){for(var tr=We==="auto"?nt.map(function(ft){return sh(ft)}):[We],Yt=!1,nr=0;nr<tr.length;nr++){var Ir=tr[nr];if(!Me.horizontal[Ir])if(Yt)Me.horizontal[Ir]=Me.horizontal[0];else{var Ar=vc(Ze,t,r,u,ye,Jt,N,"center",Ir,Ne,Be,Li.horizontal,!1,Tt,Ie,we);Ar&&(Me.horizontal[Ir]=Ar,Yt=Ar.positionedLines.length===1)}}ir()}else{We==="auto"&&(We=sh(ct));var Jr=vc(Ze,t,r,u,ye,Jt,N,ct,We,Ne,Be,Li.horizontal,!1,Tt,Ie,we);Jr&&(Me.horizontal[We]=Jr),ir(),Rl(lt)&&$&&J&&(Me.vertical=vc(Ze,t,r,u,ye,Jt,N,ct,We,Ne,Be,Li.vertical,!1,Tt,Ie,we))}}var Dr=void 0,Yr=!1;if(ue.icon&&ue.icon.name){var ur=a[ue.icon.name];ur&&(Dr=function(ft,Nt,Bt){var wt=nh(Bt),si=Nt[0]-ft.displaySize[0]*wt.horizontalAlign,Nr=Nt[1]-ft.displaySize[1]*wt.verticalAlign;return{image:ft,top:Nr,bottom:Nr+ft.displaySize[1],left:si,right:si+ft.displaySize[0]}}(u[ue.icon.name],v.get("icon-offset").evaluate(ue,{},f),v.get("icon-anchor").evaluate(ue,{},f)),Yr=ur.sdf,e.sdfIcons===void 0?e.sdfIcons=ur.sdf:e.sdfIcons!==ur.sdf&&Ft("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(ur.pixelRatio!==e.pixelRatio||v.get("icon-rotate").constantOr(1)!==0)&&(e.iconsNeedLinear=!0))}var Lr=Cm(Me.horizontal)||Me.vertical;e.iconsInText=!!Lr&&Lr.iconsInText,(Lr||Dr)&&function(ft,Nt,Bt,wt,si,Nr,Zt,vr,$r,It,Un){var Ri=Nr.textMaxSize.evaluate(Nt,{});Ri===void 0&&(Ri=Zt);var Nn,cr=ft.layers[0].layout,$n=cr.get("icon-offset").evaluate(Nt,{},Un),on=Cm(Bt.horizontal),Gs=Zt/24,Za=ft.tilePixelRatio*Gs,Zs=ft.tilePixelRatio*Ri/24,So=ft.tilePixelRatio*vr,Ws=ft.tilePixelRatio*cr.get("symbol-spacing"),Ec=cr.get("text-padding")*ft.tilePixelRatio,Hs=cr.get("icon-padding")*ft.tilePixelRatio,iu=cr.get("text-max-angle")/180*Math.PI,Pc=cr.get("text-rotation-alignment")==="map"&&cr.get("symbol-placement")!=="point",Cc=cr.get("icon-rotation-alignment")==="map"&&cr.get("symbol-placement")!=="point",To=cr.get("symbol-placement"),nu=Ws/2,Xs=cr.get("icon-text-fit");wt&&Xs!=="none"&&(ft.allowVerticalPlacement&&Bt.vertical&&(Nn=vm(wt,Bt.vertical,Xs,cr.get("icon-text-fit-padding"),$n,Gs)),on&&(wt=vm(wt,on,Xs,cr.get("icon-text-fit-padding"),$n,Gs)));var ia=function(Jb,hu){hu.x<0||hu.x>=8192||hu.y<0||hu.y>=8192||function(pr,gn,Yb,na,yh,Zm,Lc,jn,Rc,fu,Fc,Oc,vh,Wm,du,Hm,Xm,Km,Jm,Ym,Fi,Vc,Qm,qn,Qb){var ey,Ha,el,tl,rl,il=pr.addToLineVertexArray(gn,Yb),ty=0,ry=0,iy=0,ny=0,gh=-1,_h=-1,Io={},oy=U(""),xh=0,bh=0;if(jn._unevaluatedLayout.getValue("text-radial-offset")===void 0?(xh=(ey=jn.layout.get("text-offset").evaluate(Fi,{},qn).map(function(yu){return 24*yu}))[0],bh=ey[1]):(xh=24*jn.layout.get("text-radial-offset").evaluate(Fi,{},qn),bh=ah),pr.allowVerticalPlacement&&na.vertical){var ay=jn.layout.get("text-rotate").evaluate(Fi,{},qn)+90;tl=new wc(Rc,gn,fu,Fc,Oc,na.vertical,vh,Wm,du,ay),Lc&&(rl=new wc(Rc,gn,fu,Fc,Oc,Lc,Xm,Km,du,ay))}if(yh){var wh=jn.layout.get("icon-rotate").evaluate(Fi,{}),sy=jn.layout.get("icon-text-fit")!=="none",ly=Im(yh,wh,Qm,sy),Sh=Lc?Im(Lc,wh,Qm,sy):void 0;el=new wc(Rc,gn,fu,Fc,Oc,yh,Xm,Km,!1,wh),ty=4*ly.length;var uy=pr.iconSizeData,mu=null;uy.kind==="source"?(mu=[128*jn.layout.get("icon-size").evaluate(Fi,{})])[0]>32640&&Ft(pr.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):uy.kind==="composite"&&((mu=[128*Vc.compositeIconSizes[0].evaluate(Fi,{},qn),128*Vc.compositeIconSizes[1].evaluate(Fi,{},qn)])[0]>32640||mu[1]>32640)&&Ft(pr.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),pr.addSymbols(pr.icon,ly,mu,Ym,Jm,Fi,!1,gn,il.lineStartIndex,il.lineLength,-1,qn),gh=pr.icon.placedSymbolArray.length-1,Sh&&(ry=4*Sh.length,pr.addSymbols(pr.icon,Sh,mu,Ym,Jm,Fi,Li.vertical,gn,il.lineStartIndex,il.lineLength,-1,qn),_h=pr.icon.placedSymbolArray.length-1)}for(var cy in na.horizontal){var Uc=na.horizontal[cy];if(!Ha){oy=U(Uc.text);var e0=jn.layout.get("text-rotate").evaluate(Fi,{},qn);Ha=new wc(Rc,gn,fu,Fc,Oc,Uc,vh,Wm,du,e0)}var py=Uc.positionedLines.length===1;if(iy+=Pm(pr,gn,Uc,Zm,jn,du,Fi,Hm,il,na.vertical?Li.horizontal:Li.horizontalOnly,py?Object.keys(na.horizontal):[cy],Io,gh,Vc,qn),py)break}na.vertical&&(ny+=Pm(pr,gn,na.vertical,Zm,jn,du,Fi,Hm,il,Li.vertical,["vertical"],Io,_h,Vc,qn));var t0=Ha?Ha.boxStartIndex:pr.collisionBoxArray.length,r0=Ha?Ha.boxEndIndex:pr.collisionBoxArray.length,i0=tl?tl.boxStartIndex:pr.collisionBoxArray.length,n0=tl?tl.boxEndIndex:pr.collisionBoxArray.length,o0=el?el.boxStartIndex:pr.collisionBoxArray.length,a0=el?el.boxEndIndex:pr.collisionBoxArray.length,s0=rl?rl.boxStartIndex:pr.collisionBoxArray.length,l0=rl?rl.boxEndIndex:pr.collisionBoxArray.length,Gn=-1,Nc=function(yu,fy){return yu&&yu.circleDiameter?Math.max(yu.circleDiameter,fy):fy};Gn=Nc(Ha,Gn),Gn=Nc(tl,Gn),Gn=Nc(el,Gn);var hy=(Gn=Nc(rl,Gn))>-1?1:0;hy&&(Gn*=Qb/24),pr.glyphOffsetArray.length>=Lt.MAX_GLYPHS&&Ft("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Fi.sortKey!==void 0&&pr.addToSortKeyRanges(pr.symbolInstances.length,Fi.sortKey),pr.symbolInstances.emplaceBack(gn.x,gn.y,Io.right>=0?Io.right:-1,Io.center>=0?Io.center:-1,Io.left>=0?Io.left:-1,Io.vertical||-1,gh,_h,oy,t0,r0,i0,n0,o0,a0,s0,l0,fu,iy,ny,ty,ry,hy,0,vh,xh,bh,Gn)}(ft,hu,Jb,Bt,wt,si,Nn,ft.layers[0],ft.collisionBoxArray,Nt.index,Nt.sourceLayerIndex,ft.index,Za,Ec,Pc,$r,So,Hs,Cc,$n,Nt,Nr,It,Un,Zt)};if(To==="line")for(var Ks=0,kc=Tm(Nt.geometry,0,0,8192,8192);Ks<kc.length;Ks+=1)for(var Mc=kc[Ks],ou=0,au=Db(Mc,Ws,iu,Bt.vertical||on,wt,24,Zs,ft.overscaling,8192);ou<au.length;ou+=1){var zc=au[ou];on&&Ob(ft,on.text,nu,zc)||ia(Mc,zc)}else if(To==="line-center")for(var su=0,lu=Nt.geometry;su<lu.length;su+=1){var uu=lu[su];if(uu.length>1){var Bc=Bb(uu,iu,Bt.vertical||on,wt,24,Zs);Bc&&ia(uu,Bc)}}else if(Nt.type==="Polygon")for(var Js=0,Dc=Qp(Nt.geometry,0);Js<Dc.length;Js+=1){var Ys=Dc[Js],cu=Rb(Ys,16);ia(Ys[0],new Os(cu.x,cu.y,0))}else if(Nt.type==="LineString")for(var Wa=0,pu=Nt.geometry;Wa<pu.length;Wa+=1){var Qs=pu[Wa];ia(Qs,new Os(Qs[0].x,Qs[0].y,0))}else if(Nt.type==="Point")for(var fh=0,qm=Nt.geometry;fh<qm.length;fh+=1)for(var dh=0,Gm=qm[fh];dh<Gm.length;dh+=1){var mh=Gm[dh];ia([mh],new Os(mh.x,mh.y,0))}}(e,ue,Me,Dr,a,b,Ie,je,Be,Yr,f)},oe=0,se=e.features;oe<se.length;oe+=1)te();c&&e.generateCollisionDebugBuffers()},l.perspective=function(e,t,r,a,u){var c,f=1/Math.tan(t/2);return e[0]=f/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=f,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,u!=null&&u!==1/0?(e[10]=(u+a)*(c=1/(a-u)),e[14]=2*u*a*c):(e[10]=-1,e[14]=-2*a),e},l.pick=function(e,t){for(var r={},a=0;a<t.length;a++){var u=t[a];u in e&&(r[u]=e[u])}return r},l.plugin=_i,l.polygonIntersectsPolygon=Fn,l.postMapLoadEvent=fa,l.postTurnstileEvent=as,l.potpack=fm,l.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],l.register=Oe,l.registerForPluginStateChange=function(e){return e({pluginStatus:fi,pluginURL:fn}),Ol.on("pluginStateChange",e),e},l.renderColorRamp=Hd,l.rotate=function(e,t,r){var a=t[0],u=t[1],c=t[2],f=t[3],v=Math.sin(r),x=Math.cos(r);return e[0]=a*x+c*v,e[1]=u*x+f*v,e[2]=a*-v+c*x,e[3]=u*-v+f*x,e},l.rotateX=function(e,t,r){var a=Math.sin(r),u=Math.cos(r),c=t[4],f=t[5],v=t[6],x=t[7],b=t[8],S=t[9],T=t[10],C=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=c*u+b*a,e[5]=f*u+S*a,e[6]=v*u+T*a,e[7]=x*u+C*a,e[8]=b*u-c*a,e[9]=S*u-f*a,e[10]=T*u-v*a,e[11]=C*u-x*a,e},l.rotateZ=function(e,t,r){var a=Math.sin(r),u=Math.cos(r),c=t[0],f=t[1],v=t[2],x=t[3],b=t[4],S=t[5],T=t[6],C=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=c*u+b*a,e[1]=f*u+S*a,e[2]=v*u+T*a,e[3]=x*u+C*a,e[4]=b*u-c*a,e[5]=S*u-f*a,e[6]=T*u-v*a,e[7]=C*u-x*a,e},l.scale=function(e,t,r){var a=r[0],u=r[1],c=r[2];return e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e[3]=t[3]*a,e[4]=t[4]*u,e[5]=t[5]*u,e[6]=t[6]*u,e[7]=t[7]*u,e[8]=t[8]*c,e[9]=t[9]*c,e[10]=t[10]*c,e[11]=t[11]*c,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},l.scale$1=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},l.scale$2=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e},l.setCacheLimits=function(e,t){Oo=e,ss=t},l.setRTLTextPlugin=function(e,t,r){if(r===void 0&&(r=!1),fi==="deferred"||fi==="loading"||fi==="loaded")throw new Error("setRTLTextPlugin cannot be called multiple times.");fn=ln.resolveURL(e),fi="deferred",Ts=t,Da(),r||Gi()},l.sphericalToCartesian=function(e){var t=e[0],r=e[1],a=e[2];return r+=90,r*=Math.PI/180,a*=Math.PI/180,{x:t*Math.cos(r)*Math.sin(a),y:t*Math.sin(r)*Math.sin(a),z:t*Math.cos(a)}},l.sqrLen=function(e){var t=e[0],r=e[1];return t*t+r*r},l.styleSpec=D,l.sub=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e},l.symbolSize=zb,l.transformMat3=function(e,t,r){var a=t[0],u=t[1],c=t[2];return e[0]=a*r[0]+u*r[3]+c*r[6],e[1]=a*r[1]+u*r[4]+c*r[7],e[2]=a*r[2]+u*r[5]+c*r[8],e},l.transformMat4=ks,l.translate=function(e,t,r){var a,u,c,f,v,x,b,S,T,C,z,N,$=r[0],J=r[1],H=r[2];return t===e?(e[12]=t[0]*$+t[4]*J+t[8]*H+t[12],e[13]=t[1]*$+t[5]*J+t[9]*H+t[13],e[14]=t[2]*$+t[6]*J+t[10]*H+t[14],e[15]=t[3]*$+t[7]*J+t[11]*H+t[15]):(u=t[1],c=t[2],f=t[3],v=t[4],x=t[5],b=t[6],S=t[7],T=t[8],C=t[9],z=t[10],N=t[11],e[0]=a=t[0],e[1]=u,e[2]=c,e[3]=f,e[4]=v,e[5]=x,e[6]=b,e[7]=S,e[8]=T,e[9]=C,e[10]=z,e[11]=N,e[12]=a*$+v*J+T*H+t[12],e[13]=u*$+x*J+C*H+t[13],e[14]=c*$+b*J+z*H+t[14],e[15]=f*$+S*J+N*H+t[15]),e},l.triggerPluginCompletionEvent=sc,l.uniqueId=Rt,l.validateCustomStyleLayer=function(e){var t=[],r=e.id;return r===void 0&&t.push({message:"layers."+r+': missing required property "id"'}),e.render===void 0&&t.push({message:"layers."+r+': missing required method "render"'}),e.renderingMode&&e.renderingMode!=="2d"&&e.renderingMode!=="3d"&&t.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),t},l.validateLight=qp,l.validateStyle=ka,l.values=function(e){var t=[];for(var r in e)t.push(e[r]);return t},l.vectorTile=Ds,l.version="1.13.3",l.warnOnce=Ft,l.webpSupported=Ji,l.window=ae,l.wrap=At}),V(["./shared"],function(l){function re(I){var P=typeof I;if(P==="number"||P==="boolean"||P==="string"||I==null)return JSON.stringify(I);if(Array.isArray(I)){for(var M="[",O=0,q=I;O<q.length;O+=1)M+=re(q[O])+",";return M+"]"}for(var Y=Object.keys(I).sort(),ee="{",D=0;D<Y.length;D++)ee+=JSON.stringify(Y[D])+":"+re(I[Y[D]])+",";return ee+"}"}function G(I){for(var P="",M=0,O=l.refProperties;M<O.length;M+=1)P+="/"+re(I[O[M]]);return P}var me=function(I){this.keyCache={},I&&this.replace(I)};me.prototype.replace=function(I){this._layerConfigs={},this._layers={},this.update(I,[])},me.prototype.update=function(I,P){for(var M=this,O=0,q=I;O<q.length;O+=1){var Y=q[O];this._layerConfigs[Y.id]=Y;var ee=this._layers[Y.id]=l.createStyleLayer(Y);ee._featureFilter=l.featureFilter(ee.filter),this.keyCache[Y.id]&&delete this.keyCache[Y.id]}for(var D=0,W=P;D<W.length;D+=1){var ne=W[D];delete this.keyCache[ne],delete this._layerConfigs[ne],delete this._layers[ne]}this.familiesBySource={};for(var _e=0,be=function(Ae,Pe){for(var ut={},ze=0;ze<Ae.length;ze++){var vt=Pe&&Pe[Ae[ze].id]||G(Ae[ze]);Pe&&(Pe[Ae[ze].id]=vt);var Vt=ut[vt];Vt||(Vt=ut[vt]=[]),Vt.push(Ae[ze])}var pt=[];for(var Et in ut)pt.push(ut[Et]);return pt}(l.values(this._layerConfigs),this.keyCache);_e<be.length;_e+=1){var fe=be[_e].map(function(Ae){return M._layers[Ae.id]}),xe=fe[0];if(xe.visibility!=="none"){var Ve=xe.source||"",Fe=this.familiesBySource[Ve];Fe||(Fe=this.familiesBySource[Ve]={});var de=xe.sourceLayer||"_geojsonTileLayer",De=Fe[de];De||(De=Fe[de]=[]),De.push(fe)}}};var pe=function(I){var P={},M=[];for(var O in I){var q=I[O],Y=P[O]={};for(var ee in q){var D=q[+ee];if(D&&D.bitmap.width!==0&&D.bitmap.height!==0){var W={x:0,y:0,w:D.bitmap.width+2,h:D.bitmap.height+2};M.push(W),Y[ee]={rect:W,metrics:D.metrics}}}}var ne=l.potpack(M),_e=new l.AlphaImage({width:ne.w||1,height:ne.h||1});for(var be in I){var fe=I[be];for(var xe in fe){var Ve=fe[+xe];if(Ve&&Ve.bitmap.width!==0&&Ve.bitmap.height!==0){var Fe=P[be][xe].rect;l.AlphaImage.copy(Ve.bitmap,_e,{x:0,y:0},{x:Fe.x+1,y:Fe.y+1},Ve.bitmap)}}}this.image=_e,this.positions=P};l.register("GlyphAtlas",pe);var Ce=function(I){this.tileID=new l.OverscaledTileID(I.tileID.overscaledZ,I.tileID.wrap,I.tileID.canonical.z,I.tileID.canonical.x,I.tileID.canonical.y),this.uid=I.uid,this.zoom=I.zoom,this.pixelRatio=I.pixelRatio,this.tileSize=I.tileSize,this.source=I.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=I.showCollisionBoxes,this.collectResourceTiming=!!I.collectResourceTiming,this.returnDependencies=!!I.returnDependencies,this.promoteId=I.promoteId};function ae(I,P,M){for(var O=new l.EvaluationParameters(P),q=0,Y=I;q<Y.length;q+=1)Y[q].recalculate(O,M)}function ve(I,P){var M=l.getArrayBuffer(I.request,function(O,q,Y,ee){O?P(O):q&&P(null,{vectorTile:new l.vectorTile.VectorTile(new l.pbf(q)),rawData:q,cacheControl:Y,expires:ee})});return function(){M.cancel(),P()}}Ce.prototype.parse=function(I,P,M,O,q){var Y=this;this.status="parsing",this.data=I,this.collisionBoxArray=new l.CollisionBoxArray;var ee=new l.DictionaryCoder(Object.keys(I.layers).sort()),D=new l.FeatureIndex(this.tileID,this.promoteId);D.bucketLayerIDs=[];var W,ne,_e,be,fe={},xe={featureIndex:D,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:M},Ve=P.familiesBySource[this.source];for(var Fe in Ve){var de=I.layers[Fe];if(de){de.version===1&&l.warnOnce('Vector tile source "'+this.source+'" layer "'+Fe+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var De=ee.encode(Fe),Ae=[],Pe=0;Pe<de.length;Pe++){var ut=de.feature(Pe),ze=D.getId(ut,Fe);Ae.push({feature:ut,id:ze,index:Pe,sourceLayerIndex:De})}for(var vt=0,Vt=Ve[Fe];vt<Vt.length;vt+=1){var pt=Vt[vt],Et=pt[0];Et.minzoom&&this.zoom<Math.floor(Et.minzoom)||Et.maxzoom&&this.zoom>=Et.maxzoom||Et.visibility!=="none"&&(ae(pt,this.zoom,M),(fe[Et.id]=Et.createBucket({index:D.bucketLayerIDs.length,layers:pt,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:De,sourceID:this.source})).populate(Ae,xe,this.tileID.canonical),D.bucketLayerIDs.push(pt.map(function(Dt){return Dt.id})))}}}var _t=l.mapObject(xe.glyphDependencies,function(Dt){return Object.keys(Dt).map(Number)});Object.keys(_t).length?O.send("getGlyphs",{uid:this.uid,stacks:_t},function(Dt,mt){W||(W=Dt,ne=mt,ar.call(Y))}):ne={};var qr=Object.keys(xe.iconDependencies);qr.length?O.send("getImages",{icons:qr,source:this.source,tileID:this.tileID,type:"icons"},function(Dt,mt){W||(W=Dt,_e=mt,ar.call(Y))}):_e={};var Mt=Object.keys(xe.patternDependencies);function ar(){if(W)return q(W);if(ne&&_e&&be){var Dt=new pe(ne),mt=new l.ImageAtlas(_e,be);for(var Pt in fe){var ri=fe[Pt];ri instanceof l.SymbolBucket?(ae(ri.layers,this.zoom,M),l.performSymbolLayout(ri,ne,Dt.positions,_e,mt.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):ri.hasPattern&&(ri instanceof l.LineBucket||ri instanceof l.FillBucket||ri instanceof l.FillExtrusionBucket)&&(ae(ri.layers,this.zoom,M),ri.addFeatures(xe,this.tileID.canonical,mt.patternPositions))}this.status="done",q(null,{buckets:l.values(fe).filter(function(ga){return!ga.isEmpty()}),featureIndex:D,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Dt.image,imageAtlas:mt,glyphMap:this.returnDependencies?ne:null,iconMap:this.returnDependencies?_e:null,glyphPositions:this.returnDependencies?Dt.positions:null})}}Mt.length?O.send("getImages",{icons:Mt,source:this.source,tileID:this.tileID,type:"patterns"},function(Dt,mt){W||(W=Dt,be=mt,ar.call(Y))}):be={},ar.call(this)};var ke=function(I,P,M,O){this.actor=I,this.layerIndex=P,this.availableImages=M,this.loadVectorData=O||ve,this.loading={},this.loaded={}};ke.prototype.loadTile=function(I,P){var M=this,O=I.uid;this.loading||(this.loading={});var q=!!(I&&I.request&&I.request.collectResourceTiming)&&new l.RequestPerformance(I.request),Y=this.loading[O]=new Ce(I);Y.abort=this.loadVectorData(I,function(ee,D){if(delete M.loading[O],ee||!D)return Y.status="done",M.loaded[O]=Y,P(ee);var W=D.rawData,ne={};D.expires&&(ne.expires=D.expires),D.cacheControl&&(ne.cacheControl=D.cacheControl);var _e={};if(q){var be=q.finish();be&&(_e.resourceTiming=JSON.parse(JSON.stringify(be)))}Y.vectorTile=D.vectorTile,Y.parse(D.vectorTile,M.layerIndex,M.availableImages,M.actor,function(fe,xe){if(fe||!xe)return P(fe);P(null,l.extend({rawTileData:W.slice(0)},xe,ne,_e))}),M.loaded=M.loaded||{},M.loaded[O]=Y})},ke.prototype.reloadTile=function(I,P){var M=this,O=this.loaded,q=I.uid,Y=this;if(O&&O[q]){var ee=O[q];ee.showCollisionBoxes=I.showCollisionBoxes;var D=function(W,ne){var _e=ee.reloadCallback;_e&&(delete ee.reloadCallback,ee.parse(ee.vectorTile,Y.layerIndex,M.availableImages,Y.actor,_e)),P(W,ne)};ee.status==="parsing"?ee.reloadCallback=D:ee.status==="done"&&(ee.vectorTile?ee.parse(ee.vectorTile,this.layerIndex,this.availableImages,this.actor,D):D())}},ke.prototype.abortTile=function(I,P){var M=this.loading,O=I.uid;M&&M[O]&&M[O].abort&&(M[O].abort(),delete M[O]),P()},ke.prototype.removeTile=function(I,P){var M=this.loaded,O=I.uid;M&&M[O]&&delete M[O],P()};var Xe=l.window.ImageBitmap,$e=function(){this.loaded={}};function At(I,P){if(I.length!==0){et(I[0],P);for(var M=1;M<I.length;M++)et(I[M],!P)}}function et(I,P){for(var M=0,O=0,q=0,Y=I.length,ee=Y-1;q<Y;ee=q++){var D=(I[q][0]-I[ee][0])*(I[ee][1]+I[q][1]),W=M+D;O+=Math.abs(M)>=Math.abs(D)?M-W+D:D-W+M,M=W}M+O>=0!=!!P&&I.reverse()}$e.prototype.loadTile=function(I,P){var M=I.uid,O=I.encoding,q=I.rawImageData,Y=Xe&&q instanceof Xe?this.getImageData(q):q,ee=new l.DEMData(M,Y,O);this.loaded=this.loaded||{},this.loaded[M]=ee,P(null,ee)},$e.prototype.getImageData=function(I){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(I.width,I.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=I.width,this.offscreenCanvas.height=I.height,this.offscreenCanvasContext.drawImage(I,0,0,I.width,I.height);var P=this.offscreenCanvasContext.getImageData(-1,-1,I.width+2,I.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new l.RGBAImage({width:P.width,height:P.height},P.data)},$e.prototype.removeTile=function(I){var P=this.loaded,M=I.uid;P&&P[M]&&delete P[M]};var dt=l.vectorTile.VectorTileFeature.prototype.toGeoJSON,Rt=function(I){this._feature=I,this.extent=l.EXTENT,this.type=I.type,this.properties=I.tags,"id"in I&&!isNaN(I.id)&&(this.id=parseInt(I.id,10))};Rt.prototype.loadGeometry=function(){if(this._feature.type===1){for(var I=[],P=0,M=this._feature.geometry;P<M.length;P+=1){var O=M[P];I.push([new l.Point$1(O[0],O[1])])}return I}for(var q=[],Y=0,ee=this._feature.geometry;Y<ee.length;Y+=1){for(var D=[],W=0,ne=ee[Y];W<ne.length;W+=1){var _e=ne[W];D.push(new l.Point$1(_e[0],_e[1]))}q.push(D)}return q},Rt.prototype.toGeoJSON=function(I,P,M){return dt.call(this,I,P,M)};var Gt=function(I){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=l.EXTENT,this.length=I.length,this._features=I};Gt.prototype.feature=function(I){return new Rt(this._features[I])};var Qt=l.vectorTile.VectorTileFeature,fr=Er;function Er(I,P){this.options=P||{},this.features=I,this.length=I.length}function dr(I,P){this.id=typeof I.id=="number"?I.id:void 0,this.type=I.type,this.rawGeometry=I.type===1?[I.geometry]:I.geometry,this.properties=I.tags,this.extent=P||4096}Er.prototype.feature=function(I){return new dr(this.features[I],this.options.extent)},dr.prototype.loadGeometry=function(){var I=this.rawGeometry;this.geometry=[];for(var P=0;P<I.length;P++){for(var M=I[P],O=[],q=0;q<M.length;q++)O.push(new l.Point$1(M[q][0],M[q][1]));this.geometry.push(O)}return this.geometry},dr.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var I=this.geometry,P=1/0,M=-1/0,O=1/0,q=-1/0,Y=0;Y<I.length;Y++)for(var ee=I[Y],D=0;D<ee.length;D++){var W=ee[D];P=Math.min(P,W.x),M=Math.max(M,W.x),O=Math.min(O,W.y),q=Math.max(q,W.y)}return[P,O,M,q]},dr.prototype.toGeoJSON=Qt.prototype.toGeoJSON;var ei=Si,wr=fr;function Si(I){var P=new l.pbf;return function(M,O){for(var q in M.layers)O.writeMessage(3,Ft,M.layers[q])}(I,P),P.finish()}function Ft(I,P){var M;P.writeVarintField(15,I.version||1),P.writeStringField(1,I.name||""),P.writeVarintField(5,I.extent||4096);var O={keys:[],values:[],keycache:{},valuecache:{}};for(M=0;M<I.length;M++)O.feature=I.feature(M),P.writeMessage(2,Pr,O);var q=O.keys;for(M=0;M<q.length;M++)P.writeStringField(3,q[M]);var Y=O.values;for(M=0;M<Y.length;M++)P.writeMessage(4,ns,Y[M])}function Pr(I,P){var M=I.feature;M.id!==void 0&&P.writeVarintField(1,M.id),P.writeMessage(2,Bo,I),P.writeVarintField(3,M.type),P.writeMessage(4,Lo,M)}function Bo(I,P){var M=I.feature,O=I.keys,q=I.values,Y=I.keycache,ee=I.valuecache;for(var D in M.properties){var W=Y[D];W===void 0&&(O.push(D),Y[D]=W=O.length-1),P.writeVarint(W);var ne=M.properties[D],_e=typeof ne;_e!=="string"&&_e!=="boolean"&&_e!=="number"&&(ne=JSON.stringify(ne));var be=_e+":"+ne,fe=ee[be];fe===void 0&&(q.push(ne),ee[be]=fe=q.length-1),P.writeVarint(fe)}}function li(I,P){return(P<<3)+(7&I)}function Do(I){return I<<1^I>>31}function Lo(I,P){for(var M=I.loadGeometry(),O=I.type,q=0,Y=0,ee=M.length,D=0;D<ee;D++){var W=M[D],ne=1;O===1&&(ne=W.length),P.writeVarint(li(1,ne));for(var _e=O===3?W.length-1:W.length,be=0;be<_e;be++){be===1&&O!==1&&P.writeVarint(li(2,_e-1));var fe=W[be].x-q,xe=W[be].y-Y;P.writeVarint(Do(fe)),P.writeVarint(Do(xe)),q+=fe,Y+=xe}O===3&&P.writeVarint(li(7,1))}}function ns(I,P){var M=typeof I;M==="string"?P.writeStringField(1,I):M==="boolean"?P.writeBooleanField(7,I):M==="number"&&(I%1!=0?P.writeDoubleField(3,I):I<0?P.writeSVarintField(6,I):P.writeVarintField(5,I))}function xn(I,P,M,O){Oi(I,M,O),Oi(P,2*M,2*O),Oi(P,2*M+1,2*O+1)}function Oi(I,P,M){var O=I[P];I[P]=I[M],I[M]=O}function Ki(I,P,M,O){var q=I-M,Y=P-O;return q*q+Y*Y}ei.fromVectorTileJs=Si,ei.fromGeojsonVt=function(I,P){P=P||{};var M={};for(var O in I)M[O]=new fr(I[O].features,P),M[O].name=O,M[O].version=P.version,M[O].extent=P.extent;return Si({layers:M})},ei.GeoJSONWrapper=wr;var Hn=function(I){return I[0]},Xn=function(I){return I[1]},bn=function(I,P,M,O,q){P===void 0&&(P=Hn),M===void 0&&(M=Xn),O===void 0&&(O=64),q===void 0&&(q=Float64Array),this.nodeSize=O,this.points=I;for(var Y=I.length<65536?Uint16Array:Uint32Array,ee=this.ids=new Y(I.length),D=this.coords=new q(2*I.length),W=0;W<I.length;W++)ee[W]=W,D[2*W]=P(I[W]),D[2*W+1]=M(I[W]);(function ne(_e,be,fe,xe,Ve,Fe){if(!(Ve-xe<=fe)){var de=xe+Ve>>1;(function De(Ae,Pe,ut,ze,vt,Vt){for(;vt>ze;){if(vt-ze>600){var pt=vt-ze+1,Et=ut-ze+1,_t=Math.log(pt),qr=.5*Math.exp(2*_t/3),Mt=.5*Math.sqrt(_t*qr*(pt-qr)/pt)*(Et-pt/2<0?-1:1);De(Ae,Pe,ut,Math.max(ze,Math.floor(ut-Et*qr/pt+Mt)),Math.min(vt,Math.floor(ut+(pt-Et)*qr/pt+Mt)),Vt)}var ar=Pe[2*ut+Vt],Dt=ze,mt=vt;for(xn(Ae,Pe,ze,ut),Pe[2*vt+Vt]>ar&&xn(Ae,Pe,ze,vt);Dt<mt;){for(xn(Ae,Pe,Dt,mt),Dt++,mt--;Pe[2*Dt+Vt]<ar;)Dt++;for(;Pe[2*mt+Vt]>ar;)mt--}Pe[2*ze+Vt]===ar?xn(Ae,Pe,ze,mt):xn(Ae,Pe,++mt,vt),mt<=ut&&(ze=mt+1),ut<=mt&&(vt=mt-1)}})(_e,be,de,xe,Ve,Fe%2),ne(_e,be,fe,xe,de-1,Fe+1),ne(_e,be,fe,de+1,Ve,Fe+1)}})(ee,D,O,0,ee.length-1,0)};bn.prototype.range=function(I,P,M,O){return function(q,Y,ee,D,W,ne,_e){for(var be,fe,xe=[0,q.length-1,0],Ve=[];xe.length;){var Fe=xe.pop(),de=xe.pop(),De=xe.pop();if(de-De<=_e)for(var Ae=De;Ae<=de;Ae++)fe=Y[2*Ae+1],(be=Y[2*Ae])>=ee&&be<=W&&fe>=D&&fe<=ne&&Ve.push(q[Ae]);else{var Pe=Math.floor((De+de)/2);fe=Y[2*Pe+1],(be=Y[2*Pe])>=ee&&be<=W&&fe>=D&&fe<=ne&&Ve.push(q[Pe]);var ut=(Fe+1)%2;(Fe===0?ee<=be:D<=fe)&&(xe.push(De),xe.push(Pe-1),xe.push(ut)),(Fe===0?W>=be:ne>=fe)&&(xe.push(Pe+1),xe.push(de),xe.push(ut))}}return Ve}(this.ids,this.coords,I,P,M,O,this.nodeSize)},bn.prototype.within=function(I,P,M){return function(O,q,Y,ee,D,W){for(var ne=[0,O.length-1,0],_e=[],be=D*D;ne.length;){var fe=ne.pop(),xe=ne.pop(),Ve=ne.pop();if(xe-Ve<=W)for(var Fe=Ve;Fe<=xe;Fe++)Ki(q[2*Fe],q[2*Fe+1],Y,ee)<=be&&_e.push(O[Fe]);else{var de=Math.floor((Ve+xe)/2),De=q[2*de],Ae=q[2*de+1];Ki(De,Ae,Y,ee)<=be&&_e.push(O[de]);var Pe=(fe+1)%2;(fe===0?Y-D<=De:ee-D<=Ae)&&(ne.push(Ve),ne.push(de-1),ne.push(Pe)),(fe===0?Y+D>=De:ee+D>=Ae)&&(ne.push(de+1),ne.push(xe),ne.push(Pe))}}return _e}(this.ids,this.coords,I,P,M,this.nodeSize)};var _l={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(I){return I}},jr=function(I){this.options=wn(Object.create(_l),I),this.trees=new Array(this.options.maxZoom+1)};function ln(I,P,M,O,q){return{x:I,y:P,zoom:1/0,id:M,parentId:-1,numPoints:O,properties:q}}function Ot(I,P){var M=I.geometry.coordinates,O=M[1];return{x:Vi(M[0]),y:yt(O),zoom:1/0,index:P,parentId:-1}}function Ji(I){return{type:"Feature",id:I.id,properties:Ro(I),geometry:{type:"Point",coordinates:[(O=I.x,360*(O-.5)),(P=I.y,M=(180-360*P)*Math.PI/180,360*Math.atan(Math.exp(M))/Math.PI-90)]}};var P,M,O}function Ro(I){var P=I.numPoints,M=P>=1e4?Math.round(P/1e3)+"k":P>=1e3?Math.round(P/100)/10+"k":P;return wn(wn({},I.properties),{cluster:!0,cluster_id:I.id,point_count:P,point_count_abbreviated:M})}function Vi(I){return I/360+.5}function yt(I){var P=Math.sin(I*Math.PI/180),M=.5-.25*Math.log((1+P)/(1-P))/Math.PI;return M<0?0:M>1?1:M}function wn(I,P){for(var M in P)I[M]=P[M];return I}function ti(I){return I.x}function Ti(I){return I.y}function xl(I,P,M,O,q,Y){var ee=q-M,D=Y-O;if(ee!==0||D!==0){var W=((I-M)*ee+(P-O)*D)/(ee*ee+D*D);W>1?(M=q,O=Y):W>0&&(M+=ee*W,O+=D*W)}return(ee=I-M)*ee+(D=P-O)*D}function Ui(I,P,M,O){var q={id:I===void 0?null:I,type:P,geometry:M,tags:O,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(Y){var ee=Y.geometry,D=Y.type;if(D==="Point"||D==="MultiPoint"||D==="LineString")pa(Y,ee);else if(D==="Polygon"||D==="MultiLineString")for(var W=0;W<ee.length;W++)pa(Y,ee[W]);else if(D==="MultiPolygon")for(W=0;W<ee.length;W++)for(var ne=0;ne<ee[W].length;ne++)pa(Y,ee[W][ne])}(q),q}function pa(I,P){for(var M=0;M<P.length;M+=3)I.minX=Math.min(I.minX,P[M]),I.minY=Math.min(I.minY,P[M+1]),I.maxX=Math.max(I.maxX,P[M]),I.maxY=Math.max(I.maxY,P[M+1])}function Ii(I,P,M,O){if(P.geometry){var q=P.geometry.coordinates,Y=P.geometry.type,ee=Math.pow(M.tolerance/((1<<M.maxZoom)*M.extent),2),D=[],W=P.id;if(M.promoteId?W=P.properties[M.promoteId]:M.generateId&&(W=O||0),Y==="Point")Kn(q,D);else if(Y==="MultiPoint")for(var ne=0;ne<q.length;ne++)Kn(q[ne],D);else if(Y==="LineString")Fo(q,D,ee,!1);else if(Y==="MultiLineString"){if(M.lineMetrics){for(ne=0;ne<q.length;ne++)Fo(q[ne],D=[],ee,!1),I.push(Ui(W,"LineString",D,P.properties));return}Ai(q,D,ee,!1)}else if(Y==="Polygon")Ai(q,D,ee,!0);else{if(Y!=="MultiPolygon"){if(Y==="GeometryCollection"){for(ne=0;ne<P.geometry.geometries.length;ne++)Ii(I,{id:W,geometry:P.geometry.geometries[ne],properties:P.properties},M,O);return}throw new Error("Input data is not a valid GeoJSON object.")}for(ne=0;ne<q.length;ne++){var _e=[];Ai(q[ne],_e,ee,!0),D.push(_e)}}I.push(Ui(W,Y,D,P.properties))}}function Kn(I,P){P.push(Ei(I[0])),P.push(Jn(I[1])),P.push(0)}function Fo(I,P,M,O){for(var q,Y,ee=0,D=0;D<I.length;D++){var W=Ei(I[D][0]),ne=Jn(I[D][1]);P.push(W),P.push(ne),P.push(0),D>0&&(ee+=O?(q*ne-W*Y)/2:Math.sqrt(Math.pow(W-q,2)+Math.pow(ne-Y,2))),q=W,Y=ne}var _e=P.length-3;P[2]=1,function be(fe,xe,Ve,Fe){for(var de,De=Fe,Ae=Ve-xe>>1,Pe=Ve-xe,ut=fe[xe],ze=fe[xe+1],vt=fe[Ve],Vt=fe[Ve+1],pt=xe+3;pt<Ve;pt+=3){var Et=xl(fe[pt],fe[pt+1],ut,ze,vt,Vt);if(Et>De)de=pt,De=Et;else if(Et===De){var _t=Math.abs(pt-Ae);_t<Pe&&(de=pt,Pe=_t)}}De>Fe&&(de-xe>3&&be(fe,xe,de,Fe),fe[de+2]=De,Ve-de>3&&be(fe,de,Ve,Fe))}(P,0,_e,M),P[_e+2]=1,P.size=Math.abs(ee),P.start=0,P.end=P.size}function Ai(I,P,M,O){for(var q=0;q<I.length;q++){var Y=[];Fo(I[q],Y,M,O),P.push(Y)}}function Ei(I){return I/360+.5}function Jn(I){var P=Math.sin(I*Math.PI/180),M=.5-.25*Math.log((1+P)/(1-P))/Math.PI;return M<0?0:M>1?1:M}function Ni(I,P,M,O,q,Y,ee,D){if(O/=P,Y>=(M/=P)&&ee<O)return I;if(ee<M||Y>=O)return null;for(var W=[],ne=0;ne<I.length;ne++){var _e=I[ne],be=_e.geometry,fe=_e.type,xe=q===0?_e.minX:_e.minY,Ve=q===0?_e.maxX:_e.maxY;if(xe>=M&&Ve<O)W.push(_e);else if(!(Ve<M||xe>=O)){var Fe=[];if(fe==="Point"||fe==="MultiPoint")os(be,Fe,M,O,q);else if(fe==="LineString")as(be,Fe,M,O,q,!1,D.lineMetrics);else if(fe==="MultiLineString")fa(be,Fe,M,O,q,!1);else if(fe==="Polygon")fa(be,Fe,M,O,q,!0);else if(fe==="MultiPolygon")for(var de=0;de<be.length;de++){var De=[];fa(be[de],De,M,O,q,!0),De.length&&Fe.push(De)}if(Fe.length){if(D.lineMetrics&&fe==="LineString"){for(de=0;de<Fe.length;de++)W.push(Ui(_e.id,fe,Fe[de],_e.tags));continue}fe!=="LineString"&&fe!=="MultiLineString"||(Fe.length===1?(fe="LineString",Fe=Fe[0]):fe="MultiLineString"),fe!=="Point"&&fe!=="MultiPoint"||(fe=Fe.length===3?"Point":"MultiPoint"),W.push(Ui(_e.id,fe,Fe,_e.tags))}}}return W.length?W:null}function os(I,P,M,O,q){for(var Y=0;Y<I.length;Y+=3){var ee=I[Y+q];ee>=M&&ee<=O&&(P.push(I[Y]),P.push(I[Y+1]),P.push(I[Y+2]))}}function as(I,P,M,O,q,Y,ee){for(var D,W,ne=ha(I),_e=q===0?ss:Vo,be=I.start,fe=0;fe<I.length-3;fe+=3){var xe=I[fe],Ve=I[fe+1],Fe=I[fe+2],de=I[fe+3],De=I[fe+4],Ae=q===0?xe:Ve,Pe=q===0?de:De,ut=!1;ee&&(D=Math.sqrt(Math.pow(xe-de,2)+Math.pow(Ve-De,2))),Ae<M?Pe>M&&(W=_e(ne,xe,Ve,de,De,M),ee&&(ne.start=be+D*W)):Ae>O?Pe<O&&(W=_e(ne,xe,Ve,de,De,O),ee&&(ne.start=be+D*W)):Oo(ne,xe,Ve,Fe),Pe<M&&Ae>=M&&(W=_e(ne,xe,Ve,de,De,M),ut=!0),Pe>O&&Ae<=O&&(W=_e(ne,xe,Ve,de,De,O),ut=!0),!Y&&ut&&(ee&&(ne.end=be+D*W),P.push(ne),ne=ha(I)),ee&&(be+=D)}var ze=I.length-3;xe=I[ze],Ve=I[ze+1],Fe=I[ze+2],(Ae=q===0?xe:Ve)>=M&&Ae<=O&&Oo(ne,xe,Ve,Fe),ze=ne.length-3,Y&&ze>=3&&(ne[ze]!==ne[0]||ne[ze+1]!==ne[1])&&Oo(ne,ne[0],ne[1],ne[2]),ne.length&&P.push(ne)}function ha(I){var P=[];return P.size=I.size,P.start=I.start,P.end=I.end,P}function fa(I,P,M,O,q,Y){for(var ee=0;ee<I.length;ee++)as(I[ee],P,M,O,q,Y,!1)}function Oo(I,P,M,O){I.push(P),I.push(M),I.push(O)}function ss(I,P,M,O,q,Y){var ee=(Y-P)/(O-P);return I.push(Y),I.push(M+(q-M)*ee),I.push(1),ee}function Vo(I,P,M,O,q,Y){var ee=(Y-M)/(q-M);return I.push(P+(O-P)*ee),I.push(Y),I.push(1),ee}function da(I,P){for(var M=[],O=0;O<I.length;O++){var q,Y=I[O],ee=Y.type;if(ee==="Point"||ee==="MultiPoint"||ee==="LineString")q=Yn(Y.geometry,P);else if(ee==="MultiLineString"||ee==="Polygon"){q=[];for(var D=0;D<Y.geometry.length;D++)q.push(Yn(Y.geometry[D],P))}else if(ee==="MultiPolygon")for(q=[],D=0;D<Y.geometry.length;D++){for(var W=[],ne=0;ne<Y.geometry[D].length;ne++)W.push(Yn(Y.geometry[D][ne],P));q.push(W)}M.push(Ui(Y.id,ee,q,Y.tags))}return M}function Yn(I,P){var M=[];M.size=I.size,I.start!==void 0&&(M.start=I.start,M.end=I.end);for(var O=0;O<I.length;O+=3)M.push(I[O]+P,I[O+1],I[O+2]);return M}function ma(I,P){if(I.transformed)return I;var M,O,q,Y=1<<I.z,ee=I.x,D=I.y;for(M=0;M<I.features.length;M++){var W=I.features[M],ne=W.geometry,_e=W.type;if(W.geometry=[],_e===1)for(O=0;O<ne.length;O+=2)W.geometry.push(ya(ne[O],ne[O+1],P,Y,ee,D));else for(O=0;O<ne.length;O++){var be=[];for(q=0;q<ne[O].length;q+=2)be.push(ya(ne[O][q],ne[O][q+1],P,Y,ee,D));W.geometry.push(be)}}return I.transformed=!0,I}function ya(I,P,M,O,q,Y){return[Math.round(M*(I*O-q)),Math.round(M*(P*O-Y))]}function ls(I,P,M,O,q){for(var Y=P===q.maxZoom?0:q.tolerance/((1<<P)*q.extent),ee={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:M,y:O,z:P,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},D=0;D<I.length;D++){ee.numFeatures++,us(ee,I[D],Y,q);var W=I[D].minX,ne=I[D].minY,_e=I[D].maxX,be=I[D].maxY;W<ee.minX&&(ee.minX=W),ne<ee.minY&&(ee.minY=ne),_e>ee.maxX&&(ee.maxX=_e),be>ee.maxY&&(ee.maxY=be)}return ee}function us(I,P,M,O){var q=P.geometry,Y=P.type,ee=[];if(Y==="Point"||Y==="MultiPoint")for(var D=0;D<q.length;D+=3)ee.push(q[D]),ee.push(q[D+1]),I.numPoints++,I.numSimplified++;else if(Y==="LineString")Qn(ee,q,I,M,!1,!1);else if(Y==="MultiLineString"||Y==="Polygon")for(D=0;D<q.length;D++)Qn(ee,q[D],I,M,Y==="Polygon",D===0);else if(Y==="MultiPolygon")for(var W=0;W<q.length;W++){var ne=q[W];for(D=0;D<ne.length;D++)Qn(ee,ne[D],I,M,!0,D===0)}if(ee.length){var _e=P.tags||null;if(Y==="LineString"&&O.lineMetrics){for(var be in _e={},P.tags)_e[be]=P.tags[be];_e.mapbox_clip_start=q.start/q.size,_e.mapbox_clip_end=q.end/q.size}var fe={geometry:ee,type:Y==="Polygon"||Y==="MultiPolygon"?3:Y==="LineString"||Y==="MultiLineString"?2:1,tags:_e};P.id!==null&&(fe.id=P.id),I.features.push(fe)}}function Qn(I,P,M,O,q,Y){var ee=O*O;if(O>0&&P.size<(q?ee:O))M.numPoints+=P.length/3;else{for(var D=[],W=0;W<P.length;W+=3)(O===0||P[W+2]>ee)&&(M.numSimplified++,D.push(P[W]),D.push(P[W+1])),M.numPoints++;q&&function(ne,_e){for(var be=0,fe=0,xe=ne.length,Ve=xe-2;fe<xe;Ve=fe,fe+=2)be+=(ne[fe]-ne[Ve])*(ne[fe+1]+ne[Ve+1]);if(be>0===_e)for(fe=0,xe=ne.length;fe<xe/2;fe+=2){var Fe=ne[fe],de=ne[fe+1];ne[fe]=ne[xe-2-fe],ne[fe+1]=ne[xe-1-fe],ne[xe-2-fe]=Fe,ne[xe-1-fe]=de}}(D,Y),I.push(D)}}function un(I,P){var M=(P=this.options=function(q,Y){for(var ee in Y)q[ee]=Y[ee];return q}(Object.create(this.options),P)).debug;if(M&&console.time("preprocess data"),P.maxZoom<0||P.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(P.promoteId&&P.generateId)throw new Error("promoteId and generateId cannot be used together.");var O=function(q,Y){var ee=[];if(q.type==="FeatureCollection")for(var D=0;D<q.features.length;D++)Ii(ee,q.features[D],Y,D);else Ii(ee,q.type==="Feature"?q:{geometry:q},Y);return ee}(I,P);this.tiles={},this.tileCoords=[],M&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",P.indexMaxZoom,P.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(O=function(q,Y){var ee=Y.buffer/Y.extent,D=q,W=Ni(q,1,-1-ee,ee,0,-1,2,Y),ne=Ni(q,1,1-ee,2+ee,0,-1,2,Y);return(W||ne)&&(D=Ni(q,1,-ee,1+ee,0,-1,2,Y)||[],W&&(D=da(W,1).concat(D)),ne&&(D=D.concat(da(ne,-1)))),D}(O,P)).length&&this.splitTile(O,0,0,0),M&&(O.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function cn(I,P,M){return 32*((1<<I)*M+P)+I}function Uo(I,P){var M=I.tileID.canonical;if(!this._geoJSONIndex)return P(null,null);var O=this._geoJSONIndex.getTile(M.z,M.x,M.y);if(!O)return P(null,null);var q=new Gt(O.features),Y=ei(q);Y.byteOffset===0&&Y.byteLength===Y.buffer.byteLength||(Y=new Uint8Array(Y)),P(null,{vectorTile:q,rawData:Y.buffer})}jr.prototype.load=function(I){var P=this.options,M=P.log,O=P.minZoom,q=P.maxZoom,Y=P.nodeSize;M&&console.time("total time");var ee="prepare "+I.length+" points";M&&console.time(ee),this.points=I;for(var D=[],W=0;W<I.length;W++)I[W].geometry&&D.push(Ot(I[W],W));this.trees[q+1]=new bn(D,ti,Ti,Y,Float32Array),M&&console.timeEnd(ee);for(var ne=q;ne>=O;ne--){var _e=+Date.now();D=this._cluster(D,ne),this.trees[ne]=new bn(D,ti,Ti,Y,Float32Array),M&&console.log("z%d: %d clusters in %dms",ne,D.length,+Date.now()-_e)}return M&&console.timeEnd("total time"),this},jr.prototype.getClusters=function(I,P){var M=((I[0]+180)%360+360)%360-180,O=Math.max(-90,Math.min(90,I[1])),q=I[2]===180?180:((I[2]+180)%360+360)%360-180,Y=Math.max(-90,Math.min(90,I[3]));if(I[2]-I[0]>=360)M=-180,q=180;else if(M>q){var ee=this.getClusters([M,O,180,Y],P),D=this.getClusters([-180,O,q,Y],P);return ee.concat(D)}for(var W=this.trees[this._limitZoom(P)],ne=[],_e=0,be=W.range(Vi(M),yt(Y),Vi(q),yt(O));_e<be.length;_e+=1){var fe=W.points[be[_e]];ne.push(fe.numPoints?Ji(fe):this.points[fe.index])}return ne},jr.prototype.getChildren=function(I){var P=this._getOriginId(I),M=this._getOriginZoom(I),O="No cluster with the specified id.",q=this.trees[M];if(!q)throw new Error(O);var Y=q.points[P];if(!Y)throw new Error(O);for(var ee=this.options.radius/(this.options.extent*Math.pow(2,M-1)),D=[],W=0,ne=q.within(Y.x,Y.y,ee);W<ne.length;W+=1){var _e=q.points[ne[W]];_e.parentId===I&&D.push(_e.numPoints?Ji(_e):this.points[_e.index])}if(D.length===0)throw new Error(O);return D},jr.prototype.getLeaves=function(I,P,M){var O=[];return this._appendLeaves(O,I,P=P||10,M=M||0,0),O},jr.prototype.getTile=function(I,P,M){var O=this.trees[this._limitZoom(I)],q=Math.pow(2,I),Y=this.options,ee=Y.radius/Y.extent,D=(M-ee)/q,W=(M+1+ee)/q,ne={features:[]};return this._addTileFeatures(O.range((P-ee)/q,D,(P+1+ee)/q,W),O.points,P,M,q,ne),P===0&&this._addTileFeatures(O.range(1-ee/q,D,1,W),O.points,q,M,q,ne),P===q-1&&this._addTileFeatures(O.range(0,D,ee/q,W),O.points,-1,M,q,ne),ne.features.length?ne:null},jr.prototype.getClusterExpansionZoom=function(I){for(var P=this._getOriginZoom(I)-1;P<=this.options.maxZoom;){var M=this.getChildren(I);if(P++,M.length!==1)break;I=M[0].properties.cluster_id}return P},jr.prototype._appendLeaves=function(I,P,M,O,q){for(var Y=0,ee=this.getChildren(P);Y<ee.length;Y+=1){var D=ee[Y],W=D.properties;if(W&&W.cluster?q+W.point_count<=O?q+=W.point_count:q=this._appendLeaves(I,W.cluster_id,M,O,q):q<O?q++:I.push(D),I.length===M)break}return q},jr.prototype._addTileFeatures=function(I,P,M,O,q,Y){for(var ee=0,D=I;ee<D.length;ee+=1){var W=P[D[ee]],ne=W.numPoints,_e={type:1,geometry:[[Math.round(this.options.extent*(W.x*q-M)),Math.round(this.options.extent*(W.y*q-O))]],tags:ne?Ro(W):this.points[W.index].properties},be=void 0;ne?be=W.id:this.options.generateId?be=W.index:this.points[W.index].id&&(be=this.points[W.index].id),be!==void 0&&(_e.id=be),Y.features.push(_e)}},jr.prototype._limitZoom=function(I){return Math.max(this.options.minZoom,Math.min(+I,this.options.maxZoom+1))},jr.prototype._cluster=function(I,P){for(var M=[],O=this.options,q=O.reduce,Y=O.minPoints,ee=O.radius/(O.extent*Math.pow(2,P)),D=0;D<I.length;D++){var W=I[D];if(!(W.zoom<=P)){W.zoom=P;for(var ne=this.trees[P+1],_e=ne.within(W.x,W.y,ee),be=W.numPoints||1,fe=be,xe=0,Ve=_e;xe<Ve.length;xe+=1){var Fe=ne.points[Ve[xe]];Fe.zoom>P&&(fe+=Fe.numPoints||1)}if(fe>=Y){for(var de=W.x*be,De=W.y*be,Ae=q&&be>1?this._map(W,!0):null,Pe=(D<<5)+(P+1)+this.points.length,ut=0,ze=_e;ut<ze.length;ut+=1){var vt=ne.points[ze[ut]];if(!(vt.zoom<=P)){vt.zoom=P;var Vt=vt.numPoints||1;de+=vt.x*Vt,De+=vt.y*Vt,vt.parentId=Pe,q&&(Ae||(Ae=this._map(W,!0)),q(Ae,this._map(vt)))}}W.parentId=Pe,M.push(ln(de/fe,De/fe,Pe,fe,Ae))}else if(M.push(W),fe>1)for(var pt=0,Et=_e;pt<Et.length;pt+=1){var _t=ne.points[Et[pt]];_t.zoom<=P||(_t.zoom=P,M.push(_t))}}}return M},jr.prototype._getOriginId=function(I){return I-this.points.length>>5},jr.prototype._getOriginZoom=function(I){return(I-this.points.length)%32},jr.prototype._map=function(I,P){if(I.numPoints)return P?wn({},I.properties):I.properties;var M=this.points[I.index].properties,O=this.options.map(M);return P&&O===M?wn({},O):O},un.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},un.prototype.splitTile=function(I,P,M,O,q,Y,ee){for(var D=[I,P,M,O],W=this.options,ne=W.debug;D.length;){O=D.pop(),M=D.pop(),P=D.pop(),I=D.pop();var _e=1<<P,be=cn(P,M,O),fe=this.tiles[be];if(!fe&&(ne>1&&console.time("creation"),fe=this.tiles[be]=ls(I,P,M,O,W),this.tileCoords.push({z:P,x:M,y:O}),ne)){ne>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",P,M,O,fe.numFeatures,fe.numPoints,fe.numSimplified),console.timeEnd("creation"));var xe="z"+P;this.stats[xe]=(this.stats[xe]||0)+1,this.total++}if(fe.source=I,q){if(P===W.maxZoom||P===q)continue;var Ve=1<<q-P;if(M!==Math.floor(Y/Ve)||O!==Math.floor(ee/Ve))continue}else if(P===W.indexMaxZoom||fe.numPoints<=W.indexMaxPoints)continue;if(fe.source=null,I.length!==0){ne>1&&console.time("clipping");var Fe,de,De,Ae,Pe,ut,ze=.5*W.buffer/W.extent,vt=.5-ze,Vt=.5+ze,pt=1+ze;Fe=de=De=Ae=null,Pe=Ni(I,_e,M-ze,M+Vt,0,fe.minX,fe.maxX,W),ut=Ni(I,_e,M+vt,M+pt,0,fe.minX,fe.maxX,W),I=null,Pe&&(Fe=Ni(Pe,_e,O-ze,O+Vt,1,fe.minY,fe.maxY,W),de=Ni(Pe,_e,O+vt,O+pt,1,fe.minY,fe.maxY,W),Pe=null),ut&&(De=Ni(ut,_e,O-ze,O+Vt,1,fe.minY,fe.maxY,W),Ae=Ni(ut,_e,O+vt,O+pt,1,fe.minY,fe.maxY,W),ut=null),ne>1&&console.timeEnd("clipping"),D.push(Fe||[],P+1,2*M,2*O),D.push(de||[],P+1,2*M,2*O+1),D.push(De||[],P+1,2*M+1,2*O),D.push(Ae||[],P+1,2*M+1,2*O+1)}}},un.prototype.getTile=function(I,P,M){var O=this.options,q=O.extent,Y=O.debug;if(I<0||I>24)return null;var ee=1<<I,D=cn(I,P=(P%ee+ee)%ee,M);if(this.tiles[D])return ma(this.tiles[D],q);Y>1&&console.log("drilling down to z%d-%d-%d",I,P,M);for(var W,ne=I,_e=P,be=M;!W&&ne>0;)ne--,_e=Math.floor(_e/2),be=Math.floor(be/2),W=this.tiles[cn(ne,_e,be)];return W&&W.source?(Y>1&&console.log("found parent tile z%d-%d-%d",ne,_e,be),Y>1&&console.time("drilling down"),this.splitTile(W.source,ne,_e,be,I,P,M),Y>1&&console.timeEnd("drilling down"),this.tiles[D]?ma(this.tiles[D],q):null):null};var va=function(I){function P(M,O,q,Y){I.call(this,M,O,q,Uo),Y&&(this.loadGeoJSON=Y)}return I&&(P.__proto__=I),(P.prototype=Object.create(I&&I.prototype)).constructor=P,P.prototype.loadData=function(M,O){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=O,this._pendingLoadDataParams=M,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},P.prototype._loadData=function(){var M=this;if(this._pendingCallback&&this._pendingLoadDataParams){var O=this._pendingCallback,q=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var Y=!!(q&&q.request&&q.request.collectResourceTiming)&&new l.RequestPerformance(q.request);this.loadGeoJSON(q,function(ee,D){if(ee||!D)return O(ee);if(typeof D!="object")return O(new Error("Input data given to '"+q.source+"' is not a valid GeoJSON object."));(function fe(xe,Ve){var Fe,de=xe&&xe.type;if(de==="FeatureCollection")for(Fe=0;Fe<xe.features.length;Fe++)fe(xe.features[Fe],Ve);else if(de==="GeometryCollection")for(Fe=0;Fe<xe.geometries.length;Fe++)fe(xe.geometries[Fe],Ve);else if(de==="Feature")fe(xe.geometry,Ve);else if(de==="Polygon")At(xe.coordinates,Ve);else if(de==="MultiPolygon")for(Fe=0;Fe<xe.coordinates.length;Fe++)At(xe.coordinates[Fe],Ve);return xe})(D,!0);try{if(q.filter){var W=l.createExpression(q.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(W.result==="error")throw new Error(W.value.map(function(fe){return fe.key+": "+fe.message}).join(", "));var ne=D.features.filter(function(fe){return W.value.evaluate({zoom:0},fe)});D={type:"FeatureCollection",features:ne}}M._geoJSONIndex=q.cluster?new jr(function(fe){var xe=fe.superclusterOptions,Ve=fe.clusterProperties;if(!Ve||!xe)return xe;for(var Fe={},de={},De={accumulated:null,zoom:0},Ae={properties:null},Pe=Object.keys(Ve),ut=0,ze=Pe;ut<ze.length;ut+=1){var vt=ze[ut],Vt=Ve[vt],pt=Vt[0],Et=l.createExpression(Vt[1]),_t=l.createExpression(typeof pt=="string"?[pt,["accumulated"],["get",vt]]:pt);Fe[vt]=Et.value,de[vt]=_t.value}return xe.map=function(qr){Ae.properties=qr;for(var Mt={},ar=0,Dt=Pe;ar<Dt.length;ar+=1){var mt=Dt[ar];Mt[mt]=Fe[mt].evaluate(De,Ae)}return Mt},xe.reduce=function(qr,Mt){Ae.properties=Mt;for(var ar=0,Dt=Pe;ar<Dt.length;ar+=1){var mt=Dt[ar];De.accumulated=qr[mt],qr[mt]=de[mt].evaluate(De,Ae)}},xe}(q)).load(D.features):function(fe,xe){return new un(fe,xe)}(D,q.geojsonVtOptions)}catch(fe){return O(fe)}M.loaded={};var _e={};if(Y){var be=Y.finish();be&&(_e.resourceTiming={},_e.resourceTiming[q.source]=JSON.parse(JSON.stringify(be)))}O(null,_e)})}},P.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},P.prototype.reloadTile=function(M,O){var q=this.loaded;return q&&q[M.uid]?I.prototype.reloadTile.call(this,M,O):this.loadTile(M,O)},P.prototype.loadGeoJSON=function(M,O){if(M.request)l.getJSON(M.request,O);else{if(typeof M.data!="string")return O(new Error("Input data given to '"+M.source+"' is not a valid GeoJSON object."));try{return O(null,JSON.parse(M.data))}catch{return O(new Error("Input data given to '"+M.source+"' is not a valid GeoJSON object."))}}},P.prototype.removeSource=function(M,O){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),O()},P.prototype.getClusterExpansionZoom=function(M,O){try{O(null,this._geoJSONIndex.getClusterExpansionZoom(M.clusterId))}catch(q){O(q)}},P.prototype.getClusterChildren=function(M,O){try{O(null,this._geoJSONIndex.getChildren(M.clusterId))}catch(q){O(q)}},P.prototype.getClusterLeaves=function(M,O){try{O(null,this._geoJSONIndex.getLeaves(M.clusterId,M.limit,M.offset))}catch(q){O(q)}},P}(ke),or=function(I){var P=this;this.self=I,this.actor=new l.Actor(I,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:ke,geojson:va},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(M,O){if(P.workerSourceTypes[M])throw new Error('Worker source with name "'+M+'" already registered.');P.workerSourceTypes[M]=O},this.self.registerRTLTextPlugin=function(M){if(l.plugin.isParsed())throw new Error("RTL text plugin already registered.");l.plugin.applyArabicShaping=M.applyArabicShaping,l.plugin.processBidirectionalText=M.processBidirectionalText,l.plugin.processStyledBidirectionalText=M.processStyledBidirectionalText}};return or.prototype.setReferrer=function(I,P){this.referrer=P},or.prototype.setImages=function(I,P,M){for(var O in this.availableImages[I]=P,this.workerSources[I]){var q=this.workerSources[I][O];for(var Y in q)q[Y].availableImages=P}M()},or.prototype.setLayers=function(I,P,M){this.getLayerIndex(I).replace(P),M()},or.prototype.updateLayers=function(I,P,M){this.getLayerIndex(I).update(P.layers,P.removedIds),M()},or.prototype.loadTile=function(I,P,M){this.getWorkerSource(I,P.type,P.source).loadTile(P,M)},or.prototype.loadDEMTile=function(I,P,M){this.getDEMWorkerSource(I,P.source).loadTile(P,M)},or.prototype.reloadTile=function(I,P,M){this.getWorkerSource(I,P.type,P.source).reloadTile(P,M)},or.prototype.abortTile=function(I,P,M){this.getWorkerSource(I,P.type,P.source).abortTile(P,M)},or.prototype.removeTile=function(I,P,M){this.getWorkerSource(I,P.type,P.source).removeTile(P,M)},or.prototype.removeDEMTile=function(I,P){this.getDEMWorkerSource(I,P.source).removeTile(P)},or.prototype.removeSource=function(I,P,M){if(this.workerSources[I]&&this.workerSources[I][P.type]&&this.workerSources[I][P.type][P.source]){var O=this.workerSources[I][P.type][P.source];delete this.workerSources[I][P.type][P.source],O.removeSource!==void 0?O.removeSource(P,M):M()}},or.prototype.loadWorkerSource=function(I,P,M){try{this.self.importScripts(P.url),M()}catch(O){M(O.toString())}},or.prototype.syncRTLPluginState=function(I,P,M){try{l.plugin.setState(P);var O=l.plugin.getPluginURL();if(l.plugin.isLoaded()&&!l.plugin.isParsed()&&O!=null){this.self.importScripts(O);var q=l.plugin.isParsed();M(q?void 0:new Error("RTL Text Plugin failed to import scripts from "+O),q)}}catch(Y){M(Y.toString())}},or.prototype.getAvailableImages=function(I){var P=this.availableImages[I];return P||(P=[]),P},or.prototype.getLayerIndex=function(I){var P=this.layerIndexes[I];return P||(P=this.layerIndexes[I]=new me),P},or.prototype.getWorkerSource=function(I,P,M){var O=this;return this.workerSources[I]||(this.workerSources[I]={}),this.workerSources[I][P]||(this.workerSources[I][P]={}),this.workerSources[I][P][M]||(this.workerSources[I][P][M]=new this.workerSourceTypes[P]({send:function(q,Y,ee){O.actor.send(q,Y,ee,I)}},this.getLayerIndex(I),this.getAvailableImages(I))),this.workerSources[I][P][M]},or.prototype.getDEMWorkerSource=function(I,P){return this.demWorkerSources[I]||(this.demWorkerSources[I]={}),this.demWorkerSources[I][P]||(this.demWorkerSources[I][P]=new $e),this.demWorkerSources[I][P]},or.prototype.enforceCacheSizeLimit=function(I,P){l.enforceCacheSizeLimit(P)},typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new or(self)),or}),V(["./shared"],function(l){var re=l.createCommonjsModule(function(i){function o(p){return!n(p)}function n(p){return typeof window>"u"||typeof document>"u"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var y,g,w=new Blob([""],{type:"text/javascript"}),A=URL.createObjectURL(w);try{g=new Worker(A),y=!0}catch{y=!1}return g&&g.terminate(),URL.revokeObjectURL(A),y}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var y=document.createElement("canvas");y.width=y.height=1;var g=y.getContext("2d");if(!g)return!1;var w=g.getImageData(0,0,1,1);return w&&w.width===y.width}()?(s[m=p&&p.failIfMajorPerformanceCaveat]===void 0&&(s[m]=function(y){var g=function(A){var B=document.createElement("canvas"),L=Object.create(o.webGLContextAttributes);return L.failIfMajorPerformanceCaveat=A,B.probablySupportsContext?B.probablySupportsContext("webgl",L)||B.probablySupportsContext("experimental-webgl",L):B.supportsContext?B.supportsContext("webgl",L)||B.supportsContext("experimental-webgl",L):B.getContext("webgl",L)||B.getContext("experimental-webgl",L)}(y);if(!g)return!1;var w=g.createShader(g.VERTEX_SHADER);return!(!w||g.isContextLost())&&(g.shaderSource(w,"void main() {}"),g.compileShader(w),g.getShaderParameter(w,g.COMPILE_STATUS)===!0)}(m)),s[m]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var m}i.exports?i.exports=o:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=o,window.mapboxgl.notSupportedReason=n);var s={};o.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}}),G={create:function(i,o,n){var s=l.window.document.createElement(i);return o!==void 0&&(s.className=o),n&&n.appendChild(s),s},createNS:function(i,o){return l.window.document.createElementNS(i,o)}},me=l.window.document&&l.window.document.documentElement.style;function pe(i){if(!me)return i[0];for(var o=0;o<i.length;o++)if(i[o]in me)return i[o];return i[0]}var Ce,ae=pe(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);G.disableDrag=function(){me&&ae&&(Ce=me[ae],me[ae]="none")},G.enableDrag=function(){me&&ae&&(me[ae]=Ce)};var ve=pe(["transform","WebkitTransform"]);G.setTransform=function(i,o){i.style[ve]=o};var ke=!1;try{var Xe=Object.defineProperty({},"passive",{get:function(){ke=!0}});l.window.addEventListener("test",Xe,Xe),l.window.removeEventListener("test",Xe,Xe)}catch{ke=!1}G.addEventListener=function(i,o,n,s){s===void 0&&(s={}),i.addEventListener(o,n,"passive"in s&&ke?s:s.capture)},G.removeEventListener=function(i,o,n,s){s===void 0&&(s={}),i.removeEventListener(o,n,"passive"in s&&ke?s:s.capture)};var $e=function(i){i.preventDefault(),i.stopPropagation(),l.window.removeEventListener("click",$e,!0)};function At(i){var o=i.userImage;return!!(o&&o.render&&o.render())&&(i.data.replace(new Uint8Array(o.data.buffer)),!0)}G.suppressClick=function(){l.window.addEventListener("click",$e,!0),l.window.setTimeout(function(){l.window.removeEventListener("click",$e,!0)},0)},G.mousePos=function(i,o){var n=i.getBoundingClientRect();return new l.Point(o.clientX-n.left-i.clientLeft,o.clientY-n.top-i.clientTop)},G.touchPos=function(i,o){for(var n=i.getBoundingClientRect(),s=[],p=0;p<o.length;p++)s.push(new l.Point(o[p].clientX-n.left-i.clientLeft,o[p].clientY-n.top-i.clientTop));return s},G.mouseButton=function(i){return l.window.InstallTrigger!==void 0&&i.button===2&&i.ctrlKey&&l.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:i.button},G.remove=function(i){i.parentNode&&i.parentNode.removeChild(i)};var et=function(i){function o(){i.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new l.RGBAImage({width:1,height:1}),this.dirty=!0}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.isLoaded=function(){return this.loaded},o.prototype.setLoaded=function(n){if(this.loaded!==n&&(this.loaded=n,n)){for(var s=0,p=this.requestors;s<p.length;s+=1){var m=p[s];this._notify(m.ids,m.callback)}this.requestors=[]}},o.prototype.getImage=function(n){return this.images[n]},o.prototype.addImage=function(n,s){this._validate(n,s)&&(this.images[n]=s)},o.prototype._validate=function(n,s){var p=!0;return this._validateStretch(s.stretchX,s.data&&s.data.width)||(this.fire(new l.ErrorEvent(new Error('Image "'+n+'" has invalid "stretchX" value'))),p=!1),this._validateStretch(s.stretchY,s.data&&s.data.height)||(this.fire(new l.ErrorEvent(new Error('Image "'+n+'" has invalid "stretchY" value'))),p=!1),this._validateContent(s.content,s)||(this.fire(new l.ErrorEvent(new Error('Image "'+n+'" has invalid "content" value'))),p=!1),p},o.prototype._validateStretch=function(n,s){if(!n)return!0;for(var p=0,m=0,y=n;m<y.length;m+=1){var g=y[m];if(g[0]<p||g[1]<g[0]||s<g[1])return!1;p=g[1]}return!0},o.prototype._validateContent=function(n,s){return!(n&&(n.length!==4||n[0]<0||s.data.width<n[0]||n[1]<0||s.data.height<n[1]||n[2]<0||s.data.width<n[2]||n[3]<0||s.data.height<n[3]||n[2]<n[0]||n[3]<n[1]))},o.prototype.updateImage=function(n,s){s.version=this.images[n].version+1,this.images[n]=s,this.updatedImages[n]=!0},o.prototype.removeImage=function(n){var s=this.images[n];delete this.images[n],delete this.patterns[n],s.userImage&&s.userImage.onRemove&&s.userImage.onRemove()},o.prototype.listImages=function(){return Object.keys(this.images)},o.prototype.getImages=function(n,s){var p=!0;if(!this.isLoaded())for(var m=0,y=n;m<y.length;m+=1)this.images[y[m]]||(p=!1);this.isLoaded()||p?this._notify(n,s):this.requestors.push({ids:n,callback:s})},o.prototype._notify=function(n,s){for(var p={},m=0,y=n;m<y.length;m+=1){var g=y[m];this.images[g]||this.fire(new l.Event("styleimagemissing",{id:g}));var w=this.images[g];w?p[g]={data:w.data.clone(),pixelRatio:w.pixelRatio,sdf:w.sdf,version:w.version,stretchX:w.stretchX,stretchY:w.stretchY,content:w.content,hasRenderCallback:!!(w.userImage&&w.userImage.render)}:l.warnOnce('Image "'+g+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}s(null,p)},o.prototype.getPixelSize=function(){var n=this.atlasImage;return{width:n.width,height:n.height}},o.prototype.getPattern=function(n){var s=this.patterns[n],p=this.getImage(n);if(!p)return null;if(s&&s.position.version===p.version)return s.position;if(s)s.position.version=p.version;else{var m={w:p.data.width+2,h:p.data.height+2,x:0,y:0},y=new l.ImagePosition(m,p);this.patterns[n]={bin:m,position:y}}return this._updatePatternAtlas(),this.patterns[n].position},o.prototype.bind=function(n){var s=n.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new l.Texture(n,this.atlasImage,s.RGBA),this.atlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE)},o.prototype._updatePatternAtlas=function(){var n=[];for(var s in this.patterns)n.push(this.patterns[s].bin);var p=l.potpack(n),m=p.w,y=p.h,g=this.atlasImage;for(var w in g.resize({width:m||1,height:y||1}),this.patterns){var A=this.patterns[w].bin,B=A.x+1,L=A.y+1,R=this.images[w].data,Z=R.width,j=R.height;l.RGBAImage.copy(R,g,{x:0,y:0},{x:B,y:L},{width:Z,height:j}),l.RGBAImage.copy(R,g,{x:0,y:j-1},{x:B,y:L-1},{width:Z,height:1}),l.RGBAImage.copy(R,g,{x:0,y:0},{x:B,y:L+j},{width:Z,height:1}),l.RGBAImage.copy(R,g,{x:Z-1,y:0},{x:B-1,y:L},{width:1,height:j}),l.RGBAImage.copy(R,g,{x:0,y:0},{x:B+Z,y:L},{width:1,height:j})}this.dirty=!0},o.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},o.prototype.dispatchRenderCallbacks=function(n){for(var s=0,p=n;s<p.length;s+=1){var m=p[s];if(!this.callbackDispatchedThisFrame[m]){this.callbackDispatchedThisFrame[m]=!0;var y=this.images[m];At(y)&&this.updateImage(m,y)}}},o}(l.Evented),dt=Qt,Rt=Qt,Gt=1e20;function Qt(i,o,n,s,p,m){this.fontSize=i||24,this.buffer=o===void 0?3:o,this.cutoff=s||.25,this.fontFamily=p||"sans-serif",this.fontWeight=m||"normal",this.radius=n||8;var y=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=y,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(y*y),this.gridInner=new Float64Array(y*y),this.f=new Float64Array(y),this.d=new Float64Array(y),this.z=new Float64Array(y+1),this.v=new Int16Array(y),this.middle=Math.round(y/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function fr(i,o,n,s,p,m,y){for(var g=0;g<o;g++){for(var w=0;w<n;w++)s[w]=i[w*o+g];for(Er(s,p,m,y,n),w=0;w<n;w++)i[w*o+g]=p[w]}for(w=0;w<n;w++){for(g=0;g<o;g++)s[g]=i[w*o+g];for(Er(s,p,m,y,o),g=0;g<o;g++)i[w*o+g]=Math.sqrt(p[g])}}function Er(i,o,n,s,p){n[0]=0,s[0]=-Gt,s[1]=+Gt;for(var m=1,y=0;m<p;m++){for(var g=(i[m]+m*m-(i[n[y]]+n[y]*n[y]))/(2*m-2*n[y]);g<=s[y];)y--,g=(i[m]+m*m-(i[n[y]]+n[y]*n[y]))/(2*m-2*n[y]);n[++y]=m,s[y]=g,s[y+1]=+Gt}for(m=0,y=0;m<p;m++){for(;s[y+1]<m;)y++;o[m]=(m-n[y])*(m-n[y])+i[n[y]]}}Qt.prototype.draw=function(i){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(i,this.buffer,this.middle);for(var o=this.ctx.getImageData(0,0,this.size,this.size),n=new Uint8ClampedArray(this.size*this.size),s=0;s<this.size*this.size;s++){var p=o.data[4*s+3]/255;this.gridOuter[s]=p===1?0:p===0?Gt:Math.pow(Math.max(0,.5-p),2),this.gridInner[s]=p===1?Gt:p===0?0:Math.pow(Math.max(0,p-.5),2)}for(fr(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),fr(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),s=0;s<this.size*this.size;s++)n[s]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[s]-this.gridInner[s])/this.radius+this.cutoff))));return n},dt.default=Rt;var dr=function(i,o){this.requestManager=i,this.localIdeographFontFamily=o,this.entries={}};dr.prototype.setURL=function(i){this.url=i},dr.prototype.getGlyphs=function(i,o){var n=this,s=[];for(var p in i)for(var m=0,y=i[p];m<y.length;m+=1)s.push({stack:p,id:y[m]});l.asyncAll(s,function(g,w){var A=g.stack,B=g.id,L=n.entries[A];L||(L=n.entries[A]={glyphs:{},requests:{},ranges:{}});var R=L.glyphs[B];if(R===void 0){if(R=n._tinySDF(L,A,B))return L.glyphs[B]=R,void w(null,{stack:A,id:B,glyph:R});var Z=Math.floor(B/256);if(256*Z>65535)w(new Error("glyphs > 65535 not supported"));else if(L.ranges[Z])w(null,{stack:A,id:B,glyph:R});else{var j=L.requests[Z];j||(j=L.requests[Z]=[],dr.loadGlyphRange(A,Z,n.url,n.requestManager,function(K,U){if(U){for(var X in U)n._doesCharSupportLocalGlyph(+X)||(L.glyphs[+X]=U[+X]);L.ranges[Z]=!0}for(var Q=0,ie=j;Q<ie.length;Q+=1)(0,ie[Q])(K,U);delete L.requests[Z]})),j.push(function(K,U){K?w(K):U&&w(null,{stack:A,id:B,glyph:U[B]||null})})}}else w(null,{stack:A,id:B,glyph:R})},function(g,w){if(g)o(g);else if(w){for(var A={},B=0,L=w;B<L.length;B+=1){var R=L[B],Z=R.stack,j=R.id,K=R.glyph;(A[Z]||(A[Z]={}))[j]=K&&{id:K.id,bitmap:K.bitmap.clone(),metrics:K.metrics}}o(null,A)}})},dr.prototype._doesCharSupportLocalGlyph=function(i){return!!this.localIdeographFontFamily&&(l.isChar["CJK Unified Ideographs"](i)||l.isChar["Hangul Syllables"](i)||l.isChar.Hiragana(i)||l.isChar.Katakana(i))},dr.prototype._tinySDF=function(i,o,n){var s=this.localIdeographFontFamily;if(s&&this._doesCharSupportLocalGlyph(n)){var p=i.tinySDF;if(!p){var m="400";/bold/i.test(o)?m="900":/medium/i.test(o)?m="500":/light/i.test(o)&&(m="200"),p=i.tinySDF=new dr.TinySDF(24,3,8,.25,s,m)}return{id:n,bitmap:new l.AlphaImage({width:30,height:30},p.draw(String.fromCharCode(n))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},dr.loadGlyphRange=function(i,o,n,s,p){var m=256*o,y=m+255,g=s.transformRequest(s.normalizeGlyphsURL(n).replace("{fontstack}",i).replace("{range}",m+"-"+y),l.ResourceType.Glyphs);l.getArrayBuffer(g,function(w,A){if(w)p(w);else if(A){for(var B={},L=0,R=l.parseGlyphPBF(A);L<R.length;L+=1){var Z=R[L];B[Z.id]=Z}p(null,B)}})},dr.TinySDF=dt;var ei=function(){this.specification=l.styleSpec.light.position};ei.prototype.possiblyEvaluate=function(i,o){return l.sphericalToCartesian(i.expression.evaluate(o))},ei.prototype.interpolate=function(i,o,n){return{x:l.number(i.x,o.x,n),y:l.number(i.y,o.y,n),z:l.number(i.z,o.z,n)}};var wr=new l.Properties({anchor:new l.DataConstantProperty(l.styleSpec.light.anchor),position:new ei,color:new l.DataConstantProperty(l.styleSpec.light.color),intensity:new l.DataConstantProperty(l.styleSpec.light.intensity)}),Si=function(i){function o(n){i.call(this),this._transitionable=new l.Transitionable(wr),this.setLight(n),this._transitioning=this._transitionable.untransitioned()}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getLight=function(){return this._transitionable.serialize()},o.prototype.setLight=function(n,s){if(s===void 0&&(s={}),!this._validate(l.validateLight,n,s))for(var p in n){var m=n[p];l.endsWith(p,"-transition")?this._transitionable.setTransition(p.slice(0,-11),m):this._transitionable.setValue(p,m)}},o.prototype.updateTransitions=function(n){this._transitioning=this._transitionable.transitioned(n,this._transitioning)},o.prototype.hasTransition=function(){return this._transitioning.hasTransition()},o.prototype.recalculate=function(n){this.properties=this._transitioning.possiblyEvaluate(n)},o.prototype._validate=function(n,s,p){return(!p||p.validate!==!1)&&l.emitValidationErrors(this,n.call(l.validateStyle,l.extend({value:s,style:{glyphs:!0,sprite:!0},styleSpec:l.styleSpec})))},o}(l.Evented),Ft=function(i,o){this.width=i,this.height=o,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};Ft.prototype.getDash=function(i,o){var n=i.join(",")+String(o);return this.dashEntry[n]||(this.dashEntry[n]=this.addDash(i,o)),this.dashEntry[n]},Ft.prototype.getDashRanges=function(i,o,n){var s=[],p=i.length%2==1?-i[i.length-1]*n:0,m=i[0]*n,y=!0;s.push({left:p,right:m,isDash:y,zeroLength:i[0]===0});for(var g=i[0],w=1;w<i.length;w++){var A=i[w];s.push({left:p=g*n,right:m=(g+=A)*n,isDash:y=!y,zeroLength:A===0})}return s},Ft.prototype.addRoundDash=function(i,o,n){for(var s=o/2,p=-n;p<=n;p++)for(var m=this.width*(this.nextRow+n+p),y=0,g=i[y],w=0;w<this.width;w++){w/g.right>1&&(g=i[++y]);var A=Math.abs(w-g.left),B=Math.abs(w-g.right),L=Math.min(A,B),R=void 0,Z=p/n*(s+1);if(g.isDash){var j=s-Math.abs(Z);R=Math.sqrt(L*L+j*j)}else R=s-Math.sqrt(L*L+Z*Z);this.data[m+w]=Math.max(0,Math.min(255,R+128))}},Ft.prototype.addRegularDash=function(i){for(var o=i.length-1;o>=0;--o){var n=i[o],s=i[o+1];n.zeroLength?i.splice(o,1):s&&s.isDash===n.isDash&&(s.left=n.left,i.splice(o,1))}var p=i[0],m=i[i.length-1];p.isDash===m.isDash&&(p.left=m.left-this.width,m.right=p.right+this.width);for(var y=this.width*this.nextRow,g=0,w=i[g],A=0;A<this.width;A++){A/w.right>1&&(w=i[++g]);var B=Math.abs(A-w.left),L=Math.abs(A-w.right),R=Math.min(B,L);this.data[y+A]=Math.max(0,Math.min(255,(w.isDash?R:-R)+128))}},Ft.prototype.addDash=function(i,o){var n=o?7:0,s=2*n+1;if(this.nextRow+s>this.height)return l.warnOnce("LineAtlas out of space"),null;for(var p=0,m=0;m<i.length;m++)p+=i[m];if(p!==0){var y=this.width/p,g=this.getDashRanges(i,this.width,y);o?this.addRoundDash(g,y,n):this.addRegularDash(g)}var w={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:p};return this.nextRow+=s,this.dirty=!0,w},Ft.prototype.bind=function(i){var o=i.gl;this.texture?(o.bindTexture(o.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,o.texSubImage2D(o.TEXTURE_2D,0,0,0,this.width,this.height,o.ALPHA,o.UNSIGNED_BYTE,this.data))):(this.texture=o.createTexture(),o.bindTexture(o.TEXTURE_2D,this.texture),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.REPEAT),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.REPEAT),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texImage2D(o.TEXTURE_2D,0,o.ALPHA,this.width,this.height,0,o.ALPHA,o.UNSIGNED_BYTE,this.data))};var Pr=function i(o,n){this.workerPool=o,this.actors=[],this.currentActor=0,this.id=l.uniqueId();for(var s=this.workerPool.acquire(this.id),p=0;p<s.length;p++){var m=new i.Actor(s[p],n,this.id);m.name="Worker "+p,this.actors.push(m)}};function Bo(i,o,n){var s=function(p,m){if(p)return n(p);if(m){var y=l.pick(l.extend(m,i),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);m.vector_layers&&(y.vectorLayers=m.vector_layers,y.vectorLayerIds=y.vectorLayers.map(function(g){return g.id})),y.tiles=o.canonicalizeTileset(y,i.url),n(null,y)}};return i.url?l.getJSON(o.transformRequest(o.normalizeSourceURL(i.url),l.ResourceType.Source),s):l.browser.frame(function(){return s(null,i)})}Pr.prototype.broadcast=function(i,o,n){l.asyncAll(this.actors,function(s,p){s.send(i,o,p)},n=n||function(){})},Pr.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},Pr.prototype.remove=function(){this.actors.forEach(function(i){i.remove()}),this.actors=[],this.workerPool.release(this.id)},Pr.Actor=l.Actor;var li=function(i,o,n){this.bounds=l.LngLatBounds.convert(this.validateBounds(i)),this.minzoom=o||0,this.maxzoom=n||24};li.prototype.validateBounds=function(i){return Array.isArray(i)&&i.length===4?[Math.max(-180,i[0]),Math.max(-90,i[1]),Math.min(180,i[2]),Math.min(90,i[3])]:[-180,-90,180,90]},li.prototype.contains=function(i){var o=Math.pow(2,i.z),n=Math.floor(l.mercatorXfromLng(this.bounds.getWest())*o),s=Math.floor(l.mercatorYfromLat(this.bounds.getNorth())*o),p=Math.ceil(l.mercatorXfromLng(this.bounds.getEast())*o),m=Math.ceil(l.mercatorYfromLat(this.bounds.getSouth())*o);return i.x>=n&&i.x<p&&i.y>=s&&i.y<m};var Do=function(i){function o(n,s,p,m){if(i.call(this),this.id=n,this.dispatcher=p,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,l.extend(this,l.pick(s,["url","scheme","tileSize","promoteId"])),this._options=l.extend({type:"vector"},s),this._collectResourceTiming=s.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(m)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1,this.fire(new l.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Bo(this._options,this.map._requestManager,function(s,p){n._tileJSONRequest=null,n._loaded=!0,s?n.fire(new l.ErrorEvent(s)):p&&(l.extend(n,p),p.bounds&&(n.tileBounds=new li(p.bounds,n.minzoom,n.maxzoom)),l.postTurnstileEvent(p.tiles,n.map._requestManager._customAccessToken),l.postMapLoadEvent(p.tiles,n.map._getMapId(),n.map._requestManager._skuToken,n.map._requestManager._customAccessToken),n.fire(new l.Event("data",{dataType:"source",sourceDataType:"metadata"})),n.fire(new l.Event("data",{dataType:"source",sourceDataType:"content"})))})},o.prototype.loaded=function(){return this._loaded},o.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setSourceProperty=function(n){this._tileJSONRequest&&this._tileJSONRequest.cancel(),n(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},o.prototype.setTiles=function(n){var s=this;return this.setSourceProperty(function(){s._options.tiles=n}),this},o.prototype.setUrl=function(n){var s=this;return this.setSourceProperty(function(){s.url=n,s._options.url=n}),this},o.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},o.prototype.serialize=function(){return l.extend({},this._options)},o.prototype.loadTile=function(n,s){var p=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme)),m={request:this.map._requestManager.transformRequest(p,l.ResourceType.Tile),uid:n.uid,tileID:n.tileID,zoom:n.tileID.overscaledZ,tileSize:this.tileSize*n.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:l.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function y(g,w){return delete n.request,n.aborted?s(null):g&&g.status!==404?s(g):(w&&w.resourceTiming&&(n.resourceTiming=w.resourceTiming),this.map._refreshExpiredTiles&&w&&n.setExpiryData(w),n.loadVectorData(w,this.map.painter),l.cacheEntryPossiblyAdded(this.dispatcher),s(null),void(n.reloadCallback&&(this.loadTile(n,n.reloadCallback),n.reloadCallback=null)))}m.request.collectResourceTiming=this._collectResourceTiming,n.actor&&n.state!=="expired"?n.state==="loading"?n.reloadCallback=s:n.request=n.actor.send("reloadTile",m,y.bind(this)):(n.actor=this.dispatcher.getActor(),n.request=n.actor.send("loadTile",m,y.bind(this)))},o.prototype.abortTile=function(n){n.request&&(n.request.cancel(),delete n.request),n.actor&&n.actor.send("abortTile",{uid:n.uid,type:this.type,source:this.id},void 0)},o.prototype.unloadTile=function(n){n.unloadVectorData(),n.actor&&n.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id},void 0)},o.prototype.hasTransition=function(){return!1},o}(l.Evented),Lo=function(i){function o(n,s,p,m){i.call(this),this.id=n,this.dispatcher=p,this.setEventedParent(m),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=l.extend({type:"raster"},s),l.extend(this,l.pick(s,["url","scheme","tileSize"]))}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1,this.fire(new l.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Bo(this._options,this.map._requestManager,function(s,p){n._tileJSONRequest=null,n._loaded=!0,s?n.fire(new l.ErrorEvent(s)):p&&(l.extend(n,p),p.bounds&&(n.tileBounds=new li(p.bounds,n.minzoom,n.maxzoom)),l.postTurnstileEvent(p.tiles),l.postMapLoadEvent(p.tiles,n.map._getMapId(),n.map._requestManager._skuToken),n.fire(new l.Event("data",{dataType:"source",sourceDataType:"metadata"})),n.fire(new l.Event("data",{dataType:"source",sourceDataType:"content"})))})},o.prototype.loaded=function(){return this._loaded},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},o.prototype.serialize=function(){return l.extend({},this._options)},o.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)},o.prototype.loadTile=function(n,s){var p=this,m=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);n.request=l.getImage(this.map._requestManager.transformRequest(m,l.ResourceType.Tile),function(y,g){if(delete n.request,n.aborted)n.state="unloaded",s(null);else if(y)n.state="errored",s(y);else if(g){p.map._refreshExpiredTiles&&n.setExpiryData(g),delete g.cacheControl,delete g.expires;var w=p.map.painter.context,A=w.gl;n.texture=p.map.painter.getTileTexture(g.width),n.texture?n.texture.update(g,{useMipmap:!0}):(n.texture=new l.Texture(w,g,A.RGBA,{useMipmap:!0}),n.texture.bind(A.LINEAR,A.CLAMP_TO_EDGE,A.LINEAR_MIPMAP_NEAREST),w.extTextureFilterAnisotropic&&A.texParameterf(A.TEXTURE_2D,w.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,w.extTextureFilterAnisotropicMax)),n.state="loaded",l.cacheEntryPossiblyAdded(p.dispatcher),s(null)}})},o.prototype.abortTile=function(n,s){n.request&&(n.request.cancel(),delete n.request),s()},o.prototype.unloadTile=function(n,s){n.texture&&this.map.painter.saveTileTexture(n.texture),s()},o.prototype.hasTransition=function(){return!1},o}(l.Evented),ns=function(i){function o(n,s,p,m){i.call(this,n,s,p,m),this.type="raster-dem",this.maxzoom=22,this._options=l.extend({type:"raster-dem"},s),this.encoding=s.encoding||"mapbox"}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},o.prototype.loadTile=function(n,s){var p=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function m(y,g){y&&(n.state="errored",s(y)),g&&(n.dem=g,n.needsHillshadePrepare=!0,n.state="loaded",s(null))}n.request=l.getImage(this.map._requestManager.transformRequest(p,l.ResourceType.Tile),(function(y,g){if(delete n.request,n.aborted)n.state="unloaded",s(null);else if(y)n.state="errored",s(y);else if(g){this.map._refreshExpiredTiles&&n.setExpiryData(g),delete g.cacheControl,delete g.expires;var w=l.window.ImageBitmap&&g instanceof l.window.ImageBitmap&&l.offscreenCanvasSupported()?g:l.browser.getImageData(g,1),A={uid:n.uid,coord:n.tileID,source:this.id,rawImageData:w,encoding:this.encoding};n.actor&&n.state!=="expired"||(n.actor=this.dispatcher.getActor(),n.actor.send("loadDEMTile",A,m.bind(this)))}}).bind(this)),n.neighboringTiles=this._getNeighboringTiles(n.tileID)},o.prototype._getNeighboringTiles=function(n){var s=n.canonical,p=Math.pow(2,s.z),m=(s.x-1+p)%p,y=s.x===0?n.wrap-1:n.wrap,g=(s.x+1+p)%p,w=s.x+1===p?n.wrap+1:n.wrap,A={};return A[new l.OverscaledTileID(n.overscaledZ,y,s.z,m,s.y).key]={backfilled:!1},A[new l.OverscaledTileID(n.overscaledZ,w,s.z,g,s.y).key]={backfilled:!1},s.y>0&&(A[new l.OverscaledTileID(n.overscaledZ,y,s.z,m,s.y-1).key]={backfilled:!1},A[new l.OverscaledTileID(n.overscaledZ,n.wrap,s.z,s.x,s.y-1).key]={backfilled:!1},A[new l.OverscaledTileID(n.overscaledZ,w,s.z,g,s.y-1).key]={backfilled:!1}),s.y+1<p&&(A[new l.OverscaledTileID(n.overscaledZ,y,s.z,m,s.y+1).key]={backfilled:!1},A[new l.OverscaledTileID(n.overscaledZ,n.wrap,s.z,s.x,s.y+1).key]={backfilled:!1},A[new l.OverscaledTileID(n.overscaledZ,w,s.z,g,s.y+1).key]={backfilled:!1}),A},o.prototype.unloadTile=function(n){n.demTexture&&this.map.painter.saveTileTexture(n.demTexture),n.fbo&&(n.fbo.destroy(),delete n.fbo),n.dem&&delete n.dem,delete n.neighboringTiles,n.state="unloaded",n.actor&&n.actor.send("removeDEMTile",{uid:n.uid,source:this.id})},o}(Lo),xn=function(i){function o(n,s,p,m){i.call(this),this.id=n,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=p.getActor(),this.setEventedParent(m),this._data=s.data,this._options=l.extend({},s),this._collectResourceTiming=s.collectResourceTiming,this._resourceTiming=[],s.maxzoom!==void 0&&(this.maxzoom=s.maxzoom),s.type&&(this.type=s.type),s.attribution&&(this.attribution=s.attribution),this.promoteId=s.promoteId;var y=l.EXTENT/this.tileSize;this.workerOptions=l.extend({source:this.id,cluster:s.cluster||!1,geojsonVtOptions:{buffer:(s.buffer!==void 0?s.buffer:128)*y,tolerance:(s.tolerance!==void 0?s.tolerance:.375)*y,extent:l.EXTENT,maxZoom:this.maxzoom,lineMetrics:s.lineMetrics||!1,generateId:s.generateId||!1},superclusterOptions:{maxZoom:s.clusterMaxZoom!==void 0?Math.min(s.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,s.clusterMinPoints||2),extent:l.EXTENT,radius:(s.clusterRadius||50)*y,log:!1,generateId:s.generateId||!1},clusterProperties:s.clusterProperties,filter:s.filter},s.workerOptions)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this.fire(new l.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(s){if(s)n.fire(new l.ErrorEvent(s));else{var p={dataType:"source",sourceDataType:"metadata"};n._collectResourceTiming&&n._resourceTiming&&n._resourceTiming.length>0&&(p.resourceTiming=n._resourceTiming,n._resourceTiming=[]),n.fire(new l.Event("data",p))}})},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setData=function(n){var s=this;return this._data=n,this.fire(new l.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(p){if(p)s.fire(new l.ErrorEvent(p));else{var m={dataType:"source",sourceDataType:"content"};s._collectResourceTiming&&s._resourceTiming&&s._resourceTiming.length>0&&(m.resourceTiming=s._resourceTiming,s._resourceTiming=[]),s.fire(new l.Event("data",m))}}),this},o.prototype.getClusterExpansionZoom=function(n,s){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:n,source:this.id},s),this},o.prototype.getClusterChildren=function(n,s){return this.actor.send("geojson.getClusterChildren",{clusterId:n,source:this.id},s),this},o.prototype.getClusterLeaves=function(n,s,p,m){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:n,limit:s,offset:p},m),this},o.prototype._updateWorkerData=function(n){var s=this;this._loaded=!1;var p=l.extend({},this.workerOptions),m=this._data;typeof m=="string"?(p.request=this.map._requestManager.transformRequest(l.browser.resolveURL(m),l.ResourceType.Source),p.request.collectResourceTiming=this._collectResourceTiming):p.data=JSON.stringify(m),this.actor.send(this.type+".loadData",p,function(y,g){s._removed||g&&g.abandoned||(s._loaded=!0,g&&g.resourceTiming&&g.resourceTiming[s.id]&&(s._resourceTiming=g.resourceTiming[s.id].slice(0)),s.actor.send(s.type+".coalesce",{source:p.source},null),n(y))})},o.prototype.loaded=function(){return this._loaded},o.prototype.loadTile=function(n,s){var p=this,m=n.actor?"reloadTile":"loadTile";n.actor=this.actor,n.request=this.actor.send(m,{type:this.type,uid:n.uid,tileID:n.tileID,zoom:n.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:l.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},function(y,g){return delete n.request,n.unloadVectorData(),n.aborted?s(null):y?s(y):(n.loadVectorData(g,p.map.painter,m==="reloadTile"),s(null))})},o.prototype.abortTile=function(n){n.request&&(n.request.cancel(),delete n.request),n.aborted=!0},o.prototype.unloadTile=function(n){n.unloadVectorData(),this.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id})},o.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},o.prototype.serialize=function(){return l.extend({},this._options,{type:this.type,data:this._data})},o.prototype.hasTransition=function(){return!1},o}(l.Evented),Oi=l.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Ki=function(i){function o(n,s,p,m){i.call(this),this.id=n,this.dispatcher=p,this.coordinates=s.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(m),this.options=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(n,s){var p=this;this._loaded=!1,this.fire(new l.Event("dataloading",{dataType:"source"})),this.url=this.options.url,l.getImage(this.map._requestManager.transformRequest(this.url,l.ResourceType.Image),function(m,y){p._loaded=!0,m?p.fire(new l.ErrorEvent(m)):y&&(p.image=y,n&&(p.coordinates=n),s&&s(),p._finishLoading())})},o.prototype.loaded=function(){return this._loaded},o.prototype.updateImage=function(n){var s=this;return this.image&&n.url?(this.options.url=n.url,this.load(n.coordinates,function(){s.texture=null}),this):this},o.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new l.Event("data",{dataType:"source",sourceDataType:"metadata"})))},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setCoordinates=function(n){var s=this;this.coordinates=n;var p=n.map(l.MercatorCoordinate.fromLngLat);this.tileID=function(y){for(var g=1/0,w=1/0,A=-1/0,B=-1/0,L=0,R=y;L<R.length;L+=1){var Z=R[L];g=Math.min(g,Z.x),w=Math.min(w,Z.y),A=Math.max(A,Z.x),B=Math.max(B,Z.y)}var j=Math.max(A-g,B-w),K=Math.max(0,Math.floor(-Math.log(j)/Math.LN2)),U=Math.pow(2,K);return new l.CanonicalTileID(K,Math.floor((g+A)/2*U),Math.floor((w+B)/2*U))}(p),this.minzoom=this.maxzoom=this.tileID.z;var m=p.map(function(y){return s.tileID.getTilePoint(y)._round()});return this._boundsArray=new l.StructArrayLayout4i8,this._boundsArray.emplaceBack(m[0].x,m[0].y,0,0),this._boundsArray.emplaceBack(m[1].x,m[1].y,l.EXTENT,0),this._boundsArray.emplaceBack(m[3].x,m[3].y,0,l.EXTENT),this._boundsArray.emplaceBack(m[2].x,m[2].y,l.EXTENT,l.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new l.Event("data",{dataType:"source",sourceDataType:"content"})),this},o.prototype.prepare=function(){if(Object.keys(this.tiles).length!==0&&this.image){var n=this.map.painter.context,s=n.gl;for(var p in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Oi.members)),this.boundsSegments||(this.boundsSegments=l.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new l.Texture(n,this.image,s.RGBA),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE)),this.tiles){var m=this.tiles[p];m.state!=="loaded"&&(m.state="loaded",m.texture=this.texture)}}},o.prototype.loadTile=function(n,s){this.tileID&&this.tileID.equals(n.tileID.canonical)?(this.tiles[String(n.tileID.wrap)]=n,n.buckets={},s(null)):(n.state="errored",s(null))},o.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},o.prototype.hasTransition=function(){return!1},o}(l.Evented),Hn=function(i){function o(n,s,p,m){i.call(this,n,s,p,m),this.roundZoom=!0,this.type="video",this.options=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1;var s=this.options;this.urls=[];for(var p=0,m=s.urls;p<m.length;p+=1)this.urls.push(this.map._requestManager.transformRequest(m[p],l.ResourceType.Source).url);l.getVideo(this.urls,function(y,g){n._loaded=!0,y?n.fire(new l.ErrorEvent(y)):g&&(n.video=g,n.video.loop=!0,n.video.setAttribute("playsinline",""),n.video.addEventListener("playing",function(){n.map.triggerRepaint()}),n.map&&n.video.play(),n._finishLoading())})},o.prototype.pause=function(){this.video&&this.video.pause()},o.prototype.play=function(){this.video&&this.video.play()},o.prototype.seek=function(n){if(this.video){var s=this.video.seekable;n<s.start(0)||n>s.end(0)?this.fire(new l.ErrorEvent(new l.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+s.start(0)+" and "+s.end(0)+"-second mark."))):this.video.currentTime=n}},o.prototype.getVideo=function(){return this.video},o.prototype.onAdd=function(n){this.map||(this.map=n,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},o.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var n=this.map.painter.context,s=n.gl;for(var p in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Oi.members)),this.boundsSegments||(this.boundsSegments=l.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE),s.texSubImage2D(s.TEXTURE_2D,0,0,0,s.RGBA,s.UNSIGNED_BYTE,this.video)):(this.texture=new l.Texture(n,this.video,s.RGBA),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE)),this.tiles){var m=this.tiles[p];m.state!=="loaded"&&(m.state="loaded",m.texture=this.texture)}}},o.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},o.prototype.hasTransition=function(){return this.video&&!this.video.paused},o}(Ki),Xn=function(i){function o(n,s,p,m){i.call(this,n,s,p,m),s.coordinates?Array.isArray(s.coordinates)&&s.coordinates.length===4&&!s.coordinates.some(function(y){return!Array.isArray(y)||y.length!==2||y.some(function(g){return typeof g!="number"})})||this.fire(new l.ErrorEvent(new l.ValidationError("sources."+n,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new l.ErrorEvent(new l.ValidationError("sources."+n,null,'missing required property "coordinates"'))),s.animate&&typeof s.animate!="boolean"&&this.fire(new l.ErrorEvent(new l.ValidationError("sources."+n,null,'optional "animate" property must be a boolean value'))),s.canvas?typeof s.canvas=="string"||s.canvas instanceof l.window.HTMLCanvasElement||this.fire(new l.ErrorEvent(new l.ValidationError("sources."+n,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new l.ErrorEvent(new l.ValidationError("sources."+n,null,'missing required property "canvas"'))),this.options=s,this.animate=s.animate===void 0||s.animate}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof l.window.HTMLCanvasElement?this.options.canvas:l.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new l.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},o.prototype.getCanvas=function(){return this.canvas},o.prototype.onAdd=function(n){this.map=n,this.load(),this.canvas&&this.animate&&this.play()},o.prototype.onRemove=function(){this.pause()},o.prototype.prepare=function(){var n=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,n=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,n=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var s=this.map.painter.context,p=s.gl;for(var m in this.boundsBuffer||(this.boundsBuffer=s.createVertexBuffer(this._boundsArray,Oi.members)),this.boundsSegments||(this.boundsSegments=l.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(n||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new l.Texture(s,this.canvas,p.RGBA,{premultiply:!0}),this.tiles){var y=this.tiles[m];y.state!=="loaded"&&(y.state="loaded",y.texture=this.texture)}}},o.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},o.prototype.hasTransition=function(){return this._playing},o.prototype._hasInvalidDimensions=function(){for(var n=0,s=[this.canvas.width,this.canvas.height];n<s.length;n+=1){var p=s[n];if(isNaN(p)||p<=0)return!0}return!1},o}(Ki),bn={vector:Do,raster:Lo,"raster-dem":ns,geojson:xn,video:Hn,image:Ki,canvas:Xn};function _l(i,o){var n=l.identity([]);return l.translate(n,n,[1,1,0]),l.scale(n,n,[.5*i.width,.5*i.height,1]),l.multiply(n,n,i.calculatePosMatrix(o.toUnwrapped()))}function jr(i,o,n,s,p,m){var y=function(K,U,X){if(K)for(var Q=0,ie=K;Q<ie.length;Q+=1){var ce=U[ie[Q]];if(ce&&ce.source===X&&ce.type==="fill-extrusion")return!0}else for(var le in U){var he=U[le];if(he.source===X&&he.type==="fill-extrusion")return!0}return!1}(p&&p.layers,o,i.id),g=m.maxPitchScaleFactor(),w=i.tilesIn(s,g,y);w.sort(ln);for(var A=[],B=0,L=w;B<L.length;B+=1){var R=L[B];A.push({wrappedTileID:R.tileID.wrapped().key,queryResults:R.tile.queryRenderedFeatures(o,n,i._state,R.queryGeometry,R.cameraQueryGeometry,R.scale,p,m,g,_l(i.transform,R.tileID))})}var Z=function(K){for(var U={},X={},Q=0,ie=K;Q<ie.length;Q+=1){var ce=ie[Q],le=ce.queryResults,he=ce.wrappedTileID,ge=X[he]=X[he]||{};for(var Te in le)for(var Se=le[Te],Le=ge[Te]=ge[Te]||{},Ge=U[Te]=U[Te]||[],Ke=0,He=Se;Ke<He.length;Ke+=1){var bt=He[Ke];Le[bt.featureIndex]||(Le[bt.featureIndex]=!0,Ge.push(bt))}}return U}(A);for(var j in Z)Z[j].forEach(function(K){var U=K.feature,X=i.getFeatureState(U.layer["source-layer"],U.id);U.source=U.layer.source,U.layer["source-layer"]&&(U.sourceLayer=U.layer["source-layer"]),U.state=X});return Z}function ln(i,o){var n=i.tileID,s=o.tileID;return n.overscaledZ-s.overscaledZ||n.canonical.y-s.canonical.y||n.wrap-s.wrap||n.canonical.x-s.canonical.x}var Ot=function(i,o){this.max=i,this.onRemove=o,this.reset()};Ot.prototype.reset=function(){for(var i in this.data)for(var o=0,n=this.data[i];o<n.length;o+=1){var s=n[o];s.timeout&&clearTimeout(s.timeout),this.onRemove(s.value)}return this.data={},this.order=[],this},Ot.prototype.add=function(i,o,n){var s=this,p=i.wrapped().key;this.data[p]===void 0&&(this.data[p]=[]);var m={value:o,timeout:void 0};if(n!==void 0&&(m.timeout=setTimeout(function(){s.remove(i,m)},n)),this.data[p].push(m),this.order.push(p),this.order.length>this.max){var y=this._getAndRemoveByKey(this.order[0]);y&&this.onRemove(y)}return this},Ot.prototype.has=function(i){return i.wrapped().key in this.data},Ot.prototype.getAndRemove=function(i){return this.has(i)?this._getAndRemoveByKey(i.wrapped().key):null},Ot.prototype._getAndRemoveByKey=function(i){var o=this.data[i].shift();return o.timeout&&clearTimeout(o.timeout),this.data[i].length===0&&delete this.data[i],this.order.splice(this.order.indexOf(i),1),o.value},Ot.prototype.getByKey=function(i){var o=this.data[i];return o?o[0].value:null},Ot.prototype.get=function(i){return this.has(i)?this.data[i.wrapped().key][0].value:null},Ot.prototype.remove=function(i,o){if(!this.has(i))return this;var n=i.wrapped().key,s=o===void 0?0:this.data[n].indexOf(o),p=this.data[n][s];return this.data[n].splice(s,1),p.timeout&&clearTimeout(p.timeout),this.data[n].length===0&&delete this.data[n],this.onRemove(p.value),this.order.splice(this.order.indexOf(n),1),this},Ot.prototype.setMaxSize=function(i){for(this.max=i;this.order.length>this.max;){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},Ot.prototype.filter=function(i){var o=[];for(var n in this.data)for(var s=0,p=this.data[n];s<p.length;s+=1){var m=p[s];i(m.value)||o.push(m)}for(var y=0,g=o;y<g.length;y+=1){var w=g[y];this.remove(w.value.tileID,w)}};var Ji=function(i,o,n){this.context=i;var s=i.gl;this.buffer=s.createBuffer(),this.dynamicDraw=!!n,this.context.unbindVAO(),i.bindElementBuffer.set(this.buffer),s.bufferData(s.ELEMENT_ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?s.DYNAMIC_DRAW:s.STATIC_DRAW),this.dynamicDraw||delete o.arrayBuffer};Ji.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Ji.prototype.updateData=function(i){var o=this.context.gl;this.context.unbindVAO(),this.bind(),o.bufferSubData(o.ELEMENT_ARRAY_BUFFER,0,i.arrayBuffer)},Ji.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var Ro={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},Vi=function(i,o,n,s){this.length=o.length,this.attributes=n,this.itemSize=o.bytesPerElement,this.dynamicDraw=s,this.context=i;var p=i.gl;this.buffer=p.createBuffer(),i.bindVertexBuffer.set(this.buffer),p.bufferData(p.ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?p.DYNAMIC_DRAW:p.STATIC_DRAW),this.dynamicDraw||delete o.arrayBuffer};Vi.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},Vi.prototype.updateData=function(i){var o=this.context.gl;this.bind(),o.bufferSubData(o.ARRAY_BUFFER,0,i.arrayBuffer)},Vi.prototype.enableAttributes=function(i,o){for(var n=0;n<this.attributes.length;n++){var s=o.attributes[this.attributes[n].name];s!==void 0&&i.enableVertexAttribArray(s)}},Vi.prototype.setVertexAttribPointers=function(i,o,n){for(var s=0;s<this.attributes.length;s++){var p=this.attributes[s],m=o.attributes[p.name];m!==void 0&&i.vertexAttribPointer(m,p.components,i[Ro[p.type]],!1,this.itemSize,p.offset+this.itemSize*(n||0))}},Vi.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var yt=function(i){this.gl=i.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};yt.prototype.get=function(){return this.current},yt.prototype.set=function(i){},yt.prototype.getDefault=function(){return this.default},yt.prototype.setDefault=function(){this.set(this.default)};var wn=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return l.Color.transparent},o.prototype.set=function(n){var s=this.current;(n.r!==s.r||n.g!==s.g||n.b!==s.b||n.a!==s.a||this.dirty)&&(this.gl.clearColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)},o}(yt),ti=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 1},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.clearDepth(n),this.current=n,this.dirty=!1)},o}(yt),Ti=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.clearStencil(n),this.current=n,this.dirty=!1)},o}(yt),xl=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return[!0,!0,!0,!0]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||n[3]!==s[3]||this.dirty)&&(this.gl.colorMask(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)},o}(yt),Ui=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.depthMask(n),this.current=n,this.dirty=!1)},o}(yt),pa=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 255},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.stencilMask(n),this.current=n,this.dirty=!1)},o}(yt),Ii=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},o.prototype.set=function(n){var s=this.current;(n.func!==s.func||n.ref!==s.ref||n.mask!==s.mask||this.dirty)&&(this.gl.stencilFunc(n.func,n.ref,n.mask),this.current=n,this.dirty=!1)},o}(yt),Kn=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[n.KEEP,n.KEEP,n.KEEP]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||this.dirty)&&(this.gl.stencilOp(n[0],n[1],n[2]),this.current=n,this.dirty=!1)},o}(yt),Fo=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.STENCIL_TEST):s.disable(s.STENCIL_TEST),this.current=n,this.dirty=!1}},o}(yt),Ai=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return[0,1]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||this.dirty)&&(this.gl.depthRange(n[0],n[1]),this.current=n,this.dirty=!1)},o}(yt),Ei=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.DEPTH_TEST):s.disable(s.DEPTH_TEST),this.current=n,this.dirty=!1}},o}(yt),Jn=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.LESS},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.depthFunc(n),this.current=n,this.dirty=!1)},o}(yt),Ni=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.BLEND):s.disable(s.BLEND),this.current=n,this.dirty=!1}},o}(yt),os=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[n.ONE,n.ZERO]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||this.dirty)&&(this.gl.blendFunc(n[0],n[1]),this.current=n,this.dirty=!1)},o}(yt),as=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return l.Color.transparent},o.prototype.set=function(n){var s=this.current;(n.r!==s.r||n.g!==s.g||n.b!==s.b||n.a!==s.a||this.dirty)&&(this.gl.blendColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)},o}(yt),ha=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.FUNC_ADD},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.blendEquation(n),this.current=n,this.dirty=!1)},o}(yt),fa=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.CULL_FACE):s.disable(s.CULL_FACE),this.current=n,this.dirty=!1}},o}(yt),Oo=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.BACK},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.cullFace(n),this.current=n,this.dirty=!1)},o}(yt),ss=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.CCW},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.frontFace(n),this.current=n,this.dirty=!1)},o}(yt),Vo=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.useProgram(n),this.current=n,this.dirty=!1)},o}(yt),da=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.TEXTURE0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.activeTexture(n),this.current=n,this.dirty=!1)},o}(yt),Yn=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[0,0,n.drawingBufferWidth,n.drawingBufferHeight]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||n[3]!==s[3]||this.dirty)&&(this.gl.viewport(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)},o}(yt),ma=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindFramebuffer(s.FRAMEBUFFER,n),this.current=n,this.dirty=!1}},o}(yt),ya=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindRenderbuffer(s.RENDERBUFFER,n),this.current=n,this.dirty=!1}},o}(yt),ls=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindTexture(s.TEXTURE_2D,n),this.current=n,this.dirty=!1}},o}(yt),us=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindBuffer(s.ARRAY_BUFFER,n),this.current=n,this.dirty=!1}},o}(yt),Qn=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){var s=this.gl;s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,n),this.current=n,this.dirty=!1},o}(yt),un=function(i){function o(n){i.call(this,n),this.vao=n.extVertexArrayObject}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){this.vao&&(n!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(n),this.current=n,this.dirty=!1)},o}(yt),cn=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 4},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_ALIGNMENT,n),this.current=n,this.dirty=!1}},o}(yt),Uo=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n),this.current=n,this.dirty=!1}},o}(yt),va=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,n),this.current=n,this.dirty=!1}},o}(yt),or=function(i){function o(n,s){i.call(this,n),this.context=n,this.parent=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o}(yt),I=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.setDirty=function(){this.dirty=!0},o.prototype.set=function(n){if(n!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var s=this.gl;s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,n,0),this.current=n,this.dirty=!1}},o}(or),P=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.set=function(n){if(n!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var s=this.gl;s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,n),this.current=n,this.dirty=!1}},o}(or),M=function(i,o,n,s){this.context=i,this.width=o,this.height=n;var p=this.framebuffer=i.gl.createFramebuffer();this.colorAttachment=new I(i,p),s&&(this.depthAttachment=new P(i,p))};M.prototype.destroy=function(){var i=this.context.gl,o=this.colorAttachment.get();if(o&&i.deleteTexture(o),this.depthAttachment){var n=this.depthAttachment.get();n&&i.deleteRenderbuffer(n)}i.deleteFramebuffer(this.framebuffer)};var O=function(i,o,n){this.func=i,this.mask=o,this.range=n};O.ReadOnly=!1,O.ReadWrite=!0,O.disabled=new O(519,O.ReadOnly,[0,1]);var q=function(i,o,n,s,p,m){this.test=i,this.ref=o,this.mask=n,this.fail=s,this.depthFail=p,this.pass=m};q.disabled=new q({func:519,mask:0},0,0,7680,7680,7680);var Y=function(i,o,n){this.blendFunction=i,this.blendColor=o,this.mask=n};Y.disabled=new Y(Y.Replace=[1,0],l.Color.transparent,[!1,!1,!1,!1]),Y.unblended=new Y(Y.Replace,l.Color.transparent,[!0,!0,!0,!0]),Y.alphaBlended=new Y([1,771],l.Color.transparent,[!0,!0,!0,!0]);var ee=function(i,o,n){this.enable=i,this.mode=o,this.frontFace=n};ee.disabled=new ee(!1,1029,2305),ee.backCCW=new ee(!0,1029,2305);var D=function(i){this.gl=i,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new wn(this),this.clearDepth=new ti(this),this.clearStencil=new Ti(this),this.colorMask=new xl(this),this.depthMask=new Ui(this),this.stencilMask=new pa(this),this.stencilFunc=new Ii(this),this.stencilOp=new Kn(this),this.stencilTest=new Fo(this),this.depthRange=new Ai(this),this.depthTest=new Ei(this),this.depthFunc=new Jn(this),this.blend=new Ni(this),this.blendFunc=new os(this),this.blendColor=new as(this),this.blendEquation=new ha(this),this.cullFace=new fa(this),this.cullFaceSide=new Oo(this),this.frontFace=new ss(this),this.program=new Vo(this),this.activeTexture=new da(this),this.viewport=new Yn(this),this.bindFramebuffer=new ma(this),this.bindRenderbuffer=new ya(this),this.bindTexture=new ls(this),this.bindVertexBuffer=new us(this),this.bindElementBuffer=new Qn(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new un(this),this.pixelStoreUnpack=new cn(this),this.pixelStoreUnpackPremultiplyAlpha=new Uo(this),this.pixelStoreUnpackFlipY=new va(this),this.extTextureFilterAnisotropic=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=i.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=i.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(i.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=i.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=i.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE)};D.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},D.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},D.prototype.createIndexBuffer=function(i,o){return new Ji(this,i,o)},D.prototype.createVertexBuffer=function(i,o,n){return new Vi(this,i,o,n)},D.prototype.createRenderbuffer=function(i,o,n){var s=this.gl,p=s.createRenderbuffer();return this.bindRenderbuffer.set(p),s.renderbufferStorage(s.RENDERBUFFER,i,o,n),this.bindRenderbuffer.set(null),p},D.prototype.createFramebuffer=function(i,o,n){return new M(this,i,o,n)},D.prototype.clear=function(i){var o=i.color,n=i.depth,s=this.gl,p=0;o&&(p|=s.COLOR_BUFFER_BIT,this.clearColor.set(o),this.colorMask.set([!0,!0,!0,!0])),n!==void 0&&(p|=s.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),s.clear(p)},D.prototype.setCullFace=function(i){i.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(i.mode),this.frontFace.set(i.frontFace))},D.prototype.setDepthMode=function(i){i.func!==this.gl.ALWAYS||i.mask?(this.depthTest.set(!0),this.depthFunc.set(i.func),this.depthMask.set(i.mask),this.depthRange.set(i.range)):this.depthTest.set(!1)},D.prototype.setStencilMode=function(i){i.test.func!==this.gl.ALWAYS||i.mask?(this.stencilTest.set(!0),this.stencilMask.set(i.mask),this.stencilOp.set([i.fail,i.depthFail,i.pass]),this.stencilFunc.set({func:i.test.func,ref:i.ref,mask:i.test.mask})):this.stencilTest.set(!1)},D.prototype.setColorMode=function(i){l.deepEqual(i.blendFunction,Y.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(i.blendFunction),this.blendColor.set(i.blendColor)),this.colorMask.set(i.mask)},D.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var W=function(i){function o(n,s,p){var m=this;i.call(this),this.id=n,this.dispatcher=p,this.on("data",function(y){y.dataType==="source"&&y.sourceDataType==="metadata"&&(m._sourceLoaded=!0),m._sourceLoaded&&!m._paused&&y.dataType==="source"&&y.sourceDataType==="content"&&(m.reload(),m.transform&&m.update(m.transform))}),this.on("error",function(){m._sourceErrored=!0}),this._source=function(y,g,w,A){var B=new bn[g.type](y,g,w,A);if(B.id!==y)throw new Error("Expected Source id to be "+y+" instead of "+B.id);return l.bindAll(["load","abort","unload","serialize","prepare"],B),B}(n,s,p,this),this._tiles={},this._cache=new Ot(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new l.SourceFeatureState}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.onAdd=function(n){this.map=n,this._maxTileCacheSize=n?n._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(n)},o.prototype.onRemove=function(n){this._source&&this._source.onRemove&&this._source.onRemove(n)},o.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(var n in this._tiles){var s=this._tiles[n];if(s.state!=="loaded"&&s.state!=="errored")return!1}return!0},o.prototype.getSource=function(){return this._source},o.prototype.pause=function(){this._paused=!0},o.prototype.resume=function(){if(this._paused){var n=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,n&&this.reload(),this.transform&&this.update(this.transform)}},o.prototype._loadTile=function(n,s){return this._source.loadTile(n,s)},o.prototype._unloadTile=function(n){if(this._source.unloadTile)return this._source.unloadTile(n,function(){})},o.prototype._abortTile=function(n){if(this._source.abortTile)return this._source.abortTile(n,function(){})},o.prototype.serialize=function(){return this._source.serialize()},o.prototype.prepare=function(n){for(var s in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var p=this._tiles[s];p.upload(n),p.prepare(this.map.style.imageManager)}},o.prototype.getIds=function(){return l.values(this._tiles).map(function(n){return n.tileID}).sort(ne).map(function(n){return n.key})},o.prototype.getRenderableIds=function(n){var s=this,p=[];for(var m in this._tiles)this._isIdRenderable(m,n)&&p.push(this._tiles[m]);return n?p.sort(function(y,g){var w=y.tileID,A=g.tileID,B=new l.Point(w.canonical.x,w.canonical.y)._rotate(s.transform.angle),L=new l.Point(A.canonical.x,A.canonical.y)._rotate(s.transform.angle);return w.overscaledZ-A.overscaledZ||L.y-B.y||L.x-B.x}).map(function(y){return y.tileID.key}):p.map(function(y){return y.tileID}).sort(ne).map(function(y){return y.key})},o.prototype.hasRenderableParent=function(n){var s=this.findLoadedParent(n,0);return!!s&&this._isIdRenderable(s.tileID.key)},o.prototype._isIdRenderable=function(n,s){return this._tiles[n]&&this._tiles[n].hasData()&&!this._coveredTiles[n]&&(s||!this._tiles[n].holdingForFade())},o.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var n in this._cache.reset(),this._tiles)this._tiles[n].state!=="errored"&&this._reloadTile(n,"reloading")},o.prototype._reloadTile=function(n,s){var p=this._tiles[n];p&&(p.state!=="loading"&&(p.state=s),this._loadTile(p,this._tileLoaded.bind(this,p,n,s)))},o.prototype._tileLoaded=function(n,s,p,m){if(m)return n.state="errored",void(m.status!==404?this._source.fire(new l.ErrorEvent(m,{tile:n})):this.update(this.transform));n.timeAdded=l.browser.now(),p==="expired"&&(n.refreshedUponExpiration=!0),this._setTileReloadTimer(s,n),this.getSource().type==="raster-dem"&&n.dem&&this._backfillDEM(n),this._state.initializeTileState(n,this.map?this.map.painter:null),this._source.fire(new l.Event("data",{dataType:"source",tile:n,coord:n.tileID}))},o.prototype._backfillDEM=function(n){for(var s=this.getRenderableIds(),p=0;p<s.length;p++){var m=s[p];if(n.neighboringTiles&&n.neighboringTiles[m]){var y=this.getTileByID(m);g(n,y),g(y,n)}}function g(w,A){w.needsHillshadePrepare=!0;var B=A.tileID.canonical.x-w.tileID.canonical.x,L=A.tileID.canonical.y-w.tileID.canonical.y,R=Math.pow(2,w.tileID.canonical.z),Z=A.tileID.key;B===0&&L===0||Math.abs(L)>1||(Math.abs(B)>1&&(Math.abs(B+R)===1?B+=R:Math.abs(B-R)===1&&(B-=R)),A.dem&&w.dem&&(w.dem.backfillBorder(A.dem,B,L),w.neighboringTiles&&w.neighboringTiles[Z]&&(w.neighboringTiles[Z].backfilled=!0)))}},o.prototype.getTile=function(n){return this.getTileByID(n.key)},o.prototype.getTileByID=function(n){return this._tiles[n]},o.prototype._retainLoadedChildren=function(n,s,p,m){for(var y in this._tiles){var g=this._tiles[y];if(!(m[y]||!g.hasData()||g.tileID.overscaledZ<=s||g.tileID.overscaledZ>p)){for(var w=g.tileID;g&&g.tileID.overscaledZ>s+1;){var A=g.tileID.scaledTo(g.tileID.overscaledZ-1);(g=this._tiles[A.key])&&g.hasData()&&(w=A)}for(var B=w;B.overscaledZ>s;)if(n[(B=B.scaledTo(B.overscaledZ-1)).key]){m[w.key]=w;break}}}},o.prototype.findLoadedParent=function(n,s){if(n.key in this._loadedParentTiles){var p=this._loadedParentTiles[n.key];return p&&p.tileID.overscaledZ>=s?p:null}for(var m=n.overscaledZ-1;m>=s;m--){var y=n.scaledTo(m),g=this._getLoadedTile(y);if(g)return g}},o.prototype._getLoadedTile=function(n){var s=this._tiles[n.key];return s&&s.hasData()?s:this._cache.getByKey(n.wrapped().key)},o.prototype.updateCacheSize=function(n){var s=Math.ceil(n.width/this._source.tileSize)+1,p=Math.ceil(n.height/this._source.tileSize)+1,m=Math.floor(s*p*5),y=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,m):m;this._cache.setMaxSize(y)},o.prototype.handleWrapJump=function(n){var s=Math.round((n-(this._prevLng===void 0?n:this._prevLng))/360);if(this._prevLng=n,s){var p={};for(var m in this._tiles){var y=this._tiles[m];y.tileID=y.tileID.unwrapTo(y.tileID.wrap+s),p[y.tileID.key]=y}for(var g in this._tiles=p,this._timers)clearTimeout(this._timers[g]),delete this._timers[g];for(var w in this._tiles)this._setTileReloadTimer(w,this._tiles[w])}},o.prototype.update=function(n){var s=this;if(this.transform=n,this._sourceLoaded&&!this._paused){var p;this.updateCacheSize(n),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?p=n.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(ge){return new l.OverscaledTileID(ge.canonical.z,ge.wrap,ge.canonical.z,ge.canonical.x,ge.canonical.y)}):(p=n.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(p=p.filter(function(ge){return s._source.hasTile(ge)}))):p=[];var m=n.coveringZoomLevel(this._source),y=Math.max(m-o.maxOverzooming,this._source.minzoom),g=Math.max(m+o.maxUnderzooming,this._source.minzoom),w=this._updateRetainedTiles(p,m);if(_e(this._source.type)){for(var A={},B={},L=0,R=Object.keys(w);L<R.length;L+=1){var Z=R[L],j=w[Z],K=this._tiles[Z];if(K&&!(K.fadeEndTime&&K.fadeEndTime<=l.browser.now())){var U=this.findLoadedParent(j,y);U&&(this._addTile(U.tileID),A[U.tileID.key]=U.tileID),B[Z]=j}}for(var X in this._retainLoadedChildren(B,m,g,w),A)w[X]||(this._coveredTiles[X]=!0,w[X]=A[X])}for(var Q in w)this._tiles[Q].clearFadeHold();for(var ie=0,ce=l.keysDifference(this._tiles,w);ie<ce.length;ie+=1){var le=ce[ie],he=this._tiles[le];he.hasSymbolBuckets&&!he.holdingForFade()?he.setHoldDuration(this.map._fadeDuration):he.hasSymbolBuckets&&!he.symbolFadeFinished()||this._removeTile(le)}this._updateLoadedParentTileCache()}},o.prototype.releaseSymbolFadeTiles=function(){for(var n in this._tiles)this._tiles[n].holdingForFade()&&this._removeTile(n)},o.prototype._updateRetainedTiles=function(n,s){for(var p={},m={},y=Math.max(s-o.maxOverzooming,this._source.minzoom),g=Math.max(s+o.maxUnderzooming,this._source.minzoom),w={},A=0,B=n;A<B.length;A+=1){var L=B[A],R=this._addTile(L);p[L.key]=L,R.hasData()||s<this._source.maxzoom&&(w[L.key]=L)}this._retainLoadedChildren(w,s,g,p);for(var Z=0,j=n;Z<j.length;Z+=1){var K=j[Z],U=this._tiles[K.key];if(!U.hasData()){if(s+1>this._source.maxzoom){var X=K.children(this._source.maxzoom)[0],Q=this.getTile(X);if(Q&&Q.hasData()){p[X.key]=X;continue}}else{var ie=K.children(this._source.maxzoom);if(p[ie[0].key]&&p[ie[1].key]&&p[ie[2].key]&&p[ie[3].key])continue}for(var ce=U.wasRequested(),le=K.overscaledZ-1;le>=y;--le){var he=K.scaledTo(le);if(m[he.key]||(m[he.key]=!0,!(U=this.getTile(he))&&ce&&(U=this._addTile(he)),U&&(p[he.key]=he,ce=U.wasRequested(),U.hasData())))break}}}return p},o.prototype._updateLoadedParentTileCache=function(){for(var n in this._loadedParentTiles={},this._tiles){for(var s=[],p=void 0,m=this._tiles[n].tileID;m.overscaledZ>0;){if(m.key in this._loadedParentTiles){p=this._loadedParentTiles[m.key];break}s.push(m.key);var y=m.scaledTo(m.overscaledZ-1);if(p=this._getLoadedTile(y))break;m=y}for(var g=0,w=s;g<w.length;g+=1)this._loadedParentTiles[w[g]]=p}},o.prototype._addTile=function(n){var s=this._tiles[n.key];if(s)return s;(s=this._cache.getAndRemove(n))&&(this._setTileReloadTimer(n.key,s),s.tileID=n,this._state.initializeTileState(s,this.map?this.map.painter:null),this._cacheTimers[n.key]&&(clearTimeout(this._cacheTimers[n.key]),delete this._cacheTimers[n.key],this._setTileReloadTimer(n.key,s)));var p=!!s;return p||(s=new l.Tile(n,this._source.tileSize*n.overscaleFactor()),this._loadTile(s,this._tileLoaded.bind(this,s,n.key,s.state))),s?(s.uses++,this._tiles[n.key]=s,p||this._source.fire(new l.Event("dataloading",{tile:s,coord:s.tileID,dataType:"source"})),s):null},o.prototype._setTileReloadTimer=function(n,s){var p=this;n in this._timers&&(clearTimeout(this._timers[n]),delete this._timers[n]);var m=s.getExpiryTimeout();m&&(this._timers[n]=setTimeout(function(){p._reloadTile(n,"expired"),delete p._timers[n]},m))},o.prototype._removeTile=function(n){var s=this._tiles[n];s&&(s.uses--,delete this._tiles[n],this._timers[n]&&(clearTimeout(this._timers[n]),delete this._timers[n]),s.uses>0||(s.hasData()&&s.state!=="reloading"?this._cache.add(s.tileID,s,s.getExpiryTimeout()):(s.aborted=!0,this._abortTile(s),this._unloadTile(s))))},o.prototype.clearTiles=function(){for(var n in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(n);this._cache.reset()},o.prototype.tilesIn=function(n,s,p){var m=this,y=[],g=this.transform;if(!g)return y;for(var w=p?g.getCameraQueryGeometry(n):n,A=n.map(function(le){return g.pointCoordinate(le)}),B=w.map(function(le){return g.pointCoordinate(le)}),L=this.getIds(),R=1/0,Z=1/0,j=-1/0,K=-1/0,U=0,X=B;U<X.length;U+=1){var Q=X[U];R=Math.min(R,Q.x),Z=Math.min(Z,Q.y),j=Math.max(j,Q.x),K=Math.max(K,Q.y)}for(var ie=function(le){var he=m._tiles[L[le]];if(!he.holdingForFade()){var ge=he.tileID,Te=Math.pow(2,g.zoom-he.tileID.overscaledZ),Se=s*he.queryPadding*l.EXTENT/he.tileSize/Te,Le=[ge.getTilePoint(new l.MercatorCoordinate(R,Z)),ge.getTilePoint(new l.MercatorCoordinate(j,K))];if(Le[0].x-Se<l.EXTENT&&Le[0].y-Se<l.EXTENT&&Le[1].x+Se>=0&&Le[1].y+Se>=0){var Ge=A.map(function(He){return ge.getTilePoint(He)}),Ke=B.map(function(He){return ge.getTilePoint(He)});y.push({tile:he,tileID:ge,queryGeometry:Ge,cameraQueryGeometry:Ke,scale:Te})}}},ce=0;ce<L.length;ce++)ie(ce);return y},o.prototype.getVisibleCoordinates=function(n){for(var s=this,p=this.getRenderableIds(n).map(function(w){return s._tiles[w].tileID}),m=0,y=p;m<y.length;m+=1){var g=y[m];g.posMatrix=this.transform.calculatePosMatrix(g.toUnwrapped())}return p},o.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(_e(this._source.type))for(var n in this._tiles){var s=this._tiles[n];if(s.fadeEndTime!==void 0&&s.fadeEndTime>=l.browser.now())return!0}return!1},o.prototype.setFeatureState=function(n,s,p){this._state.updateState(n=n||"_geojsonTileLayer",s,p)},o.prototype.removeFeatureState=function(n,s,p){this._state.removeFeatureState(n=n||"_geojsonTileLayer",s,p)},o.prototype.getFeatureState=function(n,s){return this._state.getState(n=n||"_geojsonTileLayer",s)},o.prototype.setDependencies=function(n,s,p){var m=this._tiles[n];m&&m.setDependencies(s,p)},o.prototype.reloadTilesForDependencies=function(n,s){for(var p in this._tiles)this._tiles[p].hasDependency(n,s)&&this._reloadTile(p,"reloading");this._cache.filter(function(m){return!m.hasDependency(n,s)})},o}(l.Evented);function ne(i,o){var n=Math.abs(2*i.wrap)-+(i.wrap<0),s=Math.abs(2*o.wrap)-+(o.wrap<0);return i.overscaledZ-o.overscaledZ||s-n||o.canonical.y-i.canonical.y||o.canonical.x-i.canonical.x}function _e(i){return i==="raster"||i==="image"||i==="video"}function be(){return new l.window.Worker(Cs.workerUrl)}W.maxOverzooming=10,W.maxUnderzooming=3;var fe="mapboxgl_preloaded_worker_pool",xe=function(){this.active={}};xe.prototype.acquire=function(i){if(!this.workers)for(this.workers=[];this.workers.length<xe.workerCount;)this.workers.push(new be);return this.active[i]=!0,this.workers.slice()},xe.prototype.release=function(i){delete this.active[i],this.numActive()===0&&(this.workers.forEach(function(o){o.terminate()}),this.workers=null)},xe.prototype.isPreloaded=function(){return!!this.active[fe]},xe.prototype.numActive=function(){return Object.keys(this.active).length};var Ve,Fe=Math.floor(l.browser.hardwareConcurrency/2);function de(){return Ve||(Ve=new xe),Ve}function De(i,o){var n={};for(var s in i)s!=="ref"&&(n[s]=i[s]);return l.refProperties.forEach(function(p){p in o&&(n[p]=o[p])}),n}function Ae(i){i=i.slice();for(var o=Object.create(null),n=0;n<i.length;n++)o[i[n].id]=i[n];for(var s=0;s<i.length;s++)"ref"in i[s]&&(i[s]=De(i[s],o[i[s].ref]));return i}xe.workerCount=Math.max(Math.min(Fe,6),1);var Pe={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function ut(i,o,n){n.push({command:Pe.addSource,args:[i,o[i]]})}function ze(i,o,n){o.push({command:Pe.removeSource,args:[i]}),n[i]=!0}function vt(i,o,n,s){ze(i,n,s),ut(i,o,n)}function Vt(i,o,n){var s;for(s in i[n])if(i[n].hasOwnProperty(s)&&s!=="data"&&!l.deepEqual(i[n][s],o[n][s]))return!1;for(s in o[n])if(o[n].hasOwnProperty(s)&&s!=="data"&&!l.deepEqual(i[n][s],o[n][s]))return!1;return!0}function pt(i,o,n,s,p,m){var y;for(y in o=o||{},i=i||{})i.hasOwnProperty(y)&&(l.deepEqual(i[y],o[y])||n.push({command:m,args:[s,y,o[y],p]}));for(y in o)o.hasOwnProperty(y)&&!i.hasOwnProperty(y)&&(l.deepEqual(i[y],o[y])||n.push({command:m,args:[s,y,o[y],p]}))}function Et(i){return i.id}function _t(i,o){return i[o.id]=o,i}var qr=function(i,o){this.reset(i,o)};qr.prototype.reset=function(i,o){this.points=i||[],this._distances=[0];for(var n=1;n<this.points.length;n++)this._distances[n]=this._distances[n-1]+this.points[n].dist(this.points[n-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(o||0,.5*this.length),this.paddedLength=this.length-2*this.padding},qr.prototype.lerp=function(i){if(this.points.length===1)return this.points[0];i=l.clamp(i,0,1);for(var o=1,n=this._distances[o],s=i*this.paddedLength+this.padding;n<s&&o<this._distances.length;)n=this._distances[++o];var p=o-1,m=this._distances[p],y=n-m,g=y>0?(s-m)/y:0;return this.points[p].mult(1-g).add(this.points[o].mult(g))};var Mt=function(i,o,n){var s=this.boxCells=[],p=this.circleCells=[];this.xCellCount=Math.ceil(i/n),this.yCellCount=Math.ceil(o/n);for(var m=0;m<this.xCellCount*this.yCellCount;m++)s.push([]),p.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=i,this.height=o,this.xScale=this.xCellCount/i,this.yScale=this.yCellCount/o,this.boxUid=0,this.circleUid=0};function ar(i,o,n,s,p){var m=l.create();return o?(l.scale(m,m,[1/p,1/p,1]),n||l.rotateZ(m,m,s.angle)):l.multiply(m,s.labelPlaneMatrix,i),m}function Dt(i,o,n,s,p){if(o){var m=l.clone(i);return l.scale(m,m,[p,p,1]),n||l.rotateZ(m,m,-s.angle),m}return s.glCoordMatrix}function mt(i,o){var n=[i.x,i.y,0,1];kr(n,n,o);var s=n[3];return{point:new l.Point(n[0]/s,n[1]/s),signedDistanceFromCamera:s}}function Pt(i,o){return .5+i/o*.5}function ri(i,o){var n=i[0]/i[3],s=i[1]/i[3];return n>=-o[0]&&n<=o[0]&&s>=-o[1]&&s<=o[1]}function ga(i,o,n,s,p,m,y,g){var w=s?i.textSizeData:i.iconSizeData,A=l.evaluateSizeForZoom(w,n.transform.zoom),B=[256/n.width*2+1,256/n.height*2+1],L=s?i.text.dynamicLayoutVertexArray:i.icon.dynamicLayoutVertexArray;L.clear();for(var R=i.lineVertexArray,Z=s?i.text.placedSymbolArray:i.icon.placedSymbolArray,j=n.transform.width/n.transform.height,K=!1,U=0;U<Z.length;U++){var X=Z.get(U);if(X.hidden||X.writingMode===l.WritingMode.vertical&&!K)Gr(X.numGlyphs,L);else{K=!1;var Q=[X.anchorX,X.anchorY,0,1];if(l.transformMat4(Q,Q,o),ri(Q,B)){var ie=Pt(n.transform.cameraToCenterDistance,Q[3]),ce=l.evaluateSizeForFeature(w,A,X),le=y?ce/ie:ce*ie,he=new l.Point(X.anchorX,X.anchorY),ge=mt(he,p).point,Te={},Se=bl(X,le,!1,g,o,p,m,i.glyphOffsetArray,R,L,ge,he,Te,j);K=Se.useVertical,(Se.notEnoughRoom||K||Se.needsFlipping&&bl(X,le,!0,g,o,p,m,i.glyphOffsetArray,R,L,ge,he,Te,j).notEnoughRoom)&&Gr(X.numGlyphs,L)}else Gr(X.numGlyphs,L)}}s?i.text.dynamicLayoutVertexBuffer.updateData(L):i.icon.dynamicLayoutVertexBuffer.updateData(L)}function Cr(i,o,n,s,p,m,y,g,w,A,B){var L=g.glyphStartIndex+g.numGlyphs,R=g.lineStartIndex,Z=g.lineStartIndex+g.lineLength,j=o.getoffsetX(g.glyphStartIndex),K=o.getoffsetX(L-1),U=sr(i*j,n,s,p,m,y,g.segment,R,Z,w,A,B);if(!U)return null;var X=sr(i*K,n,s,p,m,y,g.segment,R,Z,w,A,B);return X?{first:U,last:X}:null}function ii(i,o,n,s){return i===l.WritingMode.horizontal&&Math.abs(n.y-o.y)>Math.abs(n.x-o.x)*s?{useVertical:!0}:(i===l.WritingMode.vertical?o.y<n.y:o.x>n.x)?{needsFlipping:!0}:null}function bl(i,o,n,s,p,m,y,g,w,A,B,L,R,Z){var j,K=o/24,U=i.lineOffsetX*K,X=i.lineOffsetY*K;if(i.numGlyphs>1){var Q=i.glyphStartIndex+i.numGlyphs,ie=i.lineStartIndex,ce=i.lineStartIndex+i.lineLength,le=Cr(K,g,U,X,n,B,L,i,w,m,R);if(!le)return{notEnoughRoom:!0};var he=mt(le.first.point,y).point,ge=mt(le.last.point,y).point;if(s&&!n){var Te=ii(i.writingMode,he,ge,Z);if(Te)return Te}j=[le.first];for(var Se=i.glyphStartIndex+1;Se<Q-1;Se++)j.push(sr(K*g.getoffsetX(Se),U,X,n,B,L,i.segment,ie,ce,w,m,R));j.push(le.last)}else{if(s&&!n){var Le=mt(L,p).point,Ge=i.lineStartIndex+i.segment+1,Ke=new l.Point(w.getx(Ge),w.gety(Ge)),He=mt(Ke,p),bt=He.signedDistanceFromCamera>0?He.point:_a(L,Ke,Le,1,p),Re=ii(i.writingMode,Le,bt,Z);if(Re)return Re}var it=sr(K*g.getoffsetX(i.glyphStartIndex),U,X,n,B,L,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,w,m,R);if(!it)return{notEnoughRoom:!0};j=[it]}for(var at=0,rt=j;at<rt.length;at+=1){var tt=rt[at];l.addDynamicAttributes(A,tt.point,tt.angle)}return{}}function _a(i,o,n,s,p){var m=mt(i.add(i.sub(o)._unit()),p).point,y=n.sub(m);return n.add(y._mult(s/y.mag()))}function sr(i,o,n,s,p,m,y,g,w,A,B,L){var R=s?i-o:i+o,Z=R>0?1:-1,j=0;s&&(Z*=-1,j=Math.PI),Z<0&&(j+=Math.PI);for(var K=Z>0?g+y:g+y+1,U=p,X=p,Q=0,ie=0,ce=Math.abs(R),le=[];Q+ie<=ce;){if((K+=Z)<g||K>=w)return null;if(X=U,le.push(U),(U=L[K])===void 0){var he=new l.Point(A.getx(K),A.gety(K)),ge=mt(he,B);if(ge.signedDistanceFromCamera>0)U=L[K]=ge.point;else{var Te=K-Z;U=_a(Q===0?m:new l.Point(A.getx(Te),A.gety(Te)),he,X,ce-Q+1,B)}}Q+=ie,ie=X.dist(U)}var Se=(ce-Q)/ie,Le=U.sub(X),Ge=Le.mult(Se)._add(X);Ge._add(Le._unit()._perp()._mult(n*Z));var Ke=j+Math.atan2(U.y-X.y,U.x-X.x);return le.push(Ge),{point:Ge,angle:Ke,path:le}}Mt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Mt.prototype.insert=function(i,o,n,s,p){this._forEachCell(o,n,s,p,this._insertBoxCell,this.boxUid++),this.boxKeys.push(i),this.bboxes.push(o),this.bboxes.push(n),this.bboxes.push(s),this.bboxes.push(p)},Mt.prototype.insertCircle=function(i,o,n,s){this._forEachCell(o-s,n-s,o+s,n+s,this._insertCircleCell,this.circleUid++),this.circleKeys.push(i),this.circles.push(o),this.circles.push(n),this.circles.push(s)},Mt.prototype._insertBoxCell=function(i,o,n,s,p,m){this.boxCells[p].push(m)},Mt.prototype._insertCircleCell=function(i,o,n,s,p,m){this.circleCells[p].push(m)},Mt.prototype._query=function(i,o,n,s,p,m){if(n<0||i>this.width||s<0||o>this.height)return!p&&[];var y=[];if(i<=0&&o<=0&&this.width<=n&&this.height<=s){if(p)return!0;for(var g=0;g<this.boxKeys.length;g++)y.push({key:this.boxKeys[g],x1:this.bboxes[4*g],y1:this.bboxes[4*g+1],x2:this.bboxes[4*g+2],y2:this.bboxes[4*g+3]});for(var w=0;w<this.circleKeys.length;w++){var A=this.circles[3*w],B=this.circles[3*w+1],L=this.circles[3*w+2];y.push({key:this.circleKeys[w],x1:A-L,y1:B-L,x2:A+L,y2:B+L})}return m?y.filter(m):y}return this._forEachCell(i,o,n,s,this._queryCell,y,{hitTest:p,seenUids:{box:{},circle:{}}},m),p?y.length>0:y},Mt.prototype._queryCircle=function(i,o,n,s,p){var m=i-n,y=i+n,g=o-n,w=o+n;if(y<0||m>this.width||w<0||g>this.height)return!s&&[];var A=[];return this._forEachCell(m,g,y,w,this._queryCellCircle,A,{hitTest:s,circle:{x:i,y:o,radius:n},seenUids:{box:{},circle:{}}},p),s?A.length>0:A},Mt.prototype.query=function(i,o,n,s,p){return this._query(i,o,n,s,!1,p)},Mt.prototype.hitTest=function(i,o,n,s,p){return this._query(i,o,n,s,!0,p)},Mt.prototype.hitTestCircle=function(i,o,n,s){return this._queryCircle(i,o,n,!0,s)},Mt.prototype._queryCell=function(i,o,n,s,p,m,y,g){var w=y.seenUids,A=this.boxCells[p];if(A!==null)for(var B=this.bboxes,L=0,R=A;L<R.length;L+=1){var Z=R[L];if(!w.box[Z]){w.box[Z]=!0;var j=4*Z;if(i<=B[j+2]&&o<=B[j+3]&&n>=B[j+0]&&s>=B[j+1]&&(!g||g(this.boxKeys[Z]))){if(y.hitTest)return m.push(!0),!0;m.push({key:this.boxKeys[Z],x1:B[j],y1:B[j+1],x2:B[j+2],y2:B[j+3]})}}}var K=this.circleCells[p];if(K!==null)for(var U=this.circles,X=0,Q=K;X<Q.length;X+=1){var ie=Q[X];if(!w.circle[ie]){w.circle[ie]=!0;var ce=3*ie;if(this._circleAndRectCollide(U[ce],U[ce+1],U[ce+2],i,o,n,s)&&(!g||g(this.circleKeys[ie]))){if(y.hitTest)return m.push(!0),!0;var le=U[ce],he=U[ce+1],ge=U[ce+2];m.push({key:this.circleKeys[ie],x1:le-ge,y1:he-ge,x2:le+ge,y2:he+ge})}}}},Mt.prototype._queryCellCircle=function(i,o,n,s,p,m,y,g){var w=y.circle,A=y.seenUids,B=this.boxCells[p];if(B!==null)for(var L=this.bboxes,R=0,Z=B;R<Z.length;R+=1){var j=Z[R];if(!A.box[j]){A.box[j]=!0;var K=4*j;if(this._circleAndRectCollide(w.x,w.y,w.radius,L[K+0],L[K+1],L[K+2],L[K+3])&&(!g||g(this.boxKeys[j])))return m.push(!0),!0}}var U=this.circleCells[p];if(U!==null)for(var X=this.circles,Q=0,ie=U;Q<ie.length;Q+=1){var ce=ie[Q];if(!A.circle[ce]){A.circle[ce]=!0;var le=3*ce;if(this._circlesCollide(X[le],X[le+1],X[le+2],w.x,w.y,w.radius)&&(!g||g(this.circleKeys[ce])))return m.push(!0),!0}}},Mt.prototype._forEachCell=function(i,o,n,s,p,m,y,g){for(var w=this._convertToXCellCoord(i),A=this._convertToYCellCoord(o),B=this._convertToXCellCoord(n),L=this._convertToYCellCoord(s),R=w;R<=B;R++)for(var Z=A;Z<=L;Z++)if(p.call(this,i,o,n,s,this.xCellCount*Z+R,m,y,g))return},Mt.prototype._convertToXCellCoord=function(i){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(i*this.xScale)))},Mt.prototype._convertToYCellCoord=function(i){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(i*this.yScale)))},Mt.prototype._circlesCollide=function(i,o,n,s,p,m){var y=s-i,g=p-o,w=n+m;return w*w>y*y+g*g},Mt.prototype._circleAndRectCollide=function(i,o,n,s,p,m,y){var g=(m-s)/2,w=Math.abs(i-(s+g));if(w>g+n)return!1;var A=(y-p)/2,B=Math.abs(o-(p+A));if(B>A+n)return!1;if(w<=g||B<=A)return!0;var L=w-g,R=B-A;return L*L+R*R<=n*n};var xa=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Gr(i,o){for(var n=0;n<i;n++){var s=o.length;o.resize(s+4),o.float32.set(xa,3*s)}}function kr(i,o,n){var s=o[0],p=o[1];return i[0]=n[0]*s+n[4]*p+n[12],i[1]=n[1]*s+n[5]*p+n[13],i[3]=n[3]*s+n[7]*p+n[15],i}var Pi=function(i,o,n){o===void 0&&(o=new Mt(i.width+200,i.height+200,25)),n===void 0&&(n=new Mt(i.width+200,i.height+200,25)),this.transform=i,this.grid=o,this.ignoredGrid=n,this.pitchfactor=Math.cos(i._pitch)*i.cameraToCenterDistance,this.screenRightBoundary=i.width+100,this.screenBottomBoundary=i.height+100,this.gridRightBoundary=i.width+200,this.gridBottomBoundary=i.height+200};function Ht(i,o,n){return o*(l.EXTENT/(i.tileSize*Math.pow(2,n-i.tileID.overscaledZ)))}Pi.prototype.placeCollisionBox=function(i,o,n,s,p){var m=this.projectAndGetPerspectiveRatio(s,i.anchorPointX,i.anchorPointY),y=n*m.perspectiveRatio,g=i.x1*y+m.point.x,w=i.y1*y+m.point.y,A=i.x2*y+m.point.x,B=i.y2*y+m.point.y;return!this.isInsideGrid(g,w,A,B)||!o&&this.grid.hitTest(g,w,A,B,p)?{box:[],offscreen:!1}:{box:[g,w,A,B],offscreen:this.isOffscreen(g,w,A,B)}},Pi.prototype.placeCollisionCircles=function(i,o,n,s,p,m,y,g,w,A,B,L,R){var Z=[],j=new l.Point(o.anchorX,o.anchorY),K=mt(j,m),U=Pt(this.transform.cameraToCenterDistance,K.signedDistanceFromCamera),X=(A?p/U:p*U)/l.ONE_EM,Q=mt(j,y).point,ie=Cr(X,s,o.lineOffsetX*X,o.lineOffsetY*X,!1,Q,j,o,n,y,{}),ce=!1,le=!1,he=!0;if(ie){for(var ge=.5*L*U+R,Te=new l.Point(-100,-100),Se=new l.Point(this.screenRightBoundary,this.screenBottomBoundary),Le=new qr,Ge=ie.first,Ke=ie.last,He=[],bt=Ge.path.length-1;bt>=1;bt--)He.push(Ge.path[bt]);for(var Re=1;Re<Ke.path.length;Re++)He.push(Ke.path[Re]);var it=2.5*ge;if(g){var at=He.map(function(Di){return mt(Di,g)});He=at.some(function(Di){return Di.signedDistanceFromCamera<=0})?[]:at.map(function(Di){return Di.point})}var rt=[];if(He.length>0){for(var tt=He[0].clone(),ot=He[0].clone(),Qe=1;Qe<He.length;Qe++)tt.x=Math.min(tt.x,He[Qe].x),tt.y=Math.min(tt.y,He[Qe].y),ot.x=Math.max(ot.x,He[Qe].x),ot.y=Math.max(ot.y,He[Qe].y);rt=tt.x>=Te.x&&ot.x<=Se.x&&tt.y>=Te.y&&ot.y<=Se.y?[He]:ot.x<Te.x||tt.x>Se.x||ot.y<Te.y||tt.y>Se.y?[]:l.clipLine([He],Te.x,Te.y,Se.x,Se.y)}for(var Je=0,Sr=rt;Je<Sr.length;Je+=1){var rr;Le.reset(Sr[Je],.25*ge),rr=Le.length<=.5*ge?1:Math.ceil(Le.paddedLength/it)+1;for(var Ur=0;Ur<rr;Ur++){var zr=Ur/Math.max(rr-1,1),er=Le.lerp(zr),lr=er.x+100,mi=er.y+100;Z.push(lr,mi,ge,0);var Xr=lr-ge,Fn=mi-ge,ni=lr+ge,Hi=mi+ge;if(he=he&&this.isOffscreen(Xr,Fn,ni,Hi),le=le||this.isInsideGrid(Xr,Fn,ni,Hi),!i&&this.grid.hitTestCircle(lr,mi,ge,B)&&(ce=!0,!w))return{circles:[],offscreen:!1,collisionDetected:ce}}}}return{circles:!w&&ce||!le?[]:Z,offscreen:he,collisionDetected:ce}},Pi.prototype.queryRenderedSymbols=function(i){if(i.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};for(var o=[],n=1/0,s=1/0,p=-1/0,m=-1/0,y=0,g=i;y<g.length;y+=1){var w=g[y],A=new l.Point(w.x+100,w.y+100);n=Math.min(n,A.x),s=Math.min(s,A.y),p=Math.max(p,A.x),m=Math.max(m,A.y),o.push(A)}for(var B={},L={},R=0,Z=this.grid.query(n,s,p,m).concat(this.ignoredGrid.query(n,s,p,m));R<Z.length;R+=1){var j=Z[R],K=j.key;if(B[K.bucketInstanceId]===void 0&&(B[K.bucketInstanceId]={}),!B[K.bucketInstanceId][K.featureIndex]){var U=[new l.Point(j.x1,j.y1),new l.Point(j.x2,j.y1),new l.Point(j.x2,j.y2),new l.Point(j.x1,j.y2)];l.polygonIntersectsPolygon(o,U)&&(B[K.bucketInstanceId][K.featureIndex]=!0,L[K.bucketInstanceId]===void 0&&(L[K.bucketInstanceId]=[]),L[K.bucketInstanceId].push(K.featureIndex))}}return L},Pi.prototype.insertCollisionBox=function(i,o,n,s,p){(o?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:s,collisionGroupID:p},i[0],i[1],i[2],i[3])},Pi.prototype.insertCollisionCircles=function(i,o,n,s,p){for(var m=o?this.ignoredGrid:this.grid,y={bucketInstanceId:n,featureIndex:s,collisionGroupID:p},g=0;g<i.length;g+=4)m.insertCircle(y,i[g],i[g+1],i[g+2])},Pi.prototype.projectAndGetPerspectiveRatio=function(i,o,n){var s=[o,n,0,1];return kr(s,s,i),{point:new l.Point((s[0]/s[3]+1)/2*this.transform.width+100,(-s[1]/s[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/s[3]*.5}},Pi.prototype.isOffscreen=function(i,o,n,s){return n<100||i>=this.screenRightBoundary||s<100||o>this.screenBottomBoundary},Pi.prototype.isInsideGrid=function(i,o,n,s){return n>=0&&i<this.gridRightBoundary&&s>=0&&o<this.gridBottomBoundary},Pi.prototype.getViewportMatrix=function(){var i=l.identity([]);return l.translate(i,i,[-100,-100,0]),i};var $i=function(i,o,n,s){this.opacity=i?Math.max(0,Math.min(1,i.opacity+(i.placed?o:-o))):s&&n?1:0,this.placed=n};$i.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var vi=function(i,o,n,s,p){this.text=new $i(i?i.text:null,o,n,p),this.icon=new $i(i?i.icon:null,o,s,p)};vi.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var zu=function(i,o,n){this.text=i,this.icon=o,this.skipFade=n},Ci=function(){this.invProjMatrix=l.create(),this.viewportMatrix=l.create(),this.circles=[]},zp=function(i,o,n,s,p){this.bucketInstanceId=i,this.featureIndex=o,this.sourceLayerIndex=n,this.bucketIndex=s,this.tileID=p},pn=function(i){this.crossSourceCollisions=i,this.maxGroupID=0,this.collisionGroups={}};function Rr(i,o,n,s,p){var m=l.getAnchorAlignment(i),y=-(m.horizontalAlign-.5)*o,g=-(m.verticalAlign-.5)*n,w=l.evaluateVariableOffset(i,s);return new l.Point(y+w[0]*p,g+w[1]*p)}function Yi(i,o,n,s,p,m){var y=i.x1,g=i.x2,w=i.y1,A=i.y2,B=i.anchorPointX,L=i.anchorPointY,R=new l.Point(o,n);return s&&R._rotate(p?m:-m),{x1:y+R.x,y1:w+R.y,x2:g+R.x,y2:A+R.y,anchorPointX:B,anchorPointY:L}}pn.prototype.get=function(i){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[i]){var o=++this.maxGroupID;this.collisionGroups[i]={ID:o,predicate:function(n){return n.collisionGroupID===o}}}return this.collisionGroups[i]};var Zr=function(i,o,n,s){this.transform=i.clone(),this.collisionIndex=new Pi(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new pn(n),this.collisionCircleArrays={},this.prevPlacement=s,s&&(s.prevPlacement=void 0),this.placedOrientations={}};function eo(i,o,n,s,p){i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0)}Zr.prototype.getBucketParts=function(i,o,n,s){var p=n.getBucket(o),m=n.latestFeatureIndex;if(p&&m&&o.id===p.layerIds[0]){var y=n.collisionBoxArray,g=p.layers[0].layout,w=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),A=n.tileSize/l.EXTENT,B=this.transform.calculatePosMatrix(n.tileID.toUnwrapped()),L=g.get("text-pitch-alignment")==="map",R=g.get("text-rotation-alignment")==="map",Z=Ht(n,1,this.transform.zoom),j=ar(B,L,R,this.transform,Z),K=null;if(L){var U=Dt(B,L,R,this.transform,Z);K=l.multiply([],this.transform.labelPlaneMatrix,U)}this.retainedQueryData[p.bucketInstanceId]=new zp(p.bucketInstanceId,m,p.sourceLayerIndex,p.index,n.tileID);var X={bucket:p,layout:g,posMatrix:B,textLabelPlaneMatrix:j,labelToScreenMatrix:K,scale:w,textPixelRatio:A,holdingForFade:n.holdingForFade(),collisionBoxArray:y,partiallyEvaluatedTextSize:l.evaluateSizeForZoom(p.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(p.sourceID)};if(s)for(var Q=0,ie=p.sortKeyRanges;Q<ie.length;Q+=1){var ce=ie[Q];i.push({sortKey:ce.sortKey,symbolInstanceStart:ce.symbolInstanceStart,symbolInstanceEnd:ce.symbolInstanceEnd,parameters:X})}else i.push({symbolInstanceStart:0,symbolInstanceEnd:p.symbolInstances.length,parameters:X})}},Zr.prototype.attemptAnchorPlacement=function(i,o,n,s,p,m,y,g,w,A,B,L,R,Z,j){var K,U=[L.textOffset0,L.textOffset1],X=Rr(i,n,s,U,p),Q=this.collisionIndex.placeCollisionBox(Yi(o,X.x,X.y,m,y,this.transform.angle),B,g,w,A.predicate);if(!j||this.collisionIndex.placeCollisionBox(Yi(j,X.x,X.y,m,y,this.transform.angle),B,g,w,A.predicate).box.length!==0)return Q.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[L.crossTileID]&&this.prevPlacement.placements[L.crossTileID]&&this.prevPlacement.placements[L.crossTileID].text&&(K=this.prevPlacement.variableOffsets[L.crossTileID].anchor),this.variableOffsets[L.crossTileID]={textOffset:U,width:n,height:s,anchor:i,textBoxScale:p,prevAnchor:K},this.markUsedJustification(R,i,L,Z),R.allowVerticalPlacement&&(this.markUsedOrientation(R,Z,L),this.placedOrientations[L.crossTileID]=Z),{shift:X,placedGlyphBoxes:Q}):void 0},Zr.prototype.placeLayerBucketPart=function(i,o,n){var s=this,p=i.parameters,m=p.bucket,y=p.layout,g=p.posMatrix,w=p.textLabelPlaneMatrix,A=p.labelToScreenMatrix,B=p.textPixelRatio,L=p.holdingForFade,R=p.collisionBoxArray,Z=p.partiallyEvaluatedTextSize,j=p.collisionGroup,K=y.get("text-optional"),U=y.get("icon-optional"),X=y.get("text-allow-overlap"),Q=y.get("icon-allow-overlap"),ie=y.get("text-rotation-alignment")==="map",ce=y.get("text-pitch-alignment")==="map",le=y.get("icon-text-fit")!=="none",he=y.get("symbol-z-order")==="viewport-y",ge=X&&(Q||!m.hasIconData()||U),Te=Q&&(X||!m.hasTextData()||K);!m.collisionArrays&&R&&m.deserializeCollisionBoxes(R);var Se=function(Re,it){if(!o[Re.crossTileID])if(L)s.placements[Re.crossTileID]=new zu(!1,!1,!1);else{var at,rt=!1,tt=!1,ot=!0,Qe=null,Je={box:null,offscreen:null},Sr={box:null,offscreen:null},rr=null,Ur=null,zr=0,er=0,lr=0;it.textFeatureIndex?zr=it.textFeatureIndex:Re.useRuntimeCollisionCircles&&(zr=Re.featureIndex),it.verticalTextFeatureIndex&&(er=it.verticalTextFeatureIndex);var mi=it.textBox;if(mi){var Xr=function(Ct){var xi=l.WritingMode.horizontal;if(m.allowVerticalPlacement&&!Ct&&s.prevPlacement){var oi=s.prevPlacement.placedOrientations[Re.crossTileID];oi&&(s.placedOrientations[Re.crossTileID]=oi,s.markUsedOrientation(m,xi=oi,Re))}return xi},Fn=function(Ct,xi){if(m.allowVerticalPlacement&&Re.numVerticalGlyphVertices>0&&it.verticalTextBox)for(var oi=0,_o=m.writingModes;oi<_o.length&&(_o[oi]===l.WritingMode.vertical?(Je=xi(),Sr=Je):Je=Ct(),!(Je&&Je.box&&Je.box.length));oi+=1);else Je=Ct()};if(y.get("text-variable-anchor")){var ni=y.get("text-variable-anchor");if(s.prevPlacement&&s.prevPlacement.variableOffsets[Re.crossTileID]){var Hi=s.prevPlacement.variableOffsets[Re.crossTileID];ni.indexOf(Hi.anchor)>0&&(ni=ni.filter(function(Ct){return Ct!==Hi.anchor})).unshift(Hi.anchor)}var Di=function(Ct,xi,oi){for(var _o=Ct.x2-Ct.x1,Zp=Ct.y2-Ct.y1,ks=Re.textBoxScale,Wp=le&&!Q?xi:null,Na={box:[],offscreen:!1},uc=X?2*ni.length:ni.length,ea=0;ea<uc;++ea){var Ms=s.attemptAnchorPlacement(ni[ea%ni.length],Ct,_o,Zp,ks,ie,ce,B,g,j,ea>=ni.length,Re,m,oi,Wp);if(Ms&&(Na=Ms.placedGlyphBoxes)&&Na.box&&Na.box.length){rt=!0,Qe=Ms.shift;break}}return Na};Fn(function(){return Di(mi,it.iconBox,l.WritingMode.horizontal)},function(){var Ct=it.verticalTextBox;return m.allowVerticalPlacement&&!(Je&&Je.box&&Je.box.length)&&Re.numVerticalGlyphVertices>0&&Ct?Di(Ct,it.verticalIconBox,l.WritingMode.vertical):{box:null,offscreen:null}}),Je&&(rt=Je.box,ot=Je.offscreen);var Oa=Xr(Je&&Je.box);if(!rt&&s.prevPlacement){var Yo=s.prevPlacement.variableOffsets[Re.crossTileID];Yo&&(s.variableOffsets[Re.crossTileID]=Yo,s.markUsedJustification(m,Yo.anchor,Re,Oa))}}else{var On=function(Ct,xi){var oi=s.collisionIndex.placeCollisionBox(Ct,X,B,g,j.predicate);return oi&&oi.box&&oi.box.length&&(s.markUsedOrientation(m,xi,Re),s.placedOrientations[Re.crossTileID]=xi),oi};Fn(function(){return On(mi,l.WritingMode.horizontal)},function(){var Ct=it.verticalTextBox;return m.allowVerticalPlacement&&Re.numVerticalGlyphVertices>0&&Ct?On(Ct,l.WritingMode.vertical):{box:null,offscreen:null}}),Xr(Je&&Je.box&&Je.box.length)}}if(rt=(at=Je)&&at.box&&at.box.length>0,ot=at&&at.offscreen,Re.useRuntimeCollisionCircles){var Qo=m.text.placedSymbolArray.get(Re.centerJustifiedTextSymbolIndex),Va=l.evaluateSizeForFeature(m.textSizeData,Z,Qo),rn=y.get("text-padding");rr=s.collisionIndex.placeCollisionCircles(X,Qo,m.lineVertexArray,m.glyphOffsetArray,Va,g,w,A,n,ce,j.predicate,Re.collisionCircleDiameter,rn),rt=X||rr.circles.length>0&&!rr.collisionDetected,ot=ot&&rr.offscreen}if(it.iconFeatureIndex&&(lr=it.iconFeatureIndex),it.iconBox){var Ua=function(Ct){var xi=le&&Qe?Yi(Ct,Qe.x,Qe.y,ie,ce,s.transform.angle):Ct;return s.collisionIndex.placeCollisionBox(xi,Q,B,g,j.predicate)};tt=Sr&&Sr.box&&Sr.box.length&&it.verticalIconBox?(Ur=Ua(it.verticalIconBox)).box.length>0:(Ur=Ua(it.iconBox)).box.length>0,ot=ot&&Ur.offscreen}var nn=K||Re.numHorizontalGlyphVertices===0&&Re.numVerticalGlyphVertices===0,Tr=U||Re.numIconVertices===0;if(nn||Tr?Tr?nn||(tt=tt&&rt):rt=tt&&rt:tt=rt=tt&&rt,rt&&at&&at.box&&s.collisionIndex.insertCollisionBox(at.box,y.get("text-ignore-placement"),m.bucketInstanceId,Sr&&Sr.box&&er?er:zr,j.ID),tt&&Ur&&s.collisionIndex.insertCollisionBox(Ur.box,y.get("icon-ignore-placement"),m.bucketInstanceId,lr,j.ID),rr&&(rt&&s.collisionIndex.insertCollisionCircles(rr.circles,y.get("text-ignore-placement"),m.bucketInstanceId,zr,j.ID),n)){var mn=m.bucketInstanceId,Vn=s.collisionCircleArrays[mn];Vn===void 0&&(Vn=s.collisionCircleArrays[mn]=new Ci);for(var go=0;go<rr.circles.length;go+=4)Vn.circles.push(rr.circles[go+0]),Vn.circles.push(rr.circles[go+1]),Vn.circles.push(rr.circles[go+2]),Vn.circles.push(rr.collisionDetected?1:0)}s.placements[Re.crossTileID]=new zu(rt||ge,tt||Te,ot||m.justReloaded),o[Re.crossTileID]=!0}};if(he)for(var Le=m.getSortedSymbolIndexes(this.transform.angle),Ge=Le.length-1;Ge>=0;--Ge){var Ke=Le[Ge];Se(m.symbolInstances.get(Ke),m.collisionArrays[Ke])}else for(var He=i.symbolInstanceStart;He<i.symbolInstanceEnd;He++)Se(m.symbolInstances.get(He),m.collisionArrays[He]);if(n&&m.bucketInstanceId in this.collisionCircleArrays){var bt=this.collisionCircleArrays[m.bucketInstanceId];l.invert(bt.invProjMatrix,g),bt.viewportMatrix=this.collisionIndex.getViewportMatrix()}m.justReloaded=!1},Zr.prototype.markUsedJustification=function(i,o,n,s){var p;p=s===l.WritingMode.vertical?n.verticalPlacedTextSymbolIndex:{left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex}[l.getAnchorJustification(o)];for(var m=0,y=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];m<y.length;m+=1){var g=y[m];g>=0&&(i.text.placedSymbolArray.get(g).crossTileID=p>=0&&g!==p?0:n.crossTileID)}},Zr.prototype.markUsedOrientation=function(i,o,n){for(var s=o===l.WritingMode.horizontal||o===l.WritingMode.horizontalOnly?o:0,p=o===l.WritingMode.vertical?o:0,m=0,y=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];m<y.length;m+=1)i.text.placedSymbolArray.get(y[m]).placedOrientation=s;n.verticalPlacedTextSymbolIndex&&(i.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=p)},Zr.prototype.commit=function(i){this.commitTime=i,this.zoomAtLastRecencyCheck=this.transform.zoom;var o=this.prevPlacement,n=!1;this.prevZoomAdjustment=o?o.zoomAdjustment(this.transform.zoom):0;var s=o?o.symbolFadeChange(i):1,p=o?o.opacities:{},m=o?o.variableOffsets:{},y=o?o.placedOrientations:{};for(var g in this.placements){var w=this.placements[g],A=p[g];A?(this.opacities[g]=new vi(A,s,w.text,w.icon),n=n||w.text!==A.text.placed||w.icon!==A.icon.placed):(this.opacities[g]=new vi(null,s,w.text,w.icon,w.skipFade),n=n||w.text||w.icon)}for(var B in p){var L=p[B];if(!this.opacities[B]){var R=new vi(L,s,!1,!1);R.isHidden()||(this.opacities[B]=R,n=n||L.text.placed||L.icon.placed)}}for(var Z in m)this.variableOffsets[Z]||!this.opacities[Z]||this.opacities[Z].isHidden()||(this.variableOffsets[Z]=m[Z]);for(var j in y)this.placedOrientations[j]||!this.opacities[j]||this.opacities[j].isHidden()||(this.placedOrientations[j]=y[j]);n?this.lastPlacementChangeTime=i:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=o?o.lastPlacementChangeTime:i)},Zr.prototype.updateLayerOpacities=function(i,o){for(var n={},s=0,p=o;s<p.length;s+=1){var m=p[s],y=m.getBucket(i);y&&m.latestFeatureIndex&&i.id===y.layerIds[0]&&this.updateBucketOpacities(y,n,m.collisionBoxArray)}},Zr.prototype.updateBucketOpacities=function(i,o,n){var s=this;i.hasTextData()&&i.text.opacityVertexArray.clear(),i.hasIconData()&&i.icon.opacityVertexArray.clear(),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexArray.clear(),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexArray.clear();var p=i.layers[0].layout,m=new vi(null,0,!1,!1,!0),y=p.get("text-allow-overlap"),g=p.get("icon-allow-overlap"),w=p.get("text-variable-anchor"),A=p.get("text-rotation-alignment")==="map",B=p.get("text-pitch-alignment")==="map",L=p.get("icon-text-fit")!=="none",R=new vi(null,0,y&&(g||!i.hasIconData()||p.get("icon-optional")),g&&(y||!i.hasTextData()||p.get("text-optional")),!0);!i.collisionArrays&&n&&(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData())&&i.deserializeCollisionBoxes(n);for(var Z=function(X,Q,ie){for(var ce=0;ce<Q/4;ce++)X.opacityVertexArray.emplaceBack(ie)},j=function(X){var Q=i.symbolInstances.get(X),ie=Q.numHorizontalGlyphVertices,ce=Q.numVerticalGlyphVertices,le=Q.crossTileID,he=s.opacities[le];o[le]?he=m:he||(s.opacities[le]=he=R),o[le]=!0;var ge=Q.numIconVertices>0,Te=s.placedOrientations[Q.crossTileID],Se=Te===l.WritingMode.vertical,Le=Te===l.WritingMode.horizontal||Te===l.WritingMode.horizontalOnly;if(ie>0||ce>0){var Ge=Lu(he.text);Z(i.text,ie,Se?No:Ge),Z(i.text,ce,Le?No:Ge);var Ke=he.text.isHidden();[Q.rightJustifiedTextSymbolIndex,Q.centerJustifiedTextSymbolIndex,Q.leftJustifiedTextSymbolIndex].forEach(function(Je){Je>=0&&(i.text.placedSymbolArray.get(Je).hidden=Ke||Se?1:0)}),Q.verticalPlacedTextSymbolIndex>=0&&(i.text.placedSymbolArray.get(Q.verticalPlacedTextSymbolIndex).hidden=Ke||Le?1:0);var He=s.variableOffsets[Q.crossTileID];He&&s.markUsedJustification(i,He.anchor,Q,Te);var bt=s.placedOrientations[Q.crossTileID];bt&&(s.markUsedJustification(i,"left",Q,bt),s.markUsedOrientation(i,bt,Q))}if(ge){var Re=Lu(he.icon),it=!(L&&Q.verticalPlacedIconSymbolIndex&&Se);Q.placedIconSymbolIndex>=0&&(Z(i.icon,Q.numIconVertices,it?Re:No),i.icon.placedSymbolArray.get(Q.placedIconSymbolIndex).hidden=he.icon.isHidden()),Q.verticalPlacedIconSymbolIndex>=0&&(Z(i.icon,Q.numVerticalIconVertices,it?No:Re),i.icon.placedSymbolArray.get(Q.verticalPlacedIconSymbolIndex).hidden=he.icon.isHidden())}if(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData()){var at=i.collisionArrays[X];if(at){var rt=new l.Point(0,0);if(at.textBox||at.verticalTextBox){var tt=!0;if(w){var ot=s.variableOffsets[le];ot?(rt=Rr(ot.anchor,ot.width,ot.height,ot.textOffset,ot.textBoxScale),A&&rt._rotate(B?s.transform.angle:-s.transform.angle)):tt=!1}at.textBox&&eo(i.textCollisionBox.collisionVertexArray,he.text.placed,!tt||Se,rt.x,rt.y),at.verticalTextBox&&eo(i.textCollisionBox.collisionVertexArray,he.text.placed,!tt||Le,rt.x,rt.y)}var Qe=!!(!Le&&at.verticalIconBox);at.iconBox&&eo(i.iconCollisionBox.collisionVertexArray,he.icon.placed,Qe,L?rt.x:0,L?rt.y:0),at.verticalIconBox&&eo(i.iconCollisionBox.collisionVertexArray,he.icon.placed,!Qe,L?rt.x:0,L?rt.y:0)}}},K=0;K<i.symbolInstances.length;K++)j(K);if(i.sortFeatures(this.transform.angle),this.retainedQueryData[i.bucketInstanceId]&&(this.retainedQueryData[i.bucketInstanceId].featureSortOrder=i.featureSortOrder),i.hasTextData()&&i.text.opacityVertexBuffer&&i.text.opacityVertexBuffer.updateData(i.text.opacityVertexArray),i.hasIconData()&&i.icon.opacityVertexBuffer&&i.icon.opacityVertexBuffer.updateData(i.icon.opacityVertexArray),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexBuffer&&i.iconCollisionBox.collisionVertexBuffer.updateData(i.iconCollisionBox.collisionVertexArray),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexBuffer&&i.textCollisionBox.collisionVertexBuffer.updateData(i.textCollisionBox.collisionVertexArray),i.bucketInstanceId in this.collisionCircleArrays){var U=this.collisionCircleArrays[i.bucketInstanceId];i.placementInvProjMatrix=U.invProjMatrix,i.placementViewportMatrix=U.viewportMatrix,i.collisionCircleArray=U.circles,delete this.collisionCircleArrays[i.bucketInstanceId]}},Zr.prototype.symbolFadeChange=function(i){return this.fadeDuration===0?1:(i-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},Zr.prototype.zoomAdjustment=function(i){return Math.max(0,(this.transform.zoom-i)/1.5)},Zr.prototype.hasTransitions=function(i){return this.stale||i-this.lastPlacementChangeTime<this.fadeDuration},Zr.prototype.stillRecent=function(i,o){var n=this.zoomAtLastRecencyCheck===o?1-this.zoomAdjustment(o):1;return this.zoomAtLastRecencyCheck=o,this.commitTime+this.fadeDuration*n>i},Zr.prototype.setStale=function(){this.stale=!0};var Bp=Math.pow(2,25),Dp=Math.pow(2,24),wl=Math.pow(2,17),Lp=Math.pow(2,16),Bu=Math.pow(2,9),Rp=Math.pow(2,8),Du=Math.pow(2,1);function Lu(i){if(i.opacity===0&&!i.placed)return 0;if(i.opacity===1&&i.placed)return 4294967295;var o=i.placed?1:0,n=Math.floor(127*i.opacity);return n*Bp+o*Dp+n*wl+o*Lp+n*Bu+o*Rp+n*Du+o}var No=0,Sl=function(i){this._sortAcrossTiles=i.layout.get("symbol-z-order")!=="viewport-y"&&i.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Sl.prototype.continuePlacement=function(i,o,n,s,p){for(var m=this._bucketParts;this._currentTileIndex<i.length;)if(o.getBucketParts(m,s,i[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,p())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,m.sort(function(y,g){return y.sortKey-g.sortKey}));this._currentPartIndex<m.length;)if(o.placeLayerBucketPart(m[this._currentPartIndex],this._seenCrossTileIDs,n),this._currentPartIndex++,p())return!0;return!1};var ba=function(i,o,n,s,p,m,y){this.placement=new Zr(i,p,m,y),this._currentPlacementIndex=o.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=s,this._done=!1};ba.prototype.isDone=function(){return this._done},ba.prototype.continuePlacement=function(i,o,n){for(var s=this,p=l.browser.now(),m=function(){var w=l.browser.now()-p;return!s._forceFullPlacement&&w>2};this._currentPlacementIndex>=0;){var y=o[i[this._currentPlacementIndex]],g=this.placement.collisionIndex.transform.zoom;if(y.type==="symbol"&&(!y.minzoom||y.minzoom<=g)&&(!y.maxzoom||y.maxzoom>g)){if(this._inProgressLayer||(this._inProgressLayer=new Sl(y)),this._inProgressLayer.continuePlacement(n[y.source],this.placement,this._showCollisionBoxes,y,m))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},ba.prototype.commit=function(i){return this.placement.commit(i),this.placement};var Ru=512/l.EXTENT/2,cs=function(i,o,n){this.tileID=i,this.indexedSymbolInstances={},this.bucketInstanceId=n;for(var s=0;s<o.length;s++){var p=o.get(s),m=p.key;this.indexedSymbolInstances[m]||(this.indexedSymbolInstances[m]=[]),this.indexedSymbolInstances[m].push({crossTileID:p.crossTileID,coord:this.getScaledCoordinates(p,i)})}};cs.prototype.getScaledCoordinates=function(i,o){var n=Ru/Math.pow(2,o.canonical.z-this.tileID.canonical.z);return{x:Math.floor((o.canonical.x*l.EXTENT+i.anchorX)*n),y:Math.floor((o.canonical.y*l.EXTENT+i.anchorY)*n)}},cs.prototype.findMatches=function(i,o,n){for(var s=this.tileID.canonical.z<o.canonical.z?1:Math.pow(2,this.tileID.canonical.z-o.canonical.z),p=0;p<i.length;p++){var m=i.get(p);if(!m.crossTileID){var y=this.indexedSymbolInstances[m.key];if(y)for(var g=this.getScaledCoordinates(m,o),w=0,A=y;w<A.length;w+=1){var B=A[w];if(Math.abs(B.coord.x-g.x)<=s&&Math.abs(B.coord.y-g.y)<=s&&!n[B.crossTileID]){n[B.crossTileID]=!0,m.crossTileID=B.crossTileID;break}}}}};var ki=function(){this.maxCrossTileID=0};ki.prototype.generate=function(){return++this.maxCrossTileID};var Sn=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Sn.prototype.handleWrapJump=function(i){var o=Math.round((i-this.lng)/360);if(o!==0)for(var n in this.indexes){var s=this.indexes[n],p={};for(var m in s){var y=s[m];y.tileID=y.tileID.unwrapTo(y.tileID.wrap+o),p[y.tileID.key]=y}this.indexes[n]=p}this.lng=i},Sn.prototype.addBucket=function(i,o,n){if(this.indexes[i.overscaledZ]&&this.indexes[i.overscaledZ][i.key]){if(this.indexes[i.overscaledZ][i.key].bucketInstanceId===o.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(i.overscaledZ,this.indexes[i.overscaledZ][i.key])}for(var s=0;s<o.symbolInstances.length;s++)o.symbolInstances.get(s).crossTileID=0;this.usedCrossTileIDs[i.overscaledZ]||(this.usedCrossTileIDs[i.overscaledZ]={});var p=this.usedCrossTileIDs[i.overscaledZ];for(var m in this.indexes){var y=this.indexes[m];if(Number(m)>i.overscaledZ)for(var g in y){var w=y[g];w.tileID.isChildOf(i)&&w.findMatches(o.symbolInstances,i,p)}else{var A=y[i.scaledTo(Number(m)).key];A&&A.findMatches(o.symbolInstances,i,p)}}for(var B=0;B<o.symbolInstances.length;B++){var L=o.symbolInstances.get(B);L.crossTileID||(L.crossTileID=n.generate(),p[L.crossTileID]=!0)}return this.indexes[i.overscaledZ]===void 0&&(this.indexes[i.overscaledZ]={}),this.indexes[i.overscaledZ][i.key]=new cs(i,o.symbolInstances,o.bucketInstanceId),!0},Sn.prototype.removeBucketCrossTileIDs=function(i,o){for(var n in o.indexedSymbolInstances)for(var s=0,p=o.indexedSymbolInstances[n];s<p.length;s+=1)delete this.usedCrossTileIDs[i][p[s].crossTileID]},Sn.prototype.removeStaleBuckets=function(i){var o=!1;for(var n in this.indexes){var s=this.indexes[n];for(var p in s)i[s[p].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,s[p]),delete s[p],o=!0)}return o};var Tn=function(){this.layerIndexes={},this.crossTileIDs=new ki,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Tn.prototype.addLayer=function(i,o,n){var s=this.layerIndexes[i.id];s===void 0&&(s=this.layerIndexes[i.id]=new Sn);var p=!1,m={};s.handleWrapJump(n);for(var y=0,g=o;y<g.length;y+=1){var w=g[y],A=w.getBucket(i);A&&i.id===A.layerIds[0]&&(A.bucketInstanceId||(A.bucketInstanceId=++this.maxBucketInstanceId),s.addBucket(w.tileID,A,this.crossTileIDs)&&(p=!0),m[A.bucketInstanceId]=!0)}return s.removeStaleBuckets(m)&&(p=!0),p},Tn.prototype.pruneUnusedLayers=function(i){var o={};for(var n in i.forEach(function(s){o[s]=!0}),this.layerIndexes)o[n]||delete this.layerIndexes[n]};var to=function(i,o){return l.emitValidationErrors(i,o&&o.filter(function(n){return n.identifier!=="source.canvas"}))},In=l.pick(Pe,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),An=l.pick(Pe,["setCenter","setZoom","setBearing","setPitch"]),ps=function(){var i={},o=l.styleSpec.$version;for(var n in l.styleSpec.$root){var s,p=l.styleSpec.$root[n];p.required&&(s=n==="version"?o:p.type==="array"?[]:{})!=null&&(i[n]=s)}return i}(),ui=function(i){function o(n,s){var p=this;s===void 0&&(s={}),i.call(this),this.map=n,this.dispatcher=new Pr(de(),this),this.imageManager=new et,this.imageManager.setEventedParent(this),this.glyphManager=new dr(n._requestManager,s.localIdeographFontFamily),this.lineAtlas=new Ft(256,512),this.crossTileSymbolIndex=new Tn,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new l.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",l.getReferrer());var m=this;this._rtlTextPluginCallback=o.registerForPluginStateChange(function(y){m.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:y.pluginStatus,pluginURL:y.pluginURL},function(g,w){if(l.triggerPluginCompletionEvent(g),w&&w.every(function(B){return B}))for(var A in m.sourceCaches)m.sourceCaches[A].reload()})}),this.on("data",function(y){if(y.dataType==="source"&&y.sourceDataType==="metadata"){var g=p.sourceCaches[y.sourceId];if(g){var w=g.getSource();if(w&&w.vectorLayerIds)for(var A in p._layers){var B=p._layers[A];B.source===w.id&&p._validateLayer(B)}}}})}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.loadURL=function(n,s){var p=this;s===void 0&&(s={}),this.fire(new l.Event("dataloading",{dataType:"style"}));var m=typeof s.validate=="boolean"?s.validate:!l.isMapboxURL(n);n=this.map._requestManager.normalizeStyleURL(n,s.accessToken);var y=this.map._requestManager.transformRequest(n,l.ResourceType.Style);this._request=l.getJSON(y,function(g,w){p._request=null,g?p.fire(new l.ErrorEvent(g)):w&&p._load(w,m)})},o.prototype.loadJSON=function(n,s){var p=this;s===void 0&&(s={}),this.fire(new l.Event("dataloading",{dataType:"style"})),this._request=l.browser.frame(function(){p._request=null,p._load(n,s.validate!==!1)})},o.prototype.loadEmpty=function(){this.fire(new l.Event("dataloading",{dataType:"style"})),this._load(ps,!1)},o.prototype._load=function(n,s){if(!s||!to(this,l.validateStyle(n))){for(var p in this._loaded=!0,this.stylesheet=n,n.sources)this.addSource(p,n.sources[p],{validate:!1});n.sprite?this._loadSprite(n.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(n.glyphs);var m=Ae(this.stylesheet.layers);this._order=m.map(function(A){return A.id}),this._layers={},this._serializedLayers={};for(var y=0,g=m;y<g.length;y+=1){var w=g[y];(w=l.createStyleLayer(w)).setEventedParent(this,{layer:{id:w.id}}),this._layers[w.id]=w,this._serializedLayers[w.id]=w.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new Si(this.stylesheet.light),this.fire(new l.Event("data",{dataType:"style"})),this.fire(new l.Event("style.load"))}},o.prototype._loadSprite=function(n){var s=this;this._spriteRequest=function(p,m,y){var g,w,A,B=l.browser.devicePixelRatio>1?"@2x":"",L=l.getJSON(m.transformRequest(m.normalizeSpriteURL(p,B,".json"),l.ResourceType.SpriteJSON),function(j,K){L=null,A||(A=j,g=K,Z())}),R=l.getImage(m.transformRequest(m.normalizeSpriteURL(p,B,".png"),l.ResourceType.SpriteImage),function(j,K){R=null,A||(A=j,w=K,Z())});function Z(){if(A)y(A);else if(g&&w){var j=l.browser.getImageData(w),K={};for(var U in g){var X=g[U],Q=X.width,ie=X.height,ce=X.x,le=X.y,he=X.sdf,ge=X.pixelRatio,Te=X.stretchX,Se=X.stretchY,Le=X.content,Ge=new l.RGBAImage({width:Q,height:ie});l.RGBAImage.copy(j,Ge,{x:ce,y:le},{x:0,y:0},{width:Q,height:ie}),K[U]={data:Ge,pixelRatio:ge,sdf:he,stretchX:Te,stretchY:Se,content:Le}}y(null,K)}}return{cancel:function(){L&&(L.cancel(),L=null),R&&(R.cancel(),R=null)}}}(n,this.map._requestManager,function(p,m){if(s._spriteRequest=null,p)s.fire(new l.ErrorEvent(p));else if(m)for(var y in m)s.imageManager.addImage(y,m[y]);s.imageManager.setLoaded(!0),s._availableImages=s.imageManager.listImages(),s.dispatcher.broadcast("setImages",s._availableImages),s.fire(new l.Event("data",{dataType:"style"}))})},o.prototype._validateLayer=function(n){var s=this.sourceCaches[n.source];if(s){var p=n.sourceLayer;if(p){var m=s.getSource();(m.type==="geojson"||m.vectorLayerIds&&m.vectorLayerIds.indexOf(p)===-1)&&this.fire(new l.ErrorEvent(new Error('Source layer "'+p+'" does not exist on source "'+m.id+'" as specified by style layer "'+n.id+'"')))}}},o.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var n in this.sourceCaches)if(!this.sourceCaches[n].loaded())return!1;return!!this.imageManager.isLoaded()},o.prototype._serializeLayers=function(n){for(var s=[],p=0,m=n;p<m.length;p+=1){var y=this._layers[m[p]];y.type!=="custom"&&s.push(y.serialize())}return s},o.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var n in this.sourceCaches)if(this.sourceCaches[n].hasTransition())return!0;for(var s in this._layers)if(this._layers[s].hasTransition())return!0;return!1},o.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},o.prototype.update=function(n){if(this._loaded){var s=this._changed;if(this._changed){var p=Object.keys(this._updatedLayers),m=Object.keys(this._removedLayers);for(var y in(p.length||m.length)&&this._updateWorkerLayers(p,m),this._updatedSources){var g=this._updatedSources[y];g==="reload"?this._reloadSource(y):g==="clear"&&this._clearSource(y)}for(var w in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[w].updateTransitions(n);this.light.updateTransitions(n),this._resetUpdates()}var A={};for(var B in this.sourceCaches){var L=this.sourceCaches[B];A[B]=L.used,L.used=!1}for(var R=0,Z=this._order;R<Z.length;R+=1){var j=this._layers[Z[R]];j.recalculate(n,this._availableImages),!j.isHidden(n.zoom)&&j.source&&(this.sourceCaches[j.source].used=!0)}for(var K in A){var U=this.sourceCaches[K];A[K]!==U.used&&U.fire(new l.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:K}))}this.light.recalculate(n),this.z=n.zoom,s&&this.fire(new l.Event("data",{dataType:"style"}))}},o.prototype._updateTilesForChangedImages=function(){var n=Object.keys(this._changedImages);if(n.length){for(var s in this.sourceCaches)this.sourceCaches[s].reloadTilesForDependencies(["icons","patterns"],n);this._changedImages={}}},o.prototype._updateWorkerLayers=function(n,s){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(n),removedIds:s})},o.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},o.prototype.setState=function(n){var s=this;if(this._checkLoaded(),to(this,l.validateStyle(n)))return!1;(n=l.clone$1(n)).layers=Ae(n.layers);var p=function(y,g){if(!y)return[{command:Pe.setStyle,args:[g]}];var w=[];try{if(!l.deepEqual(y.version,g.version))return[{command:Pe.setStyle,args:[g]}];l.deepEqual(y.center,g.center)||w.push({command:Pe.setCenter,args:[g.center]}),l.deepEqual(y.zoom,g.zoom)||w.push({command:Pe.setZoom,args:[g.zoom]}),l.deepEqual(y.bearing,g.bearing)||w.push({command:Pe.setBearing,args:[g.bearing]}),l.deepEqual(y.pitch,g.pitch)||w.push({command:Pe.setPitch,args:[g.pitch]}),l.deepEqual(y.sprite,g.sprite)||w.push({command:Pe.setSprite,args:[g.sprite]}),l.deepEqual(y.glyphs,g.glyphs)||w.push({command:Pe.setGlyphs,args:[g.glyphs]}),l.deepEqual(y.transition,g.transition)||w.push({command:Pe.setTransition,args:[g.transition]}),l.deepEqual(y.light,g.light)||w.push({command:Pe.setLight,args:[g.light]});var A={},B=[];(function(R,Z,j,K){var U;for(U in Z=Z||{},R=R||{})R.hasOwnProperty(U)&&(Z.hasOwnProperty(U)||ze(U,j,K));for(U in Z)Z.hasOwnProperty(U)&&(R.hasOwnProperty(U)?l.deepEqual(R[U],Z[U])||(R[U].type==="geojson"&&Z[U].type==="geojson"&&Vt(R,Z,U)?j.push({command:Pe.setGeoJSONSourceData,args:[U,Z[U].data]}):vt(U,Z,j,K)):ut(U,Z,j))})(y.sources,g.sources,B,A);var L=[];y.layers&&y.layers.forEach(function(R){A[R.source]?w.push({command:Pe.removeLayer,args:[R.id]}):L.push(R)}),w=w.concat(B),function(R,Z,j){Z=Z||[];var K,U,X,Q,ie,ce,le,he=(R=R||[]).map(Et),ge=Z.map(Et),Te=R.reduce(_t,{}),Se=Z.reduce(_t,{}),Le=he.slice(),Ge=Object.create(null);for(K=0,U=0;K<he.length;K++)Se.hasOwnProperty(X=he[K])?U++:(j.push({command:Pe.removeLayer,args:[X]}),Le.splice(Le.indexOf(X,U),1));for(K=0,U=0;K<ge.length;K++)Le[Le.length-1-K]!==(X=ge[ge.length-1-K])&&(Te.hasOwnProperty(X)?(j.push({command:Pe.removeLayer,args:[X]}),Le.splice(Le.lastIndexOf(X,Le.length-U),1)):U++,j.push({command:Pe.addLayer,args:[Se[X],ce=Le[Le.length-K]]}),Le.splice(Le.length-K,0,X),Ge[X]=!0);for(K=0;K<ge.length;K++)if(Q=Te[X=ge[K]],ie=Se[X],!Ge[X]&&!l.deepEqual(Q,ie))if(l.deepEqual(Q.source,ie.source)&&l.deepEqual(Q["source-layer"],ie["source-layer"])&&l.deepEqual(Q.type,ie.type)){for(le in pt(Q.layout,ie.layout,j,X,null,Pe.setLayoutProperty),pt(Q.paint,ie.paint,j,X,null,Pe.setPaintProperty),l.deepEqual(Q.filter,ie.filter)||j.push({command:Pe.setFilter,args:[X,ie.filter]}),l.deepEqual(Q.minzoom,ie.minzoom)&&l.deepEqual(Q.maxzoom,ie.maxzoom)||j.push({command:Pe.setLayerZoomRange,args:[X,ie.minzoom,ie.maxzoom]}),Q)Q.hasOwnProperty(le)&&le!=="layout"&&le!=="paint"&&le!=="filter"&&le!=="metadata"&&le!=="minzoom"&&le!=="maxzoom"&&(le.indexOf("paint.")===0?pt(Q[le],ie[le],j,X,le.slice(6),Pe.setPaintProperty):l.deepEqual(Q[le],ie[le])||j.push({command:Pe.setLayerProperty,args:[X,le,ie[le]]}));for(le in ie)ie.hasOwnProperty(le)&&!Q.hasOwnProperty(le)&&le!=="layout"&&le!=="paint"&&le!=="filter"&&le!=="metadata"&&le!=="minzoom"&&le!=="maxzoom"&&(le.indexOf("paint.")===0?pt(Q[le],ie[le],j,X,le.slice(6),Pe.setPaintProperty):l.deepEqual(Q[le],ie[le])||j.push({command:Pe.setLayerProperty,args:[X,le,ie[le]]}))}else j.push({command:Pe.removeLayer,args:[X]}),ce=Le[Le.lastIndexOf(X)+1],j.push({command:Pe.addLayer,args:[ie,ce]})}(L,g.layers,w)}catch(R){console.warn("Unable to compute style diff:",R),w=[{command:Pe.setStyle,args:[g]}]}return w}(this.serialize(),n).filter(function(y){return!(y.command in An)});if(p.length===0)return!1;var m=p.filter(function(y){return!(y.command in In)});if(m.length>0)throw new Error("Unimplemented: "+m.map(function(y){return y.command}).join(", ")+".");return p.forEach(function(y){y.command!=="setTransition"&&s[y.command].apply(s,y.args)}),this.stylesheet=n,!0},o.prototype.addImage=function(n,s){if(this.getImage(n))return this.fire(new l.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(n,s),this._afterImageUpdated(n)},o.prototype.updateImage=function(n,s){this.imageManager.updateImage(n,s)},o.prototype.getImage=function(n){return this.imageManager.getImage(n)},o.prototype.removeImage=function(n){if(!this.getImage(n))return this.fire(new l.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(n),this._afterImageUpdated(n)},o.prototype._afterImageUpdated=function(n){this._availableImages=this.imageManager.listImages(),this._changedImages[n]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new l.Event("data",{dataType:"style"}))},o.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},o.prototype.addSource=function(n,s,p){var m=this;if(p===void 0&&(p={}),this._checkLoaded(),this.sourceCaches[n]!==void 0)throw new Error("There is already a source with this ID");if(!s.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(s).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(s.type)>=0&&this._validate(l.validateStyle.source,"sources."+n,s,null,p))){this.map&&this.map._collectResourceTiming&&(s.collectResourceTiming=!0);var y=this.sourceCaches[n]=new W(n,s,this.dispatcher);y.style=this,y.setEventedParent(this,function(){return{isSourceLoaded:m.loaded(),source:y.serialize(),sourceId:n}}),y.onAdd(this.map),this._changed=!0}},o.prototype.removeSource=function(n){if(this._checkLoaded(),this.sourceCaches[n]===void 0)throw new Error("There is no source with this ID");for(var s in this._layers)if(this._layers[s].source===n)return this.fire(new l.ErrorEvent(new Error('Source "'+n+'" cannot be removed while layer "'+s+'" is using it.')));var p=this.sourceCaches[n];delete this.sourceCaches[n],delete this._updatedSources[n],p.fire(new l.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:n})),p.setEventedParent(null),p.clearTiles(),p.onRemove&&p.onRemove(this.map),this._changed=!0},o.prototype.setGeoJSONSourceData=function(n,s){this._checkLoaded(),this.sourceCaches[n].getSource().setData(s),this._changed=!0},o.prototype.getSource=function(n){return this.sourceCaches[n]&&this.sourceCaches[n].getSource()},o.prototype.addLayer=function(n,s,p){p===void 0&&(p={}),this._checkLoaded();var m=n.id;if(this.getLayer(m))this.fire(new l.ErrorEvent(new Error('Layer with id "'+m+'" already exists on this map')));else{var y;if(n.type==="custom"){if(to(this,l.validateCustomStyleLayer(n)))return;y=l.createStyleLayer(n)}else{if(typeof n.source=="object"&&(this.addSource(m,n.source),n=l.clone$1(n),n=l.extend(n,{source:m})),this._validate(l.validateStyle.layer,"layers."+m,n,{arrayIndex:-1},p))return;y=l.createStyleLayer(n),this._validateLayer(y),y.setEventedParent(this,{layer:{id:m}}),this._serializedLayers[y.id]=y.serialize()}var g=s?this._order.indexOf(s):this._order.length;if(s&&g===-1)this.fire(new l.ErrorEvent(new Error('Layer with id "'+s+'" does not exist on this map.')));else{if(this._order.splice(g,0,m),this._layerOrderChanged=!0,this._layers[m]=y,this._removedLayers[m]&&y.source&&y.type!=="custom"){var w=this._removedLayers[m];delete this._removedLayers[m],w.type!==y.type?this._updatedSources[y.source]="clear":(this._updatedSources[y.source]="reload",this.sourceCaches[y.source].pause())}this._updateLayer(y),y.onAdd&&y.onAdd(this.map)}}},o.prototype.moveLayer=function(n,s){if(this._checkLoaded(),this._changed=!0,this._layers[n]){if(n!==s){var p=this._order.indexOf(n);this._order.splice(p,1);var m=s?this._order.indexOf(s):this._order.length;s&&m===-1?this.fire(new l.ErrorEvent(new Error('Layer with id "'+s+'" does not exist on this map.'))):(this._order.splice(m,0,n),this._layerOrderChanged=!0)}}else this.fire(new l.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be moved.")))},o.prototype.removeLayer=function(n){this._checkLoaded();var s=this._layers[n];if(s){s.setEventedParent(null);var p=this._order.indexOf(n);this._order.splice(p,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[n]=s,delete this._layers[n],delete this._serializedLayers[n],delete this._updatedLayers[n],delete this._updatedPaintProps[n],s.onRemove&&s.onRemove(this.map)}else this.fire(new l.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be removed.")))},o.prototype.getLayer=function(n){return this._layers[n]},o.prototype.hasLayer=function(n){return n in this._layers},o.prototype.setLayerZoomRange=function(n,s,p){this._checkLoaded();var m=this.getLayer(n);m?m.minzoom===s&&m.maxzoom===p||(s!=null&&(m.minzoom=s),p!=null&&(m.maxzoom=p),this._updateLayer(m)):this.fire(new l.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot have zoom extent.")))},o.prototype.setFilter=function(n,s,p){p===void 0&&(p={}),this._checkLoaded();var m=this.getLayer(n);if(m){if(!l.deepEqual(m.filter,s))return s==null?(m.filter=void 0,void this._updateLayer(m)):void(this._validate(l.validateStyle.filter,"layers."+m.id+".filter",s,null,p)||(m.filter=l.clone$1(s),this._updateLayer(m)))}else this.fire(new l.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be filtered.")))},o.prototype.getFilter=function(n){return l.clone$1(this.getLayer(n).filter)},o.prototype.setLayoutProperty=function(n,s,p,m){m===void 0&&(m={}),this._checkLoaded();var y=this.getLayer(n);y?l.deepEqual(y.getLayoutProperty(s),p)||(y.setLayoutProperty(s,p,m),this._updateLayer(y)):this.fire(new l.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be styled.")))},o.prototype.getLayoutProperty=function(n,s){var p=this.getLayer(n);if(p)return p.getLayoutProperty(s);this.fire(new l.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style.")))},o.prototype.setPaintProperty=function(n,s,p,m){m===void 0&&(m={}),this._checkLoaded();var y=this.getLayer(n);y?l.deepEqual(y.getPaintProperty(s),p)||(y.setPaintProperty(s,p,m)&&this._updateLayer(y),this._changed=!0,this._updatedPaintProps[n]=!0):this.fire(new l.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be styled.")))},o.prototype.getPaintProperty=function(n,s){return this.getLayer(n).getPaintProperty(s)},o.prototype.setFeatureState=function(n,s){this._checkLoaded();var p=n.source,m=n.sourceLayer,y=this.sourceCaches[p];if(y!==void 0){var g=y.getSource().type;g==="geojson"&&m?this.fire(new l.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):g!=="vector"||m?(n.id===void 0&&this.fire(new l.ErrorEvent(new Error("The feature id parameter must be provided."))),y.setFeatureState(m,n.id,s)):this.fire(new l.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new l.ErrorEvent(new Error("The source '"+p+"' does not exist in the map's style.")))},o.prototype.removeFeatureState=function(n,s){this._checkLoaded();var p=n.source,m=this.sourceCaches[p];if(m!==void 0){var y=m.getSource().type,g=y==="vector"?n.sourceLayer:void 0;y!=="vector"||g?s&&typeof n.id!="string"&&typeof n.id!="number"?this.fire(new l.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):m.removeFeatureState(g,n.id,s):this.fire(new l.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new l.ErrorEvent(new Error("The source '"+p+"' does not exist in the map's style.")))},o.prototype.getFeatureState=function(n){this._checkLoaded();var s=n.source,p=n.sourceLayer,m=this.sourceCaches[s];if(m!==void 0){if(m.getSource().type!=="vector"||p)return n.id===void 0&&this.fire(new l.ErrorEvent(new Error("The feature id parameter must be provided."))),m.getFeatureState(p,n.id);this.fire(new l.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new l.ErrorEvent(new Error("The source '"+s+"' does not exist in the map's style.")))},o.prototype.getTransition=function(){return l.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},o.prototype.serialize=function(){return l.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:l.mapObject(this.sourceCaches,function(n){return n.serialize()}),layers:this._serializeLayers(this._order)},function(n){return n!==void 0})},o.prototype._updateLayer=function(n){this._updatedLayers[n.id]=!0,n.source&&!this._updatedSources[n.source]&&this.sourceCaches[n.source].getSource().type!=="raster"&&(this._updatedSources[n.source]="reload",this.sourceCaches[n.source].pause()),this._changed=!0},o.prototype._flattenAndSortRenderedFeatures=function(n){for(var s=this,p=function(Te){return s._layers[Te].type==="fill-extrusion"},m={},y=[],g=this._order.length-1;g>=0;g--){var w=this._order[g];if(p(w)){m[w]=g;for(var A=0,B=n;A<B.length;A+=1){var L=B[A][w];if(L)for(var R=0,Z=L;R<Z.length;R+=1)y.push(Z[R])}}}y.sort(function(Te,Se){return Se.intersectionZ-Te.intersectionZ});for(var j=[],K=this._order.length-1;K>=0;K--){var U=this._order[K];if(p(U))for(var X=y.length-1;X>=0;X--){var Q=y[X].feature;if(m[Q.layer.id]<K)break;j.push(Q),y.pop()}else for(var ie=0,ce=n;ie<ce.length;ie+=1){var le=ce[ie][U];if(le)for(var he=0,ge=le;he<ge.length;he+=1)j.push(ge[he].feature)}}return j},o.prototype.queryRenderedFeatures=function(n,s,p){s&&s.filter&&this._validate(l.validateStyle.filter,"queryRenderedFeatures.filter",s.filter,null,s);var m={};if(s&&s.layers){if(!Array.isArray(s.layers))return this.fire(new l.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var y=0,g=s.layers;y<g.length;y+=1){var w=g[y],A=this._layers[w];if(!A)return this.fire(new l.ErrorEvent(new Error("The layer '"+w+"' does not exist in the map's style and cannot be queried for features."))),[];m[A.source]=!0}}var B=[];for(var L in s.availableImages=this._availableImages,this.sourceCaches)s.layers&&!m[L]||B.push(jr(this.sourceCaches[L],this._layers,this._serializedLayers,n,s,p));return this.placement&&B.push(function(R,Z,j,K,U,X,Q){for(var ie={},ce=X.queryRenderedSymbols(K),le=[],he=0,ge=Object.keys(ce).map(Number);he<ge.length;he+=1)le.push(Q[ge[he]]);le.sort(ln);for(var Te=function(){var He=Le[Se],bt=He.featureIndex.lookupSymbolFeatures(ce[He.bucketInstanceId],Z,He.bucketIndex,He.sourceLayerIndex,U.filter,U.layers,U.availableImages,R);for(var Re in bt){var it=ie[Re]=ie[Re]||[],at=bt[Re];at.sort(function(ot,Qe){var Je=He.featureSortOrder;if(Je){var Sr=Je.indexOf(ot.featureIndex);return Je.indexOf(Qe.featureIndex)-Sr}return Qe.featureIndex-ot.featureIndex});for(var rt=0,tt=at;rt<tt.length;rt+=1)it.push(tt[rt])}},Se=0,Le=le;Se<Le.length;Se+=1)Te();var Ge=function(He){ie[He].forEach(function(bt){var Re=bt.feature,it=j[R[He].source].getFeatureState(Re.layer["source-layer"],Re.id);Re.source=Re.layer.source,Re.layer["source-layer"]&&(Re.sourceLayer=Re.layer["source-layer"]),Re.state=it})};for(var Ke in ie)Ge(Ke);return ie}(this._layers,this._serializedLayers,this.sourceCaches,n,s,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(B)},o.prototype.querySourceFeatures=function(n,s){s&&s.filter&&this._validate(l.validateStyle.filter,"querySourceFeatures.filter",s.filter,null,s);var p=this.sourceCaches[n];return p?function(m,y){for(var g=m.getRenderableIds().map(function(Z){return m.getTileByID(Z)}),w=[],A={},B=0;B<g.length;B++){var L=g[B],R=L.tileID.canonical.key;A[R]||(A[R]=!0,L.querySourceFeatures(w,y))}return w}(p,s):[]},o.prototype.addSourceType=function(n,s,p){return o.getSourceType(n)?p(new Error('A source type called "'+n+'" already exists.')):(o.setSourceType(n,s),s.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:n,url:s.workerSourceURL},p):p(null,null))},o.prototype.getLight=function(){return this.light.getLight()},o.prototype.setLight=function(n,s){s===void 0&&(s={}),this._checkLoaded();var p=this.light.getLight(),m=!1;for(var y in n)if(!l.deepEqual(n[y],p[y])){m=!0;break}if(m){var g={now:l.browser.now(),transition:l.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(n,s),this.light.updateTransitions(g)}},o.prototype._validate=function(n,s,p,m,y){return y===void 0&&(y={}),(!y||y.validate!==!1)&&to(this,n.call(l.validateStyle,l.extend({key:s,style:this.serialize(),value:p,styleSpec:l.styleSpec},m)))},o.prototype._remove=function(){for(var n in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),l.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[n].setEventedParent(null);for(var s in this.sourceCaches)this.sourceCaches[s].clearTiles(),this.sourceCaches[s].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},o.prototype._clearSource=function(n){this.sourceCaches[n].clearTiles()},o.prototype._reloadSource=function(n){this.sourceCaches[n].resume(),this.sourceCaches[n].reload()},o.prototype._updateSources=function(n){for(var s in this.sourceCaches)this.sourceCaches[s].update(n)},o.prototype._generateCollisionBoxes=function(){for(var n in this.sourceCaches)this._reloadSource(n)},o.prototype._updatePlacement=function(n,s,p,m,y){y===void 0&&(y=!1);for(var g=!1,w=!1,A={},B=0,L=this._order;B<L.length;B+=1){var R=this._layers[L[B]];if(R.type==="symbol"){if(!A[R.source]){var Z=this.sourceCaches[R.source];A[R.source]=Z.getRenderableIds(!0).map(function(Q){return Z.getTileByID(Q)}).sort(function(Q,ie){return ie.tileID.overscaledZ-Q.tileID.overscaledZ||(Q.tileID.isLessThan(ie.tileID)?-1:1)})}var j=this.crossTileSymbolIndex.addLayer(R,A[R.source],n.center.lng);g=g||j}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((y=y||this._layerOrderChanged||p===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(l.browser.now(),n.zoom))&&(this.pauseablePlacement=new ba(n,this._order,y,s,p,m,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,A),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(l.browser.now()),w=!0),g&&this.pauseablePlacement.placement.setStale()),w||g)for(var K=0,U=this._order;K<U.length;K+=1){var X=this._layers[U[K]];X.type==="symbol"&&this.placement.updateLayerOpacities(X,A[X.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(l.browser.now())},o.prototype._releaseSymbolFadeTiles=function(){for(var n in this.sourceCaches)this.sourceCaches[n].releaseSymbolFadeTiles()},o.prototype.getImages=function(n,s,p){this.imageManager.getImages(s.icons,p),this._updateTilesForChangedImages();var m=this.sourceCaches[s.source];m&&m.setDependencies(s.tileID.key,s.type,s.icons)},o.prototype.getGlyphs=function(n,s,p){this.glyphManager.getGlyphs(s.stacks,p)},o.prototype.getResource=function(n,s,p){return l.makeRequest(s,p)},o}(l.Evented);ui.getSourceType=function(i){return bn[i]},ui.setSourceType=function(i,o){bn[i]=o},ui.registerForPluginStateChange=l.registerForPluginStateChange;var mr=l.createLayout([{name:"a_pos",type:"Int16",components:2}]),$o=Ut(`#ifdef GL_ES
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const st=require("./LoadingSpinner-DV2HOq5V.js"),F=require("vue"),aa=require("pinia");let Ka=null;typeof window<"u"&&(Ka=document.currentScript);const dy={options:{div:"map",logo:"os-logo-maps",statement:"Contains OS data © Crown copyright and database rights YYYY",prefix:"",suffix:""},init(d){if(typeof window<"u"){Ka&&(this.options.div=Ka.getAttribute("data-div")||this.options.div,this.options.logo=Ka.getAttribute("data-logo")||this.options.logo,this.options.statement=Ka.getAttribute("data-statement")||this.options.statement,this.options.prefix=Ka.getAttribute("data-prefix")||this.options.prefix,this.options.suffix=Ka.getAttribute("data-suffix")||this.options.suffix),d=typeof d<"u"?d:{},Object.assign(this.options,d);const h=document.getElementById(this.options.div);let _="os-api-branding logo";this.options.logo==="os-logo-maps-white"&&(_="os-api-branding logo white");let E=this.options.statement;E=E.replace("YYYY",new Date().getFullYear()),this.options.prefix!==""&&(E=`${this.options.prefix}<span>|</span>${E}`),this.options.suffix!==""&&(E=`${E}<span>|</span>${this.options.suffix}`),document.querySelectorAll(`#${this.options.div} .os-api-branding`).forEach(l=>l.remove());const k=document.createElement("div");k.className=_,h.appendChild(k);const V=document.createElement("div");V.className="os-api-branding copyright",V.innerHTML=E,h.appendChild(V)}}},Xi=aa.defineStore("map",()=>{const d=F.ref([]),h=F.ref([]),_=F.ref(null),E=F.ref(null),k=F.ref(null);function V(Ae){d.value.push({id:Ae.id,filters:Ae.filters,places:Ae.places,activePins:Ae.activePins,hovered:"",activePlace:null})}function l(Ae){d.value.forEach(Je=>{Je.id===Ae.mapId&&(Je.hovered=Ae.hoveredFeature)})}function re(Ae){d.value.forEach(Je=>{Je.id===Ae.mapId&&(Je.activePlace=Ae.activeFeature)})}function q(Ae){h.value=Ae}function me(Ae){_.value=Ae}function pe(Ae){E.value=Ae}function ke(Ae){return d.value.find(Je=>Je.id===Ae)}function ae(Ae){return d.value.find(qe=>qe.id===Ae).hovered}function ve(Ae){return d.value.find(qe=>qe.id===Ae).activePlace}return{maps:d,activeSubcatFilters:h,selectedSubCategory:_,activeMarkerPos:E,activePlace:k,addMapInstance:V,setHoveredPlace:l,setActivePlace:re,setActiveSubcatFilters:q,setSelectedSubcat:me,setActiveMarkerPos:pe,getMapById:ke,getHoveredStop:ae,getActivePlace:ve}});var Qg={exports:{}};(function(d,h){(function(_,E){d.exports=E()})(st.commonjsGlobal,function(){var _,E,k;function V(l,re){if(!_)_=re;else if(!E)E=re;else{var q="var sharedChunk = {}; ("+_+")(sharedChunk); ("+E+")(sharedChunk);",me={};_(me),k=re(me),typeof window<"u"&&(k.workerUrl=window.URL.createObjectURL(new Blob([q],{type:"text/javascript"})))}}return V(["exports"],function(l){function re(e,t){return e(t={exports:{}},t.exports),t.exports}var q=me;function me(e,t,r,a){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(a-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=a,this.p2x=r,this.p2y=a}me.prototype.sampleCurveX=function(e){return((this.ax*e+this.bx)*e+this.cx)*e},me.prototype.sampleCurveY=function(e){return((this.ay*e+this.by)*e+this.cy)*e},me.prototype.sampleCurveDerivativeX=function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},me.prototype.solveCurveX=function(e,t){var r,a,u,c,f;for(t===void 0&&(t=1e-6),u=e,f=0;f<8;f++){if(c=this.sampleCurveX(u)-e,Math.abs(c)<t)return u;var v=this.sampleCurveDerivativeX(u);if(Math.abs(v)<1e-6)break;u-=c/v}if((u=e)<(r=0))return r;if(u>(a=1))return a;for(;r<a;){if(c=this.sampleCurveX(u),Math.abs(c-e)<t)return u;e>c?r=u:a=u,u=.5*(a-r)+r}return u},me.prototype.solve=function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))};var pe=ke;function ke(e,t){this.x=e,this.y=t}ke.prototype={clone:function(){return new ke(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),a=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=a,this},_rotateAround:function(e,t){var r=Math.cos(e),a=Math.sin(e),u=t.y+a*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-a*(this.y-t.y),this.y=u,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},ke.convert=function(e){return e instanceof ke?e:Array.isArray(e)?new ke(e[0],e[1]):e};var ae=typeof self<"u"?self:{},ve=Math.pow(2,53)-1;function Ae(e,t,r,a){var u=new q(e,t,r,a);return function(c){return u.solve(c)}}var Je=Ae(.25,.1,.25,1);function qe(e,t,r){return Math.min(r,Math.max(t,e))}function pt(e,t,r){var a=r-t,u=((e-t)%a+a)%a+t;return u===t?r:u}function ot(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var a=0,u=t;a<u.length;a+=1){var c=u[a];for(var f in c)e[f]=c[f]}return e}var Rt=1;function bt(){return Rt++}function Ct(){return function e(t){return t?(t^16*Math.random()>>t/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,e)}()}function Qt(e){return!!e&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(e)}function vr(e,t){e.forEach(function(r){t[r]&&(t[r]=t[r].bind(t))})}function Er(e,t){return e.indexOf(t,e.length-t.length)!==-1}function er(e,t,r){var a={};for(var u in e)a[u]=t.call(r||this,e[u],u,e);return a}function Qr(e,t,r){var a={};for(var u in e)t.call(r||this,e[u],u,e)&&(a[u]=e[u]);return a}function ei(e){return Array.isArray(e)?e.map(ei):typeof e=="object"&&e?er(e,ei):e}var vi={};function It(e){vi[e]||(typeof console<"u"&&console.warn(e),vi[e]=!0)}function gr(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function Bo(e){for(var t=0,r=0,a=e.length,u=a-1,c=void 0,f=void 0;r<a;u=r++)t+=((f=e[u]).x-(c=e[r]).x)*(c.y+f.y);return t}function li(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}function Do(e){var t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,function(a,u,c,f){var v=c||f;return t[u]=!v||v.toLowerCase(),""}),t["max-age"]){var r=parseInt(t["max-age"],10);isNaN(r)?delete t["max-age"]:t["max-age"]=r}return t}var Lo=null;function ns(e){if(Lo==null){var t=e.navigator?e.navigator.userAgent:null;Lo=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return Lo}function xn(e){try{var t=ae[e];return t.setItem("_mapbox_test_",1),t.removeItem("_mapbox_test_"),!0}catch{return!1}}var Oi,Ki,Xn,Kn,bn=ae.performance&&ae.performance.now?ae.performance.now.bind(ae.performance):Date.now.bind(Date),_l=ae.requestAnimationFrame||ae.mozRequestAnimationFrame||ae.webkitRequestAnimationFrame||ae.msRequestAnimationFrame,$r=ae.cancelAnimationFrame||ae.mozCancelAnimationFrame||ae.webkitCancelAnimationFrame||ae.msCancelAnimationFrame,ln={now:bn,frame:function(e){var t=_l(e);return{cancel:function(){return $r(t)}}},getImageData:function(e,t){t===void 0&&(t=0);var r=ae.document.createElement("canvas"),a=r.getContext("2d");if(!a)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,a.drawImage(e,0,0,e.width,e.height),a.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:function(e){return Oi||(Oi=ae.document.createElement("a")),Oi.href=e,Oi.href},hardwareConcurrency:ae.navigator&&ae.navigator.hardwareConcurrency||4,get devicePixelRatio(){return ae.devicePixelRatio},get prefersReducedMotion(){return!!ae.matchMedia&&(Ki==null&&(Ki=ae.matchMedia("(prefers-reduced-motion: reduce)")),Ki.matches)}},Vt={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?this.API_URL.indexOf("https://api.mapbox.cn")===0?"https://events.mapbox.cn/events/v2":this.API_URL.indexOf("https://api.mapbox.com")===0?"https://events.mapbox.com/events/v2":null:null},FEEDBACK_URL:"https://apps.mapbox.com/feedback",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},Ji={supported:!1,testSupport:function(e){!Ro&&Kn&&(Vi?yt(e):Xn=e)}},Ro=!1,Vi=!1;function yt(e){var t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,Kn),e.isContextLost())return;Ji.supported=!0}catch{}e.deleteTexture(t),Ro=!0}ae.document&&((Kn=ae.document.createElement("img")).onload=function(){Xn&&yt(Xn),Xn=null,Vi=!0},Kn.onerror=function(){Ro=!0,Xn=null},Kn.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var wn="01",ti=function(e,t){this._transformRequestFn=e,this._customAccessToken=t,this._createSkuToken()};function Ti(e){return e.indexOf("mapbox:")===0}ti.prototype._createSkuToken=function(){var e=function(){for(var t="",r=0;r<10;r++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",wn,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=e.token,this._skuTokenExpiresAt=e.tokenExpiresAt},ti.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},ti.prototype.transformRequest=function(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}},ti.prototype.normalizeStyleURL=function(e,t){if(!Ti(e))return e;var r=Ii(e);return r.path="/styles/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},ti.prototype.normalizeGlyphsURL=function(e,t){if(!Ti(e))return e;var r=Ii(e);return r.path="/fonts/v1"+r.path,this._makeAPIURL(r,this._customAccessToken||t)},ti.prototype.normalizeSourceURL=function(e,t){if(!Ti(e))return e;var r=Ii(e);return r.path="/v4/"+r.authority+".json",r.params.push("secure"),this._makeAPIURL(r,this._customAccessToken||t)},ti.prototype.normalizeSpriteURL=function(e,t,r,a){var u=Ii(e);return Ti(e)?(u.path="/styles/v1"+u.path+"/sprite"+t+r,this._makeAPIURL(u,this._customAccessToken||a)):(u.path+=""+t+r,Jn(u))},ti.prototype.normalizeTileURL=function(e,t){if(this._isSkuTokenExpired()&&this._createSkuToken(),e&&!Ti(e))return e;var r=Ii(e);r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(ln.devicePixelRatio>=2||t===512?"@2x":"")+(Ji.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path;var a=this._customAccessToken||function(u){for(var c=0,f=u;c<f.length;c+=1){var v=f[c].match(/^access_token=(.*)$/);if(v)return v[1]}return null}(r.params)||Vt.ACCESS_TOKEN;return Vt.REQUIRE_ACCESS_TOKEN&&a&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,a)},ti.prototype.canonicalizeTileURL=function(e,t){var r=Ii(e);if(!r.path.match(/(^\/v4\/)/)||!r.path.match(/\.[\w]+$/))return e;var a="mapbox://tiles/";a+=r.path.replace("/v4/","");var u=r.params;return t&&(u=u.filter(function(c){return!c.match(/^access_token=/)})),u.length&&(a+="?"+u.join("&")),a},ti.prototype.canonicalizeTileset=function(e,t){for(var r=!!t&&Ti(t),a=[],u=0,c=e.tiles||[];u<c.length;u+=1){var f=c[u];Ui(f)?a.push(this.canonicalizeTileURL(f,r)):a.push(f)}return a},ti.prototype._makeAPIURL=function(e,t){var r="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",a=Ii(Vt.API_URL);if(e.protocol=a.protocol,e.authority=a.authority,e.protocol==="http"){var u=e.params.indexOf("secure");u>=0&&e.params.splice(u,1)}if(a.path!=="/"&&(e.path=""+a.path+e.path),!Vt.REQUIRE_ACCESS_TOKEN)return Jn(e);if(!(t=t||Vt.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+r);if(t[0]==="s")throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+r);return e.params=e.params.filter(function(c){return c.indexOf("access_token")===-1}),e.params.push("access_token="+t),Jn(e)};var xl=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Ui(e){return xl.test(e)}var pa=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function Ii(e){var t=e.match(pa);if(!t)throw new Error("Unable to parse URL object");return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}function Jn(e){var t=e.params.length?"?"+e.params.join("&"):"";return e.protocol+"://"+e.authority+e.path+t}function Fo(e){if(!e)return null;var t=e.split(".");if(!t||t.length!==3)return null;try{return JSON.parse(decodeURIComponent(ae.atob(t[1]).split("").map(function(r){return"%"+("00"+r.charCodeAt(0).toString(16)).slice(-2)}).join("")))}catch{return null}}var Ai=function(e){this.type=e,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null};Ai.prototype.getStorageKey=function(e){var t,r=Fo(Vt.ACCESS_TOKEN);return t=r&&r.u?ae.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,function(a,u){return String.fromCharCode(+("0x"+u))})):Vt.ACCESS_TOKEN||"",e?"mapbox.eventData."+e+":"+t:"mapbox.eventData:"+t},Ai.prototype.fetchEventData=function(){var e=xn("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{var a=ae.localStorage.getItem(t);a&&(this.eventData=JSON.parse(a));var u=ae.localStorage.getItem(r);u&&(this.anonId=u)}catch{It("Unable to read from LocalStorage")}},Ai.prototype.saveEventData=function(){var e=xn("localStorage"),t=this.getStorageKey(),r=this.getStorageKey("uuid");if(e)try{ae.localStorage.setItem(r,this.anonId),Object.keys(this.eventData).length>=1&&ae.localStorage.setItem(t,JSON.stringify(this.eventData))}catch{It("Unable to write to LocalStorage")}},Ai.prototype.processRequests=function(e){},Ai.prototype.postEvent=function(e,t,r,a){var u=this;if(Vt.EVENTS_URL){var c=Ii(Vt.EVENTS_URL);c.params.push("access_token="+(a||Vt.ACCESS_TOKEN||""));var f={event:this.type,created:new Date(e).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.13.3",skuId:wn,userId:this.anonId},v=t?ot(f,t):f,x={url:Jn(c),headers:{"Content-Type":"text/plain"},body:JSON.stringify([v])};this.pendingRequest=ar(x,function(b){u.pendingRequest=null,r(b),u.saveEventData(),u.processRequests(a)})}},Ai.prototype.queueRequest=function(e,t){this.queue.push(e),this.processRequests(t)};var Ei,Yn,Ni=function(e){function t(){e.call(this,"map.load"),this.success={},this.skuToken=""}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.postMapLoadEvent=function(r,a,u,c){this.skuToken=u;var f=!(!c&&!Vt.ACCESS_TOKEN),v=Array.isArray(r)&&r.some(function(x){return Ti(x)||Ui(x)});Vt.EVENTS_URL&&f&&v&&this.queueRequest({id:a,timestamp:Date.now()},c)},t.prototype.processRequests=function(r){var a=this;if(!this.pendingRequest&&this.queue.length!==0){var u=this.queue.shift(),c=u.id,f=u.timestamp;c&&this.success[c]||(this.anonId||this.fetchEventData(),Qt(this.anonId)||(this.anonId=Ct()),this.postEvent(f,{skuToken:this.skuToken},function(v){v||c&&(a.success[c]=!0)},r))}},t}(Ai),os=new(function(e){function t(r){e.call(this,"appUserTurnstile"),this._customAccessToken=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.postTurnstileEvent=function(r,a){Vt.EVENTS_URL&&Vt.ACCESS_TOKEN&&Array.isArray(r)&&r.some(function(u){return Ti(u)||Ui(u)})&&this.queueRequest(Date.now(),a)},t.prototype.processRequests=function(r){var a=this;if(!this.pendingRequest&&this.queue.length!==0){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var u=Fo(Vt.ACCESS_TOKEN),c=u?u.u:Vt.ACCESS_TOKEN,f=c!==this.eventData.tokenU;Qt(this.anonId)||(this.anonId=Ct(),f=!0);var v=this.queue.shift();if(this.eventData.lastSuccess){var x=new Date(this.eventData.lastSuccess),b=new Date(v),S=(v-this.eventData.lastSuccess)/864e5;f=f||S>=1||S<-1||x.getDate()!==b.getDate()}else f=!0;if(!f)return this.processRequests();this.postEvent(v,{"enabled.telemetry":!1},function(T){T||(a.eventData.lastSuccess=v,a.eventData.tokenU=c)},r)}},t}(Ai)),as=os.postTurnstileEvent.bind(os),ha=new Ni,fa=ha.postMapLoadEvent.bind(ha),Oo=500,ss=50;function Vo(){ae.caches&&!Ei&&(Ei=ae.caches.open("mapbox-tiles"))}function da(e){var t=e.indexOf("?");return t<0?e:e.slice(0,t)}var Qn,ma=1/0;function ya(){return Qn==null&&(Qn=ae.OffscreenCanvas&&new ae.OffscreenCanvas(1,1).getContext("2d")&&typeof ae.createImageBitmap=="function"),Qn}var ls={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};typeof Object.freeze=="function"&&Object.freeze(ls);var us=function(e){function t(r,a,u){a===401&&Ui(u)&&(r+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),e.call(this,r),this.status=a,this.url=u,this.name=this.constructor.name,this.message=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},t}(Error),eo=li()?function(){return self.worker&&self.worker.referrer}:function(){return(ae.location.protocol==="blob:"?ae.parent:ae).location.href},un,cn,Uo=function(e,t){if(!(/^file:/.test(r=e.url)||/^file:/.test(eo())&&!/^\w+:/.test(r))){if(ae.fetch&&ae.Request&&ae.AbortController&&ae.Request.prototype.hasOwnProperty("signal"))return function(a,u){var c,f=new ae.AbortController,v=new ae.Request(a.url,{method:a.method||"GET",body:a.body,credentials:a.credentials,headers:a.headers,referrer:eo(),signal:f.signal}),x=!1,b=!1,S=(c=v.url).indexOf("sku=")>0&&Ui(c);a.type==="json"&&v.headers.set("Accept","application/json");var T=function(z,N,$){if(!b){if(z&&z.message!=="SecurityError"&&It(z),N&&$)return C(N);var J=Date.now();ae.fetch(v).then(function(H){if(H.ok){var te=S?H.clone():null;return C(H,te,J)}return u(new us(H.statusText,H.status,a.url))}).catch(function(H){H.code!==20&&u(new Error(H.message))})}},C=function(z,N,$){(a.type==="arrayBuffer"?z.arrayBuffer():a.type==="json"?z.json():z.text()).then(function(J){b||(N&&$&&function(H,te,oe){if(Vo(),Ei){var se={status:te.status,statusText:te.statusText,headers:new ae.Headers};te.headers.forEach(function(ye,we){return se.headers.set(we,ye)});var ue=Do(te.headers.get("Cache-Control")||"");ue["no-store"]||(ue["max-age"]&&se.headers.set("Expires",new Date(oe+1e3*ue["max-age"]).toUTCString()),new Date(se.headers.get("Expires")).getTime()-oe<42e4||function(ye,we){if(Yn===void 0)try{new Response(new ReadableStream),Yn=!0}catch{Yn=!1}Yn?we(ye.body):ye.blob().then(we)}(te,function(ye){var we=new ae.Response(ye,se);Vo(),Ei&&Ei.then(function(Ie){return Ie.put(da(H.url),we)}).catch(function(Ie){return It(Ie.message)})}))}}(v,N,$),x=!0,u(null,J,z.headers.get("Cache-Control"),z.headers.get("Expires")))}).catch(function(J){b||u(new Error(J.message))})};return S?function(z,N){if(Vo(),!Ei)return N(null);var $=da(z.url);Ei.then(function(J){J.match($).then(function(H){var te=function(oe){if(!oe)return!1;var se=new Date(oe.headers.get("Expires")||0),ue=Do(oe.headers.get("Cache-Control")||"");return se>Date.now()&&!ue["no-cache"]}(H);J.delete($),te&&J.put($,H.clone()),N(null,H,te)}).catch(N)}).catch(N)}(v,T):T(null,null),{cancel:function(){b=!0,x||f.abort()}}}(e,t);if(li()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var r;return function(a,u){var c=new ae.XMLHttpRequest;for(var f in c.open(a.method||"GET",a.url,!0),a.type==="arrayBuffer"&&(c.responseType="arraybuffer"),a.headers)c.setRequestHeader(f,a.headers[f]);return a.type==="json"&&(c.responseType="text",c.setRequestHeader("Accept","application/json")),c.withCredentials=a.credentials==="include",c.onerror=function(){u(new Error(c.statusText))},c.onload=function(){if((c.status>=200&&c.status<300||c.status===0)&&c.response!==null){var v=c.response;if(a.type==="json")try{v=JSON.parse(c.response)}catch(x){return u(x)}u(null,v,c.getResponseHeader("Cache-Control"),c.getResponseHeader("Expires"))}else u(new us(c.statusText,c.status,a.url))},c.send(a.body),{cancel:function(){return c.abort()}}}(e,t)},va=function(e,t){return Uo(ot(e,{type:"arrayBuffer"}),t)},ar=function(e,t){return Uo(ot(e,{method:"POST"}),t)},I="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";un=[],cn=0;var P=function(e,t){if(Ji.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),cn>=Vt.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:e,callback:t,cancelled:!1,cancel:function(){this.cancelled=!0}};return un.push(r),r}cn++;var a=!1,u=function(){if(!a)for(a=!0,cn--;un.length&&cn<Vt.MAX_PARALLEL_IMAGE_REQUESTS;){var f=un.shift();f.cancelled||(f.cancel=P(f.requestParameters,f.callback).cancel)}},c=va(e,function(f,v,x,b){u(),f?t(f):v&&(ya()?function(S,T){var C=new ae.Blob([new Uint8Array(S)],{type:"image/png"});ae.createImageBitmap(C).then(function(z){T(null,z)}).catch(function(z){T(new Error("Could not load image because of "+z.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))})}(v,t):function(S,T,C,z){var N=new ae.Image,$=ae.URL;N.onload=function(){T(null,N),$.revokeObjectURL(N.src),N.onload=null,ae.requestAnimationFrame(function(){N.src=I})},N.onerror=function(){return T(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))};var J=new ae.Blob([new Uint8Array(S)],{type:"image/png"});N.cacheControl=C,N.expires=z,N.src=S.byteLength?$.createObjectURL(J):I}(v,t,x,b))});return{cancel:function(){c.cancel(),u()}}};function M(e,t,r){r[e]&&r[e].indexOf(t)!==-1||(r[e]=r[e]||[],r[e].push(t))}function O(e,t,r){if(r&&r[e]){var a=r[e].indexOf(t);a!==-1&&r[e].splice(a,1)}}var G=function(e,t){t===void 0&&(t={}),ot(this,t),this.type=e},Y=function(e){function t(r,a){a===void 0&&(a={}),e.call(this,"error",ot({error:r},a))}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(G),ee=function(){};ee.prototype.on=function(e,t){return this._listeners=this._listeners||{},M(e,t,this._listeners),this},ee.prototype.off=function(e,t){return O(e,t,this._listeners),O(e,t,this._oneTimeListeners),this},ee.prototype.once=function(e,t){return this._oneTimeListeners=this._oneTimeListeners||{},M(e,t,this._oneTimeListeners),this},ee.prototype.fire=function(e,t){typeof e=="string"&&(e=new G(e,t||{}));var r=e.type;if(this.listens(r)){e.target=this;for(var a=0,u=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];a<u.length;a+=1)u[a].call(this,e);for(var c=0,f=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];c<f.length;c+=1){var v=f[c];O(r,v,this._oneTimeListeners),v.call(this,e)}var x=this._eventedParent;x&&(ot(e,typeof this._eventedParentData=="function"?this._eventedParentData():this._eventedParentData),x.fire(e))}else e instanceof Y&&console.error(e.error);return this},ee.prototype.listens=function(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)},ee.prototype.setEventedParent=function(e,t){return this._eventedParent=e,this._eventedParentData=t,this};var D={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},light:{type:"light"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{},within:{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}},W=function(e,t,r,a){this.message=(e?e+": ":"")+r,a&&(this.identifier=a),t!=null&&t.__line__&&(this.line=t.__line__)};function ne(e){var t=e.value;return t?[new W(e.key,t,"constants have been deprecated as of v8")]:[]}function _e(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];for(var a=0,u=t;a<u.length;a+=1){var c=u[a];for(var f in c)e[f]=c[f]}return e}function be(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function fe(e){if(Array.isArray(e))return e.map(fe);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){var t={};for(var r in e)t[r]=fe(e[r]);return t}return be(e)}var xe=function(e){function t(r,a){e.call(this,a),this.message=a,this.key=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(Error),Ve=function(e,t){t===void 0&&(t=[]),this.parent=e,this.bindings={};for(var r=0,a=t;r<a.length;r+=1){var u=a[r];this.bindings[u[0]]=u[1]}};Ve.prototype.concat=function(e){return new Ve(this,e)},Ve.prototype.get=function(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(e+" not found in scope.")},Ve.prototype.has=function(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)};var Fe={kind:"null"},de={kind:"number"},De={kind:"string"},Ee={kind:"boolean"},Ce={kind:"color"},ut={kind:"object"},ze={kind:"value"},vt={kind:"collator"},Ut={kind:"formatted"},ht={kind:"resolvedImage"};function kt(e,t){return{kind:"array",itemType:e,N:t}}function _t(e){if(e.kind==="array"){var t=_t(e.itemType);return typeof e.N=="number"?"array<"+t+", "+e.N+">":e.itemType.kind==="value"?"array":"array<"+t+">"}return e.kind}var qr=[Fe,de,De,Ee,Ce,Ut,ut,kt(ze),ht];function Bt(e,t){if(t.kind==="error")return null;if(e.kind==="array"){if(t.kind==="array"&&(t.N===0&&t.itemType.kind==="value"||!Bt(e.itemType,t.itemType))&&(typeof e.N!="number"||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if(e.kind==="value"){for(var r=0,a=qr;r<a.length;r+=1)if(!Bt(a[r],t))return null}}return"Expected "+_t(e)+" but found "+_t(t)+" instead."}function sr(e,t){return t.some(function(r){return r.kind===e.kind})}function Ft(e,t){return t.some(function(r){return r==="null"?e===null:r==="array"?Array.isArray(e):r==="object"?e&&!Array.isArray(e)&&typeof e=="object":r===typeof e})}var mt=re(function(e,t){var r={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],rebeccapurple:[102,51,153,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function a(v){return(v=Math.round(v))<0?0:v>255?255:v}function u(v){return a(v[v.length-1]==="%"?parseFloat(v)/100*255:parseInt(v))}function c(v){return(x=v[v.length-1]==="%"?parseFloat(v)/100:parseFloat(v))<0?0:x>1?1:x;var x}function f(v,x,b){return b<0?b+=1:b>1&&(b-=1),6*b<1?v+(x-v)*b*6:2*b<1?x:3*b<2?v+(x-v)*(2/3-b)*6:v}try{t.parseCSSColor=function(v){var x,b=v.replace(/ /g,"").toLowerCase();if(b in r)return r[b].slice();if(b[0]==="#")return b.length===4?(x=parseInt(b.substr(1),16))>=0&&x<=4095?[(3840&x)>>4|(3840&x)>>8,240&x|(240&x)>>4,15&x|(15&x)<<4,1]:null:b.length===7&&(x=parseInt(b.substr(1),16))>=0&&x<=16777215?[(16711680&x)>>16,(65280&x)>>8,255&x,1]:null;var S=b.indexOf("("),T=b.indexOf(")");if(S!==-1&&T+1===b.length){var C=b.substr(0,S),z=b.substr(S+1,T-(S+1)).split(","),N=1;switch(C){case"rgba":if(z.length!==4)return null;N=c(z.pop());case"rgb":return z.length!==3?null:[u(z[0]),u(z[1]),u(z[2]),N];case"hsla":if(z.length!==4)return null;N=c(z.pop());case"hsl":if(z.length!==3)return null;var $=(parseFloat(z[0])%360+360)%360/360,J=c(z[1]),H=c(z[2]),te=H<=.5?H*(J+1):H+J-H*J,oe=2*H-te;return[a(255*f(oe,te,$+1/3)),a(255*f(oe,te,$)),a(255*f(oe,te,$-1/3)),N];default:return null}}return null}}catch{}}).parseCSSColor,Mt=function(e,t,r,a){a===void 0&&(a=1),this.r=e,this.g=t,this.b=r,this.a=a};Mt.parse=function(e){if(e){if(e instanceof Mt)return e;if(typeof e=="string"){var t=mt(e);if(t)return new Mt(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}}},Mt.prototype.toString=function(){var e=this.toArray(),t=e[1],r=e[2],a=e[3];return"rgba("+Math.round(e[0])+","+Math.round(t)+","+Math.round(r)+","+a+")"},Mt.prototype.toArray=function(){var e=this.a;return e===0?[0,0,0,0]:[255*this.r/e,255*this.g/e,255*this.b/e,e]},Mt.black=new Mt(0,0,0,1),Mt.white=new Mt(1,1,1,1),Mt.transparent=new Mt(0,0,0,0),Mt.red=new Mt(1,0,0,1);var ri=function(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})};ri.prototype.compare=function(e,t){return this.collator.compare(e,t)},ri.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale};var ga=function(e,t,r,a,u){this.text=e,this.image=t,this.scale=r,this.fontStack=a,this.textColor=u},Pr=function(e){this.sections=e};Pr.fromString=function(e){return new Pr([new ga(e,null,null,null,null)])},Pr.prototype.isEmpty=function(){return this.sections.length===0||!this.sections.some(function(e){return e.text.length!==0||e.image&&e.image.name.length!==0})},Pr.factory=function(e){return e instanceof Pr?e:Pr.fromString(e)},Pr.prototype.toString=function(){return this.sections.length===0?"":this.sections.map(function(e){return e.text}).join("")},Pr.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var a=r[t];if(a.image)e.push(["image",a.image.name]);else{e.push(a.text);var u={};a.fontStack&&(u["text-font"]=["literal",a.fontStack.split(",")]),a.scale&&(u["font-scale"]=a.scale),a.textColor&&(u["text-color"]=["rgba"].concat(a.textColor.toArray())),e.push(u)}}return e};var ii=function(e){this.name=e.name,this.available=e.available};function bl(e,t,r,a){return typeof e=="number"&&e>=0&&e<=255&&typeof t=="number"&&t>=0&&t<=255&&typeof r=="number"&&r>=0&&r<=255?a===void 0||typeof a=="number"&&a>=0&&a<=1?null:"Invalid rgba value ["+[e,t,r,a].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+(typeof a=="number"?[e,t,r,a]:[e,t,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function _a(e){if(e===null||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||e instanceof Mt||e instanceof ri||e instanceof Pr||e instanceof ii)return!0;if(Array.isArray(e)){for(var t=0,r=e;t<r.length;t+=1)if(!_a(r[t]))return!1;return!0}if(typeof e=="object"){for(var a in e)if(!_a(e[a]))return!1;return!0}return!1}function lr(e){if(e===null)return Fe;if(typeof e=="string")return De;if(typeof e=="boolean")return Ee;if(typeof e=="number")return de;if(e instanceof Mt)return Ce;if(e instanceof ri)return vt;if(e instanceof Pr)return Ut;if(e instanceof ii)return ht;if(Array.isArray(e)){for(var t,r=e.length,a=0,u=e;a<u.length;a+=1){var c=lr(u[a]);if(t){if(t===c)continue;t=ze;break}t=c}return kt(t||ze,r)}return ut}function xa(e){var t=typeof e;return e===null?"":t==="string"||t==="number"||t==="boolean"?String(e):e instanceof Mt||e instanceof Pr||e instanceof ii?e.toString():JSON.stringify(e)}ii.prototype.toString=function(){return this.name},ii.fromString=function(e){return e?new ii({name:e,available:!1}):null},ii.prototype.serialize=function(){return["image",this.name]};var jr=function(e,t){this.type=e,this.value=t};jr.parse=function(e,t){if(e.length!==2)return t.error("'literal' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(!_a(e[1]))return t.error("invalid value");var r=e[1],a=lr(r),u=t.expectedType;return a.kind!=="array"||a.N!==0||!u||u.kind!=="array"||typeof u.N=="number"&&u.N!==0||(a=u),new jr(a,r)},jr.prototype.evaluate=function(){return this.value},jr.prototype.eachChild=function(){},jr.prototype.outputDefined=function(){return!0},jr.prototype.serialize=function(){return this.type.kind==="array"||this.type.kind==="object"?["literal",this.value]:this.value instanceof Mt?["rgba"].concat(this.value.toArray()):this.value instanceof Pr?this.value.serialize():this.value};var Cr=function(e){this.name="ExpressionEvaluationError",this.message=e};Cr.prototype.toJSON=function(){return this.message};var Pi={string:De,number:de,boolean:Ee,object:ut},Ht=function(e,t){this.type=e,this.args=t};Ht.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r,a=1,u=e[0];if(u==="array"){var c,f;if(e.length>2){var v=e[1];if(typeof v!="string"||!(v in Pi)||v==="object")return t.error('The item type argument of "array" must be one of string, number, boolean',1);c=Pi[v],a++}else c=ze;if(e.length>3){if(e[2]!==null&&(typeof e[2]!="number"||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);f=e[2],a++}r=kt(c,f)}else r=Pi[u];for(var x=[];a<e.length;a++){var b=t.parse(e[a],a,ze);if(!b)return null;x.push(b)}return new Ht(r,x)},Ht.prototype.evaluate=function(e){for(var t=0;t<this.args.length;t++){var r=this.args[t].evaluate(e);if(!Bt(this.type,lr(r)))return r;if(t===this.args.length-1)throw new Cr("Expected value to be of type "+_t(this.type)+", but found "+_t(lr(r))+" instead.")}return null},Ht.prototype.eachChild=function(e){this.args.forEach(e)},Ht.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},Ht.prototype.serialize=function(){var e=this.type,t=[e.kind];if(e.kind==="array"){var r=e.itemType;if(r.kind==="string"||r.kind==="number"||r.kind==="boolean"){t.push(r.kind);var a=e.N;(typeof a=="number"||this.args.length>1)&&t.push(a)}}return t.concat(this.args.map(function(u){return u.serialize()}))};var $i=function(e){this.type=Ut,this.sections=e};$i.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[1];if(!Array.isArray(r)&&typeof r=="object")return t.error("First argument must be an image or text section.");for(var a=[],u=!1,c=1;c<=e.length-1;++c){var f=e[c];if(u&&typeof f=="object"&&!Array.isArray(f)){u=!1;var v=null;if(f["font-scale"]&&!(v=t.parse(f["font-scale"],1,de)))return null;var x=null;if(f["text-font"]&&!(x=t.parse(f["text-font"],1,kt(De))))return null;var b=null;if(f["text-color"]&&!(b=t.parse(f["text-color"],1,Ce)))return null;var S=a[a.length-1];S.scale=v,S.font=x,S.textColor=b}else{var T=t.parse(e[c],1,ze);if(!T)return null;var C=T.type.kind;if(C!=="string"&&C!=="value"&&C!=="null"&&C!=="resolvedImage")return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");u=!0,a.push({content:T,scale:null,font:null,textColor:null})}}return new $i(a)},$i.prototype.evaluate=function(e){return new Pr(this.sections.map(function(t){var r=t.content.evaluate(e);return lr(r)===ht?new ga("",r,null,null,null):new ga(xa(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)}))},$i.prototype.eachChild=function(e){for(var t=0,r=this.sections;t<r.length;t+=1){var a=r[t];e(a.content),a.scale&&e(a.scale),a.font&&e(a.font),a.textColor&&e(a.textColor)}},$i.prototype.outputDefined=function(){return!1},$i.prototype.serialize=function(){for(var e=["format"],t=0,r=this.sections;t<r.length;t+=1){var a=r[t];e.push(a.content.serialize());var u={};a.scale&&(u["font-scale"]=a.scale.serialize()),a.font&&(u["text-font"]=a.font.serialize()),a.textColor&&(u["text-color"]=a.textColor.serialize()),e.push(u)}return e};var gi=function(e){this.type=ht,this.input=e};gi.parse=function(e,t){if(e.length!==2)return t.error("Expected two arguments.");var r=t.parse(e[1],1,De);return r?new gi(r):t.error("No image name provided.")},gi.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=ii.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r},gi.prototype.eachChild=function(e){e(this.input)},gi.prototype.outputDefined=function(){return!1},gi.prototype.serialize=function(){return["image",this.input.serialize()]};var zu={"to-boolean":Ee,"to-color":Ce,"to-number":de,"to-string":De},Ci=function(e,t){this.type=e,this.args=t};Ci.parse=function(e,t){if(e.length<2)return t.error("Expected at least one argument.");var r=e[0];if((r==="to-boolean"||r==="to-string")&&e.length!==2)return t.error("Expected one argument.");for(var a=zu[r],u=[],c=1;c<e.length;c++){var f=t.parse(e[c],c,ze);if(!f)return null;u.push(f)}return new Ci(a,u)},Ci.prototype.evaluate=function(e){if(this.type.kind==="boolean")return!!this.args[0].evaluate(e);if(this.type.kind==="color"){for(var t,r,a=0,u=this.args;a<u.length;a+=1){if(r=null,(t=u[a].evaluate(e))instanceof Mt)return t;if(typeof t=="string"){var c=e.parseColor(t);if(c)return c}else if(Array.isArray(t)&&!(r=t.length<3||t.length>4?"Invalid rbga value "+JSON.stringify(t)+": expected an array containing either three or four numeric values.":bl(t[0],t[1],t[2],t[3])))return new Mt(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Cr(r||"Could not parse color from value '"+(typeof t=="string"?t:String(JSON.stringify(t)))+"'")}if(this.type.kind==="number"){for(var f=null,v=0,x=this.args;v<x.length;v+=1){if((f=x[v].evaluate(e))===null)return 0;var b=Number(f);if(!isNaN(b))return b}throw new Cr("Could not convert "+JSON.stringify(f)+" to number.")}return this.type.kind==="formatted"?Pr.fromString(xa(this.args[0].evaluate(e))):this.type.kind==="resolvedImage"?ii.fromString(xa(this.args[0].evaluate(e))):xa(this.args[0].evaluate(e))},Ci.prototype.eachChild=function(e){this.args.forEach(e)},Ci.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},Ci.prototype.serialize=function(){if(this.type.kind==="formatted")return new $i([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if(this.type.kind==="resolvedImage")return new gi(this.args[0]).serialize();var e=["to-"+this.type.kind];return this.eachChild(function(t){e.push(t.serialize())}),e};var zp=["Unknown","Point","LineString","Polygon"],pn=function(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null};pn.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},pn.prototype.geometryType=function(){return this.feature?typeof this.feature.type=="number"?zp[this.feature.type]:this.feature.type:null},pn.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},pn.prototype.canonicalID=function(){return this.canonical},pn.prototype.properties=function(){return this.feature&&this.feature.properties||{}},pn.prototype.parseColor=function(e){var t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=Mt.parse(e)),t};var Lr=function(e,t,r,a){this.name=e,this.type=t,this._evaluate=r,this.args=a};Lr.prototype.evaluate=function(e){return this._evaluate(e,this.args)},Lr.prototype.eachChild=function(e){this.args.forEach(e)},Lr.prototype.outputDefined=function(){return!1},Lr.prototype.serialize=function(){return[this.name].concat(this.args.map(function(e){return e.serialize()}))},Lr.parse=function(e,t){var r,a=e[0],u=Lr.definitions[a];if(!u)return t.error('Unknown expression "'+a+'". If you wanted a literal array, use ["literal", [...]].',0);for(var c=Array.isArray(u)?u[0]:u.type,f=Array.isArray(u)?[[u[1],u[2]]]:u.overloads,v=f.filter(function(Ze){var Be=Ze[0];return!Array.isArray(Be)||Be.length===e.length-1}),x=null,b=0,S=v;b<S.length;b+=1){var T=S[b],C=T[0],z=T[1];x=new An(t.registry,t.path,null,t.scope);for(var N=[],$=!1,J=1;J<e.length;J++){var H=e[J],te=Array.isArray(C)?C[J-1]:C.type,oe=x.parse(H,1+N.length,te);if(!oe){$=!0;break}N.push(oe)}if(!$)if(Array.isArray(C)&&C.length!==N.length)x.error("Expected "+C.length+" arguments, but found "+N.length+" instead.");else{for(var se=0;se<N.length;se++){var ue=Array.isArray(C)?C[se]:C.type,ye=N[se];x.concat(se+1).checkSubtype(ue,ye.type)}if(x.errors.length===0)return new Lr(a,c,z,N)}}if(v.length===1)(r=t.errors).push.apply(r,x.errors);else{for(var we=(v.length?v:f).map(function(Ze){var Be;return Be=Ze[0],Array.isArray(Be)?"("+Be.map(_t).join(", ")+")":"("+_t(Be.type)+"...)"}).join(" | "),Ie=[],$e=1;$e<e.length;$e++){var Me=t.parse(e[$e],1+Ie.length);if(!Me)return null;Ie.push(_t(Me.type))}t.error("Expected arguments of type "+we+", but found ("+Ie.join(", ")+") instead.")}return null},Lr.register=function(e,t){for(var r in Lr.definitions=t,t)e[r]=Lr};var Yi=function(e,t,r){this.type=vt,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t};function Gr(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function to(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function Bp(e,t){var r=(180+e[0])/360,a=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,u=Math.pow(2,t.z);return[Math.round(r*u*8192),Math.round(a*u*8192)]}function Dp(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function wl(e,t){for(var r,a,u,c,f,v,x,b=!1,S=0,T=t.length;S<T;S++)for(var C=t[S],z=0,N=C.length;z<N-1;z++){if((c=(r=e)[0]-(a=C[z])[0])*(x=r[1]-(u=C[z+1])[1])-(v=r[0]-u[0])*(f=r[1]-a[1])==0&&c*v<=0&&f*x<=0)return!1;Dp(e,C[z],C[z+1])&&(b=!b)}return b}function Lp(e,t){for(var r=0;r<t.length;r++)if(wl(e,t[r]))return!0;return!1}function Bu(e,t,r,a){var u=a[0]-r[0],c=a[1]-r[1],f=(e[0]-r[0])*c-u*(e[1]-r[1]),v=(t[0]-r[0])*c-u*(t[1]-r[1]);return f>0&&v<0||f<0&&v>0}function Rp(e,t,r){for(var a=0,u=r;a<u.length;a+=1)for(var c=u[a],f=0;f<c.length-1;++f)if((T=[(S=c[f+1])[0]-(b=c[f])[0],S[1]-b[1]])[0]*(C=[(x=t)[0]-(v=e)[0],x[1]-v[1]])[1]-T[1]*C[0]!=0&&Bu(v,x,b,S)&&Bu(b,S,v,x))return!0;var v,x,b,S,T,C;return!1}function Du(e,t){for(var r=0;r<e.length;++r)if(!wl(e[r],t))return!1;for(var a=0;a<e.length-1;++a)if(Rp(e[a],e[a+1],t))return!1;return!0}function Lu(e,t){for(var r=0;r<t.length;r++)if(Du(e,t[r]))return!0;return!1}function No(e,t,r){for(var a=[],u=0;u<e.length;u++){for(var c=[],f=0;f<e[u].length;f++){var v=Bp(e[u][f],r);Gr(t,v),c.push(v)}a.push(c)}return a}function Sl(e,t,r){for(var a=[],u=0;u<e.length;u++){var c=No(e[u],t,r);a.push(c)}return a}function ba(e,t,r,a){if(e[0]<r[0]||e[0]>r[2]){var u=.5*a,c=e[0]-r[0]>u?-a:r[0]-e[0]>u?a:0;c===0&&(c=e[0]-r[2]>u?-a:r[2]-e[0]>u?a:0),e[0]+=c}Gr(t,e)}function Ru(e,t,r,a){for(var u=8192*Math.pow(2,a.z),c=[8192*a.x,8192*a.y],f=[],v=0,x=e;v<x.length;v+=1)for(var b=0,S=x[v];b<S.length;b+=1){var T=S[b],C=[T.x+c[0],T.y+c[1]];ba(C,t,r,u),f.push(C)}return f}function cs(e,t,r,a){for(var u,c=8192*Math.pow(2,a.z),f=[8192*a.x,8192*a.y],v=[],x=0,b=e;x<b.length;x+=1){for(var S=[],T=0,C=b[x];T<C.length;T+=1){var z=C[T],N=[z.x+f[0],z.y+f[1]];Gr(t,N),S.push(N)}v.push(S)}if(t[2]-t[0]<=c/2){(u=t)[0]=u[1]=1/0,u[2]=u[3]=-1/0;for(var $=0,J=v;$<J.length;$+=1)for(var H=0,te=J[$];H<te.length;H+=1)ba(te[H],t,r,c)}return v}Yi.parse=function(e,t){if(e.length!==2)return t.error("Expected one argument.");var r=e[1];if(typeof r!="object"||Array.isArray(r))return t.error("Collator options argument must be an object.");var a=t.parse(r["case-sensitive"]!==void 0&&r["case-sensitive"],1,Ee);if(!a)return null;var u=t.parse(r["diacritic-sensitive"]!==void 0&&r["diacritic-sensitive"],1,Ee);if(!u)return null;var c=null;return r.locale&&!(c=t.parse(r.locale,1,De))?null:new Yi(a,u,c)},Yi.prototype.evaluate=function(e){return new ri(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)},Yi.prototype.eachChild=function(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)},Yi.prototype.outputDefined=function(){return!1},Yi.prototype.serialize=function(){var e={};return e["case-sensitive"]=this.caseSensitive.serialize(),e["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(e.locale=this.locale.serialize()),["collator",e]};var ki=function(e,t){this.type=Ee,this.geojson=e,this.geometries=t};function Sn(e){if(e instanceof Lr&&(e.name==="get"&&e.args.length===1||e.name==="feature-state"||e.name==="has"&&e.args.length===1||e.name==="properties"||e.name==="geometry-type"||e.name==="id"||/^filter-/.test(e.name))||e instanceof ki)return!1;var t=!0;return e.eachChild(function(r){t&&!Sn(r)&&(t=!1)}),t}function Tn(e){if(e instanceof Lr&&e.name==="feature-state")return!1;var t=!0;return e.eachChild(function(r){t&&!Tn(r)&&(t=!1)}),t}function ro(e,t){if(e instanceof Lr&&t.indexOf(e.name)>=0)return!1;var r=!0;return e.eachChild(function(a){r&&!ro(a,t)&&(r=!1)}),r}ki.parse=function(e,t){if(e.length!==2)return t.error("'within' expression requires exactly one argument, but found "+(e.length-1)+" instead.");if(_a(e[1])){var r=e[1];if(r.type==="FeatureCollection")for(var a=0;a<r.features.length;++a){var u=r.features[a].geometry.type;if(u==="Polygon"||u==="MultiPolygon")return new ki(r,r.features[a].geometry)}else if(r.type==="Feature"){var c=r.geometry.type;if(c==="Polygon"||c==="MultiPolygon")return new ki(r,r.geometry)}else if(r.type==="Polygon"||r.type==="MultiPolygon")return new ki(r,r)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")},ki.prototype.evaluate=function(e){if(e.geometry()!=null&&e.canonicalID()!=null){if(e.geometryType()==="Point")return function(t,r){var a=[1/0,1/0,-1/0,-1/0],u=[1/0,1/0,-1/0,-1/0],c=t.canonicalID();if(r.type==="Polygon"){var f=No(r.coordinates,u,c),v=Ru(t.geometry(),a,u,c);if(!to(a,u))return!1;for(var x=0,b=v;x<b.length;x+=1)if(!wl(b[x],f))return!1}if(r.type==="MultiPolygon"){var S=Sl(r.coordinates,u,c),T=Ru(t.geometry(),a,u,c);if(!to(a,u))return!1;for(var C=0,z=T;C<z.length;C+=1)if(!Lp(z[C],S))return!1}return!0}(e,this.geometries);if(e.geometryType()==="LineString")return function(t,r){var a=[1/0,1/0,-1/0,-1/0],u=[1/0,1/0,-1/0,-1/0],c=t.canonicalID();if(r.type==="Polygon"){var f=No(r.coordinates,u,c),v=cs(t.geometry(),a,u,c);if(!to(a,u))return!1;for(var x=0,b=v;x<b.length;x+=1)if(!Du(b[x],f))return!1}if(r.type==="MultiPolygon"){var S=Sl(r.coordinates,u,c),T=cs(t.geometry(),a,u,c);if(!to(a,u))return!1;for(var C=0,z=T;C<z.length;C+=1)if(!Lu(z[C],S))return!1}return!0}(e,this.geometries)}return!1},ki.prototype.eachChild=function(){},ki.prototype.outputDefined=function(){return!0},ki.prototype.serialize=function(){return["within",this.geojson]};var In=function(e,t){this.type=t.type,this.name=e,this.boundExpression=t};In.parse=function(e,t){if(e.length!==2||typeof e[1]!="string")return t.error("'var' expression requires exactly one string literal argument.");var r=e[1];return t.scope.has(r)?new In(r,t.scope.get(r)):t.error('Unknown variable "'+r+'". Make sure "'+r+'" has been bound in an enclosing "let" expression before using it.',1)},In.prototype.evaluate=function(e){return this.boundExpression.evaluate(e)},In.prototype.eachChild=function(){},In.prototype.outputDefined=function(){return!1},In.prototype.serialize=function(){return["var",this.name]};var An=function(e,t,r,a,u){t===void 0&&(t=[]),a===void 0&&(a=new Ve),u===void 0&&(u=[]),this.registry=e,this.path=t,this.key=t.map(function(c){return"["+c+"]"}).join(""),this.scope=a,this.errors=u,this.expectedType=r};function ps(e,t){for(var r,a=e.length-1,u=0,c=a,f=0;u<=c;)if((r=e[f=Math.floor((u+c)/2)])<=t){if(f===a||t<e[f+1])return f;u=f+1}else{if(!(r>t))throw new Cr("Input is not a number.");c=f-1}return 0}An.prototype.parse=function(e,t,r,a,u){return u===void 0&&(u={}),t?this.concat(t,r,a)._parse(e,u):this._parse(e,u)},An.prototype._parse=function(e,t){function r(b,S,T){return T==="assert"?new Ht(S,[b]):T==="coerce"?new Ci(S,[b]):b}if(e!==null&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"||(e=["literal",e]),Array.isArray(e)){if(e.length===0)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var a=e[0];if(typeof a!="string")return this.error("Expression name must be a string, but found "+typeof a+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;var u=this.registry[a];if(u){var c=u.parse(e,this);if(!c)return null;if(this.expectedType){var f=this.expectedType,v=c.type;if(f.kind!=="string"&&f.kind!=="number"&&f.kind!=="boolean"&&f.kind!=="object"&&f.kind!=="array"||v.kind!=="value")if(f.kind!=="color"&&f.kind!=="formatted"&&f.kind!=="resolvedImage"||v.kind!=="value"&&v.kind!=="string"){if(this.checkSubtype(f,v))return null}else c=r(c,f,t.typeAnnotation||"coerce");else c=r(c,f,t.typeAnnotation||"assert")}if(!(c instanceof jr)&&c.type.kind!=="resolvedImage"&&function b(S){if(S instanceof In)return b(S.boundExpression);if(S instanceof Lr&&S.name==="error"||S instanceof Yi||S instanceof ki)return!1;var T=S instanceof Ci||S instanceof Ht,C=!0;return S.eachChild(function(z){C=T?C&&b(z):C&&z instanceof jr}),!!C&&Sn(S)&&ro(S,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(c)){var x=new pn;try{c=new jr(c.type,c.evaluate(x))}catch(b){return this.error(b.message),null}}return c}return this.error('Unknown expression "'+a+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(e===void 0?"'undefined' value invalid. Use null instead.":typeof e=="object"?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof e+" instead.")},An.prototype.concat=function(e,t,r){var a=typeof e=="number"?this.path.concat(e):this.path,u=r?this.scope.concat(r):this.scope;return new An(this.registry,a,t||null,u,this.errors)},An.prototype.error=function(e){for(var t=[],r=arguments.length-1;r-- >0;)t[r]=arguments[r+1];var a=""+this.key+t.map(function(u){return"["+u+"]"}).join("");this.errors.push(new xe(a,e))},An.prototype.checkSubtype=function(e,t){var r=Bt(e,t);return r&&this.error(r),r};var ui=function(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(var a=0,u=r;a<u.length;a+=1){var c=u[a],f=c[1];this.labels.push(c[0]),this.outputs.push(f)}};function dr(e,t,r){return e*(1-r)+t*r}ui.parse=function(e,t){if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");var r=t.parse(e[1],1,de);if(!r)return null;var a=[],u=null;t.expectedType&&t.expectedType.kind!=="value"&&(u=t.expectedType);for(var c=1;c<e.length;c+=2){var f=c===1?-1/0:e[c],v=e[c+1],x=c,b=c+1;if(typeof f!="number")return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',x);if(a.length&&a[a.length-1][0]>=f)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',x);var S=t.parse(v,b,u);if(!S)return null;u=u||S.type,a.push([f,S])}return new ui(u,r,a)},ui.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(t.length===1)return r[0].evaluate(e);var a=this.input.evaluate(e);if(a<=t[0])return r[0].evaluate(e);var u=t.length;return a>=t[u-1]?r[u-1].evaluate(e):r[ps(t,a)].evaluate(e)},ui.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},ui.prototype.outputDefined=function(){return this.outputs.every(function(e){return e.outputDefined()})},ui.prototype.serialize=function(){for(var e=["step",this.input.serialize()],t=0;t<this.labels.length;t++)t>0&&e.push(this.labels[t]),e.push(this.outputs[t].serialize());return e};var $o=Object.freeze({__proto__:null,number:dr,color:function(e,t,r){return new Mt(dr(e.r,t.r,r),dr(e.g,t.g,r),dr(e.b,t.b,r),dr(e.a,t.a,r))},array:function(e,t,r){return e.map(function(a,u){return dr(a,t[u],r)})}}),Fu=6/29*3*(6/29),Fp=Math.PI/180,Op=180/Math.PI;function Tl(e){return e>.008856451679035631?Math.pow(e,1/3):e/Fu+4/29}function Il(e){return e>6/29?e*e*e:Fu*(e-4/29)}function Al(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function El(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ou(e){var t=El(e.r),r=El(e.g),a=El(e.b),u=Tl((.4124564*t+.3575761*r+.1804375*a)/.95047),c=Tl((.2126729*t+.7151522*r+.072175*a)/1);return{l:116*c-16,a:500*(u-c),b:200*(c-Tl((.0193339*t+.119192*r+.9503041*a)/1.08883)),alpha:e.a}}function Vu(e){var t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,a=isNaN(e.b)?t:t-e.b/200;return t=1*Il(t),r=.95047*Il(r),a=1.08883*Il(a),new Mt(Al(3.2404542*r-1.5371385*t-.4985314*a),Al(-.969266*r+1.8760108*t+.041556*a),Al(.0556434*r-.2040259*t+1.0572252*a),e.alpha)}function Vp(e,t,r){var a=t-e;return e+r*(a>180||a<-180?a-360*Math.round(a/360):a)}var wa={forward:Ou,reverse:Vu,interpolate:function(e,t,r){return{l:dr(e.l,t.l,r),a:dr(e.a,t.a,r),b:dr(e.b,t.b,r),alpha:dr(e.alpha,t.alpha,r)}}},Sa={forward:function(e){var t=Ou(e),r=t.l,a=t.a,u=t.b,c=Math.atan2(u,a)*Op;return{h:c<0?c+360:c,c:Math.sqrt(a*a+u*u),l:r,alpha:e.a}},reverse:function(e){var t=e.h*Fp,r=e.c;return Vu({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:Vp(e.h,t.h,r),c:dr(e.c,t.c,r),l:dr(e.l,t.l,r),alpha:dr(e.alpha,t.alpha,r)}}},Uu=Object.freeze({__proto__:null,lab:wa,hcl:Sa}),Rr=function(e,t,r,a,u){this.type=e,this.operator=t,this.interpolation=r,this.input=a,this.labels=[],this.outputs=[];for(var c=0,f=u;c<f.length;c+=1){var v=f[c],x=v[1];this.labels.push(v[0]),this.outputs.push(x)}};function Pl(e,t,r,a){var u=a-r,c=e-r;return u===0?0:t===1?c/u:(Math.pow(t,c)-1)/(Math.pow(t,u)-1)}Rr.interpolationFactor=function(e,t,r,a){var u=0;if(e.name==="exponential")u=Pl(t,e.base,r,a);else if(e.name==="linear")u=Pl(t,1,r,a);else if(e.name==="cubic-bezier"){var c=e.controlPoints;u=new q(c[0],c[1],c[2],c[3]).solve(Pl(t,1,r,a))}return u},Rr.parse=function(e,t){var r=e[0],a=e[1],u=e[2],c=e.slice(3);if(!Array.isArray(a)||a.length===0)return t.error("Expected an interpolation type expression.",1);if(a[0]==="linear")a={name:"linear"};else if(a[0]==="exponential"){var f=a[1];if(typeof f!="number")return t.error("Exponential interpolation requires a numeric base.",1,1);a={name:"exponential",base:f}}else{if(a[0]!=="cubic-bezier")return t.error("Unknown interpolation type "+String(a[0]),1,0);var v=a.slice(1);if(v.length!==4||v.some(function(J){return typeof J!="number"||J<0||J>1}))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);a={name:"cubic-bezier",controlPoints:v}}if(e.length-1<4)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(!(u=t.parse(u,2,de)))return null;var x=[],b=null;r==="interpolate-hcl"||r==="interpolate-lab"?b=Ce:t.expectedType&&t.expectedType.kind!=="value"&&(b=t.expectedType);for(var S=0;S<c.length;S+=2){var T=c[S],C=c[S+1],z=S+3,N=S+4;if(typeof T!="number")return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',z);if(x.length&&x[x.length-1][0]>=T)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',z);var $=t.parse(C,N,b);if(!$)return null;b=b||$.type,x.push([T,$])}return b.kind==="number"||b.kind==="color"||b.kind==="array"&&b.itemType.kind==="number"&&typeof b.N=="number"?new Rr(b,r,a,u,x):t.error("Type "+_t(b)+" is not interpolatable.")},Rr.prototype.evaluate=function(e){var t=this.labels,r=this.outputs;if(t.length===1)return r[0].evaluate(e);var a=this.input.evaluate(e);if(a<=t[0])return r[0].evaluate(e);var u=t.length;if(a>=t[u-1])return r[u-1].evaluate(e);var c=ps(t,a),f=Rr.interpolationFactor(this.interpolation,a,t[c],t[c+1]),v=r[c].evaluate(e),x=r[c+1].evaluate(e);return this.operator==="interpolate"?$o[this.type.kind.toLowerCase()](v,x,f):this.operator==="interpolate-hcl"?Sa.reverse(Sa.interpolate(Sa.forward(v),Sa.forward(x),f)):wa.reverse(wa.interpolate(wa.forward(v),wa.forward(x),f))},Rr.prototype.eachChild=function(e){e(this.input);for(var t=0,r=this.outputs;t<r.length;t+=1)e(r[t])},Rr.prototype.outputDefined=function(){return this.outputs.every(function(e){return e.outputDefined()})},Rr.prototype.serialize=function(){var e;e=this.interpolation.name==="linear"?["linear"]:this.interpolation.name==="exponential"?this.interpolation.base===1?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);for(var t=[this.operator,e,this.input.serialize()],r=0;r<this.labels.length;r++)t.push(this.labels[r],this.outputs[r].serialize());return t};var En=function(e,t){this.type=e,this.args=t};En.parse=function(e,t){if(e.length<2)return t.error("Expectected at least one argument.");var r=null,a=t.expectedType;a&&a.kind!=="value"&&(r=a);for(var u=[],c=0,f=e.slice(1);c<f.length;c+=1){var v=t.parse(f[c],1+u.length,r,void 0,{typeAnnotation:"omit"});if(!v)return null;r=r||v.type,u.push(v)}var x=a&&u.some(function(b){return Bt(a,b.type)});return new En(x?ze:r,u)},En.prototype.evaluate=function(e){for(var t,r=null,a=0,u=0,c=this.args;u<c.length&&(a++,(r=c[u].evaluate(e))&&r instanceof ii&&!r.available&&(t||(t=r.name),r=null,a===this.args.length&&(r=t)),r===null);u+=1);return r},En.prototype.eachChild=function(e){this.args.forEach(e)},En.prototype.outputDefined=function(){return this.args.every(function(e){return e.outputDefined()})},En.prototype.serialize=function(){var e=["coalesce"];return this.eachChild(function(t){e.push(t.serialize())}),e};var Pn=function(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t};Pn.prototype.evaluate=function(e){return this.result.evaluate(e)},Pn.prototype.eachChild=function(e){for(var t=0,r=this.bindings;t<r.length;t+=1)e(r[t][1]);e(this.result)},Pn.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found "+(e.length-1)+" instead.");for(var r=[],a=1;a<e.length-1;a+=2){var u=e[a];if(typeof u!="string")return t.error("Expected string, but found "+typeof u+" instead.",a);if(/[^a-zA-Z0-9_]/.test(u))return t.error("Variable names must contain only alphanumeric characters or '_'.",a);var c=t.parse(e[a+1],a+1);if(!c)return null;r.push([u,c])}var f=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return f?new Pn(r,f):null},Pn.prototype.outputDefined=function(){return this.result.outputDefined()},Pn.prototype.serialize=function(){for(var e=["let"],t=0,r=this.bindings;t<r.length;t+=1){var a=r[t];e.push(a[0],a[1].serialize())}return e.push(this.result.serialize()),e};var io=function(e,t,r){this.type=e,this.index=t,this.input=r};io.parse=function(e,t){if(e.length!==3)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,de),a=t.parse(e[2],2,kt(t.expectedType||ze));return r&&a?new io(a.type.itemType,r,a):null},io.prototype.evaluate=function(e){var t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new Cr("Array index out of bounds: "+t+" < 0.");if(t>=r.length)throw new Cr("Array index out of bounds: "+t+" > "+(r.length-1)+".");if(t!==Math.floor(t))throw new Cr("Array index must be an integer, but found "+t+" instead.");return r[t]},io.prototype.eachChild=function(e){e(this.index),e(this.input)},io.prototype.outputDefined=function(){return!1},io.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]};var no=function(e,t){this.type=Ee,this.needle=e,this.haystack=t};no.parse=function(e,t){if(e.length!==3)return t.error("Expected 2 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,ze),a=t.parse(e[2],2,ze);return r&&a?sr(r.type,[Ee,De,de,Fe,ze])?new no(r,a):t.error("Expected first argument to be of type boolean, string, number or null, but found "+_t(r.type)+" instead"):null},no.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!Ft(t,["boolean","string","number","null"]))throw new Cr("Expected first argument to be of type boolean, string, number or null, but found "+_t(lr(t))+" instead.");if(!Ft(r,["string","array"]))throw new Cr("Expected second argument to be of type array or string, but found "+_t(lr(r))+" instead.");return r.indexOf(t)>=0},no.prototype.eachChild=function(e){e(this.needle),e(this.haystack)},no.prototype.outputDefined=function(){return!0},no.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]};var Cn=function(e,t,r){this.type=de,this.needle=e,this.haystack=t,this.fromIndex=r};Cn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,ze),a=t.parse(e[2],2,ze);if(!r||!a)return null;if(!sr(r.type,[Ee,De,de,Fe,ze]))return t.error("Expected first argument to be of type boolean, string, number or null, but found "+_t(r.type)+" instead");if(e.length===4){var u=t.parse(e[3],3,de);return u?new Cn(r,a,u):null}return new Cn(r,a)},Cn.prototype.evaluate=function(e){var t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Ft(t,["boolean","string","number","null"]))throw new Cr("Expected first argument to be of type boolean, string, number or null, but found "+_t(lr(t))+" instead.");if(!Ft(r,["string","array"]))throw new Cr("Expected second argument to be of type array or string, but found "+_t(lr(r))+" instead.");if(this.fromIndex){var a=this.fromIndex.evaluate(e);return r.indexOf(t,a)}return r.indexOf(t)},Cn.prototype.eachChild=function(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)},Cn.prototype.outputDefined=function(){return!1},Cn.prototype.serialize=function(){if(this.fromIndex!=null&&this.fromIndex!==void 0){var e=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),e]}return["index-of",this.needle.serialize(),this.haystack.serialize()]};var oo=function(e,t,r,a,u,c){this.inputType=e,this.type=t,this.input=r,this.cases=a,this.outputs=u,this.otherwise=c};oo.parse=function(e,t){if(e.length<5)return t.error("Expected at least 4 arguments, but found only "+(e.length-1)+".");if(e.length%2!=1)return t.error("Expected an even number of arguments.");var r,a;t.expectedType&&t.expectedType.kind!=="value"&&(a=t.expectedType);for(var u={},c=[],f=2;f<e.length-1;f+=2){var v=e[f],x=e[f+1];Array.isArray(v)||(v=[v]);var b=t.concat(f);if(v.length===0)return b.error("Expected at least one branch label.");for(var S=0,T=v;S<T.length;S+=1){var C=T[S];if(typeof C!="number"&&typeof C!="string")return b.error("Branch labels must be numbers or strings.");if(typeof C=="number"&&Math.abs(C)>Number.MAX_SAFE_INTEGER)return b.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if(typeof C=="number"&&Math.floor(C)!==C)return b.error("Numeric branch labels must be integer values.");if(r){if(b.checkSubtype(r,lr(C)))return null}else r=lr(C);if(u[String(C)]!==void 0)return b.error("Branch labels must be unique.");u[String(C)]=c.length}var z=t.parse(x,f,a);if(!z)return null;a=a||z.type,c.push(z)}var N=t.parse(e[1],1,ze);if(!N)return null;var $=t.parse(e[e.length-1],e.length-1,a);return $?N.type.kind!=="value"&&t.concat(1).checkSubtype(r,N.type)?null:new oo(r,a,N,u,c,$):null},oo.prototype.evaluate=function(e){var t=this.input.evaluate(e);return(lr(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)},oo.prototype.eachChild=function(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)},oo.prototype.outputDefined=function(){return this.outputs.every(function(e){return e.outputDefined()})&&this.otherwise.outputDefined()},oo.prototype.serialize=function(){for(var e=this,t=["match",this.input.serialize()],r=[],a={},u=0,c=Object.keys(this.cases).sort();u<c.length;u+=1){var f=c[u];(T=a[this.cases[f]])===void 0?(a[this.cases[f]]=r.length,r.push([this.cases[f],[f]])):r[T][1].push(f)}for(var v=function(z){return e.inputType.kind==="number"?Number(z):z},x=0,b=r;x<b.length;x+=1){var S=b[x],T=S[0],C=S[1];t.push(C.length===1?v(C[0]):C.map(v)),t.push(this.outputs[outputIndex$1].serialize())}return t.push(this.otherwise.serialize()),t};var ao=function(e,t,r){this.type=e,this.branches=t,this.otherwise=r};ao.parse=function(e,t){if(e.length<4)return t.error("Expected at least 3 arguments, but found only "+(e.length-1)+".");if(e.length%2!=0)return t.error("Expected an odd number of arguments.");var r;t.expectedType&&t.expectedType.kind!=="value"&&(r=t.expectedType);for(var a=[],u=1;u<e.length-1;u+=2){var c=t.parse(e[u],u,Ee);if(!c)return null;var f=t.parse(e[u+1],u+1,r);if(!f)return null;a.push([c,f]),r=r||f.type}var v=t.parse(e[e.length-1],e.length-1,r);return v?new ao(r,a,v):null},ao.prototype.evaluate=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var a=r[t],u=a[1];if(a[0].evaluate(e))return u.evaluate(e)}return this.otherwise.evaluate(e)},ao.prototype.eachChild=function(e){for(var t=0,r=this.branches;t<r.length;t+=1){var a=r[t],u=a[1];e(a[0]),e(u)}e(this.otherwise)},ao.prototype.outputDefined=function(){return this.branches.every(function(e){return e[1].outputDefined()})&&this.otherwise.outputDefined()},ao.prototype.serialize=function(){var e=["case"];return this.eachChild(function(t){e.push(t.serialize())}),e};var kn=function(e,t,r,a){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=a};function Nu(e,t){return e==="=="||e==="!="?t.kind==="boolean"||t.kind==="string"||t.kind==="number"||t.kind==="null"||t.kind==="value":t.kind==="string"||t.kind==="number"||t.kind==="value"}function $u(e,t,r,a){return a.compare(t,r)===0}function Nt(e,t,r){var a=e!=="=="&&e!=="!=";return function(){function u(c,f,v){this.type=Ee,this.lhs=c,this.rhs=f,this.collator=v,this.hasUntypedArgument=c.type.kind==="value"||f.type.kind==="value"}return u.parse=function(c,f){if(c.length!==3&&c.length!==4)return f.error("Expected two or three arguments.");var v=c[0],x=f.parse(c[1],1,ze);if(!x)return null;if(!Nu(v,x.type))return f.concat(1).error('"'+v+`" comparisons are not supported for type '`+_t(x.type)+"'.");var b=f.parse(c[2],2,ze);if(!b)return null;if(!Nu(v,b.type))return f.concat(2).error('"'+v+`" comparisons are not supported for type '`+_t(b.type)+"'.");if(x.type.kind!==b.type.kind&&x.type.kind!=="value"&&b.type.kind!=="value")return f.error("Cannot compare types '"+_t(x.type)+"' and '"+_t(b.type)+"'.");a&&(x.type.kind==="value"&&b.type.kind!=="value"?x=new Ht(b.type,[x]):x.type.kind!=="value"&&b.type.kind==="value"&&(b=new Ht(x.type,[b])));var S=null;if(c.length===4){if(x.type.kind!=="string"&&b.type.kind!=="string"&&x.type.kind!=="value"&&b.type.kind!=="value")return f.error("Cannot use collator to compare non-string types.");if(!(S=f.parse(c[3],3,vt)))return null}return new u(x,b,S)},u.prototype.evaluate=function(c){var f=this.lhs.evaluate(c),v=this.rhs.evaluate(c);if(a&&this.hasUntypedArgument){var x=lr(f),b=lr(v);if(x.kind!==b.kind||x.kind!=="string"&&x.kind!=="number")throw new Cr('Expected arguments for "'+e+'" to be (string, string) or (number, number), but found ('+x.kind+", "+b.kind+") instead.")}if(this.collator&&!a&&this.hasUntypedArgument){var S=lr(f),T=lr(v);if(S.kind!=="string"||T.kind!=="string")return t(c,f,v)}return this.collator?r(c,f,v,this.collator.evaluate(c)):t(c,f,v)},u.prototype.eachChild=function(c){c(this.lhs),c(this.rhs),this.collator&&c(this.collator)},u.prototype.outputDefined=function(){return!0},u.prototype.serialize=function(){var c=[e];return this.eachChild(function(f){c.push(f.serialize())}),c},u}()}kn.parse=function(e,t){if(e.length<=2||e.length>=5)return t.error("Expected 3 or 4 arguments, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1,ze),a=t.parse(e[2],2,de);if(!r||!a)return null;if(!sr(r.type,[kt(ze),De,ze]))return t.error("Expected first argument to be of type array or string, but found "+_t(r.type)+" instead");if(e.length===4){var u=t.parse(e[3],3,de);return u?new kn(r.type,r,a,u):null}return new kn(r.type,r,a)},kn.prototype.evaluate=function(e){var t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!Ft(t,["string","array"]))throw new Cr("Expected first argument to be of type array or string, but found "+_t(lr(t))+" instead.");if(this.endIndex){var a=this.endIndex.evaluate(e);return t.slice(r,a)}return t.slice(r)},kn.prototype.eachChild=function(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)},kn.prototype.outputDefined=function(){return!1},kn.prototype.serialize=function(){if(this.endIndex!=null&&this.endIndex!==void 0){var e=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),e]}return["slice",this.input.serialize(),this.beginIndex.serialize()]};var Up=Nt("==",function(e,t,r){return t===r},$u),hs=Nt("!=",function(e,t,r){return t!==r},function(e,t,r,a){return!$u(0,t,r,a)}),qu=Nt("<",function(e,t,r){return t<r},function(e,t,r,a){return a.compare(t,r)<0}),ju=Nt(">",function(e,t,r){return t>r},function(e,t,r,a){return a.compare(t,r)>0}),Gu=Nt("<=",function(e,t,r){return t<=r},function(e,t,r,a){return a.compare(t,r)<=0}),Zu=Nt(">=",function(e,t,r){return t>=r},function(e,t,r,a){return a.compare(t,r)>=0}),so=function(e,t,r,a,u){this.type=De,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=a,this.maxFractionDigits=u};so.parse=function(e,t){if(e.length!==3)return t.error("Expected two arguments.");var r=t.parse(e[1],1,de);if(!r)return null;var a=e[2];if(typeof a!="object"||Array.isArray(a))return t.error("NumberFormat options argument must be an object.");var u=null;if(a.locale&&!(u=t.parse(a.locale,1,De)))return null;var c=null;if(a.currency&&!(c=t.parse(a.currency,1,De)))return null;var f=null;if(a["min-fraction-digits"]&&!(f=t.parse(a["min-fraction-digits"],1,de)))return null;var v=null;return a["max-fraction-digits"]&&!(v=t.parse(a["max-fraction-digits"],1,de))?null:new so(r,u,c,f,v)},so.prototype.evaluate=function(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))},so.prototype.eachChild=function(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)},so.prototype.outputDefined=function(){return!1},so.prototype.serialize=function(){var e={};return this.locale&&(e.locale=this.locale.serialize()),this.currency&&(e.currency=this.currency.serialize()),this.minFractionDigits&&(e["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(e["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),e]};var Mn=function(e){this.type=de,this.input=e};Mn.parse=function(e,t){if(e.length!==2)return t.error("Expected 1 argument, but found "+(e.length-1)+" instead.");var r=t.parse(e[1],1);return r?r.type.kind!=="array"&&r.type.kind!=="string"&&r.type.kind!=="value"?t.error("Expected argument of type string or array, but found "+_t(r.type)+" instead."):new Mn(r):null},Mn.prototype.evaluate=function(e){var t=this.input.evaluate(e);if(typeof t=="string"||Array.isArray(t))return t.length;throw new Cr("Expected value to be of type string or array, but found "+_t(lr(t))+" instead.")},Mn.prototype.eachChild=function(e){e(this.input)},Mn.prototype.outputDefined=function(){return!1},Mn.prototype.serialize=function(){var e=["length"];return this.eachChild(function(t){e.push(t.serialize())}),e};var lo={"==":Up,"!=":hs,">":ju,"<":qu,">=":Zu,"<=":Gu,array:Ht,at:io,boolean:Ht,case:ao,coalesce:En,collator:Yi,format:$i,image:gi,in:no,"index-of":Cn,interpolate:Rr,"interpolate-hcl":Rr,"interpolate-lab":Rr,length:Mn,let:Pn,literal:jr,match:oo,number:Ht,"number-format":so,object:Ht,slice:kn,step:ui,string:Ht,"to-boolean":Ci,"to-color":Ci,"to-number":Ci,"to-string":Ci,var:In,within:ki};function Wu(e,t){var r=t[0],a=t[1],u=t[2],c=t[3];r=r.evaluate(e),a=a.evaluate(e),u=u.evaluate(e);var f=c?c.evaluate(e):1,v=bl(r,a,u,f);if(v)throw new Cr(v);return new Mt(r/255*f,a/255*f,u/255*f,f)}function Hu(e,t){return e in t}function Cl(e,t){var r=t[e];return r===void 0?null:r}function uo(e){return{type:e}}function Xu(e){return{result:"success",value:e}}function co(e){return{result:"error",value:e}}function po(e){return e["property-type"]==="data-driven"||e["property-type"]==="cross-faded-data-driven"}function Ku(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function Ta(e){return!!e.expression&&e.expression.interpolated}function qt(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":e===null?"null":typeof e}function fs(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Np(e){return e}function qo(e,t,r){return e!==void 0?e:t!==void 0?t:r!==void 0?r:void 0}function Ju(e,t,r,a,u){return qo(typeof r===u?a[r]:void 0,e.default,t.default)}function $p(e,t,r){if(qt(r)!=="number")return qo(e.default,t.default);var a=e.stops.length;if(a===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[a-1][0])return e.stops[a-1][1];var u=ps(e.stops.map(function(c){return c[0]}),r);return e.stops[u][1]}function Yu(e,t,r){var a=e.base!==void 0?e.base:1;if(qt(r)!=="number")return qo(e.default,t.default);var u=e.stops.length;if(u===1||r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[u-1][0])return e.stops[u-1][1];var c=ps(e.stops.map(function(T){return T[0]}),r),f=function(T,C,z,N){var $=N-z,J=T-z;return $===0?0:C===1?J/$:(Math.pow(C,J)-1)/(Math.pow(C,$)-1)}(r,a,e.stops[c][0],e.stops[c+1][0]),v=e.stops[c][1],x=e.stops[c+1][1],b=$o[t.type]||Np;if(e.colorSpace&&e.colorSpace!=="rgb"){var S=Uu[e.colorSpace];b=function(T,C){return S.reverse(S.interpolate(S.forward(T),S.forward(C),f))}}return typeof v.evaluate=="function"?{evaluate:function(){for(var T=[],C=arguments.length;C--;)T[C]=arguments[C];var z=v.evaluate.apply(void 0,T),N=x.evaluate.apply(void 0,T);if(z!==void 0&&N!==void 0)return b(z,N,f)}}:b(v,x,f)}function ds(e,t,r){return t.type==="color"?r=Mt.parse(r):t.type==="formatted"?r=Pr.fromString(r.toString()):t.type==="resolvedImage"?r=ii.fromString(r.toString()):qt(r)===t.type||t.type==="enum"&&t.values[r]||(r=void 0),qo(r,e.default,t.default)}Lr.register(lo,{error:[{kind:"error"},[De],function(e,t){throw new Cr(t[0].evaluate(e))}],typeof:[De,[ze],function(e,t){return _t(lr(t[0].evaluate(e)))}],"to-rgba":[kt(de,4),[Ce],function(e,t){return t[0].evaluate(e).toArray()}],rgb:[Ce,[de,de,de],Wu],rgba:[Ce,[de,de,de,de],Wu],has:{type:Ee,overloads:[[[De],function(e,t){return Hu(t[0].evaluate(e),e.properties())}],[[De,ut],function(e,t){var r=t[1];return Hu(t[0].evaluate(e),r.evaluate(e))}]]},get:{type:ze,overloads:[[[De],function(e,t){return Cl(t[0].evaluate(e),e.properties())}],[[De,ut],function(e,t){var r=t[1];return Cl(t[0].evaluate(e),r.evaluate(e))}]]},"feature-state":[ze,[De],function(e,t){return Cl(t[0].evaluate(e),e.featureState||{})}],properties:[ut,[],function(e){return e.properties()}],"geometry-type":[De,[],function(e){return e.geometryType()}],id:[ze,[],function(e){return e.id()}],zoom:[de,[],function(e){return e.globals.zoom}],"heatmap-density":[de,[],function(e){return e.globals.heatmapDensity||0}],"line-progress":[de,[],function(e){return e.globals.lineProgress||0}],accumulated:[ze,[],function(e){return e.globals.accumulated===void 0?null:e.globals.accumulated}],"+":[de,uo(de),function(e,t){for(var r=0,a=0,u=t;a<u.length;a+=1)r+=u[a].evaluate(e);return r}],"*":[de,uo(de),function(e,t){for(var r=1,a=0,u=t;a<u.length;a+=1)r*=u[a].evaluate(e);return r}],"-":{type:de,overloads:[[[de,de],function(e,t){var r=t[1];return t[0].evaluate(e)-r.evaluate(e)}],[[de],function(e,t){return-t[0].evaluate(e)}]]},"/":[de,[de,de],function(e,t){var r=t[1];return t[0].evaluate(e)/r.evaluate(e)}],"%":[de,[de,de],function(e,t){var r=t[1];return t[0].evaluate(e)%r.evaluate(e)}],ln2:[de,[],function(){return Math.LN2}],pi:[de,[],function(){return Math.PI}],e:[de,[],function(){return Math.E}],"^":[de,[de,de],function(e,t){var r=t[1];return Math.pow(t[0].evaluate(e),r.evaluate(e))}],sqrt:[de,[de],function(e,t){return Math.sqrt(t[0].evaluate(e))}],log10:[de,[de],function(e,t){return Math.log(t[0].evaluate(e))/Math.LN10}],ln:[de,[de],function(e,t){return Math.log(t[0].evaluate(e))}],log2:[de,[de],function(e,t){return Math.log(t[0].evaluate(e))/Math.LN2}],sin:[de,[de],function(e,t){return Math.sin(t[0].evaluate(e))}],cos:[de,[de],function(e,t){return Math.cos(t[0].evaluate(e))}],tan:[de,[de],function(e,t){return Math.tan(t[0].evaluate(e))}],asin:[de,[de],function(e,t){return Math.asin(t[0].evaluate(e))}],acos:[de,[de],function(e,t){return Math.acos(t[0].evaluate(e))}],atan:[de,[de],function(e,t){return Math.atan(t[0].evaluate(e))}],min:[de,uo(de),function(e,t){return Math.min.apply(Math,t.map(function(r){return r.evaluate(e)}))}],max:[de,uo(de),function(e,t){return Math.max.apply(Math,t.map(function(r){return r.evaluate(e)}))}],abs:[de,[de],function(e,t){return Math.abs(t[0].evaluate(e))}],round:[de,[de],function(e,t){var r=t[0].evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[de,[de],function(e,t){return Math.floor(t[0].evaluate(e))}],ceil:[de,[de],function(e,t){return Math.ceil(t[0].evaluate(e))}],"filter-==":[Ee,[De,ze],function(e,t){var r=t[0],a=t[1];return e.properties()[r.value]===a.value}],"filter-id-==":[Ee,[ze],function(e,t){var r=t[0];return e.id()===r.value}],"filter-type-==":[Ee,[De],function(e,t){var r=t[0];return e.geometryType()===r.value}],"filter-<":[Ee,[De,ze],function(e,t){var r=t[0],a=t[1],u=e.properties()[r.value],c=a.value;return typeof u==typeof c&&u<c}],"filter-id-<":[Ee,[ze],function(e,t){var r=t[0],a=e.id(),u=r.value;return typeof a==typeof u&&a<u}],"filter->":[Ee,[De,ze],function(e,t){var r=t[0],a=t[1],u=e.properties()[r.value],c=a.value;return typeof u==typeof c&&u>c}],"filter-id->":[Ee,[ze],function(e,t){var r=t[0],a=e.id(),u=r.value;return typeof a==typeof u&&a>u}],"filter-<=":[Ee,[De,ze],function(e,t){var r=t[0],a=t[1],u=e.properties()[r.value],c=a.value;return typeof u==typeof c&&u<=c}],"filter-id-<=":[Ee,[ze],function(e,t){var r=t[0],a=e.id(),u=r.value;return typeof a==typeof u&&a<=u}],"filter->=":[Ee,[De,ze],function(e,t){var r=t[0],a=t[1],u=e.properties()[r.value],c=a.value;return typeof u==typeof c&&u>=c}],"filter-id->=":[Ee,[ze],function(e,t){var r=t[0],a=e.id(),u=r.value;return typeof a==typeof u&&a>=u}],"filter-has":[Ee,[ze],function(e,t){return t[0].value in e.properties()}],"filter-has-id":[Ee,[],function(e){return e.id()!==null&&e.id()!==void 0}],"filter-type-in":[Ee,[kt(De)],function(e,t){return t[0].value.indexOf(e.geometryType())>=0}],"filter-id-in":[Ee,[kt(ze)],function(e,t){return t[0].value.indexOf(e.id())>=0}],"filter-in-small":[Ee,[De,kt(ze)],function(e,t){var r=t[0];return t[1].value.indexOf(e.properties()[r.value])>=0}],"filter-in-large":[Ee,[De,kt(ze)],function(e,t){var r=t[0],a=t[1];return function(u,c,f,v){for(;f<=v;){var x=f+v>>1;if(c[x]===u)return!0;c[x]>u?v=x-1:f=x+1}return!1}(e.properties()[r.value],a.value,0,a.value.length-1)}],all:{type:Ee,overloads:[[[Ee,Ee],function(e,t){var r=t[1];return t[0].evaluate(e)&&r.evaluate(e)}],[uo(Ee),function(e,t){for(var r=0,a=t;r<a.length;r+=1)if(!a[r].evaluate(e))return!1;return!0}]]},any:{type:Ee,overloads:[[[Ee,Ee],function(e,t){var r=t[1];return t[0].evaluate(e)||r.evaluate(e)}],[uo(Ee),function(e,t){for(var r=0,a=t;r<a.length;r+=1)if(a[r].evaluate(e))return!0;return!1}]]},"!":[Ee,[Ee],function(e,t){return!t[0].evaluate(e)}],"is-supported-script":[Ee,[De],function(e,t){var r=e.globals&&e.globals.isSupportedScript;return!r||r(t[0].evaluate(e))}],upcase:[De,[De],function(e,t){return t[0].evaluate(e).toUpperCase()}],downcase:[De,[De],function(e,t){return t[0].evaluate(e).toLowerCase()}],concat:[De,uo(ze),function(e,t){return t.map(function(r){return xa(r.evaluate(e))}).join("")}],"resolved-locale":[De,[vt],function(e,t){return t[0].evaluate(e).resolvedLocale()}]});var jo=function(e,t){this.expression=e,this._warningHistory={},this._evaluator=new pn,this._defaultValue=t?function(r){return r.type==="color"&&fs(r.default)?new Mt(0,0,0,0):r.type==="color"?Mt.parse(r.default)||null:r.default===void 0?null:r.default}(t):null,this._enumValues=t&&t.type==="enum"?t.values:null};function Ia(e){return Array.isArray(e)&&e.length>0&&typeof e[0]=="string"&&e[0]in lo}function ms(e,t){var r=new An(lo,[],t?function(u){var c={color:Ce,string:De,number:de,enum:De,boolean:Ee,formatted:Ut,resolvedImage:ht};return u.type==="array"?kt(c[u.value]||ze,u.length):c[u.type]}(t):void 0),a=r.parse(e,void 0,void 0,void 0,t&&t.type==="string"?{typeAnnotation:"coerce"}:void 0);return a?Xu(new jo(a,t)):co(r.errors)}jo.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,u,c){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=a,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=c,this.expression.evaluate(this._evaluator)},jo.prototype.evaluate=function(e,t,r,a,u,c){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=a,this._evaluator.availableImages=u||null,this._evaluator.formattedSection=c||null;try{var f=this.expression.evaluate(this._evaluator);if(f==null||typeof f=="number"&&f!=f)return this._defaultValue;if(this._enumValues&&!(f in this._enumValues))throw new Cr("Expected value to be one of "+Object.keys(this._enumValues).map(function(v){return JSON.stringify(v)}).join(", ")+", but found "+JSON.stringify(f)+" instead.");return f}catch(v){return this._warningHistory[v.message]||(this._warningHistory[v.message]=!0,typeof console<"u"&&console.warn(v.message)),this._defaultValue}};var Aa=function(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent=e!=="constant"&&!Tn(t.expression)};Aa.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,u,c){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,a,u,c)},Aa.prototype.evaluate=function(e,t,r,a,u,c){return this._styleExpression.evaluate(e,t,r,a,u,c)};var Go=function(e,t,r,a){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent=e!=="camera"&&!Tn(t.expression),this.interpolationType=a};function Qu(e,t){if((e=ms(e,t)).result==="error")return e;var r=e.value.expression,a=Sn(r);if(!a&&!po(t))return co([new xe("","data expressions not supported")]);var u=ro(r,["zoom"]);if(!u&&!Ku(t))return co([new xe("","zoom expressions not supported")]);var c=function f(v){var x=null;if(v instanceof Pn)x=f(v.result);else if(v instanceof En)for(var b=0,S=v.args;b<S.length&&!(x=f(S[b]));b+=1);else(v instanceof ui||v instanceof Rr)&&v.input instanceof Lr&&v.input.name==="zoom"&&(x=v);return x instanceof xe||v.eachChild(function(T){var C=f(T);C instanceof xe?x=C:!x&&C?x=new xe("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):x&&C&&x!==C&&(x=new xe("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),x}(r);return c||u?c instanceof xe?co([c]):c instanceof Rr&&!Ta(t)?co([new xe("",'"interpolate" expressions cannot be used with this property')]):Xu(c?new Go(a?"camera":"composite",e.value,c.labels,c instanceof Rr?c.interpolation:void 0):new Aa(a?"constant":"source",e.value)):co([new xe("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}Go.prototype.evaluateWithoutErrorHandling=function(e,t,r,a,u,c){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,a,u,c)},Go.prototype.evaluate=function(e,t,r,a,u,c){return this._styleExpression.evaluate(e,t,r,a,u,c)},Go.prototype.interpolationFactor=function(e,t,r){return this.interpolationType?Rr.interpolationFactor(this.interpolationType,e,t,r):0};var Zo=function(e,t){this._parameters=e,this._specification=t,_e(this,function r(a,u){var c,f,v,x=u.type==="color",b=a.stops&&typeof a.stops[0][0]=="object",S=b||!(b||a.property!==void 0),T=a.type||(Ta(u)?"exponential":"interval");if(x&&((a=_e({},a)).stops&&(a.stops=a.stops.map(function(Me){return[Me[0],Mt.parse(Me[1])]})),a.default=Mt.parse(a.default?a.default:u.default)),a.colorSpace&&a.colorSpace!=="rgb"&&!Uu[a.colorSpace])throw new Error("Unknown color space: "+a.colorSpace);if(T==="exponential")c=Yu;else if(T==="interval")c=$p;else if(T==="categorical"){c=Ju,f=Object.create(null);for(var C=0,z=a.stops;C<z.length;C+=1){var N=z[C];f[N[0]]=N[1]}v=typeof a.stops[0][0]}else{if(T!=="identity")throw new Error('Unknown function type "'+T+'"');c=ds}if(b){for(var $={},J=[],H=0;H<a.stops.length;H++){var te=a.stops[H],oe=te[0].zoom;$[oe]===void 0&&($[oe]={zoom:oe,type:a.type,property:a.property,default:a.default,stops:[]},J.push(oe)),$[oe].stops.push([te[0].value,te[1]])}for(var se=[],ue=0,ye=J;ue<ye.length;ue+=1){var we=ye[ue];se.push([$[we].zoom,r($[we],u)])}var Ie={name:"linear"};return{kind:"composite",interpolationType:Ie,interpolationFactor:Rr.interpolationFactor.bind(void 0,Ie),zoomStops:se.map(function(Me){return Me[0]}),evaluate:function(Me,Ze){var Be=Me.zoom;return Yu({stops:se,base:a.base},u,Be).evaluate(Be,Ze)}}}if(S){var $e=T==="exponential"?{name:"exponential",base:a.base!==void 0?a.base:1}:null;return{kind:"camera",interpolationType:$e,interpolationFactor:Rr.interpolationFactor.bind(void 0,$e),zoomStops:a.stops.map(function(Me){return Me[0]}),evaluate:function(Me){return c(a,u,Me.zoom,f,v)}}}return{kind:"source",evaluate:function(Me,Ze){var Be=Ze&&Ze.properties?Ze.properties[a.property]:void 0;return Be===void 0?qo(a.default,u.default):c(a,u,Be,f,v)}}}(this._parameters,this._specification))};function qi(e){var t=e.key,r=e.value,a=e.valueSpec||{},u=e.objectElementValidators||{},c=e.style,f=e.styleSpec,v=[],x=qt(r);if(x!=="object")return[new W(t,r,"object expected, "+x+" found")];for(var b in r){var S=b.split(".")[0],T=a[S]||a["*"],C=void 0;if(u[S])C=u[S];else if(a[S])C=gt;else if(u["*"])C=u["*"];else{if(!a["*"]){v.push(new W(t,r[b],'unknown property "'+b+'"'));continue}C=gt}v=v.concat(C({key:(t&&t+".")+b,value:r[b],valueSpec:T,style:c,styleSpec:f,object:r,objectKey:b},r))}for(var z in a)u[z]||a[z].required&&a[z].default===void 0&&r[z]===void 0&&v.push(new W(t,r,'missing required property "'+z+'"'));return v}function ec(e){var t=e.value,r=e.valueSpec,a=e.style,u=e.styleSpec,c=e.key,f=e.arrayElementValidator||gt;if(qt(t)!=="array")return[new W(c,t,"array expected, "+qt(t)+" found")];if(r.length&&t.length!==r.length)return[new W(c,t,"array length "+r.length+" expected, length "+t.length+" found")];if(r["min-length"]&&t.length<r["min-length"])return[new W(c,t,"array length at least "+r["min-length"]+" expected, length "+t.length+" found")];var v={type:r.value,values:r.values};u.$version<7&&(v.function=r.function),qt(r.value)==="object"&&(v=r.value);for(var x=[],b=0;b<t.length;b++)x=x.concat(f({array:t,arrayIndex:b,value:t[b],valueSpec:v,style:a,styleSpec:u,key:c+"["+b+"]"}));return x}function tc(e){var t=e.key,r=e.value,a=e.valueSpec,u=qt(r);return u==="number"&&r!=r&&(u="NaN"),u!=="number"?[new W(t,r,"number expected, "+u+" found")]:"minimum"in a&&r<a.minimum?[new W(t,r,r+" is less than the minimum value "+a.minimum)]:"maximum"in a&&r>a.maximum?[new W(t,r,r+" is greater than the maximum value "+a.maximum)]:[]}function rc(e){var t,r,a,u=e.valueSpec,c=be(e.value.type),f={},v=c!=="categorical"&&e.value.property===void 0,x=!v,b=qt(e.value.stops)==="array"&&qt(e.value.stops[0])==="array"&&qt(e.value.stops[0][0])==="object",S=qi({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(z){if(c==="identity")return[new W(z.key,z.value,'identity function may not have a "stops" property')];var N=[],$=z.value;return N=N.concat(ec({key:z.key,value:$,valueSpec:z.valueSpec,style:z.style,styleSpec:z.styleSpec,arrayElementValidator:T})),qt($)==="array"&&$.length===0&&N.push(new W(z.key,$,"array must have at least one stop")),N},default:function(z){return gt({key:z.key,value:z.value,valueSpec:u,style:z.style,styleSpec:z.styleSpec})}}});return c==="identity"&&v&&S.push(new W(e.key,e.value,'missing required property "property"')),c==="identity"||e.value.stops||S.push(new W(e.key,e.value,'missing required property "stops"')),c==="exponential"&&e.valueSpec.expression&&!Ta(e.valueSpec)&&S.push(new W(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(x&&!po(e.valueSpec)?S.push(new W(e.key,e.value,"property functions not supported")):v&&!Ku(e.valueSpec)&&S.push(new W(e.key,e.value,"zoom functions not supported"))),c!=="categorical"&&!b||e.value.property!==void 0||S.push(new W(e.key,e.value,'"property" property is required')),S;function T(z){var N=[],$=z.value,J=z.key;if(qt($)!=="array")return[new W(J,$,"array expected, "+qt($)+" found")];if($.length!==2)return[new W(J,$,"array length 2 expected, length "+$.length+" found")];if(b){if(qt($[0])!=="object")return[new W(J,$,"object expected, "+qt($[0])+" found")];if($[0].zoom===void 0)return[new W(J,$,"object stop key must have zoom")];if($[0].value===void 0)return[new W(J,$,"object stop key must have value")];if(a&&a>be($[0].zoom))return[new W(J,$[0].zoom,"stop zoom values must appear in ascending order")];be($[0].zoom)!==a&&(a=be($[0].zoom),r=void 0,f={}),N=N.concat(qi({key:J+"[0]",value:$[0],valueSpec:{zoom:{}},style:z.style,styleSpec:z.styleSpec,objectElementValidators:{zoom:tc,value:C}}))}else N=N.concat(C({key:J+"[0]",value:$[0],style:z.style,styleSpec:z.styleSpec},$));return Ia(fe($[1]))?N.concat([new W(J+"[1]",$[1],"expressions are not allowed in function stops.")]):N.concat(gt({key:J+"[1]",value:$[1],valueSpec:u,style:z.style,styleSpec:z.styleSpec}))}function C(z,N){var $=qt(z.value),J=be(z.value),H=z.value!==null?z.value:N;if(t){if($!==t)return[new W(z.key,H,$+" stop domain type must match previous stop domain type "+t)]}else t=$;if($!=="number"&&$!=="string"&&$!=="boolean")return[new W(z.key,H,"stop domain value must be a number, string, or boolean")];if($!=="number"&&c!=="categorical"){var te="number expected, "+$+" found";return po(u)&&c===void 0&&(te+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new W(z.key,H,te)]}return c!=="categorical"||$!=="number"||isFinite(J)&&Math.floor(J)===J?c!=="categorical"&&$==="number"&&r!==void 0&&J<r?[new W(z.key,H,"stop domain values must appear in ascending order")]:(r=J,c==="categorical"&&J in f?[new W(z.key,H,"stop domain values must be unique")]:(f[J]=!0,[])):[new W(z.key,H,"integer expected, found "+J)]}}function ho(e){var t=(e.expressionContext==="property"?Qu:ms)(fe(e.value),e.valueSpec);if(t.result==="error")return t.value.map(function(a){return new W(""+e.key+a.key,e.value,a.message)});var r=t.value.expression||t.value._styleExpression.expression;if(e.expressionContext==="property"&&e.propertyKey==="text-font"&&!r.outputDefined())return[new W(e.key,e.value,'Invalid data expression for "'+e.propertyKey+'". Output values must be contained as literals within the expression.')];if(e.expressionContext==="property"&&e.propertyType==="layout"&&!Tn(r))return[new W(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if(e.expressionContext==="filter"&&!Tn(r))return[new W(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&e.expressionContext.indexOf("cluster")===0){if(!ro(r,["zoom","feature-state"]))return[new W(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if(e.expressionContext==="cluster-initial"&&!Sn(r))return[new W(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Ea(e){var t=e.key,r=e.value,a=e.valueSpec,u=[];return Array.isArray(a.values)?a.values.indexOf(be(r))===-1&&u.push(new W(t,r,"expected one of ["+a.values.join(", ")+"], "+JSON.stringify(r)+" found")):Object.keys(a.values).indexOf(be(r))===-1&&u.push(new W(t,r,"expected one of ["+Object.keys(a.values).join(", ")+"], "+JSON.stringify(r)+" found")),u}function ys(e){if(e===!0||e===!1)return!0;if(!Array.isArray(e)||e.length===0)return!1;switch(e[0]){case"has":return e.length>=2&&e[1]!=="$id"&&e[1]!=="$type";case"in":return e.length>=3&&(typeof e[1]!="string"||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return e.length!==3||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(var t=0,r=e.slice(1);t<r.length;t+=1){var a=r[t];if(!ys(a)&&typeof a!="boolean")return!1}return!0;default:return!0}}Zo.deserialize=function(e){return new Zo(e._parameters,e._specification)},Zo.serialize=function(e){return{_parameters:e._parameters,_specification:e._specification}};var kl={type:"boolean",default:!1};function vs(e){if(e==null)return{filter:function(){return!0},needGeometry:!1};ys(e)||(e=gs(e));var t=ms(e,kl);if(t.result==="error")throw new Error(t.value.map(function(r){return r.key+": "+r.message}).join(", "));return{filter:function(r,a,u){return t.value.evaluate(r,a,{},u)},needGeometry:function r(a){if(!Array.isArray(a))return!1;if(a[0]==="within")return!0;for(var u=1;u<a.length;u++)if(r(a[u]))return!0;return!1}(e)}}function qp(e,t){return e<t?-1:e>t?1:0}function gs(e){if(!e)return!0;var t,r=e[0];return e.length<=1?r!=="any":r==="=="?Ml(e[1],e[2],"=="):r==="!="?_s(Ml(e[1],e[2],"==")):r==="<"||r===">"||r==="<="||r===">="?Ml(e[1],e[2],r):r==="any"?(t=e.slice(1),["any"].concat(t.map(gs))):r==="all"?["all"].concat(e.slice(1).map(gs)):r==="none"?["all"].concat(e.slice(1).map(gs).map(_s)):r==="in"?ic(e[1],e.slice(2)):r==="!in"?_s(ic(e[1],e.slice(2))):r==="has"?nc(e[1]):r==="!has"?_s(nc(e[1])):r!=="within"||e}function Ml(e,t,r){switch(e){case"$type":return["filter-type-"+r,t];case"$id":return["filter-id-"+r,t];default:return["filter-"+r,e,t]}}function ic(e,t){if(t.length===0)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some(function(r){return typeof r!=typeof t[0]})?["filter-in-large",e,["literal",t.sort(qp)]]:["filter-in-small",e,["literal",t]]}}function nc(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function _s(e){return["!",e]}function zl(e){return ys(fe(e.value))?ho(_e({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(r){var a=r.value,u=r.key;if(qt(a)!=="array")return[new W(u,a,"array expected, "+qt(a)+" found")];var c,f=r.styleSpec,v=[];if(a.length<1)return[new W(u,a,"filter array must have at least 1 element")];switch(v=v.concat(Ea({key:u+"[0]",value:a[0],valueSpec:f.filter_operator,style:r.style,styleSpec:r.styleSpec})),be(a[0])){case"<":case"<=":case">":case">=":a.length>=2&&be(a[1])==="$type"&&v.push(new W(u,a,'"$type" cannot be use with operator "'+a[0]+'"'));case"==":case"!=":a.length!==3&&v.push(new W(u,a,'filter array for operator "'+a[0]+'" must have 3 elements'));case"in":case"!in":a.length>=2&&(c=qt(a[1]))!=="string"&&v.push(new W(u+"[1]",a[1],"string expected, "+c+" found"));for(var x=2;x<a.length;x++)c=qt(a[x]),be(a[1])==="$type"?v=v.concat(Ea({key:u+"["+x+"]",value:a[x],valueSpec:f.geometry_type,style:r.style,styleSpec:r.styleSpec})):c!=="string"&&c!=="number"&&c!=="boolean"&&v.push(new W(u+"["+x+"]",a[x],"string, number, or boolean expected, "+c+" found"));break;case"any":case"all":case"none":for(var b=1;b<a.length;b++)v=v.concat(t({key:u+"["+b+"]",value:a[b],style:r.style,styleSpec:r.styleSpec}));break;case"has":case"!has":c=qt(a[1]),a.length!==2?v.push(new W(u,a,'filter array for "'+a[0]+'" operator must have 2 elements')):c!=="string"&&v.push(new W(u+"[1]",a[1],"string expected, "+c+" found"));break;case"within":c=qt(a[1]),a.length!==2?v.push(new W(u,a,'filter array for "'+a[0]+'" operator must have 2 elements')):c!=="object"&&v.push(new W(u+"[1]",a[1],"object expected, "+c+" found"))}return v}(e)}function Bl(e,t){var r=e.key,a=e.style,u=e.styleSpec,c=e.value,f=e.objectKey,v=u[t+"_"+e.layerType];if(!v)return[];var x=f.match(/^(.*)-transition$/);if(t==="paint"&&x&&v[x[1]]&&v[x[1]].transition)return gt({key:r,value:c,valueSpec:u.transition,style:a,styleSpec:u});var b,S=e.valueSpec||v[f];if(!S)return[new W(r,c,'unknown property "'+f+'"')];if(qt(c)==="string"&&po(S)&&!S.tokens&&(b=/^{([^}]+)}$/.exec(c)))return[new W(r,c,'"'+f+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(b[1])+" }`.")];var T=[];return e.layerType==="symbol"&&(f==="text-field"&&a&&!a.glyphs&&T.push(new W(r,c,'use of "text-field" requires a style "glyphs" property')),f==="text-font"&&fs(fe(c))&&be(c.type)==="identity"&&T.push(new W(r,c,'"text-font" does not support identity functions'))),T.concat(gt({key:e.key,value:c,valueSpec:S,style:a,styleSpec:u,expressionContext:"property",propertyType:t,propertyKey:f}))}function Dl(e){return Bl(e,"paint")}function Pa(e){return Bl(e,"layout")}function oc(e){var t=[],r=e.value,a=e.key,u=e.style,c=e.styleSpec;r.type||r.ref||t.push(new W(a,r,'either "type" or "ref" is required'));var f,v=be(r.type),x=be(r.ref);if(r.id)for(var b=be(r.id),S=0;S<e.arrayIndex;S++){var T=u.layers[S];be(T.id)===b&&t.push(new W(a,r.id,'duplicate layer id "'+r.id+'", previously used at line '+T.id.__line__))}if("ref"in r)["type","source","source-layer","filter","layout"].forEach(function(N){N in r&&t.push(new W(a,r[N],'"'+N+'" is prohibited for ref layers'))}),u.layers.forEach(function(N){be(N.id)===x&&(f=N)}),f?f.ref?t.push(new W(a,r.ref,"ref cannot reference another ref layer")):v=be(f.type):t.push(new W(a,r.ref,'ref layer "'+x+'" not found'));else if(v!=="background")if(r.source){var C=u.sources&&u.sources[r.source],z=C&&be(C.type);C?z==="vector"&&v==="raster"?t.push(new W(a,r.source,'layer "'+r.id+'" requires a raster source')):z==="raster"&&v!=="raster"?t.push(new W(a,r.source,'layer "'+r.id+'" requires a vector source')):z!=="vector"||r["source-layer"]?z==="raster-dem"&&v!=="hillshade"?t.push(new W(a,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):v!=="line"||!r.paint||!r.paint["line-gradient"]||z==="geojson"&&C.lineMetrics||t.push(new W(a,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):t.push(new W(a,r,'layer "'+r.id+'" must specify a "source-layer"')):t.push(new W(a,r.source,'source "'+r.source+'" not found'))}else t.push(new W(a,r,'missing required property "source"'));return t=t.concat(qi({key:a,value:r,valueSpec:c.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return gt({key:a+".type",value:r.type,valueSpec:c.layer.type,style:e.style,styleSpec:e.styleSpec,object:r,objectKey:"type"})},filter:zl,layout:function(N){return qi({layer:r,key:N.key,value:N.value,style:N.style,styleSpec:N.styleSpec,objectElementValidators:{"*":function($){return Pa(_e({layerType:v},$))}}})},paint:function(N){return qi({layer:r,key:N.key,value:N.value,style:N.style,styleSpec:N.styleSpec,objectElementValidators:{"*":function($){return Dl(_e({layerType:v},$))}}})}}}))}function fo(e){var t=e.value,r=e.key,a=qt(t);return a!=="string"?[new W(r,t,"string expected, "+a+" found")]:[]}var Xt={promoteId:function(e){var t=e.key,r=e.value;if(qt(r)==="string")return fo({key:t,value:r});var a=[];for(var u in r)a.push.apply(a,fo({key:t+"."+u,value:r[u]}));return a}};function xs(e){var t=e.value,r=e.key,a=e.styleSpec,u=e.style;if(!t.type)return[new W(r,t,'"type" is required')];var c,f=be(t.type);switch(f){case"vector":case"raster":case"raster-dem":return qi({key:r,value:t,valueSpec:a["source_"+f.replace("-","_")],style:e.style,styleSpec:a,objectElementValidators:Xt});case"geojson":if(c=qi({key:r,value:t,valueSpec:a.source_geojson,style:u,styleSpec:a,objectElementValidators:Xt}),t.cluster)for(var v in t.clusterProperties){var x=t.clusterProperties[v],b=x[0],S=typeof b=="string"?[b,["accumulated"],["get",v]]:b;c.push.apply(c,ho({key:r+"."+v+".map",value:x[1],expressionContext:"cluster-map"})),c.push.apply(c,ho({key:r+"."+v+".reduce",value:S,expressionContext:"cluster-reduce"}))}return c;case"video":return qi({key:r,value:t,valueSpec:a.source_video,style:u,styleSpec:a});case"image":return qi({key:r,value:t,valueSpec:a.source_image,style:u,styleSpec:a});case"canvas":return[new W(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Ea({key:r+".type",value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]}})}}function mo(e){var t=e.value,r=e.styleSpec,a=r.light,u=e.style,c=[],f=qt(t);if(t===void 0)return c;if(f!=="object")return c.concat([new W("light",t,"object expected, "+f+" found")]);for(var v in t){var x=v.match(/^(.*)-transition$/);c=c.concat(x&&a[x[1]]&&a[x[1]].transition?gt({key:v,value:t[v],valueSpec:r.transition,style:u,styleSpec:r}):a[v]?gt({key:v,value:t[v],valueSpec:a[v],style:u,styleSpec:r}):[new W(v,t[v],'unknown property "'+v+'"')])}return c}var zn={"*":function(){return[]},array:ec,boolean:function(e){var t=e.value,r=e.key,a=qt(t);return a!=="boolean"?[new W(r,t,"boolean expected, "+a+" found")]:[]},number:tc,color:function(e){var t=e.key,r=e.value,a=qt(r);return a!=="string"?[new W(t,r,"color expected, "+a+" found")]:mt(r)===null?[new W(t,r,'color expected, "'+r+'" found')]:[]},constants:ne,enum:Ea,filter:zl,function:rc,layer:oc,object:qi,source:xs,light:mo,string:fo,formatted:function(e){return fo(e).length===0?[]:ho(e)},resolvedImage:function(e){return fo(e).length===0?[]:ho(e)}};function gt(e){var t=e.value,r=e.valueSpec,a=e.styleSpec;return r.expression&&fs(be(t))?rc(e):r.expression&&Ia(fe(t))?ho(e):r.type&&zn[r.type]?zn[r.type](e):qi(_e({},e,{valueSpec:r.type?a[r.type]:r}))}function jt(e){var t=e.value,r=e.key,a=fo(e);return a.length||(t.indexOf("{fontstack}")===-1&&a.push(new W(r,t,'"glyphs" url must include a "{fontstack}" token')),t.indexOf("{range}")===-1&&a.push(new W(r,t,'"glyphs" url must include a "{range}" token'))),a}function _i(e,t){t===void 0&&(t=D);var r=[];return r=r.concat(gt({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:jt,"*":function(){return[]}}})),e.constants&&(r=r.concat(ne({key:"constants",value:e.constants}))),Ca(r)}function Ca(e){return[].concat(e).sort(function(t,r){return t.line-r.line})}function Wo(e){return function(){for(var t=[],r=arguments.length;r--;)t[r]=arguments[r];return Ca(e.apply(this,t))}}_i.source=Wo(xs),_i.light=Wo(mo),_i.layer=Wo(oc),_i.filter=Wo(zl),_i.paintProperty=Wo(Dl),_i.layoutProperty=Wo(Pa);var ka=_i,jp=ka.light,Gp=ka.paintProperty,Ma=ka.layoutProperty;function za(e,t){var r=!1;if(t&&t.length)for(var a=0,u=t;a<u.length;a+=1)e.fire(new Y(new Error(u[a].message))),r=!0;return r}var hn=_r;function _r(e,t,r){var a=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;var u=new Int32Array(this.arrayBuffer);e=u[0],this.d=(t=u[1])+2*(r=u[2]);for(var c=0;c<this.d*this.d;c++){var f=u[3+c],v=u[3+c+1];a.push(f===v?null:u.subarray(f,v))}var x=u[3+a.length+1];this.keys=u.subarray(u[3+a.length],x),this.bboxes=u.subarray(x),this.insert=this._insertReadonly}else{this.d=t+2*r;for(var b=0;b<this.d*this.d;b++)a.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;var S=r/t*e;this.min=-S,this.max=e+S}_r.prototype.insert=function(e,t,r,a,u){this._forEachCell(t,r,a,u,this._insertCell,this.uid++),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(a),this.bboxes.push(u)},_r.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},_r.prototype._insertCell=function(e,t,r,a,u,c){this.cells[u].push(c)},_r.prototype.query=function(e,t,r,a,u){var c=this.min,f=this.max;if(e<=c&&t<=c&&f<=r&&f<=a&&!u)return Array.prototype.slice.call(this.keys);var v=[];return this._forEachCell(e,t,r,a,this._queryCell,v,{},u),v},_r.prototype._queryCell=function(e,t,r,a,u,c,f,v){var x=this.cells[u];if(x!==null)for(var b=this.keys,S=this.bboxes,T=0;T<x.length;T++){var C=x[T];if(f[C]===void 0){var z=4*C;(v?v(S[z+0],S[z+1],S[z+2],S[z+3]):e<=S[z+2]&&t<=S[z+3]&&r>=S[z+0]&&a>=S[z+1])?(f[C]=!0,c.push(b[C])):f[C]=!1}}},_r.prototype._forEachCell=function(e,t,r,a,u,c,f,v){for(var x=this._convertToCellCoord(e),b=this._convertToCellCoord(t),S=this._convertToCellCoord(r),T=this._convertToCellCoord(a),C=x;C<=S;C++)for(var z=b;z<=T;z++){var N=this.d*z+C;if((!v||v(this._convertFromCellCoord(C),this._convertFromCellCoord(z),this._convertFromCellCoord(C+1),this._convertFromCellCoord(z+1)))&&u.call(this,e,t,r,a,N,c,f,v))return}},_r.prototype._convertFromCellCoord=function(e){return(e-this.padding)/this.scale},_r.prototype._convertToCellCoord=function(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))},_r.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var e=this.cells,t=3+this.cells.length+1+1,r=0,a=0;a<this.cells.length;a++)r+=this.cells[a].length;var u=new Int32Array(t+r+this.keys.length+this.bboxes.length);u[0]=this.extent,u[1]=this.n,u[2]=this.padding;for(var c=t,f=0;f<e.length;f++){var v=e[f];u[3+f]=c,u.set(v,c),c+=v.length}return u[3+e.length]=c,u.set(this.keys,c),u[3+e.length+1]=c+=this.keys.length,u.set(this.bboxes,c),c+=this.bboxes.length,u.buffer};var Ba=ae.ImageData,ac=ae.ImageBitmap,mr={};function Oe(e,t,r){r===void 0&&(r={}),Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),mr[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}for(var ci in Oe("Object",Object),hn.serialize=function(e,t){var r=e.toArrayBuffer();return t&&t.push(r),{buffer:r}},hn.deserialize=function(e){return new hn(e.buffer)},Oe("Grid",hn),Oe("Color",Mt),Oe("Error",Error),Oe("ResolvedImage",ii),Oe("StylePropertyFunction",Zo),Oe("StyleExpression",jo,{omit:["_evaluator"]}),Oe("ZoomDependentExpression",Go),Oe("ZoomConstantExpression",Aa),Oe("CompoundExpression",Lr,{omit:["_evaluate"]}),lo)lo[ci]._classRegistryKey||Oe("Expression_"+ci,lo[ci]);function bs(e){return e&&typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||e.constructor&&e.constructor.name==="ArrayBuffer")}function Ho(e){return ac&&e instanceof ac}function ji(e,t){if(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp)return e;if(bs(e)||Ho(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){var r=e;return t&&t.push(r.buffer),r}if(e instanceof Ba)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){for(var a=[],u=0,c=e;u<c.length;u+=1)a.push(ji(c[u],t));return a}if(typeof e=="object"){var f=e.constructor,v=f._classRegistryKey;if(!v)throw new Error("can't serialize object of unregistered class");var x=f.serialize?f.serialize(e,t):{};if(!f.serialize){for(var b in e)if(e.hasOwnProperty(b)&&!(mr[v].omit.indexOf(b)>=0)){var S=e[b];x[b]=mr[v].shallow.indexOf(b)>=0?S:ji(S,t)}e instanceof Error&&(x.message=e.message)}if(x.$name)throw new Error("$name property is reserved for worker serialization logic.");return v!=="Object"&&(x.$name=v),x}throw new Error("can't serialize object of type "+typeof e)}function pi(e){if(e==null||typeof e=="boolean"||typeof e=="number"||typeof e=="string"||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||bs(e)||Ho(e)||ArrayBuffer.isView(e)||e instanceof Ba)return e;if(Array.isArray(e))return e.map(pi);if(typeof e=="object"){var t=e.$name||"Object",r=mr[t].klass;if(!r)throw new Error("can't deserialize unregistered class "+t);if(r.deserialize)return r.deserialize(e);for(var a=Object.create(r.prototype),u=0,c=Object.keys(e);u<c.length;u+=1){var f=c[u];if(f!=="$name"){var v=e[f];a[f]=mr[t].shallow.indexOf(f)>=0?v:pi(v)}}return a}throw new Error("can't deserialize object of type "+typeof e)}var Ll=function(){this.first=!0};Ll.prototype.update=function(e,t){var r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))};var Pe={"Latin-1 Supplement":function(e){return e>=128&&e<=255},Arabic:function(e){return e>=1536&&e<=1791},"Arabic Supplement":function(e){return e>=1872&&e<=1919},"Arabic Extended-A":function(e){return e>=2208&&e<=2303},"Hangul Jamo":function(e){return e>=4352&&e<=4607},"Unified Canadian Aboriginal Syllabics":function(e){return e>=5120&&e<=5759},Khmer:function(e){return e>=6016&&e<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(e){return e>=6320&&e<=6399},"General Punctuation":function(e){return e>=8192&&e<=8303},"Letterlike Symbols":function(e){return e>=8448&&e<=8527},"Number Forms":function(e){return e>=8528&&e<=8591},"Miscellaneous Technical":function(e){return e>=8960&&e<=9215},"Control Pictures":function(e){return e>=9216&&e<=9279},"Optical Character Recognition":function(e){return e>=9280&&e<=9311},"Enclosed Alphanumerics":function(e){return e>=9312&&e<=9471},"Geometric Shapes":function(e){return e>=9632&&e<=9727},"Miscellaneous Symbols":function(e){return e>=9728&&e<=9983},"Miscellaneous Symbols and Arrows":function(e){return e>=11008&&e<=11263},"CJK Radicals Supplement":function(e){return e>=11904&&e<=12031},"Kangxi Radicals":function(e){return e>=12032&&e<=12255},"Ideographic Description Characters":function(e){return e>=12272&&e<=12287},"CJK Symbols and Punctuation":function(e){return e>=12288&&e<=12351},Hiragana:function(e){return e>=12352&&e<=12447},Katakana:function(e){return e>=12448&&e<=12543},Bopomofo:function(e){return e>=12544&&e<=12591},"Hangul Compatibility Jamo":function(e){return e>=12592&&e<=12687},Kanbun:function(e){return e>=12688&&e<=12703},"Bopomofo Extended":function(e){return e>=12704&&e<=12735},"CJK Strokes":function(e){return e>=12736&&e<=12783},"Katakana Phonetic Extensions":function(e){return e>=12784&&e<=12799},"Enclosed CJK Letters and Months":function(e){return e>=12800&&e<=13055},"CJK Compatibility":function(e){return e>=13056&&e<=13311},"CJK Unified Ideographs Extension A":function(e){return e>=13312&&e<=19903},"Yijing Hexagram Symbols":function(e){return e>=19904&&e<=19967},"CJK Unified Ideographs":function(e){return e>=19968&&e<=40959},"Yi Syllables":function(e){return e>=40960&&e<=42127},"Yi Radicals":function(e){return e>=42128&&e<=42191},"Hangul Jamo Extended-A":function(e){return e>=43360&&e<=43391},"Hangul Syllables":function(e){return e>=44032&&e<=55215},"Hangul Jamo Extended-B":function(e){return e>=55216&&e<=55295},"Private Use Area":function(e){return e>=57344&&e<=63743},"CJK Compatibility Ideographs":function(e){return e>=63744&&e<=64255},"Arabic Presentation Forms-A":function(e){return e>=64336&&e<=65023},"Vertical Forms":function(e){return e>=65040&&e<=65055},"CJK Compatibility Forms":function(e){return e>=65072&&e<=65103},"Small Form Variants":function(e){return e>=65104&&e<=65135},"Arabic Presentation Forms-B":function(e){return e>=65136&&e<=65279},"Halfwidth and Fullwidth Forms":function(e){return e>=65280&&e<=65519}};function Rl(e){for(var t=0,r=e;t<r.length;t+=1)if(ws(r[t].charCodeAt(0)))return!0;return!1}function ws(e){return!(e!==746&&e!==747&&(e<4352||!(Pe["Bopomofo Extended"](e)||Pe.Bopomofo(e)||Pe["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||Pe["CJK Compatibility Ideographs"](e)||Pe["CJK Compatibility"](e)||Pe["CJK Radicals Supplement"](e)||Pe["CJK Strokes"](e)||!(!Pe["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||e===12336)||Pe["CJK Unified Ideographs Extension A"](e)||Pe["CJK Unified Ideographs"](e)||Pe["Enclosed CJK Letters and Months"](e)||Pe["Hangul Compatibility Jamo"](e)||Pe["Hangul Jamo Extended-A"](e)||Pe["Hangul Jamo Extended-B"](e)||Pe["Hangul Jamo"](e)||Pe["Hangul Syllables"](e)||Pe.Hiragana(e)||Pe["Ideographic Description Characters"](e)||Pe.Kanbun(e)||Pe["Kangxi Radicals"](e)||Pe["Katakana Phonetic Extensions"](e)||Pe.Katakana(e)&&e!==12540||!(!Pe["Halfwidth and Fullwidth Forms"](e)||e===65288||e===65289||e===65293||e>=65306&&e<=65310||e===65339||e===65341||e===65343||e>=65371&&e<=65503||e===65507||e>=65512&&e<=65519)||!(!Pe["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||Pe["Unified Canadian Aboriginal Syllabics"](e)||Pe["Unified Canadian Aboriginal Syllabics Extended"](e)||Pe["Vertical Forms"](e)||Pe["Yijing Hexagram Symbols"](e)||Pe["Yi Syllables"](e)||Pe["Yi Radicals"](e))))}function Fl(e){return!(ws(e)||function(t){return!!(Pe["Latin-1 Supplement"](t)&&(t===167||t===169||t===174||t===177||t===188||t===189||t===190||t===215||t===247)||Pe["General Punctuation"](t)&&(t===8214||t===8224||t===8225||t===8240||t===8241||t===8251||t===8252||t===8258||t===8263||t===8264||t===8265||t===8273)||Pe["Letterlike Symbols"](t)||Pe["Number Forms"](t)||Pe["Miscellaneous Technical"](t)&&(t>=8960&&t<=8967||t>=8972&&t<=8991||t>=8996&&t<=9e3||t===9003||t>=9085&&t<=9114||t>=9150&&t<=9165||t===9167||t>=9169&&t<=9179||t>=9186&&t<=9215)||Pe["Control Pictures"](t)&&t!==9251||Pe["Optical Character Recognition"](t)||Pe["Enclosed Alphanumerics"](t)||Pe["Geometric Shapes"](t)||Pe["Miscellaneous Symbols"](t)&&!(t>=9754&&t<=9759)||Pe["Miscellaneous Symbols and Arrows"](t)&&(t>=11026&&t<=11055||t>=11088&&t<=11097||t>=11192&&t<=11243)||Pe["CJK Symbols and Punctuation"](t)||Pe.Katakana(t)||Pe["Private Use Area"](t)||Pe["CJK Compatibility Forms"](t)||Pe["Small Form Variants"](t)||Pe["Halfwidth and Fullwidth Forms"](t)||t===8734||t===8756||t===8757||t>=9984&&t<=10087||t>=10102&&t<=10131||t===65532||t===65533)}(e))}function Mi(e){return e>=1424&&e<=2303||Pe["Arabic Presentation Forms-A"](e)||Pe["Arabic Presentation Forms-B"](e)}function hi(e,t){return!(!t&&Mi(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||Pe.Khmer(e))}function Ss(e){for(var t=0,r=e;t<r.length;t+=1)if(Mi(r[t].charCodeAt(0)))return!0;return!1}var Ts=null,fi="unavailable",fn=null,sc=function(e){e&&typeof e=="string"&&e.indexOf("NetworkError")>-1&&(fi="error"),Ts&&Ts(e)};function Da(){Ol.fire(new G("pluginStateChange",{pluginStatus:fi,pluginURL:fn}))}var Ol=new ee,Vl=function(){return fi},Gi=function(){if(fi!=="deferred"||!fn)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");fi="loading",Da(),fn&&va({url:fn},function(e){e?sc(e):(fi="loaded",Da())})},xi={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return fi==="loaded"||xi.applyArabicShaping!=null},isLoading:function(){return fi==="loading"},setState:function(e){fi=e.pluginStatus,fn=e.pluginURL},isParsed:function(){return xi.applyArabicShaping!=null&&xi.processBidirectionalText!=null&&xi.processStyledBidirectionalText!=null},getPluginURL:function(){return fn}},ft=function(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Ll,this.transition={})};ft.prototype.isSupportedScript=function(e){return function(t,r){for(var a=0,u=t;a<u.length;a+=1)if(!hi(u[a].charCodeAt(0),r))return!1;return!0}(e,xi.isLoaded())},ft.prototype.crossFadingFactor=function(){return this.fadeDuration===0?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},ft.prototype.getCrossfadeParameters=function(){var e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}};var Qi=function(e,t){this.property=e,this.value=t,this.expression=function(r,a){if(fs(r))return new Zo(r,a);if(Ia(r)){var u=Qu(r,a);if(u.result==="error")throw new Error(u.value.map(function(f){return f.key+": "+f.message}).join(", "));return u.value}var c=r;return typeof r=="string"&&a.type==="color"&&(c=Mt.parse(r)),{kind:"constant",evaluate:function(){return c}}}(t===void 0?e.specification.default:t,e.specification)};Qi.prototype.isDataDriven=function(){return this.expression.kind==="source"||this.expression.kind==="composite"},Qi.prototype.possiblyEvaluate=function(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)};var zi=function(e){this.property=e,this.value=new Qi(e,void 0)};zi.prototype.transitioned=function(e,t){return new yo(this.property,this.value,t,ot({},e.transition,this.transition),e.now)},zi.prototype.untransitioned=function(){return new yo(this.property,this.value,null,{},0)};var Fr=function(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)};Fr.prototype.getValue=function(e){return ei(this._values[e].value.value)},Fr.prototype.setValue=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new zi(this._values[e].property)),this._values[e].value=new Qi(this._values[e].property,t===null?void 0:ei(t))},Fr.prototype.getTransition=function(e){return ei(this._values[e].transition)},Fr.prototype.setTransition=function(e,t){this._values.hasOwnProperty(e)||(this._values[e]=new zi(this._values[e].property)),this._values[e].transition=ei(t)||void 0},Fr.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t],u=this.getValue(a);u!==void 0&&(e[a]=u);var c=this.getTransition(a);c!==void 0&&(e[a+"-transition"]=c)}return e},Fr.prototype.transitioned=function(e,t){for(var r=new Bn(this._properties),a=0,u=Object.keys(this._values);a<u.length;a+=1){var c=u[a];r._values[c]=this._values[c].transitioned(e,t._values[c])}return r},Fr.prototype.untransitioned=function(){for(var e=new Bn(this._properties),t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t];e._values[a]=this._values[a].untransitioned()}return e};var yo=function(e,t,r,a,u){this.property=e,this.value=t,this.begin=u+a.delay||0,this.end=this.begin+a.duration||0,e.specification.transition&&(a.delay||a.duration)&&(this.prior=r)};yo.prototype.possiblyEvaluate=function(e,t,r){var a=e.now||0,u=this.value.possiblyEvaluate(e,t,r),c=this.prior;if(c){if(a>this.end)return this.prior=null,u;if(this.value.isDataDriven())return this.prior=null,u;if(a<this.begin)return c.possiblyEvaluate(e,t,r);var f=(a-this.begin)/(this.end-this.begin);return this.property.interpolate(c.possiblyEvaluate(e,t,r),u,function(v){if(v<=0)return 0;if(v>=1)return 1;var x=v*v,b=x*v;return 4*(v<.5?b:3*(v-x)+b-.75)}(f))}return u};var Bn=function(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)};Bn.prototype.possiblyEvaluate=function(e,t,r){for(var a=new La(this._properties),u=0,c=Object.keys(this._values);u<c.length;u+=1){var f=c[u];a._values[f]=this._values[f].possiblyEvaluate(e,t,r)}return a},Bn.prototype.hasTransition=function(){for(var e=0,t=Object.keys(this._values);e<t.length;e+=1)if(this._values[t[e]].prior)return!0;return!1};var Zi=function(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)};Zi.prototype.getValue=function(e){return ei(this._values[e].value)},Zi.prototype.setValue=function(e,t){this._values[e]=new Qi(this._values[e].property,t===null?void 0:ei(t))},Zi.prototype.serialize=function(){for(var e={},t=0,r=Object.keys(this._values);t<r.length;t+=1){var a=r[t],u=this.getValue(a);u!==void 0&&(e[a]=u)}return e},Zi.prototype.possiblyEvaluate=function(e,t,r){for(var a=new La(this._properties),u=0,c=Object.keys(this._values);u<c.length;u+=1){var f=c[u];a._values[f]=this._values[f].possiblyEvaluate(e,t,r)}return a};var Zr=function(e,t,r){this.property=e,this.value=t,this.parameters=r};Zr.prototype.isConstant=function(){return this.value.kind==="constant"},Zr.prototype.constantOr=function(e){return this.value.kind==="constant"?this.value.value:e},Zr.prototype.evaluate=function(e,t,r,a){return this.property.evaluate(this.value,this.parameters,e,t,r,a)};var La=function(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)};La.prototype.get=function(e){return this._values[e]};var je=function(e){this.specification=e};je.prototype.possiblyEvaluate=function(e,t){return e.expression.evaluate(t)},je.prototype.interpolate=function(e,t,r){var a=$o[this.specification.type];return a?a(e,t,r):e};var Ue=function(e,t){this.specification=e,this.overrides=t};Ue.prototype.possiblyEvaluate=function(e,t,r,a){return new Zr(this,e.expression.kind==="constant"||e.expression.kind==="camera"?{kind:"constant",value:e.expression.evaluate(t,null,{},r,a)}:e.expression,t)},Ue.prototype.interpolate=function(e,t,r){if(e.value.kind!=="constant"||t.value.kind!=="constant")return e;if(e.value.value===void 0||t.value.value===void 0)return new Zr(this,{kind:"constant",value:void 0},e.parameters);var a=$o[this.specification.type];return a?new Zr(this,{kind:"constant",value:a(e.value.value,t.value.value,r)},e.parameters):e},Ue.prototype.evaluate=function(e,t,r,a,u,c){return e.kind==="constant"?e.value:e.evaluate(t,r,a,u,c)};var Is=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.possiblyEvaluate=function(r,a,u,c){if(r.value===void 0)return new Zr(this,{kind:"constant",value:void 0},a);if(r.expression.kind==="constant"){var f=r.expression.evaluate(a,null,{},u,c),v=r.property.specification.type==="resolvedImage"&&typeof f!="string"?f.name:f,x=this._calculate(v,v,v,a);return new Zr(this,{kind:"constant",value:x},a)}if(r.expression.kind==="camera"){var b=this._calculate(r.expression.evaluate({zoom:a.zoom-1}),r.expression.evaluate({zoom:a.zoom}),r.expression.evaluate({zoom:a.zoom+1}),a);return new Zr(this,{kind:"constant",value:b},a)}return new Zr(this,r.expression,a)},t.prototype.evaluate=function(r,a,u,c,f,v){if(r.kind==="source"){var x=r.evaluate(a,u,c,f,v);return this._calculate(x,x,x,a)}return r.kind==="composite"?this._calculate(r.evaluate({zoom:Math.floor(a.zoom)-1},u,c),r.evaluate({zoom:Math.floor(a.zoom)},u,c),r.evaluate({zoom:Math.floor(a.zoom)+1},u,c),a):r.value},t.prototype._calculate=function(r,a,u,c){return c.zoom>c.zoomHistory.lastIntegerZoom?{from:r,to:a}:{from:u,to:a}},t.prototype.interpolate=function(r){return r},t}(Ue),Wr=function(e){this.specification=e};Wr.prototype.possiblyEvaluate=function(e,t,r,a){if(e.value!==void 0){if(e.expression.kind==="constant"){var u=e.expression.evaluate(t,null,{},r,a);return this._calculate(u,u,u,t)}return this._calculate(e.expression.evaluate(new ft(Math.floor(t.zoom-1),t)),e.expression.evaluate(new ft(Math.floor(t.zoom),t)),e.expression.evaluate(new ft(Math.floor(t.zoom+1),t)),t)}},Wr.prototype._calculate=function(e,t,r,a){return a.zoom>a.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}},Wr.prototype.interpolate=function(e){return e};var Wi=function(e){this.specification=e};Wi.prototype.possiblyEvaluate=function(e,t,r,a){return!!e.expression.evaluate(t,null,{},r,a)},Wi.prototype.interpolate=function(){return!1};var Or=function(e){for(var t in this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],e){var r=e[t];r.specification.overridable&&this.overridableProperties.push(t);var a=this.defaultPropertyValues[t]=new Qi(r,void 0),u=this.defaultTransitionablePropertyValues[t]=new zi(r);this.defaultTransitioningPropertyValues[t]=u.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=a.possiblyEvaluate({})}};Oe("DataDrivenProperty",Ue),Oe("DataConstantProperty",je),Oe("CrossFadedDataDrivenProperty",Is),Oe("CrossFadedProperty",Wr),Oe("ColorRampProperty",Wi);var en=function(e){function t(r,a){if(e.call(this),this.id=r.id,this.type=r.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},r.type!=="custom"&&(this.metadata=(r=r).metadata,this.minzoom=r.minzoom,this.maxzoom=r.maxzoom,r.type!=="background"&&(this.source=r.source,this.sourceLayer=r["source-layer"],this.filter=r.filter),a.layout&&(this._unevaluatedLayout=new Zi(a.layout)),a.paint)){for(var u in this._transitionablePaint=new Fr(a.paint),r.paint)this.setPaintProperty(u,r.paint[u],{validate:!1});for(var c in r.layout)this.setLayoutProperty(c,r.layout[c],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new La(a.paint)}}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},t.prototype.getLayoutProperty=function(r){return r==="visibility"?this.visibility:this._unevaluatedLayout.getValue(r)},t.prototype.setLayoutProperty=function(r,a,u){u===void 0&&(u={}),a!=null&&this._validate(Ma,"layers."+this.id+".layout."+r,r,a,u)||(r!=="visibility"?this._unevaluatedLayout.setValue(r,a):this.visibility=a)},t.prototype.getPaintProperty=function(r){return Er(r,"-transition")?this._transitionablePaint.getTransition(r.slice(0,-11)):this._transitionablePaint.getValue(r)},t.prototype.setPaintProperty=function(r,a,u){if(u===void 0&&(u={}),a!=null&&this._validate(Gp,"layers."+this.id+".paint."+r,r,a,u))return!1;if(Er(r,"-transition"))return this._transitionablePaint.setTransition(r.slice(0,-11),a||void 0),!1;var c=this._transitionablePaint._values[r],f=c.property.specification["property-type"]==="cross-faded-data-driven",v=c.value.isDataDriven(),x=c.value;this._transitionablePaint.setValue(r,a),this._handleSpecialPaintPropertyUpdate(r);var b=this._transitionablePaint._values[r].value;return b.isDataDriven()||v||f||this._handleOverridablePaintPropertyUpdate(r,x,b)},t.prototype._handleSpecialPaintPropertyUpdate=function(r){},t.prototype._handleOverridablePaintPropertyUpdate=function(r,a,u){return!1},t.prototype.isHidden=function(r){return!!(this.minzoom&&r<this.minzoom)||!!(this.maxzoom&&r>=this.maxzoom)||this.visibility==="none"},t.prototype.updateTransitions=function(r){this._transitioningPaint=this._transitionablePaint.transitioned(r,this._transitioningPaint)},t.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},t.prototype.recalculate=function(r,a){r.getCrossfadeParameters&&(this._crossfadeParameters=r.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(r,void 0,a)),this.paint=this._transitioningPaint.possiblyEvaluate(r,void 0,a)},t.prototype.serialize=function(){var r={id:this.id,type:this.type,source:this.source,"source-layer":this.sourceLayer,metadata:this.metadata,minzoom:this.minzoom,maxzoom:this.maxzoom,filter:this.filter,layout:this._unevaluatedLayout&&this._unevaluatedLayout.serialize(),paint:this._transitionablePaint&&this._transitionablePaint.serialize()};return this.visibility&&(r.layout=r.layout||{},r.layout.visibility=this.visibility),Qr(r,function(a,u){return!(a===void 0||u==="layout"&&!Object.keys(a).length||u==="paint"&&!Object.keys(a).length)})},t.prototype._validate=function(r,a,u,c,f){return f===void 0&&(f={}),(!f||f.validate!==!1)&&za(this,r.call(ka,{key:a,layerType:this.type,objectKey:u,value:c,styleSpec:D,style:{glyphs:!0,sprite:!0}}))},t.prototype.is3D=function(){return!1},t.prototype.isTileClipped=function(){return!1},t.prototype.hasOffscreenPass=function(){return!1},t.prototype.resize=function(){},t.prototype.isStateDependent=function(){for(var r in this.paint._values){var a=this.paint.get(r);if(a instanceof Zr&&po(a.property.specification)&&(a.value.kind==="source"||a.value.kind==="composite")&&a.value.isStateDependent)return!0}return!1},t}(ee),Ul={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},As=function(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8},Dt=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)};function kr(e,t){t===void 0&&(t=1);var r=0,a=0;return{members:e.map(function(u){var c=Ul[u.type].BYTES_PER_ELEMENT,f=r=lc(r,Math.max(t,c)),v=u.components||1;return a=Math.max(a,c),r+=c*v,{name:u.name,type:u.type,components:v,offset:f}}),size:lc(r,Math.max(a,t)),alignment:t}}function lc(e,t){return Math.ceil(e/t)*t}Dt.serialize=function(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}},Dt.deserialize=function(e){var t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t},Dt.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},Dt.prototype.clear=function(){this.length=0},Dt.prototype.resize=function(e){this.reserve(e),this.length=e},Dt.prototype.reserve=function(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);var t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}},Dt.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var vo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var u=this.length;return this.resize(u+1),this.emplace(u,r,a)},t.prototype.emplace=function(r,a,u){var c=2*r;return this.int16[c+0]=a,this.int16[c+1]=u,r},t}(Dt);vo.prototype.bytesPerElement=4,Oe("StructArrayLayout2i4",vo);var Nl=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c){var f=this.length;return this.resize(f+1),this.emplace(f,r,a,u,c)},t.prototype.emplace=function(r,a,u,c,f){var v=4*r;return this.int16[v+0]=a,this.int16[v+1]=u,this.int16[v+2]=c,this.int16[v+3]=f,r},t}(Dt);Nl.prototype.bytesPerElement=8,Oe("StructArrayLayout4i8",Nl);var dn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,f,v){var x=this.length;return this.resize(x+1),this.emplace(x,r,a,u,c,f,v)},t.prototype.emplace=function(r,a,u,c,f,v,x){var b=6*r;return this.int16[b+0]=a,this.int16[b+1]=u,this.int16[b+2]=c,this.int16[b+3]=f,this.int16[b+4]=v,this.int16[b+5]=x,r},t}(Dt);dn.prototype.bytesPerElement=12,Oe("StructArrayLayout2i4i12",dn);var di=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,f,v){var x=this.length;return this.resize(x+1),this.emplace(x,r,a,u,c,f,v)},t.prototype.emplace=function(r,a,u,c,f,v,x){var b=4*r,S=8*r;return this.int16[b+0]=a,this.int16[b+1]=u,this.uint8[S+4]=c,this.uint8[S+5]=f,this.uint8[S+6]=v,this.uint8[S+7]=x,r},t}(Dt);di.prototype.bytesPerElement=8,Oe("StructArrayLayout2i4ub8",di);var Xo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var u=this.length;return this.resize(u+1),this.emplace(u,r,a)},t.prototype.emplace=function(r,a,u){var c=2*r;return this.float32[c+0]=a,this.float32[c+1]=u,r},t}(Dt);Xo.prototype.bytesPerElement=8,Oe("StructArrayLayout2f8",Xo);var tn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,f,v,x,b,S,T){var C=this.length;return this.resize(C+1),this.emplace(C,r,a,u,c,f,v,x,b,S,T)},t.prototype.emplace=function(r,a,u,c,f,v,x,b,S,T,C){var z=10*r;return this.uint16[z+0]=a,this.uint16[z+1]=u,this.uint16[z+2]=c,this.uint16[z+3]=f,this.uint16[z+4]=v,this.uint16[z+5]=x,this.uint16[z+6]=b,this.uint16[z+7]=S,this.uint16[z+8]=T,this.uint16[z+9]=C,r},t}(Dt);tn.prototype.bytesPerElement=20,Oe("StructArrayLayout10ui20",tn);var Es=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,f,v,x,b,S,T,C,z){var N=this.length;return this.resize(N+1),this.emplace(N,r,a,u,c,f,v,x,b,S,T,C,z)},t.prototype.emplace=function(r,a,u,c,f,v,x,b,S,T,C,z,N){var $=12*r;return this.int16[$+0]=a,this.int16[$+1]=u,this.int16[$+2]=c,this.int16[$+3]=f,this.uint16[$+4]=v,this.uint16[$+5]=x,this.uint16[$+6]=b,this.uint16[$+7]=S,this.int16[$+8]=T,this.int16[$+9]=C,this.int16[$+10]=z,this.int16[$+11]=N,r},t}(Dt);Es.prototype.bytesPerElement=24,Oe("StructArrayLayout4i4ui4i24",Es);var Ko=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,u)},t.prototype.emplace=function(r,a,u,c){var f=3*r;return this.float32[f+0]=a,this.float32[f+1]=u,this.float32[f+2]=c,r},t}(Dt);Ko.prototype.bytesPerElement=12,Oe("StructArrayLayout3f12",Ko);var Ra=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.uint32[1*r+0]=a,r},t}(Dt);Ra.prototype.bytesPerElement=4,Oe("StructArrayLayout1ul4",Ra);var $l=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,f,v,x,b,S){var T=this.length;return this.resize(T+1),this.emplace(T,r,a,u,c,f,v,x,b,S)},t.prototype.emplace=function(r,a,u,c,f,v,x,b,S,T){var C=10*r,z=5*r;return this.int16[C+0]=a,this.int16[C+1]=u,this.int16[C+2]=c,this.int16[C+3]=f,this.int16[C+4]=v,this.int16[C+5]=x,this.uint32[z+3]=b,this.uint16[C+8]=S,this.uint16[C+9]=T,r},t}(Dt);$l.prototype.bytesPerElement=20,Oe("StructArrayLayout6i1ul2ui20",$l);var Jo=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,f,v){var x=this.length;return this.resize(x+1),this.emplace(x,r,a,u,c,f,v)},t.prototype.emplace=function(r,a,u,c,f,v,x){var b=6*r;return this.int16[b+0]=a,this.int16[b+1]=u,this.int16[b+2]=c,this.int16[b+3]=f,this.int16[b+4]=v,this.int16[b+5]=x,r},t}(Dt);Jo.prototype.bytesPerElement=12,Oe("StructArrayLayout2i2i2i12",Jo);var go=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,f){var v=this.length;return this.resize(v+1),this.emplace(v,r,a,u,c,f)},t.prototype.emplace=function(r,a,u,c,f,v){var x=4*r,b=8*r;return this.float32[x+0]=a,this.float32[x+1]=u,this.float32[x+2]=c,this.int16[b+6]=f,this.int16[b+7]=v,r},t}(Dt);go.prototype.bytesPerElement=16,Oe("StructArrayLayout2f1f2i16",go);var ql=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c){var f=this.length;return this.resize(f+1),this.emplace(f,r,a,u,c)},t.prototype.emplace=function(r,a,u,c,f){var v=12*r,x=3*r;return this.uint8[v+0]=a,this.uint8[v+1]=u,this.float32[x+1]=c,this.float32[x+2]=f,r},t}(Dt);ql.prototype.bytesPerElement=12,Oe("StructArrayLayout2ub2f12",ql);var Dn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,u)},t.prototype.emplace=function(r,a,u,c){var f=3*r;return this.uint16[f+0]=a,this.uint16[f+1]=u,this.uint16[f+2]=c,r},t}(Dt);Dn.prototype.bytesPerElement=6,Oe("StructArrayLayout3ui6",Dn);var Ln=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,f,v,x,b,S,T,C,z,N,$,J,H,te){var oe=this.length;return this.resize(oe+1),this.emplace(oe,r,a,u,c,f,v,x,b,S,T,C,z,N,$,J,H,te)},t.prototype.emplace=function(r,a,u,c,f,v,x,b,S,T,C,z,N,$,J,H,te,oe){var se=24*r,ue=12*r,ye=48*r;return this.int16[se+0]=a,this.int16[se+1]=u,this.uint16[se+2]=c,this.uint16[se+3]=f,this.uint32[ue+2]=v,this.uint32[ue+3]=x,this.uint32[ue+4]=b,this.uint16[se+10]=S,this.uint16[se+11]=T,this.uint16[se+12]=C,this.float32[ue+7]=z,this.float32[ue+8]=N,this.uint8[ye+36]=$,this.uint8[ye+37]=J,this.uint8[ye+38]=H,this.uint32[ue+10]=te,this.int16[se+22]=oe,r},t}(Dt);Ln.prototype.bytesPerElement=48,Oe("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ln);var Ps=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c,f,v,x,b,S,T,C,z,N,$,J,H,te,oe,se,ue,ye,we,Ie,$e,Me,Ze,Be,lt){var Ye=this.length;return this.resize(Ye+1),this.emplace(Ye,r,a,u,c,f,v,x,b,S,T,C,z,N,$,J,H,te,oe,se,ue,ye,we,Ie,$e,Me,Ze,Be,lt)},t.prototype.emplace=function(r,a,u,c,f,v,x,b,S,T,C,z,N,$,J,H,te,oe,se,ue,ye,we,Ie,$e,Me,Ze,Be,lt,Ye){var Ne=34*r,ct=17*r;return this.int16[Ne+0]=a,this.int16[Ne+1]=u,this.int16[Ne+2]=c,this.int16[Ne+3]=f,this.int16[Ne+4]=v,this.int16[Ne+5]=x,this.int16[Ne+6]=b,this.int16[Ne+7]=S,this.uint16[Ne+8]=T,this.uint16[Ne+9]=C,this.uint16[Ne+10]=z,this.uint16[Ne+11]=N,this.uint16[Ne+12]=$,this.uint16[Ne+13]=J,this.uint16[Ne+14]=H,this.uint16[Ne+15]=te,this.uint16[Ne+16]=oe,this.uint16[Ne+17]=se,this.uint16[Ne+18]=ue,this.uint16[Ne+19]=ye,this.uint16[Ne+20]=we,this.uint16[Ne+21]=Ie,this.uint16[Ne+22]=$e,this.uint32[ct+12]=Me,this.float32[ct+13]=Ze,this.float32[ct+14]=Be,this.float32[ct+15]=lt,this.float32[ct+16]=Ye,r},t}(Dt);Ps.prototype.bytesPerElement=68,Oe("StructArrayLayout8i15ui1ul4f68",Ps);var Rn=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.float32[1*r+0]=a,r},t}(Dt);Rn.prototype.bytesPerElement=4,Oe("StructArrayLayout1f4",Rn);var Bi=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,u)},t.prototype.emplace=function(r,a,u,c){var f=3*r;return this.int16[f+0]=a,this.int16[f+1]=u,this.int16[f+2]=c,r},t}(Dt);Bi.prototype.bytesPerElement=6,Oe("StructArrayLayout3i6",Bi);var jl=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u){var c=this.length;return this.resize(c+1),this.emplace(c,r,a,u)},t.prototype.emplace=function(r,a,u,c){var f=4*r;return this.uint32[2*r+0]=a,this.uint16[f+2]=u,this.uint16[f+3]=c,r},t}(Dt);jl.prototype.bytesPerElement=8,Oe("StructArrayLayout1ul2ui8",jl);var Fa=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a){var u=this.length;return this.resize(u+1),this.emplace(u,r,a)},t.prototype.emplace=function(r,a,u){var c=2*r;return this.uint16[c+0]=a,this.uint16[c+1]=u,r},t}(Dt);Fa.prototype.bytesPerElement=4,Oe("StructArrayLayout2ui4",Fa);var Gl=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r){var a=this.length;return this.resize(a+1),this.emplace(a,r)},t.prototype.emplace=function(r,a){return this.uint16[1*r+0]=a,r},t}(Dt);Gl.prototype.bytesPerElement=2,Oe("StructArrayLayout1ui2",Gl);var Cs=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},t.prototype.emplaceBack=function(r,a,u,c){var f=this.length;return this.resize(f+1),this.emplace(f,r,a,u,c)},t.prototype.emplace=function(r,a,u,c,f){var v=4*r;return this.float32[v+0]=a,this.float32[v+1]=u,this.float32[v+2]=c,this.float32[v+3]=f,r},t}(Dt);Cs.prototype.bytesPerElement=16,Oe("StructArrayLayout4f16",Cs);var i=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={anchorPointX:{configurable:!0},anchorPointY:{configurable:!0},x1:{configurable:!0},y1:{configurable:!0},x2:{configurable:!0},y2:{configurable:!0},featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0},anchorPoint:{configurable:!0}};return r.anchorPointX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorPointY.get=function(){return this._structArray.int16[this._pos2+1]},r.x1.get=function(){return this._structArray.int16[this._pos2+2]},r.y1.get=function(){return this._structArray.int16[this._pos2+3]},r.x2.get=function(){return this._structArray.int16[this._pos2+4]},r.y2.get=function(){return this._structArray.int16[this._pos2+5]},r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+8]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.anchorPoint.get=function(){return new pe(this.anchorPointX,this.anchorPointY)},Object.defineProperties(t.prototype,r),t}(As);i.prototype.size=20;var o=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new i(this,r)},t}($l);Oe("CollisionBoxArray",o);var n=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},glyphStartIndex:{configurable:!0},numGlyphs:{configurable:!0},vertexStartIndex:{configurable:!0},lineStartIndex:{configurable:!0},lineLength:{configurable:!0},segment:{configurable:!0},lowerSize:{configurable:!0},upperSize:{configurable:!0},lineOffsetX:{configurable:!0},lineOffsetY:{configurable:!0},writingMode:{configurable:!0},placedOrientation:{configurable:!0},hidden:{configurable:!0},crossTileID:{configurable:!0},associatedIconIndex:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.glyphStartIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.numGlyphs.get=function(){return this._structArray.uint16[this._pos2+3]},r.vertexStartIndex.get=function(){return this._structArray.uint32[this._pos4+2]},r.lineStartIndex.get=function(){return this._structArray.uint32[this._pos4+3]},r.lineLength.get=function(){return this._structArray.uint32[this._pos4+4]},r.segment.get=function(){return this._structArray.uint16[this._pos2+10]},r.lowerSize.get=function(){return this._structArray.uint16[this._pos2+11]},r.upperSize.get=function(){return this._structArray.uint16[this._pos2+12]},r.lineOffsetX.get=function(){return this._structArray.float32[this._pos4+7]},r.lineOffsetY.get=function(){return this._structArray.float32[this._pos4+8]},r.writingMode.get=function(){return this._structArray.uint8[this._pos1+36]},r.placedOrientation.get=function(){return this._structArray.uint8[this._pos1+37]},r.placedOrientation.set=function(a){this._structArray.uint8[this._pos1+37]=a},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(a){this._structArray.uint8[this._pos1+38]=a},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(a){this._structArray.uint32[this._pos4+10]=a},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(t.prototype,r),t}(As);n.prototype.size=48;var s=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new n(this,r)},t}(Ln);Oe("PlacedSymbolArray",s);var p=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={anchorX:{configurable:!0},anchorY:{configurable:!0},rightJustifiedTextSymbolIndex:{configurable:!0},centerJustifiedTextSymbolIndex:{configurable:!0},leftJustifiedTextSymbolIndex:{configurable:!0},verticalPlacedTextSymbolIndex:{configurable:!0},placedIconSymbolIndex:{configurable:!0},verticalPlacedIconSymbolIndex:{configurable:!0},key:{configurable:!0},textBoxStartIndex:{configurable:!0},textBoxEndIndex:{configurable:!0},verticalTextBoxStartIndex:{configurable:!0},verticalTextBoxEndIndex:{configurable:!0},iconBoxStartIndex:{configurable:!0},iconBoxEndIndex:{configurable:!0},verticalIconBoxStartIndex:{configurable:!0},verticalIconBoxEndIndex:{configurable:!0},featureIndex:{configurable:!0},numHorizontalGlyphVertices:{configurable:!0},numVerticalGlyphVertices:{configurable:!0},numIconVertices:{configurable:!0},numVerticalIconVertices:{configurable:!0},useRuntimeCollisionCircles:{configurable:!0},crossTileID:{configurable:!0},textBoxScale:{configurable:!0},textOffset0:{configurable:!0},textOffset1:{configurable:!0},collisionCircleDiameter:{configurable:!0}};return r.anchorX.get=function(){return this._structArray.int16[this._pos2+0]},r.anchorY.get=function(){return this._structArray.int16[this._pos2+1]},r.rightJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+2]},r.centerJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+3]},r.leftJustifiedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+4]},r.verticalPlacedTextSymbolIndex.get=function(){return this._structArray.int16[this._pos2+5]},r.placedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+6]},r.verticalPlacedIconSymbolIndex.get=function(){return this._structArray.int16[this._pos2+7]},r.key.get=function(){return this._structArray.uint16[this._pos2+8]},r.textBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+9]},r.textBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+10]},r.verticalTextBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+11]},r.verticalTextBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+12]},r.iconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+13]},r.iconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+14]},r.verticalIconBoxStartIndex.get=function(){return this._structArray.uint16[this._pos2+15]},r.verticalIconBoxEndIndex.get=function(){return this._structArray.uint16[this._pos2+16]},r.featureIndex.get=function(){return this._structArray.uint16[this._pos2+17]},r.numHorizontalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+18]},r.numVerticalGlyphVertices.get=function(){return this._structArray.uint16[this._pos2+19]},r.numIconVertices.get=function(){return this._structArray.uint16[this._pos2+20]},r.numVerticalIconVertices.get=function(){return this._structArray.uint16[this._pos2+21]},r.useRuntimeCollisionCircles.get=function(){return this._structArray.uint16[this._pos2+22]},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+12]},r.crossTileID.set=function(a){this._structArray.uint32[this._pos4+12]=a},r.textBoxScale.get=function(){return this._structArray.float32[this._pos4+13]},r.textOffset0.get=function(){return this._structArray.float32[this._pos4+14]},r.textOffset1.get=function(){return this._structArray.float32[this._pos4+15]},r.collisionCircleDiameter.get=function(){return this._structArray.float32[this._pos4+16]},Object.defineProperties(t.prototype,r),t}(As);p.prototype.size=68;var m=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new p(this,r)},t}(Ps);Oe("SymbolInstanceArray",m);var y=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getoffsetX=function(r){return this.float32[1*r+0]},t}(Rn);Oe("GlyphOffsetArray",y);var g=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.getx=function(r){return this.int16[3*r+0]},t.prototype.gety=function(r){return this.int16[3*r+1]},t.prototype.gettileUnitDistanceFromAnchor=function(r){return this.int16[3*r+2]},t}(Bi);Oe("SymbolLineVertexArray",g);var w=function(e){function t(){e.apply(this,arguments)}e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t;var r={featureIndex:{configurable:!0},sourceLayerIndex:{configurable:!0},bucketIndex:{configurable:!0}};return r.featureIndex.get=function(){return this._structArray.uint32[this._pos4+0]},r.sourceLayerIndex.get=function(){return this._structArray.uint16[this._pos2+2]},r.bucketIndex.get=function(){return this._structArray.uint16[this._pos2+3]},Object.defineProperties(t.prototype,r),t}(As);w.prototype.size=8;var A=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.get=function(r){return new w(this,r)},t}(jl);Oe("FeatureIndexArray",A);var B=kr([{name:"a_pos",components:2,type:"Int16"}],4).members,L=function(e){e===void 0&&(e=[]),this.segments=e};function R(e,t){return 256*(e=qe(Math.floor(e),0,255))+qe(Math.floor(t),0,255)}L.prototype.prepareSegment=function(e,t,r,a){var u=this.segments[this.segments.length-1];return e>L.MAX_VERTEX_ARRAY_LENGTH&&It("Max vertices per segment is "+L.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+e),(!u||u.vertexLength+e>L.MAX_VERTEX_ARRAY_LENGTH||u.sortKey!==a)&&(u={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},a!==void 0&&(u.sortKey=a),this.segments.push(u)),u},L.prototype.get=function(){return this.segments},L.prototype.destroy=function(){for(var e=0,t=this.segments;e<t.length;e+=1){var r=t[e];for(var a in r.vaos)r.vaos[a].destroy()}},L.simpleSegment=function(e,t,r,a){return new L([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:a,vaos:{},sortKey:0}])},L.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Oe("SegmentVector",L);var Z=kr([{name:"a_pattern_from",components:4,type:"Uint16"},{name:"a_pattern_to",components:4,type:"Uint16"},{name:"a_pixel_ratio_from",components:1,type:"Uint16"},{name:"a_pixel_ratio_to",components:1,type:"Uint16"}]),j=re(function(e){e.exports=function(t,r){var a,u,c,f,v,x,b,S;for(u=t.length-(a=3&t.length),c=r,v=3432918353,x=461845907,S=0;S<u;)b=255&t.charCodeAt(S)|(255&t.charCodeAt(++S))<<8|(255&t.charCodeAt(++S))<<16|(255&t.charCodeAt(++S))<<24,++S,c=27492+(65535&(f=5*(65535&(c=(c^=b=(65535&(b=(b=(65535&b)*v+(((b>>>16)*v&65535)<<16)&4294967295)<<15|b>>>17))*x+(((b>>>16)*x&65535)<<16)&4294967295)<<13|c>>>19))+((5*(c>>>16)&65535)<<16)&4294967295))+((58964+(f>>>16)&65535)<<16);switch(b=0,a){case 3:b^=(255&t.charCodeAt(S+2))<<16;case 2:b^=(255&t.charCodeAt(S+1))<<8;case 1:c^=b=(65535&(b=(b=(65535&(b^=255&t.charCodeAt(S)))*v+(((b>>>16)*v&65535)<<16)&4294967295)<<15|b>>>17))*x+(((b>>>16)*x&65535)<<16)&4294967295}return c^=t.length,c=2246822507*(65535&(c^=c>>>16))+((2246822507*(c>>>16)&65535)<<16)&4294967295,c=3266489909*(65535&(c^=c>>>13))+((3266489909*(c>>>16)&65535)<<16)&4294967295,(c^=c>>>16)>>>0}}),K=re(function(e){e.exports=function(t,r){for(var a,u=t.length,c=r^u,f=0;u>=4;)a=1540483477*(65535&(a=255&t.charCodeAt(f)|(255&t.charCodeAt(++f))<<8|(255&t.charCodeAt(++f))<<16|(255&t.charCodeAt(++f))<<24))+((1540483477*(a>>>16)&65535)<<16),c=1540483477*(65535&c)+((1540483477*(c>>>16)&65535)<<16)^(a=1540483477*(65535&(a^=a>>>24))+((1540483477*(a>>>16)&65535)<<16)),u-=4,++f;switch(u){case 3:c^=(255&t.charCodeAt(f+2))<<16;case 2:c^=(255&t.charCodeAt(f+1))<<8;case 1:c=1540483477*(65535&(c^=255&t.charCodeAt(f)))+((1540483477*(c>>>16)&65535)<<16)}return c=1540483477*(65535&(c^=c>>>13))+((1540483477*(c>>>16)&65535)<<16),(c^=c>>>15)>>>0}}),U=j,X=K;U.murmur3=j,U.murmur2=X;var Q=function(){this.ids=[],this.positions=[],this.indexed=!1};Q.prototype.add=function(e,t,r,a){this.ids.push(ce(e)),this.positions.push(t,r,a)},Q.prototype.getPositions=function(e){for(var t=ce(e),r=0,a=this.ids.length-1;r<a;){var u=r+a>>1;this.ids[u]>=t?a=u:r=u+1}for(var c=[];this.ids[r]===t;)c.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return c},Q.serialize=function(e,t){var r=new Float64Array(e.ids),a=new Uint32Array(e.positions);return function u(c,f,v,x){for(;v<x;){for(var b=c[v+x>>1],S=v-1,T=x+1;;){do S++;while(c[S]<b);do T--;while(c[T]>b);if(S>=T)break;le(c,S,T),le(f,3*S,3*T),le(f,3*S+1,3*T+1),le(f,3*S+2,3*T+2)}T-v<x-T?(u(c,f,v,T),v=T+1):(u(c,f,T+1,x),x=T)}}(r,a,0,r.length-1),t&&t.push(r.buffer,a.buffer),{ids:r,positions:a}},Q.deserialize=function(e){var t=new Q;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t};var ie=Math.pow(2,53)-1;function ce(e){var t=+e;return!isNaN(t)&&t<=ie?t:U(String(e))}function le(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}Oe("FeaturePositionMap",Q);var he=function(e,t){this.gl=e.gl,this.location=t},ge=function(e){function t(r,a){e.call(this,r,a),this.current=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){this.current!==r&&(this.current=r,this.gl.uniform1i(this.location,r))},t}(he),Te=function(e){function t(r,a){e.call(this,r,a),this.current=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){this.current!==r&&(this.current=r,this.gl.uniform1f(this.location,r))},t}(he),Se=function(e){function t(r,a){e.call(this,r,a),this.current=[0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]||(this.current=r,this.gl.uniform2f(this.location,r[0],r[1]))},t}(he),Le=function(e){function t(r,a){e.call(this,r,a),this.current=[0,0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]||(this.current=r,this.gl.uniform3f(this.location,r[0],r[1],r[2]))},t}(he),Ge=function(e){function t(r,a){e.call(this,r,a),this.current=[0,0,0,0]}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r[0]===this.current[0]&&r[1]===this.current[1]&&r[2]===this.current[2]&&r[3]===this.current[3]||(this.current=r,this.gl.uniform4f(this.location,r[0],r[1],r[2],r[3]))},t}(he),Xe=function(e){function t(r,a){e.call(this,r,a),this.current=Mt.transparent}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){r.r===this.current.r&&r.g===this.current.g&&r.b===this.current.b&&r.a===this.current.a||(this.current=r,this.gl.uniform4f(this.location,r.r,r.g,r.b,r.a))},t}(he),He=new Float32Array(16),wt=function(e){function t(r,a){e.call(this,r,a),this.current=He}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.set=function(r){if(r[12]!==this.current[12]||r[0]!==this.current[0])return this.current=r,void this.gl.uniformMatrix4fv(this.location,!1,r);for(var a=1;a<16;a++)if(r[a]!==this.current[a]){this.current=r,this.gl.uniformMatrix4fv(this.location,!1,r);break}},t}(he);function Re(e){return[R(255*e.r,255*e.g),R(255*e.b,255*e.a)]}var rt=function(e,t,r){this.value=e,this.uniformNames=t.map(function(a){return"u_"+a}),this.type=r};rt.prototype.setUniform=function(e,t,r){e.set(r.constantOr(this.value))},rt.prototype.getBinding=function(e,t,r){return this.type==="color"?new Xe(e,t):new Te(e,t)};var at=function(e,t){this.uniformNames=t.map(function(r){return"u_"+r}),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1};at.prototype.setConstantPatternPositions=function(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr},at.prototype.setUniform=function(e,t,r,a){var u=a==="u_pattern_to"?this.patternTo:a==="u_pattern_from"?this.patternFrom:a==="u_pixel_ratio_to"?this.pixelRatioTo:a==="u_pixel_ratio_from"?this.pixelRatioFrom:null;u&&e.set(u)},at.prototype.getBinding=function(e,t,r){return r.substr(0,9)==="u_pattern"?new Ge(e,t):new Te(e,t)};var tt=function(e,t,r,a){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map(function(u){return{name:"a_"+u,type:"Float32",components:r==="color"?2:1,offset:0}}),this.paintVertexArray=new a};tt.prototype.populatePaintArray=function(e,t,r,a,u){var c=this.paintVertexArray.length,f=this.expression.evaluate(new ft(0),t,{},a,[],u);this.paintVertexArray.resize(e),this._setPaintValue(c,e,f)},tt.prototype.updatePaintArray=function(e,t,r,a){var u=this.expression.evaluate({zoom:0},r,a);this._setPaintValue(e,t,u)},tt.prototype._setPaintValue=function(e,t,r){if(this.type==="color")for(var a=Re(r),u=e;u<t;u++)this.paintVertexArray.emplace(u,a[0],a[1]);else{for(var c=e;c<t;c++)this.paintVertexArray.emplace(c,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}},tt.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},tt.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()};var et=function(e,t,r,a,u,c){this.expression=e,this.uniformNames=t.map(function(f){return"u_"+f+"_t"}),this.type=r,this.useIntegerZoom=a,this.zoom=u,this.maxValue=0,this.paintVertexAttributes=t.map(function(f){return{name:"a_"+f,type:"Float32",components:r==="color"?4:2,offset:0}}),this.paintVertexArray=new c};et.prototype.populatePaintArray=function(e,t,r,a,u){var c=this.expression.evaluate(new ft(this.zoom),t,{},a,[],u),f=this.expression.evaluate(new ft(this.zoom+1),t,{},a,[],u),v=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(v,e,c,f)},et.prototype.updatePaintArray=function(e,t,r,a){var u=this.expression.evaluate({zoom:this.zoom},r,a),c=this.expression.evaluate({zoom:this.zoom+1},r,a);this._setPaintValue(e,t,u,c)},et.prototype._setPaintValue=function(e,t,r,a){if(this.type==="color")for(var u=Re(r),c=Re(a),f=e;f<t;f++)this.paintVertexArray.emplace(f,u[0],u[1],c[0],c[1]);else{for(var v=e;v<t;v++)this.paintVertexArray.emplace(v,r,a);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(a))}},et.prototype.upload=function(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},et.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},et.prototype.setUniform=function(e,t){var r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,a=qe(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(a)},et.prototype.getBinding=function(e,t,r){return new Te(e,t)};var nt=function(e,t,r,a,u,c){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=a,this.layerId=c,this.zoomInPaintVertexArray=new u,this.zoomOutPaintVertexArray=new u};nt.prototype.populatePaintArray=function(e,t,r){var a=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(a,e,t.patterns&&t.patterns[this.layerId],r)},nt.prototype.updatePaintArray=function(e,t,r,a,u){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],u)},nt.prototype._setPaintValues=function(e,t,r,a){if(a&&r){var u=a[r.min],c=a[r.mid],f=a[r.max];if(u&&c&&f)for(var v=e;v<t;v++)this.zoomInPaintVertexArray.emplace(v,c.tl[0],c.tl[1],c.br[0],c.br[1],u.tl[0],u.tl[1],u.br[0],u.br[1],c.pixelRatio,u.pixelRatio),this.zoomOutPaintVertexArray.emplace(v,c.tl[0],c.tl[1],c.br[0],c.br[1],f.tl[0],f.tl[1],f.br[0],f.br[1],c.pixelRatio,f.pixelRatio)}},nt.prototype.upload=function(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,Z.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,Z.members,this.expression.isStateDependent))},nt.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()};var Qe=function(e,t,r){this.binders={},this._buffers=[];var a=[];for(var u in e.paint._values)if(r(u)){var c=e.paint.get(u);if(c instanceof Zr&&po(c.property.specification)){var f=Sr(u,e.type),v=c.value,x=c.property.specification.type,b=c.property.useIntegerZoom,S=c.property.specification["property-type"],T=S==="cross-faded"||S==="cross-faded-data-driven";if(v.kind==="constant")this.binders[u]=T?new at(v.value,f):new rt(v.value,f,x),a.push("/u_"+u);else if(v.kind==="source"||T){var C=ir(u,x,"source");this.binders[u]=T?new nt(v,x,b,t,C,e.id):new tt(v,f,x,C),a.push("/a_"+u)}else{var z=ir(u,x,"composite");this.binders[u]=new et(v,f,x,b,t,z),a.push("/z_"+u)}}}this.cacheKey=a.sort().join("")};Qe.prototype.getMaxValue=function(e){var t=this.binders[e];return t instanceof tt||t instanceof et?t.maxValue:0},Qe.prototype.populatePaintArrays=function(e,t,r,a,u){for(var c in this.binders){var f=this.binders[c];(f instanceof tt||f instanceof et||f instanceof nt)&&f.populatePaintArray(e,t,r,a,u)}},Qe.prototype.setConstantPatternPositions=function(e,t){for(var r in this.binders){var a=this.binders[r];a instanceof at&&a.setConstantPatternPositions(e,t)}},Qe.prototype.updatePaintArrays=function(e,t,r,a,u){var c=!1;for(var f in e)for(var v=0,x=t.getPositions(f);v<x.length;v+=1){var b=x[v],S=r.feature(b.index);for(var T in this.binders){var C=this.binders[T];if((C instanceof tt||C instanceof et||C instanceof nt)&&C.expression.isStateDependent===!0){var z=a.paint.get(T);C.expression=z.value,C.updatePaintArray(b.start,b.end,S,e[f],u),c=!0}}}return c},Qe.prototype.defines=function(){var e=[];for(var t in this.binders){var r=this.binders[t];(r instanceof rt||r instanceof at)&&e.push.apply(e,r.uniformNames.map(function(a){return"#define HAS_UNIFORM_"+a}))}return e},Qe.prototype.getBinderAttributes=function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof tt||r instanceof et)for(var a=0;a<r.paintVertexAttributes.length;a++)e.push(r.paintVertexAttributes[a].name);else if(r instanceof nt)for(var u=0;u<Z.members.length;u++)e.push(Z.members[u].name)}return e},Qe.prototype.getBinderUniforms=function(){var e=[];for(var t in this.binders){var r=this.binders[t];if(r instanceof rt||r instanceof at||r instanceof et)for(var a=0,u=r.uniformNames;a<u.length;a+=1)e.push(u[a])}return e},Qe.prototype.getPaintVertexBuffers=function(){return this._buffers},Qe.prototype.getUniforms=function(e,t){var r=[];for(var a in this.binders){var u=this.binders[a];if(u instanceof rt||u instanceof at||u instanceof et)for(var c=0,f=u.uniformNames;c<f.length;c+=1){var v=f[c];if(t[v]){var x=u.getBinding(e,t[v],v);r.push({name:v,property:a,binding:x})}}}return r},Qe.prototype.setUniforms=function(e,t,r,a){for(var u=0,c=t;u<c.length;u+=1){var f=c[u],v=f.name,x=f.property;this.binders[x].setUniform(f.binding,a,r.get(x),v)}},Qe.prototype.updatePaintBuffers=function(e){for(var t in this._buffers=[],this.binders){var r=this.binders[t];if(e&&r instanceof nt){var a=e.fromScale===2?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;a&&this._buffers.push(a)}else(r instanceof tt||r instanceof et)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}},Qe.prototype.upload=function(e){for(var t in this.binders){var r=this.binders[t];(r instanceof tt||r instanceof et||r instanceof nt)&&r.upload(e)}this.updatePaintBuffers()},Qe.prototype.destroy=function(){for(var e in this.binders){var t=this.binders[e];(t instanceof tt||t instanceof et||t instanceof nt)&&t.destroy()}};var Ke=function(e,t,r){r===void 0&&(r=function(){return!0}),this.programConfigurations={};for(var a=0,u=e;a<u.length;a+=1){var c=u[a];this.programConfigurations[c.id]=new Qe(c,t,r)}this.needsUpload=!1,this._featureMap=new Q,this._bufferOffset=0};function Sr(e,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[e]||[e.replace(t+"-","").replace(/-/g,"_")]}function ir(e,t,r){var a={color:{source:Xo,composite:Cs},number:{source:Rn,composite:Xo}},u=function(c){return{"line-pattern":{source:tn,composite:tn},"fill-pattern":{source:tn,composite:tn},"fill-extrusion-pattern":{source:tn,composite:tn}}[c]}(e);return u&&u[r]||a[t][r]}Ke.prototype.populatePaintArrays=function(e,t,r,a,u,c){for(var f in this.programConfigurations)this.programConfigurations[f].populatePaintArrays(e,t,a,u,c);t.id!==void 0&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0},Ke.prototype.updatePaintArrays=function(e,t,r,a){for(var u=0,c=r;u<c.length;u+=1){var f=c[u];this.needsUpload=this.programConfigurations[f.id].updatePaintArrays(e,this._featureMap,t,f,a)||this.needsUpload}},Ke.prototype.get=function(e){return this.programConfigurations[e]},Ke.prototype.upload=function(e){if(this.needsUpload){for(var t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}},Ke.prototype.destroy=function(){for(var e in this.programConfigurations)this.programConfigurations[e].destroy()},Oe("ConstantBinder",rt),Oe("CrossFadedConstantBinder",at),Oe("SourceExpressionBinder",tt),Oe("CrossFadedCompositeBinder",nt),Oe("CompositeExpressionBinder",et),Oe("ProgramConfiguration",Qe,{omit:["_buffers"]}),Oe("ProgramConfigurationSet",Ke);var Vr=Math.pow(2,14)-1,Mr=-Vr-1;function tr(e){for(var t=8192/e.extent,r=e.loadGeometry(),a=0;a<r.length;a++)for(var u=r[a],c=0;c<u.length;c++){var f=u[c],v=Math.round(f.x*t),x=Math.round(f.y*t);f.x=qe(v,Mr,Vr),f.y=qe(x,Mr,Vr),(v<f.x||v>f.x+1||x<f.y||x>f.y+1)&&It("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function ur(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?tr(e):[]}}function mi(e,t,r,a,u){e.emplaceBack(2*t+(a+1)/2,2*r+(u+1)/2)}var Hr=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new vo,this.indexArray=new Dn,this.segments=new L,this.programConfigurations=new Ke(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};function Fn(e,t){for(var r=0;r<e.length;r++)if(rn(t,e[r]))return!0;for(var a=0;a<t.length;a++)if(rn(e,t[a]))return!0;return!!Oa(e,t)}function ni(e,t,r){return!!rn(e,t)||!!On(t,e,r)}function Hi(e,t){if(e.length===1)return Va(t,e[0]);for(var r=0;r<t.length;r++)for(var a=t[r],u=0;u<a.length;u++)if(rn(e,a[u]))return!0;for(var c=0;c<e.length;c++)if(Va(t,e[c]))return!0;for(var f=0;f<t.length;f++)if(Oa(e,t[f]))return!0;return!1}function Di(e,t,r){if(e.length>1){if(Oa(e,t))return!0;for(var a=0;a<t.length;a++)if(On(t[a],e,r))return!0}for(var u=0;u<e.length;u++)if(On(e[u],t,r))return!0;return!1}function Oa(e,t){if(e.length===0||t.length===0)return!1;for(var r=0;r<e.length-1;r++)for(var a=e[r],u=e[r+1],c=0;c<t.length-1;c++)if(Yo(a,u,t[c],t[c+1]))return!0;return!1}function Yo(e,t,r,a){return gr(e,r,a)!==gr(t,r,a)&&gr(e,t,r)!==gr(e,t,a)}function On(e,t,r){var a=r*r;if(t.length===1)return e.distSqr(t[0])<a;for(var u=1;u<t.length;u++)if(Qo(e,t[u-1],t[u])<a)return!0;return!1}function Qo(e,t,r){var a=t.distSqr(r);if(a===0)return e.distSqr(t);var u=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/a;return e.distSqr(u<0?t:u>1?r:r.sub(t)._mult(u)._add(t))}function Va(e,t){for(var r,a,u,c=!1,f=0;f<e.length;f++)for(var v=0,x=(r=e[f]).length-1;v<r.length;x=v++)(a=r[v]).y>t.y!=(u=r[x]).y>t.y&&t.x<(u.x-a.x)*(t.y-a.y)/(u.y-a.y)+a.x&&(c=!c);return c}function rn(e,t){for(var r=!1,a=0,u=e.length-1;a<e.length;u=a++){var c=e[a],f=e[u];c.y>t.y!=f.y>t.y&&t.x<(f.x-c.x)*(t.y-c.y)/(f.y-c.y)+c.x&&(r=!r)}return r}function Ua(e,t,r){var a=r[0],u=r[2];if(e.x<a.x&&t.x<a.x||e.x>u.x&&t.x>u.x||e.y<a.y&&t.y<a.y||e.y>u.y&&t.y>u.y)return!1;var c=gr(e,t,r[0]);return c!==gr(e,t,r[1])||c!==gr(e,t,r[2])||c!==gr(e,t,r[3])}function nn(e,t,r){var a=t.paint.get(e).value;return a.kind==="constant"?a.value:r.programConfigurations.get(t.id).getMaxValue(e)}function Tr(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function mn(e,t,r,a,u){if(!t[0]&&!t[1])return e;var c=pe.convert(t)._mult(u);r==="viewport"&&c._rotate(-a);for(var f=[],v=0;v<e.length;v++)f.push(e[v].sub(c));return f}Hr.prototype.populate=function(e,t,r){var a=this.layers[0],u=[],c=null;a.type==="circle"&&(c=a.layout.get("circle-sort-key"));for(var f=0,v=e;f<v.length;f+=1){var x=v[f],b=x.feature,S=x.id,T=x.index,C=x.sourceLayerIndex,z=this.layers[0]._featureFilter.needGeometry,N=ur(b,z);if(this.layers[0]._featureFilter.filter(new ft(this.zoom),N,r)){var $=c?c.evaluate(N,{},r):void 0,J={id:S,properties:b.properties,type:b.type,sourceLayerIndex:C,index:T,geometry:z?N.geometry:tr(b),patterns:{},sortKey:$};u.push(J)}}c&&u.sort(function(Ie,$e){return Ie.sortKey-$e.sortKey});for(var H=0,te=u;H<te.length;H+=1){var oe=te[H],se=oe.geometry,ue=oe.index,ye=oe.sourceLayerIndex,we=e[ue].feature;this.addFeature(oe,se,ue,r),t.featureIndex.insert(we,se,ue,ye,this.index)}},Hr.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},Hr.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},Hr.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Hr.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,B),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},Hr.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Hr.prototype.addFeature=function(e,t,r,a){for(var u=0,c=t;u<c.length;u+=1)for(var f=0,v=c[u];f<v.length;f+=1){var x=v[f],b=x.x,S=x.y;if(!(b<0||b>=8192||S<0||S>=8192)){var T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),C=T.vertexLength;mi(this.layoutVertexArray,b,S,-1,-1),mi(this.layoutVertexArray,b,S,1,-1),mi(this.layoutVertexArray,b,S,1,1),mi(this.layoutVertexArray,b,S,-1,1),this.indexArray.emplaceBack(C,C+1,C+2),this.indexArray.emplaceBack(C,C+3,C+2),T.vertexLength+=4,T.primitiveLength+=2}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},a)},Oe("CircleBucket",Hr,{omit:["layers"]});var Vn=new Or({"circle-sort-key":new Ue(D.layout_circle["circle-sort-key"])}),_o={paint:new Or({"circle-radius":new Ue(D.paint_circle["circle-radius"]),"circle-color":new Ue(D.paint_circle["circle-color"]),"circle-blur":new Ue(D.paint_circle["circle-blur"]),"circle-opacity":new Ue(D.paint_circle["circle-opacity"]),"circle-translate":new je(D.paint_circle["circle-translate"]),"circle-translate-anchor":new je(D.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new je(D.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new je(D.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new Ue(D.paint_circle["circle-stroke-width"]),"circle-stroke-color":new Ue(D.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new Ue(D.paint_circle["circle-stroke-opacity"])}),layout:Vn},zt=typeof Float32Array<"u"?Float32Array:Array;function bi(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function oi(e,t,r){var a=t[0],u=t[1],c=t[2],f=t[3],v=t[4],x=t[5],b=t[6],S=t[7],T=t[8],C=t[9],z=t[10],N=t[11],$=t[12],J=t[13],H=t[14],te=t[15],oe=r[0],se=r[1],ue=r[2],ye=r[3];return e[0]=oe*a+se*v+ue*T+ye*$,e[1]=oe*u+se*x+ue*C+ye*J,e[2]=oe*c+se*b+ue*z+ye*H,e[3]=oe*f+se*S+ue*N+ye*te,e[4]=(oe=r[4])*a+(se=r[5])*v+(ue=r[6])*T+(ye=r[7])*$,e[5]=oe*u+se*x+ue*C+ye*J,e[6]=oe*c+se*b+ue*z+ye*H,e[7]=oe*f+se*S+ue*N+ye*te,e[8]=(oe=r[8])*a+(se=r[9])*v+(ue=r[10])*T+(ye=r[11])*$,e[9]=oe*u+se*x+ue*C+ye*J,e[10]=oe*c+se*b+ue*z+ye*H,e[11]=oe*f+se*S+ue*N+ye*te,e[12]=(oe=r[12])*a+(se=r[13])*v+(ue=r[14])*T+(ye=r[15])*$,e[13]=oe*u+se*x+ue*C+ye*J,e[14]=oe*c+se*b+ue*z+ye*H,e[15]=oe*f+se*S+ue*N+ye*te,e}Math.hypot||(Math.hypot=function(){for(var e=arguments,t=0,r=arguments.length;r--;)t+=e[r]*e[r];return Math.sqrt(t)});var xo,Zp=oi;function ks(e,t,r){var a=t[0],u=t[1],c=t[2],f=t[3];return e[0]=r[0]*a+r[4]*u+r[8]*c+r[12]*f,e[1]=r[1]*a+r[5]*u+r[9]*c+r[13]*f,e[2]=r[2]*a+r[6]*u+r[10]*c+r[14]*f,e[3]=r[3]*a+r[7]*u+r[11]*c+r[15]*f,e}xo=new zt(3),zt!=Float32Array&&(xo[0]=0,xo[1]=0,xo[2]=0),function(){var e=new zt(4);zt!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0)}();var Wp=(function(){var e=new zt(2);zt!=Float32Array&&(e[0]=0,e[1]=0)}(),function(e){function t(r){e.call(this,r,_o)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new Hr(r)},t.prototype.queryRadius=function(r){var a=r;return nn("circle-radius",this,a)+nn("circle-stroke-width",this,a)+Tr(this.paint.get("circle-translate"))},t.prototype.queryIntersectsFeature=function(r,a,u,c,f,v,x,b){for(var S=mn(r,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),v.angle,x),T=this.paint.get("circle-radius").evaluate(a,u)+this.paint.get("circle-stroke-width").evaluate(a,u),C=this.paint.get("circle-pitch-alignment")==="map",z=C?S:function(we,Ie){return we.map(function($e){return Na($e,Ie)})}(S,b),N=C?T*x:T,$=0,J=c;$<J.length;$+=1)for(var H=0,te=J[$];H<te.length;H+=1){var oe=te[H],se=C?oe:Na(oe,b),ue=N,ye=ks([],[oe.x,oe.y,0,1],b);if(this.paint.get("circle-pitch-scale")==="viewport"&&this.paint.get("circle-pitch-alignment")==="map"?ue*=ye[3]/v.cameraToCenterDistance:this.paint.get("circle-pitch-scale")==="map"&&this.paint.get("circle-pitch-alignment")==="viewport"&&(ue*=v.cameraToCenterDistance/ye[3]),ni(z,se,ue))return!0}return!1},t}(en));function Na(e,t){var r=ks([],[e.x,e.y,0,1],t);return new pe(r[0]/r[3],r[1]/r[3])}var uc=function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(Hr);function ea(e,t,r,a){var u=t.width,c=t.height;if(a){if(a instanceof Uint8ClampedArray)a=new Uint8Array(a.buffer);else if(a.length!==u*c*r)throw new RangeError("mismatched image size")}else a=new Uint8Array(u*c*r);return e.width=u,e.height=c,e.data=a,e}function Ms(e,t,r){var a=t.width,u=t.height;if(a!==e.width||u!==e.height){var c=ea({},{width:a,height:u},r);Hp(e,c,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,a),height:Math.min(e.height,u)},r),e.width=a,e.height=u,e.data=c.data}}function Hp(e,t,r,a,u,c){if(u.width===0||u.height===0)return t;if(u.width>e.width||u.height>e.height||r.x>e.width-u.width||r.y>e.height-u.height)throw new RangeError("out of range source coordinates for image copy");if(u.width>t.width||u.height>t.height||a.x>t.width-u.width||a.y>t.height-u.height)throw new RangeError("out of range destination coordinates for image copy");for(var f=e.data,v=t.data,x=0;x<u.height;x++)for(var b=((r.y+x)*e.width+r.x)*c,S=((a.y+x)*t.width+a.x)*c,T=0;T<u.width*c;T++)v[S+T]=f[b+T];return t}Oe("HeatmapBucket",uc,{omit:["layers"]});var $a=function(e,t){ea(this,e,1,t)};$a.prototype.resize=function(e){Ms(this,e,1)},$a.prototype.clone=function(){return new $a({width:this.width,height:this.height},new Uint8Array(this.data))},$a.copy=function(e,t,r,a,u){Hp(e,t,r,a,u,1)};var yi=function(e,t){ea(this,e,4,t)};yi.prototype.resize=function(e){Ms(this,e,4)},yi.prototype.replace=function(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e},yi.prototype.clone=function(){return new yi({width:this.width,height:this.height},new Uint8Array(this.data))},yi.copy=function(e,t,r,a,u){Hp(e,t,r,a,u,4)},Oe("AlphaImage",$a),Oe("RGBAImage",yi);var Lx={paint:new Or({"heatmap-radius":new Ue(D.paint_heatmap["heatmap-radius"]),"heatmap-weight":new Ue(D.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new je(D.paint_heatmap["heatmap-intensity"]),"heatmap-color":new Wi(D.paint_heatmap["heatmap-color"]),"heatmap-opacity":new je(D.paint_heatmap["heatmap-opacity"])})};function Hd(e){var t={},r=e.resolution||256,a=e.clips?e.clips.length:1,u=e.image||new yi({width:r,height:a}),c=function(N,$,J){t[e.evaluationKey]=J;var H=e.expression.evaluate(t);u.data[N+$+0]=Math.floor(255*H.r/H.a),u.data[N+$+1]=Math.floor(255*H.g/H.a),u.data[N+$+2]=Math.floor(255*H.b/H.a),u.data[N+$+3]=Math.floor(255*H.a)};if(e.clips)for(var f=0,v=0;f<a;++f,v+=4*r)for(var x=0,b=0;x<r;x++,b+=4){var S=x/(r-1),T=e.clips[f];c(v,b,T.start*(1-S)+T.end*S)}else for(var C=0,z=0;C<r;C++,z+=4)c(0,z,C/(r-1));return u}var Rx=function(e){function t(r){e.call(this,r,Lx),this._updateColorRamp()}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new uc(r)},t.prototype._handleSpecialPaintPropertyUpdate=function(r){r==="heatmap-color"&&this._updateColorRamp()},t.prototype._updateColorRamp=function(){this.colorRamp=Hd({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},t.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype.hasOffscreenPass=function(){return this.paint.get("heatmap-opacity")!==0&&this.visibility!=="none"},t}(en),Fx={paint:new Or({"hillshade-illumination-direction":new je(D.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new je(D.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new je(D.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new je(D.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new je(D.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new je(D.paint_hillshade["hillshade-accent-color"])})},Ox=function(e){function t(r){e.call(this,r,Fx)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.hasOffscreenPass=function(){return this.paint.get("hillshade-exaggeration")!==0&&this.visibility!=="none"},t}(en),Vx=kr([{name:"a_pos",components:2,type:"Int16"}],4).members,Xp=cc,Ux=cc;function cc(e,t,r){r=r||2;var a,u,c,f,v,x,b,S=t&&t.length,T=S?t[0]*r:e.length,C=Xd(e,0,T,r,!0),z=[];if(!C||C.next===C.prev)return z;if(S&&(C=function($,J,H,te){var oe,se,ue,ye=[];for(oe=0,se=J.length;oe<se;oe++)(ue=Xd($,J[oe]*te,oe<se-1?J[oe+1]*te:$.length,te,!1))===ue.next&&(ue.steiner=!0),ye.push(Hx(ue));for(ye.sort(Gx),oe=0;oe<ye.length;oe++)Zx(ye[oe],H),H=ta(H,H.next);return H}(e,t,C,r)),e.length>80*r){a=c=e[0],u=f=e[1];for(var N=r;N<T;N+=r)(v=e[N])<a&&(a=v),(x=e[N+1])<u&&(u=x),v>c&&(c=v),x>f&&(f=x);b=(b=Math.max(c-a,f-u))!==0?1/b:0}return Zl(C,z,r,a,u,b),z}function Xd(e,t,r,a,u){var c,f;if(u===Yp(e,t,r,a)>0)for(c=t;c<r;c+=a)f=Yd(c,e[c],e[c+1],f);else for(c=r-a;c>=t;c-=a)f=Yd(c,e[c],e[c+1],f);return f&&pc(f,f.next)&&(Hl(f),f=f.next),f}function ta(e,t){if(!e)return e;t||(t=e);var r,a=e;do if(r=!1,a.steiner||!pc(a,a.next)&&xr(a.prev,a,a.next)!==0)a=a.next;else{if(Hl(a),(a=t=a.prev)===a.next)break;r=!0}while(r||a!==t);return t}function Zl(e,t,r,a,u,c,f){if(e){!f&&c&&function(S,T,C,z){var N=S;do N.z===null&&(N.z=Kp(N.x,N.y,T,C,z)),N.prevZ=N.prev,N.nextZ=N.next,N=N.next;while(N!==S);N.prevZ.nextZ=null,N.prevZ=null,function($){var J,H,te,oe,se,ue,ye,we,Ie=1;do{for(H=$,$=null,se=null,ue=0;H;){for(ue++,te=H,ye=0,J=0;J<Ie&&(ye++,te=te.nextZ);J++);for(we=Ie;ye>0||we>0&&te;)ye!==0&&(we===0||!te||H.z<=te.z)?(oe=H,H=H.nextZ,ye--):(oe=te,te=te.nextZ,we--),se?se.nextZ=oe:$=oe,oe.prevZ=se,se=oe;H=te}se.nextZ=null,Ie*=2}while(ue>1)}(N)}(e,a,u,c);for(var v,x,b=e;e.prev!==e.next;)if(v=e.prev,x=e.next,c?$x(e,a,u,c):Nx(e))t.push(v.i/r),t.push(e.i/r),t.push(x.i/r),Hl(e),e=x.next,b=x.next;else if((e=x)===b){f?f===1?Zl(e=qx(ta(e),t,r),t,r,a,u,c,2):f===2&&jx(e,t,r,a,u,c):Zl(ta(e),t,r,a,u,c,1);break}}}function Nx(e){var t=e.prev,r=e,a=e.next;if(xr(t,r,a)>=0)return!1;for(var u=e.next.next;u!==e.prev;){if(zs(t.x,t.y,r.x,r.y,a.x,a.y,u.x,u.y)&&xr(u.prev,u,u.next)>=0)return!1;u=u.next}return!0}function $x(e,t,r,a){var u=e.prev,c=e,f=e.next;if(xr(u,c,f)>=0)return!1;for(var v=u.x>c.x?u.x>f.x?u.x:f.x:c.x>f.x?c.x:f.x,x=u.y>c.y?u.y>f.y?u.y:f.y:c.y>f.y?c.y:f.y,b=Kp(u.x<c.x?u.x<f.x?u.x:f.x:c.x<f.x?c.x:f.x,u.y<c.y?u.y<f.y?u.y:f.y:c.y<f.y?c.y:f.y,t,r,a),S=Kp(v,x,t,r,a),T=e.prevZ,C=e.nextZ;T&&T.z>=b&&C&&C.z<=S;){if(T!==e.prev&&T!==e.next&&zs(u.x,u.y,c.x,c.y,f.x,f.y,T.x,T.y)&&xr(T.prev,T,T.next)>=0||(T=T.prevZ,C!==e.prev&&C!==e.next&&zs(u.x,u.y,c.x,c.y,f.x,f.y,C.x,C.y)&&xr(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;T&&T.z>=b;){if(T!==e.prev&&T!==e.next&&zs(u.x,u.y,c.x,c.y,f.x,f.y,T.x,T.y)&&xr(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;C&&C.z<=S;){if(C!==e.prev&&C!==e.next&&zs(u.x,u.y,c.x,c.y,f.x,f.y,C.x,C.y)&&xr(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function qx(e,t,r){var a=e;do{var u=a.prev,c=a.next.next;!pc(u,c)&&Kd(u,a,a.next,c)&&Wl(u,c)&&Wl(c,u)&&(t.push(u.i/r),t.push(a.i/r),t.push(c.i/r),Hl(a),Hl(a.next),a=e=c),a=a.next}while(a!==e);return ta(a)}function jx(e,t,r,a,u,c){var f=e;do{for(var v=f.next.next;v!==f.prev;){if(f.i!==v.i&&Xx(f,v)){var x=Jd(f,v);return f=ta(f,f.next),x=ta(x,x.next),Zl(f,t,r,a,u,c),void Zl(x,t,r,a,u,c)}v=v.next}f=f.next}while(f!==e)}function Gx(e,t){return e.x-t.x}function Zx(e,t){if(t=function(a,u){var c,f=u,v=a.x,x=a.y,b=-1/0;do{if(x<=f.y&&x>=f.next.y&&f.next.y!==f.y){var S=f.x+(x-f.y)*(f.next.x-f.x)/(f.next.y-f.y);if(S<=v&&S>b){if(b=S,S===v){if(x===f.y)return f;if(x===f.next.y)return f.next}c=f.x<f.next.x?f:f.next}}f=f.next}while(f!==u);if(!c)return null;if(v===b)return c;var T,C=c,z=c.x,N=c.y,$=1/0;f=c;do v>=f.x&&f.x>=z&&v!==f.x&&zs(x<N?v:b,x,z,N,x<N?b:v,x,f.x,f.y)&&(T=Math.abs(x-f.y)/(v-f.x),Wl(f,a)&&(T<$||T===$&&(f.x>c.x||f.x===c.x&&Wx(c,f)))&&(c=f,$=T)),f=f.next;while(f!==C);return c}(e,t)){var r=Jd(t,e);ta(t,t.next),ta(r,r.next)}}function Wx(e,t){return xr(e.prev,e,t.prev)<0&&xr(t.next,e,e.next)<0}function Kp(e,t,r,a,u){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*u)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-a)*u)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Hx(e){var t=e,r=e;do(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next;while(t!==e);return r}function zs(e,t,r,a,u,c,f,v){return(u-f)*(t-v)-(e-f)*(c-v)>=0&&(e-f)*(a-v)-(r-f)*(t-v)>=0&&(r-f)*(c-v)-(u-f)*(a-v)>=0}function Xx(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(r,a){var u=r;do{if(u.i!==r.i&&u.next.i!==r.i&&u.i!==a.i&&u.next.i!==a.i&&Kd(u,u.next,r,a))return!0;u=u.next}while(u!==r);return!1}(e,t)&&(Wl(e,t)&&Wl(t,e)&&function(r,a){var u=r,c=!1,f=(r.x+a.x)/2,v=(r.y+a.y)/2;do u.y>v!=u.next.y>v&&u.next.y!==u.y&&f<(u.next.x-u.x)*(v-u.y)/(u.next.y-u.y)+u.x&&(c=!c),u=u.next;while(u!==r);return c}(e,t)&&(xr(e.prev,e,t.prev)||xr(e,t.prev,t))||pc(e,t)&&xr(e.prev,e,e.next)>0&&xr(t.prev,t,t.next)>0)}function xr(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function pc(e,t){return e.x===t.x&&e.y===t.y}function Kd(e,t,r,a){var u=fc(xr(e,t,r)),c=fc(xr(e,t,a)),f=fc(xr(r,a,e)),v=fc(xr(r,a,t));return u!==c&&f!==v||!(u!==0||!hc(e,r,t))||!(c!==0||!hc(e,a,t))||!(f!==0||!hc(r,e,a))||!(v!==0||!hc(r,t,a))}function hc(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function fc(e){return e>0?1:e<0?-1:0}function Wl(e,t){return xr(e.prev,e,e.next)<0?xr(e,t,e.next)>=0&&xr(e,e.prev,t)>=0:xr(e,t,e.prev)<0||xr(e,e.next,t)<0}function Jd(e,t){var r=new Jp(e.i,e.x,e.y),a=new Jp(t.i,t.x,t.y),u=e.next,c=t.prev;return e.next=t,t.prev=e,r.next=u,u.prev=r,a.next=r,r.prev=a,c.next=a,a.prev=c,a}function Yd(e,t,r,a){var u=new Jp(e,t,r);return a?(u.next=a.next,u.prev=a,a.next.prev=u,a.next=u):(u.prev=u,u.next=u),u}function Hl(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Jp(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function Yp(e,t,r,a){for(var u=0,c=t,f=r-a;c<r;c+=a)u+=(e[f]-e[c])*(e[c+1]+e[f+1]),f=c;return u}function Kx(e,t,r,a,u){(function c(f,v,x,b,S){for(;b>x;){if(b-x>600){var T=b-x+1,C=v-x+1,z=Math.log(T),N=.5*Math.exp(2*z/3),$=.5*Math.sqrt(z*N*(T-N)/T)*(C-T/2<0?-1:1);c(f,v,Math.max(x,Math.floor(v-C*N/T+$)),Math.min(b,Math.floor(v+(T-C)*N/T+$)),S)}var J=f[v],H=x,te=b;for(Xl(f,x,v),S(f[b],J)>0&&Xl(f,x,b);H<te;){for(Xl(f,H,te),H++,te--;S(f[H],J)<0;)H++;for(;S(f[te],J)>0;)te--}S(f[x],J)===0?Xl(f,x,te):Xl(f,++te,b),te<=v&&(x=te+1),v<=te&&(b=te-1)}})(e,t,r,a||e.length-1,u||Jx)}function Xl(e,t,r){var a=e[t];e[t]=e[r],e[r]=a}function Jx(e,t){return e<t?-1:e>t?1:0}function Qp(e,t){var r=e.length;if(r<=1)return[e];for(var a,u,c=[],f=0;f<r;f++){var v=Bo(e[f]);v!==0&&(e[f].area=Math.abs(v),u===void 0&&(u=v<0),u===v<0?(a&&c.push(a),a=[e[f]]):a.push(e[f]))}if(a&&c.push(a),t>1)for(var x=0;x<c.length;x++)c[x].length<=t||(Kx(c[x],t,1,c[x].length-1,Yx),c[x]=c[x].slice(0,t));return c}function Yx(e,t){return t.area-e.area}function eh(e,t,r){for(var a=r.patternDependencies,u=!1,c=0,f=t;c<f.length;c+=1){var v=f[c].paint.get(e+"-pattern");v.isConstant()||(u=!0);var x=v.constantOr(null);x&&(u=!0,a[x.to]=!0,a[x.from]=!0)}return u}function th(e,t,r,a,u){for(var c=u.patternDependencies,f=0,v=t;f<v.length;f+=1){var x=v[f],b=x.paint.get(e+"-pattern").value;if(b.kind!=="constant"){var S=b.evaluate({zoom:a-1},r,{},u.availableImages),T=b.evaluate({zoom:a},r,{},u.availableImages),C=b.evaluate({zoom:a+1},r,{},u.availableImages);T=T&&T.name?T.name:T,C=C&&C.name?C.name:C,c[S=S&&S.name?S.name:S]=!0,c[T]=!0,c[C]=!0,r.patterns[x.id]={min:S,mid:T,max:C}}}return r}cc.deviation=function(e,t,r,a){var u=t&&t.length,c=Math.abs(Yp(e,0,u?t[0]*r:e.length,r));if(u)for(var f=0,v=t.length;f<v;f++)c-=Math.abs(Yp(e,t[f]*r,f<v-1?t[f+1]*r:e.length,r));var x=0;for(f=0;f<a.length;f+=3){var b=a[f]*r,S=a[f+1]*r,T=a[f+2]*r;x+=Math.abs((e[b]-e[T])*(e[S+1]-e[b+1])-(e[b]-e[S])*(e[T+1]-e[b+1]))}return c===0&&x===0?0:Math.abs((x-c)/c)},cc.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},a=0,u=0;u<e.length;u++){for(var c=0;c<e[u].length;c++)for(var f=0;f<t;f++)r.vertices.push(e[u][c][f]);u>0&&r.holes.push(a+=e[u-1].length)}return r},Xp.default=Ux;var yn=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new vo,this.indexArray=new Dn,this.indexArray2=new Fa,this.programConfigurations=new Ke(e.layers,e.zoom),this.segments=new L,this.segments2=new L,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};yn.prototype.populate=function(e,t,r){this.hasPattern=eh("fill",this.layers,t);for(var a=this.layers[0].layout.get("fill-sort-key"),u=[],c=0,f=e;c<f.length;c+=1){var v=f[c],x=v.feature,b=v.id,S=v.index,T=v.sourceLayerIndex,C=this.layers[0]._featureFilter.needGeometry,z=ur(x,C);if(this.layers[0]._featureFilter.filter(new ft(this.zoom),z,r)){var N=a?a.evaluate(z,{},r,t.availableImages):void 0,$={id:b,properties:x.properties,type:x.type,sourceLayerIndex:T,index:S,geometry:C?z.geometry:tr(x),patterns:{},sortKey:N};u.push($)}}a&&u.sort(function(we,Ie){return we.sortKey-Ie.sortKey});for(var J=0,H=u;J<H.length;J+=1){var te=H[J],oe=te.geometry,se=te.index,ue=te.sourceLayerIndex;if(this.hasPattern){var ye=th("fill",this.layers,te,this.zoom,t);this.patternFeatures.push(ye)}else this.addFeature(te,oe,se,r,{});t.featureIndex.insert(e[se].feature,oe,se,ue,this.index)}},yn.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},yn.prototype.addFeatures=function(e,t,r){for(var a=0,u=this.patternFeatures;a<u.length;a+=1){var c=u[a];this.addFeature(c,c.geometry,c.index,t,r)}},yn.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},yn.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},yn.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Vx),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0},yn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},yn.prototype.addFeature=function(e,t,r,a,u){for(var c=0,f=Qp(t,500);c<f.length;c+=1){for(var v=f[c],x=0,b=0,S=v;b<S.length;b+=1)x+=S[b].length;for(var T=this.segments.prepareSegment(x,this.layoutVertexArray,this.indexArray),C=T.vertexLength,z=[],N=[],$=0,J=v;$<J.length;$+=1){var H=J[$];if(H.length!==0){H!==v[0]&&N.push(z.length/2);var te=this.segments2.prepareSegment(H.length,this.layoutVertexArray,this.indexArray2),oe=te.vertexLength;this.layoutVertexArray.emplaceBack(H[0].x,H[0].y),this.indexArray2.emplaceBack(oe+H.length-1,oe),z.push(H[0].x),z.push(H[0].y);for(var se=1;se<H.length;se++)this.layoutVertexArray.emplaceBack(H[se].x,H[se].y),this.indexArray2.emplaceBack(oe+se-1,oe+se),z.push(H[se].x),z.push(H[se].y);te.vertexLength+=H.length,te.primitiveLength+=H.length}}for(var ue=Xp(z,N),ye=0;ye<ue.length;ye+=3)this.indexArray.emplaceBack(C+ue[ye],C+ue[ye+1],C+ue[ye+2]);T.vertexLength+=x,T.primitiveLength+=ue.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,u,a)},Oe("FillBucket",yn,{omit:["layers","patternFeatures"]});var Qx=new Or({"fill-sort-key":new Ue(D.layout_fill["fill-sort-key"])}),eb={paint:new Or({"fill-antialias":new je(D.paint_fill["fill-antialias"]),"fill-opacity":new Ue(D.paint_fill["fill-opacity"]),"fill-color":new Ue(D.paint_fill["fill-color"]),"fill-outline-color":new Ue(D.paint_fill["fill-outline-color"]),"fill-translate":new je(D.paint_fill["fill-translate"]),"fill-translate-anchor":new je(D.paint_fill["fill-translate-anchor"]),"fill-pattern":new Is(D.paint_fill["fill-pattern"])}),layout:Qx},tb=function(e){function t(r){e.call(this,r,eb)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.recalculate=function(r,a){e.prototype.recalculate.call(this,r,a);var u=this.paint._values["fill-outline-color"];u.value.kind==="constant"&&u.value.value===void 0&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},t.prototype.createBucket=function(r){return new yn(r)},t.prototype.queryRadius=function(){return Tr(this.paint.get("fill-translate"))},t.prototype.queryIntersectsFeature=function(r,a,u,c,f,v,x){return Hi(mn(r,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),v.angle,x),c)},t.prototype.isTileClipped=function(){return!0},t}(en),rb=kr([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,Qd=Bs;function Bs(e,t,r,a,u){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=a,this._values=u,e.readFields(ib,this,t)}function ib(e,t,r){e==1?t.id=r.readVarint():e==2?function(a,u){for(var c=a.readVarint()+a.pos;a.pos<c;){var f=u._keys[a.readVarint()],v=u._values[a.readVarint()];u.properties[f]=v}}(r,t):e==3?t.type=r.readVarint():e==4&&(t._geometry=r.pos)}function nb(e){for(var t,r,a=0,u=0,c=e.length,f=c-1;u<c;f=u++)a+=((r=e[f]).x-(t=e[u]).x)*(t.y+r.y);return a}Bs.types=["Unknown","Point","LineString","Polygon"],Bs.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,a=1,u=0,c=0,f=0,v=[];e.pos<r;){if(u<=0){var x=e.readVarint();a=7&x,u=x>>3}if(u--,a===1||a===2)c+=e.readSVarint(),f+=e.readSVarint(),a===1&&(t&&v.push(t),t=[]),t.push(new pe(c,f));else{if(a!==7)throw new Error("unknown command "+a);t&&t.push(t[0].clone())}}return t&&v.push(t),v},Bs.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,a=0,u=0,c=0,f=1/0,v=-1/0,x=1/0,b=-1/0;e.pos<t;){if(a<=0){var S=e.readVarint();r=7&S,a=S>>3}if(a--,r===1||r===2)(u+=e.readSVarint())<f&&(f=u),u>v&&(v=u),(c+=e.readSVarint())<x&&(x=c),c>b&&(b=c);else if(r!==7)throw new Error("unknown command "+r)}return[f,x,v,b]},Bs.prototype.toGeoJSON=function(e,t,r){var a,u,c=this.extent*Math.pow(2,r),f=this.extent*e,v=this.extent*t,x=this.loadGeometry(),b=Bs.types[this.type];function S(z){for(var N=0;N<z.length;N++){var $=z[N];z[N]=[360*($.x+f)/c-180,360/Math.PI*Math.atan(Math.exp((180-360*($.y+v)/c)*Math.PI/180))-90]}}switch(this.type){case 1:var T=[];for(a=0;a<x.length;a++)T[a]=x[a][0];S(x=T);break;case 2:for(a=0;a<x.length;a++)S(x[a]);break;case 3:for(x=function(z){var N=z.length;if(N<=1)return[z];for(var $,J,H=[],te=0;te<N;te++){var oe=nb(z[te]);oe!==0&&(J===void 0&&(J=oe<0),J===oe<0?($&&H.push($),$=[z[te]]):$.push(z[te]))}return $&&H.push($),H}(x),a=0;a<x.length;a++)for(u=0;u<x[a].length;u++)S(x[a][u])}x.length===1?x=x[0]:b="Multi"+b;var C={type:"Feature",geometry:{type:b,coordinates:x},properties:this.properties};return"id"in this&&(C.id=this.id),C};var em=tm;function tm(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(ob,this,t),this.length=this._features.length}function ob(e,t,r){e===15?t.version=r.readVarint():e===1?t.name=r.readString():e===5?t.extent=r.readVarint():e===2?t._features.push(r.pos):e===3?t._keys.push(r.readString()):e===4&&t._values.push(function(a){for(var u=null,c=a.readVarint()+a.pos;a.pos<c;){var f=a.readVarint()>>3;u=f===1?a.readString():f===2?a.readFloat():f===3?a.readDouble():f===4?a.readVarint64():f===5?a.readVarint():f===6?a.readSVarint():f===7?a.readBoolean():null}return u}(r))}function ab(e,t,r){if(e===3){var a=new em(r,r.readVarint()+r.pos);a.length&&(t[a.name]=a)}}tm.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new Qd(this._pbf,t,this.extent,this._keys,this._values)};var Ds={VectorTile:function(e,t){this.layers=e.readFields(ab,{},t)},VectorTileFeature:Qd,VectorTileLayer:em},sb=Ds.VectorTileFeature.types,rh=Math.pow(2,13);function Kl(e,t,r,a,u,c,f,v){e.emplaceBack(t,r,2*Math.floor(a*rh)+f,u*rh*2,c*rh*2,Math.round(v))}var vn=function(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(t){return t.id}),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new dn,this.indexArray=new Dn,this.programConfigurations=new Ke(e.layers,e.zoom),this.segments=new L,this.stateDependentLayerIds=this.layers.filter(function(t){return t.isStateDependent()}).map(function(t){return t.id})};function lb(e,t){return e.x===t.x&&(e.x<0||e.x>8192)||e.y===t.y&&(e.y<0||e.y>8192)}vn.prototype.populate=function(e,t,r){this.features=[],this.hasPattern=eh("fill-extrusion",this.layers,t);for(var a=0,u=e;a<u.length;a+=1){var c=u[a],f=c.feature,v=c.id,x=c.index,b=c.sourceLayerIndex,S=this.layers[0]._featureFilter.needGeometry,T=ur(f,S);if(this.layers[0]._featureFilter.filter(new ft(this.zoom),T,r)){var C={id:v,sourceLayerIndex:b,index:x,geometry:S?T.geometry:tr(f),properties:f.properties,type:f.type,patterns:{}};this.hasPattern?this.features.push(th("fill-extrusion",this.layers,C,this.zoom,t)):this.addFeature(C,C.geometry,x,r,{}),t.featureIndex.insert(f,C.geometry,x,b,this.index,!0)}}},vn.prototype.addFeatures=function(e,t,r){for(var a=0,u=this.features;a<u.length;a+=1){var c=u[a];this.addFeature(c,c.geometry,c.index,t,r)}},vn.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},vn.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},vn.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},vn.prototype.upload=function(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,rb),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},vn.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},vn.prototype.addFeature=function(e,t,r,a,u){for(var c=0,f=Qp(t,500);c<f.length;c+=1){for(var v=f[c],x=0,b=0,S=v;b<S.length;b+=1)x+=S[b].length;for(var T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),C=0,z=v;C<z.length;C+=1){var N=z[C];if(N.length!==0&&!((ct=N).every(function(it){return it.x<0})||ct.every(function(it){return it.x>8192})||ct.every(function(it){return it.y<0})||ct.every(function(it){return it.y>8192})))for(var $=0,J=0;J<N.length;J++){var H=N[J];if(J>=1){var te=N[J-1];if(!lb(H,te)){T.vertexLength+4>L.MAX_VERTEX_ARRAY_LENGTH&&(T=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var oe=H.sub(te)._perp()._unit(),se=te.dist(H);$+se>32768&&($=0),Kl(this.layoutVertexArray,H.x,H.y,oe.x,oe.y,0,0,$),Kl(this.layoutVertexArray,H.x,H.y,oe.x,oe.y,0,1,$),Kl(this.layoutVertexArray,te.x,te.y,oe.x,oe.y,0,0,$+=se),Kl(this.layoutVertexArray,te.x,te.y,oe.x,oe.y,0,1,$);var ue=T.vertexLength;this.indexArray.emplaceBack(ue,ue+2,ue+1),this.indexArray.emplaceBack(ue+1,ue+2,ue+3),T.vertexLength+=4,T.primitiveLength+=2}}}}if(T.vertexLength+x>L.MAX_VERTEX_ARRAY_LENGTH&&(T=this.segments.prepareSegment(x,this.layoutVertexArray,this.indexArray)),sb[e.type]==="Polygon"){for(var ye=[],we=[],Ie=T.vertexLength,$e=0,Me=v;$e<Me.length;$e+=1){var Ze=Me[$e];if(Ze.length!==0){Ze!==v[0]&&we.push(ye.length/2);for(var Be=0;Be<Ze.length;Be++){var lt=Ze[Be];Kl(this.layoutVertexArray,lt.x,lt.y,0,0,1,1,0),ye.push(lt.x),ye.push(lt.y)}}}for(var Ye=Xp(ye,we),Ne=0;Ne<Ye.length;Ne+=3)this.indexArray.emplaceBack(Ie+Ye[Ne],Ie+Ye[Ne+2],Ie+Ye[Ne+1]);T.primitiveLength+=Ye.length/3,T.vertexLength+=x}}var ct;this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,u,a)},Oe("FillExtrusionBucket",vn,{omit:["layers","features"]});var ub={paint:new Or({"fill-extrusion-opacity":new je(D["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new Ue(D["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new je(D["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new je(D["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new Is(D["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new Ue(D["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new Ue(D["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new je(D["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})},cb=function(e){function t(r){e.call(this,r,ub)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.createBucket=function(r){return new vn(r)},t.prototype.queryRadius=function(){return Tr(this.paint.get("fill-extrusion-translate"))},t.prototype.is3D=function(){return!0},t.prototype.queryIntersectsFeature=function(r,a,u,c,f,v,x,b){var S=mn(r,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),v.angle,x),T=this.paint.get("fill-extrusion-height").evaluate(a,u),C=this.paint.get("fill-extrusion-base").evaluate(a,u),z=function($,J,H,te){for(var oe=[],se=0,ue=$;se<ue.length;se+=1){var ye=ue[se],we=[ye.x,ye.y,0,1];ks(we,we,J),oe.push(new pe(we[0]/we[3],we[1]/we[3]))}return oe}(S,b),N=function($,J,H,te){for(var oe=[],se=[],ue=te[8]*J,ye=te[9]*J,we=te[10]*J,Ie=te[11]*J,$e=te[8]*H,Me=te[9]*H,Ze=te[10]*H,Be=te[11]*H,lt=0,Ye=$;lt<Ye.length;lt+=1){for(var Ne=[],ct=[],it=0,xt=Ye[lt];it<xt.length;it+=1){var We=xt[it],Et=We.x,Jt=We.y,nr=te[0]*Et+te[4]*Jt+te[12],rr=te[1]*Et+te[5]*Jt+te[13],Yt=te[2]*Et+te[6]*Jt+te[14],or=te[3]*Et+te[7]*Jt+te[15],Ir=Yt+we,Ar=or+Ie,Kr=nr+$e,Br=rr+Me,Jr=Yt+Ze,cr=or+Be,Dr=new pe((nr+ue)/Ar,(rr+ye)/Ar);Dr.z=Ir/Ar,Ne.push(Dr);var dt=new pe(Kr/cr,Br/cr);dt.z=Jr/cr,ct.push(dt)}oe.push(Ne),se.push(ct)}return[oe,se]}(c,C,T,b);return function($,J,H){var te=1/0;Hi(H,J)&&(te=rm(H,J[0]));for(var oe=0;oe<J.length;oe++)for(var se=J[oe],ue=$[oe],ye=0;ye<se.length-1;ye++){var we=se[ye],Ie=[we,se[ye+1],ue[ye+1],ue[ye],we];Fn(H,Ie)&&(te=Math.min(te,rm(H,Ie)))}return te!==1/0&&te}(N[0],N[1],z)},t}(en);function Jl(e,t){return e.x*t.x+e.y*t.y}function rm(e,t){if(e.length===1){for(var r,a=0,u=t[a++];!r||u.equals(r);)if(!(r=t[a++]))return 1/0;for(;a<t.length;a++){var c=t[a],f=e[0],v=r.sub(u),x=c.sub(u),b=f.sub(u),S=Jl(v,v),T=Jl(v,x),C=Jl(x,x),z=Jl(b,v),N=Jl(b,x),$=S*C-T*T,J=(C*z-T*N)/$,H=(S*N-T*z)/$,te=u.z*(1-J-H)+r.z*J+c.z*H;if(isFinite(te))return te}return 1/0}for(var oe=1/0,se=0,ue=t;se<ue.length;se+=1)oe=Math.min(oe,ue[se].z);return oe}var pb=kr([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,hb=kr([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,fb=Ds.VectorTileFeature.types,db=Math.cos(Math.PI/180*37.5),im=Math.pow(2,14)/.5,ai=function(e){var t=this;this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(r){return r.id}),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach(function(r){t.gradients[r.id]={}}),this.layoutVertexArray=new di,this.layoutVertexArray2=new Xo,this.indexArray=new Dn,this.programConfigurations=new Ke(e.layers,e.zoom),this.segments=new L,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter(function(r){return r.isStateDependent()}).map(function(r){return r.id})};ai.prototype.populate=function(e,t,r){this.hasPattern=eh("line",this.layers,t);for(var a=this.layers[0].layout.get("line-sort-key"),u=[],c=0,f=e;c<f.length;c+=1){var v=f[c],x=v.feature,b=v.id,S=v.index,T=v.sourceLayerIndex,C=this.layers[0]._featureFilter.needGeometry,z=ur(x,C);if(this.layers[0]._featureFilter.filter(new ft(this.zoom),z,r)){var N=a?a.evaluate(z,{},r):void 0,$={id:b,properties:x.properties,type:x.type,sourceLayerIndex:T,index:S,geometry:C?z.geometry:tr(x),patterns:{},sortKey:N};u.push($)}}a&&u.sort(function(we,Ie){return we.sortKey-Ie.sortKey});for(var J=0,H=u;J<H.length;J+=1){var te=H[J],oe=te.geometry,se=te.index,ue=te.sourceLayerIndex;if(this.hasPattern){var ye=th("line",this.layers,te,this.zoom,t);this.patternFeatures.push(ye)}else this.addFeature(te,oe,se,r,{});t.featureIndex.insert(e[se].feature,oe,se,ue,this.index)}},ai.prototype.update=function(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)},ai.prototype.addFeatures=function(e,t,r){for(var a=0,u=this.patternFeatures;a<u.length;a+=1){var c=u[a];this.addFeature(c,c.geometry,c.index,t,r)}},ai.prototype.isEmpty=function(){return this.layoutVertexArray.length===0},ai.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},ai.prototype.upload=function(e){this.uploaded||(this.layoutVertexArray2.length!==0&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,hb)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,pb),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0},ai.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},ai.prototype.lineFeatureClips=function(e){if(e.properties&&e.properties.hasOwnProperty("mapbox_clip_start")&&e.properties.hasOwnProperty("mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}},ai.prototype.addFeature=function(e,t,r,a,u){var c=this.layers[0].layout,f=c.get("line-join").evaluate(e,{}),v=c.get("line-cap"),x=c.get("line-miter-limit"),b=c.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(var S=0,T=t;S<T.length;S+=1)this.addLine(T[S],e,f,v,x,b);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,u,a)},ai.prototype.addLine=function(e,t,r,a,u,c){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var f=0;f<e.length-1;f++)this.totalDistance+=e[f].dist(e[f+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var v=fb[t.type]==="Polygon",x=e.length;x>=2&&e[x-1].equals(e[x-2]);)x--;for(var b=0;b<x-1&&e[b].equals(e[b+1]);)b++;if(!(x<(v?3:2))){r==="bevel"&&(u=1.05);var S,T=this.overscaling<=16?122880/(512*this.overscaling):0,C=this.segments.prepareSegment(10*x,this.layoutVertexArray,this.indexArray),z=void 0,N=void 0,$=void 0,J=void 0;this.e1=this.e2=-1,v&&(J=e[b].sub(S=e[x-2])._unit()._perp());for(var H=b;H<x;H++)if(!(N=H===x-1?v?e[b+1]:void 0:e[H+1])||!e[H].equals(N)){J&&($=J),S&&(z=S),S=e[H],J=N?N.sub(S)._unit()._perp():$;var te=($=$||J).add(J);te.x===0&&te.y===0||te._unit();var oe=$.x*J.x+$.y*J.y,se=te.x*J.x+te.y*J.y,ue=se!==0?1/se:1/0,ye=2*Math.sqrt(2-2*se),we=se<db&&z&&N,Ie=$.x*J.y-$.y*J.x>0;if(we&&H>b){var $e=S.dist(z);if($e>2*T){var Me=S.sub(S.sub(z)._mult(T/$e)._round());this.updateDistance(z,Me),this.addCurrentVertex(Me,$,0,0,C),z=Me}}var Ze=z&&N,Be=Ze?r:v?"butt":a;if(Ze&&Be==="round"&&(ue<c?Be="miter":ue<=2&&(Be="fakeround")),Be==="miter"&&ue>u&&(Be="bevel"),Be==="bevel"&&(ue>2&&(Be="flipbevel"),ue<u&&(Be="miter")),z&&this.updateDistance(z,S),Be==="miter")te._mult(ue),this.addCurrentVertex(S,te,0,0,C);else if(Be==="flipbevel"){if(ue>100)te=J.mult(-1);else{var lt=ue*$.add(J).mag()/$.sub(J).mag();te._perp()._mult(lt*(Ie?-1:1))}this.addCurrentVertex(S,te,0,0,C),this.addCurrentVertex(S,te.mult(-1),0,0,C)}else if(Be==="bevel"||Be==="fakeround"){var Ye=-Math.sqrt(ue*ue-1),Ne=Ie?Ye:0,ct=Ie?0:Ye;if(z&&this.addCurrentVertex(S,$,Ne,ct,C),Be==="fakeround")for(var it=Math.round(180*ye/Math.PI/20),xt=1;xt<it;xt++){var We=xt/it;if(We!==.5){var Et=We-.5;We+=We*Et*(We-1)*((1.0904+oe*(oe*(3.55645-1.43519*oe)-3.2452))*Et*Et+(.848013+oe*(.215638*oe-1.06021)))}var Jt=J.sub($)._mult(We)._add($)._unit()._mult(Ie?-1:1);this.addHalfVertex(S,Jt.x,Jt.y,!1,Ie,0,C)}N&&this.addCurrentVertex(S,J,-Ne,-ct,C)}else if(Be==="butt")this.addCurrentVertex(S,te,0,0,C);else if(Be==="square"){var nr=z?1:-1;this.addCurrentVertex(S,te,nr,nr,C)}else Be==="round"&&(z&&(this.addCurrentVertex(S,$,0,0,C),this.addCurrentVertex(S,$,1,1,C,!0)),N&&(this.addCurrentVertex(S,J,-1,-1,C,!0),this.addCurrentVertex(S,J,0,0,C)));if(we&&H<x-1){var rr=S.dist(N);if(rr>2*T){var Yt=S.add(N.sub(S)._mult(T/rr)._round());this.updateDistance(S,Yt),this.addCurrentVertex(Yt,J,0,0,C),S=Yt}}}}},ai.prototype.addCurrentVertex=function(e,t,r,a,u,c){c===void 0&&(c=!1);var f=t.y*a-t.x,v=-t.y-t.x*a;this.addHalfVertex(e,t.x+t.y*r,t.y-t.x*r,c,!1,r,u),this.addHalfVertex(e,f,v,c,!0,-a,u),this.distance>im/2&&this.totalDistance===0&&(this.distance=0,this.addCurrentVertex(e,t,r,a,u,c))},ai.prototype.addHalfVertex=function(e,t,r,a,u,c,f){var v=.5*(this.lineClips?this.scaledDistance*(im-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e.x<<1)+(a?1:0),(e.y<<1)+(u?1:0),Math.round(63*t)+128,Math.round(63*r)+128,1+(c===0?0:c<0?-1:1)|(63&v)<<2,v>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);var x=f.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,x),f.primitiveLength++),u?this.e2=x:this.e1=x},ai.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},ai.prototype.updateDistance=function(e,t){this.distance+=e.dist(t),this.updateScaledDistance()},Oe("LineBucket",ai,{omit:["layers","patternFeatures"]});var mb=new Or({"line-cap":new je(D.layout_line["line-cap"]),"line-join":new Ue(D.layout_line["line-join"]),"line-miter-limit":new je(D.layout_line["line-miter-limit"]),"line-round-limit":new je(D.layout_line["line-round-limit"]),"line-sort-key":new Ue(D.layout_line["line-sort-key"])}),nm={paint:new Or({"line-opacity":new Ue(D.paint_line["line-opacity"]),"line-color":new Ue(D.paint_line["line-color"]),"line-translate":new je(D.paint_line["line-translate"]),"line-translate-anchor":new je(D.paint_line["line-translate-anchor"]),"line-width":new Ue(D.paint_line["line-width"]),"line-gap-width":new Ue(D.paint_line["line-gap-width"]),"line-offset":new Ue(D.paint_line["line-offset"]),"line-blur":new Ue(D.paint_line["line-blur"]),"line-dasharray":new Wr(D.paint_line["line-dasharray"]),"line-pattern":new Is(D.paint_line["line-pattern"]),"line-gradient":new Wi(D.paint_line["line-gradient"])}),layout:mb},om=new(function(e){function t(){e.apply(this,arguments)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.possiblyEvaluate=function(r,a){return a=new ft(Math.floor(a.zoom),{now:a.now,fadeDuration:a.fadeDuration,zoomHistory:a.zoomHistory,transition:a.transition}),e.prototype.possiblyEvaluate.call(this,r,a)},t.prototype.evaluate=function(r,a,u,c){return a=ot({},a,{zoom:Math.floor(a.zoom)}),e.prototype.evaluate.call(this,r,a,u,c)},t}(Ue))(nm.paint.properties["line-width"].specification);om.useIntegerZoom=!0;var yb=function(e){function t(r){e.call(this,r,nm),this.gradientVersion=0}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype._handleSpecialPaintPropertyUpdate=function(r){r==="line-gradient"&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof ui,this.gradientVersion=(this.gradientVersion+1)%ve)},t.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},t.prototype.recalculate=function(r,a){e.prototype.recalculate.call(this,r,a),this.paint._values["line-floorwidth"]=om.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,r)},t.prototype.createBucket=function(r){return new ai(r)},t.prototype.queryRadius=function(r){var a=r,u=am(nn("line-width",this,a),nn("line-gap-width",this,a)),c=nn("line-offset",this,a);return u/2+Math.abs(c)+Tr(this.paint.get("line-translate"))},t.prototype.queryIntersectsFeature=function(r,a,u,c,f,v,x){var b=mn(r,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),v.angle,x),S=x/2*am(this.paint.get("line-width").evaluate(a,u),this.paint.get("line-gap-width").evaluate(a,u)),T=this.paint.get("line-offset").evaluate(a,u);return T&&(c=function(C,z){for(var N=[],$=new pe(0,0),J=0;J<C.length;J++){for(var H=C[J],te=[],oe=0;oe<H.length;oe++){var se=H[oe],ue=H[oe+1],ye=oe===0?$:se.sub(H[oe-1])._unit()._perp(),we=oe===H.length-1?$:ue.sub(se)._unit()._perp(),Ie=ye._add(we)._unit();Ie._mult(1/(Ie.x*we.x+Ie.y*we.y)),te.push(Ie._mult(z)._add(se))}N.push(te)}return N}(c,T*x)),function(C,z,N){for(var $=0;$<z.length;$++){var J=z[$];if(C.length>=3){for(var H=0;H<J.length;H++)if(rn(C,J[H]))return!0}if(Di(C,J,N))return!0}return!1}(b,c,S)},t.prototype.isTileClipped=function(){return!0},t}(en);function am(e,t){return t>0?t+2*e:e}var vb=kr([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),gb=kr([{name:"a_projected_pos",components:3,type:"Float32"}],4),_b=(kr([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),kr([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),sm=(kr([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"}]),kr([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4)),xb=kr([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function bb(e,t,r){return e.sections.forEach(function(a){a.text=function(u,c,f){var v=c.layout.get("text-transform").evaluate(f,{});return v==="uppercase"?u=u.toLocaleUpperCase():v==="lowercase"&&(u=u.toLocaleLowerCase()),xi.applyArabicShaping&&(u=xi.applyArabicShaping(u)),u}(a.text,t,r)}),e}kr([{name:"triangle",components:3,type:"Uint16"}]),kr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"placedOrientation"},{type:"Uint8",name:"hidden"},{type:"Uint32",name:"crossTileID"},{type:"Int16",name:"associatedIconIndex"}]),kr([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Int16",name:"rightJustifiedTextSymbolIndex"},{type:"Int16",name:"centerJustifiedTextSymbolIndex"},{type:"Int16",name:"leftJustifiedTextSymbolIndex"},{type:"Int16",name:"verticalPlacedTextSymbolIndex"},{type:"Int16",name:"placedIconSymbolIndex"},{type:"Int16",name:"verticalPlacedIconSymbolIndex"},{type:"Uint16",name:"key"},{type:"Uint16",name:"textBoxStartIndex"},{type:"Uint16",name:"textBoxEndIndex"},{type:"Uint16",name:"verticalTextBoxStartIndex"},{type:"Uint16",name:"verticalTextBoxEndIndex"},{type:"Uint16",name:"iconBoxStartIndex"},{type:"Uint16",name:"iconBoxEndIndex"},{type:"Uint16",name:"verticalIconBoxStartIndex"},{type:"Uint16",name:"verticalIconBoxEndIndex"},{type:"Uint16",name:"featureIndex"},{type:"Uint16",name:"numHorizontalGlyphVertices"},{type:"Uint16",name:"numVerticalGlyphVertices"},{type:"Uint16",name:"numIconVertices"},{type:"Uint16",name:"numVerticalIconVertices"},{type:"Uint16",name:"useRuntimeCollisionCircles"},{type:"Uint32",name:"crossTileID"},{type:"Float32",name:"textBoxScale"},{type:"Float32",components:2,name:"textOffset"},{type:"Float32",name:"collisionCircleDiameter"}]),kr([{type:"Float32",name:"offsetX"}]),kr([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Yl={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},lm=function(e,t,r,a,u){var c,f,v=8*u-a-1,x=(1<<v)-1,b=x>>1,S=-7,T=u-1,C=-1,z=e[t+T];for(T+=C,c=z&(1<<-S)-1,z>>=-S,S+=v;S>0;c=256*c+e[t+T],T+=C,S-=8);for(f=c&(1<<-S)-1,c>>=-S,S+=a;S>0;f=256*f+e[t+T],T+=C,S-=8);if(c===0)c=1-b;else{if(c===x)return f?NaN:1/0*(z?-1:1);f+=Math.pow(2,a),c-=b}return(z?-1:1)*f*Math.pow(2,c-a)},um=function(e,t,r,a,u,c){var f,v,x,b=8*c-u-1,S=(1<<b)-1,T=S>>1,C=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,z=0,N=1,$=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(v=isNaN(t)?1:0,f=S):(f=Math.floor(Math.log(t)/Math.LN2),t*(x=Math.pow(2,-f))<1&&(f--,x*=2),(t+=f+T>=1?C/x:C*Math.pow(2,1-T))*x>=2&&(f++,x/=2),f+T>=S?(v=0,f=S):f+T>=1?(v=(t*x-1)*Math.pow(2,u),f+=T):(v=t*Math.pow(2,T-1)*Math.pow(2,u),f=0));u>=8;e[r+z]=255&v,z+=N,v/=256,u-=8);for(f=f<<u|v,b+=u;b>0;e[r+z]=255&f,z+=N,f/=256,b-=8);e[r+z-N]|=128*$},dc=Gt;function Gt(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}Gt.Varint=0,Gt.Fixed64=1,Gt.Bytes=2,Gt.Fixed32=5;var cm=typeof TextDecoder>"u"?null:new TextDecoder("utf8");function bo(e){return e.type===Gt.Bytes?e.readVarint()+e.pos:e.pos+1}function Ls(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function pm(e,t,r){var a=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(a);for(var u=r.pos-1;u>=e;u--)r.buf[u+a]=r.buf[u]}function wb(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function Sb(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function Tb(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function Ib(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function Ab(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function Eb(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function Pb(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Cb(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function kb(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function mc(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function Rs(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function hm(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function Mb(e,t,r){e===1&&r.readMessage(zb,t)}function zb(e,t,r){if(e===3){var a=r.readMessage(Bb,{}),u=a.width,c=a.height,f=a.left,v=a.top,x=a.advance;t.push({id:a.id,bitmap:new $a({width:u+6,height:c+6},a.bitmap),metrics:{width:u,height:c,left:f,top:v,advance:x}})}}function Bb(e,t,r){e===1?t.id=r.readVarint():e===2?t.bitmap=r.readBytes():e===3?t.width=r.readVarint():e===4?t.height=r.readVarint():e===5?t.left=r.readSVarint():e===6?t.top=r.readSVarint():e===7&&(t.advance=r.readVarint())}function fm(e){for(var t=0,r=0,a=0,u=e;a<u.length;a+=1){var c=u[a];t+=c.w*c.h,r=Math.max(r,c.w)}e.sort(function($,J){return J.h-$.h});for(var f=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}],v=0,x=0,b=0,S=e;b<S.length;b+=1)for(var T=S[b],C=f.length-1;C>=0;C--){var z=f[C];if(!(T.w>z.w||T.h>z.h)){if(T.x=z.x,T.y=z.y,x=Math.max(x,T.y+T.h),v=Math.max(v,T.x+T.w),T.w===z.w&&T.h===z.h){var N=f.pop();C<f.length&&(f[C]=N)}else T.h===z.h?(z.x+=T.w,z.w-=T.w):T.w===z.w?(z.y+=T.h,z.h-=T.h):(f.push({x:z.x+T.w,y:z.y,w:z.w-T.w,h:T.h}),z.y+=T.h,z.h-=T.h);break}}return{w:v,h:x,fill:t/(v*x)||0}}Gt.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var a=this.readVarint(),u=a>>3,c=this.pos;this.type=7&a,e(u,t,this),this.pos===c&&this.skip(a)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=mc(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=hm(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=mc(this.buf,this.pos)+4294967296*mc(this.buf,this.pos+4);return this.pos+=8,e},readSFixed64:function(){var e=mc(this.buf,this.pos)+4294967296*hm(this.buf,this.pos+4);return this.pos+=8,e},readFloat:function(){var e=lm(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=lm(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,a=this.buf;return t=127&(r=a[this.pos++]),r<128?t:(t|=(127&(r=a[this.pos++]))<<7,r<128?t:(t|=(127&(r=a[this.pos++]))<<14,r<128?t:(t|=(127&(r=a[this.pos++]))<<21,r<128?t:function(u,c,f){var v,x,b=f.buf;if(v=(112&(x=b[f.pos++]))>>4,x<128||(v|=(127&(x=b[f.pos++]))<<3,x<128)||(v|=(127&(x=b[f.pos++]))<<10,x<128)||(v|=(127&(x=b[f.pos++]))<<17,x<128)||(v|=(127&(x=b[f.pos++]))<<24,x<128)||(v|=(1&(x=b[f.pos++]))<<31,x<128))return Ls(u,v,c);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=a[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return!!this.readVarint()},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&cm?function(r,a,u){return cm.decode(r.subarray(a,u))}(this.buf,t,e):function(r,a,u){for(var c="",f=a;f<u;){var v,x,b,S=r[f],T=null,C=S>239?4:S>223?3:S>191?2:1;if(f+C>u)break;C===1?S<128&&(T=S):C===2?(192&(v=r[f+1]))==128&&(T=(31&S)<<6|63&v)<=127&&(T=null):C===3?(x=r[f+2],(192&(v=r[f+1]))==128&&(192&x)==128&&((T=(15&S)<<12|(63&v)<<6|63&x)<=2047||T>=55296&&T<=57343)&&(T=null)):C===4&&(x=r[f+2],b=r[f+3],(192&(v=r[f+1]))==128&&(192&x)==128&&(192&b)==128&&((T=(15&S)<<18|(63&v)<<12|(63&x)<<6|63&b)<=65535||T>=1114112)&&(T=null)),T===null?(T=65533,C=1):T>65535&&(T-=65536,c+=String.fromCharCode(T>>>10&1023|55296),T=56320|1023&T),c+=String.fromCharCode(T),f+=C}return c}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==Gt.Bytes)return e.push(this.readVarint(t));var r=bo(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==Gt.Bytes)return e.push(this.readSVarint());var t=bo(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==Gt.Bytes)return e.push(this.readBoolean());var t=bo(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==Gt.Bytes)return e.push(this.readFloat());var t=bo(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==Gt.Bytes)return e.push(this.readDouble());var t=bo(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==Gt.Bytes)return e.push(this.readFixed32());var t=bo(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==Gt.Bytes)return e.push(this.readSFixed32());var t=bo(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==Gt.Bytes)return e.push(this.readFixed64());var t=bo(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==Gt.Bytes)return e.push(this.readSFixed64());var t=bo(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===Gt.Varint)for(;this.buf[this.pos++]>127;);else if(t===Gt.Bytes)this.pos=this.readVarint()+this.pos;else if(t===Gt.Fixed32)this.pos+=4;else{if(t!==Gt.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),Rs(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Rs(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Rs(this.buf,-1&e,this.pos),Rs(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Rs(this.buf,-1&e,this.pos),Rs(this.buf,Math.floor(e*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(t,r){var a,u;if(t>=0?(a=t%4294967296|0,u=t/4294967296|0):(u=~(-t/4294967296),4294967295^(a=~(-t%4294967296))?a=a+1|0:(a=0,u=u+1|0)),t>=18446744073709552e3||t<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");r.realloc(10),function(c,f,v){v.buf[v.pos++]=127&c|128,c>>>=7,v.buf[v.pos++]=127&c|128,c>>>=7,v.buf[v.pos++]=127&c|128,c>>>=7,v.buf[v.pos++]=127&c|128,v.buf[v.pos]=127&(c>>>=7)}(a,0,r),function(c,f){var v=(7&c)<<4;f.buf[f.pos++]|=v|((c>>>=3)?128:0),c&&(f.buf[f.pos++]=127&c|((c>>>=7)?128:0),c&&(f.buf[f.pos++]=127&c|((c>>>=7)?128:0),c&&(f.buf[f.pos++]=127&c|((c>>>=7)?128:0),c&&(f.buf[f.pos++]=127&c|((c>>>=7)?128:0),c&&(f.buf[f.pos++]=127&c)))))}(u,r)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(!!e)},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(a,u,c){for(var f,v,x=0;x<u.length;x++){if((f=u.charCodeAt(x))>55295&&f<57344){if(!v){f>56319||x+1===u.length?(a[c++]=239,a[c++]=191,a[c++]=189):v=f;continue}if(f<56320){a[c++]=239,a[c++]=191,a[c++]=189,v=f;continue}f=v-55296<<10|f-56320|65536,v=null}else v&&(a[c++]=239,a[c++]=191,a[c++]=189,v=null);f<128?a[c++]=f:(f<2048?a[c++]=f>>6|192:(f<65536?a[c++]=f>>12|224:(a[c++]=f>>18|240,a[c++]=f>>12&63|128),a[c++]=f>>6&63|128),a[c++]=63&f|128)}return c}(this.buf,e,this.pos);var r=this.pos-t;r>=128&&pm(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),um(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),um(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var a=this.pos-r;a>=128&&pm(r,a,this),this.pos=r-1,this.writeVarint(a),this.pos+=a},writeMessage:function(e,t,r){this.writeTag(e,Gt.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,wb,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,Sb,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,Ab,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,Tb,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,Ib,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Eb,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,Pb,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Cb,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,kb,t)},writeBytesField:function(e,t){this.writeTag(e,Gt.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,Gt.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,Gt.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,Gt.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,Gt.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,Gt.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,Gt.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,Gt.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,Gt.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,Gt.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,!!t)}};var yc=function(e,t){var r=t.pixelRatio,a=t.version,u=t.stretchX,c=t.stretchY,f=t.content;this.paddedRect=e,this.pixelRatio=r,this.stretchX=u,this.stretchY=c,this.content=f,this.version=a},Ql={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}};Ql.tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},Ql.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},Ql.tlbr.get=function(){return this.tl.concat(this.br)},Ql.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(yc.prototype,Ql);var eu=function(e,t){var r={},a={};this.haveRenderCallbacks=[];var u=[];this.addImages(e,r,u),this.addImages(t,a,u);var c=fm(u),f=new yi({width:c.w||1,height:c.h||1});for(var v in e){var x=e[v],b=r[v].paddedRect;yi.copy(x.data,f,{x:0,y:0},{x:b.x+1,y:b.y+1},x.data)}for(var S in t){var T=t[S],C=a[S].paddedRect,z=C.x+1,N=C.y+1,$=T.data.width,J=T.data.height;yi.copy(T.data,f,{x:0,y:0},{x:z,y:N},T.data),yi.copy(T.data,f,{x:0,y:J-1},{x:z,y:N-1},{width:$,height:1}),yi.copy(T.data,f,{x:0,y:0},{x:z,y:N+J},{width:$,height:1}),yi.copy(T.data,f,{x:$-1,y:0},{x:z-1,y:N},{width:1,height:J}),yi.copy(T.data,f,{x:0,y:0},{x:z+$,y:N},{width:1,height:J})}this.image=f,this.iconPositions=r,this.patternPositions=a};eu.prototype.addImages=function(e,t,r){for(var a in e){var u=e[a],c={x:0,y:0,w:u.data.width+2,h:u.data.height+2};r.push(c),t[a]=new yc(c,u),u.hasRenderCallback&&this.haveRenderCallbacks.push(a)}},eu.prototype.patchUpdatedImages=function(e,t){for(var r in e.dispatchRenderCallbacks(this.haveRenderCallbacks),e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)},eu.prototype.patchUpdatedImage=function(e,t,r){if(e&&t&&e.version!==t.version){e.version=t.version;var a=e.tl;r.update(t.data,void 0,{x:a[0],y:a[1]})}},Oe("ImagePosition",yc),Oe("ImageAtlas",eu);var Li={horizontal:1,vertical:2,horizontalOnly:3},Fs=function(){this.scale=1,this.fontStack="",this.imageName=null};Fs.forText=function(e,t){var r=new Fs;return r.scale=e||1,r.fontStack=t,r},Fs.forImage=function(e){var t=new Fs;return t.imageName=e,t};var Xr=function(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null};function vc(e,t,r,a,u,c,f,v,x,b,S,T,C,z,N,$){var J,H=Xr.fromFeature(e,u);T===Li.vertical&&H.verticalizePunctuation();var te=xi.processBidirectionalText,oe=xi.processStyledBidirectionalText;if(te&&H.sections.length===1){J=[];for(var se=0,ue=te(H.toString(),ih(H,b,c,t,a,z,N));se<ue.length;se+=1){var ye=ue[se],we=new Xr;we.text=ye,we.sections=H.sections;for(var Ie=0;Ie<ye.length;Ie++)we.sectionIndex.push(0);J.push(we)}}else if(oe){J=[];for(var $e=0,Me=oe(H.text,H.sectionIndex,ih(H,b,c,t,a,z,N));$e<Me.length;$e+=1){var Ze=Me[$e],Be=new Xr;Be.text=Ze[0],Be.sectionIndex=Ze[1],Be.sections=H.sections,J.push(Be)}}else J=function(Ne,ct){for(var it=[],xt=Ne.text,We=0,Et=0,Jt=ct;Et<Jt.length;Et+=1){var nr=Jt[Et];it.push(Ne.substring(We,nr)),We=nr}return We<xt.length&&it.push(Ne.substring(We,xt.length)),it}(H,ih(H,b,c,t,a,z,N));var lt=[],Ye={positionedLines:lt,text:H.toString(),top:S[1],bottom:S[1],left:S[0],right:S[0],writingMode:T,iconsInText:!1,verticalizable:!1};return function(Ne,ct,it,xt,We,Et,Jt,nr,rr,Yt,or,Ir){for(var Ar=0,Kr=-17,Br=0,Jr=0,cr=nr==="right"?1:nr==="left"?0:.5,Dr=0,dt=0,$t=We;dt<$t.length;dt+=1){var Lt=$t[dt];Lt.trim();var St=Lt.getMaxScale(),si=24*(St-1),Ur={positionedGlyphs:[],lineOffset:0};Ne.positionedLines[Dr]=Ur;var Zt=Ur.positionedGlyphs,yr=0;if(Lt.length()){for(var Nr=0;Nr<Lt.length();Nr++){var Pt=Lt.getSection(Nr),Un=Lt.getSectionIndex(Nr),Ri=Lt.getCharCode(Nr),Nn=0,pr=null,$n=null,on=null,Gs=24,Za=!(rr===Li.horizontal||!or&&!ws(Ri)||or&&(gc[Ri]||(Io=Ri,Pe.Arabic(Io)||Pe["Arabic Supplement"](Io)||Pe["Arabic Extended-A"](Io)||Pe["Arabic Presentation Forms-A"](Io)||Pe["Arabic Presentation Forms-B"](Io))));if(Pt.imageName){var Zs=xt[Pt.imageName];if(!Zs)continue;on=Pt.imageName,Ne.iconsInText=Ne.iconsInText||!0,$n=Zs.paddedRect;var To=Zs.displaySize;Pt.scale=24*Pt.scale/Ir,Nn=si+(24-To[1]*Pt.scale),Gs=(pr={width:To[0],height:To[1],left:1,top:-3,advance:Za?To[1]:To[0]}).advance;var Ws=Za?To[0]*Pt.scale-24*St:To[1]*Pt.scale-24*St;Ws>0&&Ws>yr&&(yr=Ws)}else{var Ec=it[Pt.fontStack],Hs=Ec&&Ec[Ri];if(Hs&&Hs.rect)$n=Hs.rect,pr=Hs.metrics;else{var iu=ct[Pt.fontStack],Pc=iu&&iu[Ri];if(!Pc)continue;pr=Pc.metrics}Nn=24*(St-Pt.scale)}Za?(Ne.verticalizable=!0,Zt.push({glyph:Ri,imageName:on,x:Ar,y:Kr+Nn,vertical:Za,scale:Pt.scale,fontStack:Pt.fontStack,sectionIndex:Un,metrics:pr,rect:$n}),Ar+=Gs*Pt.scale+Yt):(Zt.push({glyph:Ri,imageName:on,x:Ar,y:Kr+Nn,vertical:Za,scale:Pt.scale,fontStack:Pt.fontStack,sectionIndex:Un,metrics:pr,rect:$n}),Ar+=pr.advance*Pt.scale+Yt)}Zt.length!==0&&(Br=Math.max(Ar-Yt,Br),Lb(Zt,0,Zt.length-1,cr,yr)),Ar=0;var Cc=Et*St+yr;Ur.lineOffset=Math.max(yr,si),Kr+=Cc,Jr=Math.max(Cc,Jr),++Dr}else Kr+=Et,++Dr}var Io,nu=Kr- -17,Xs=nh(Jt),ia=Xs.horizontalAlign,Ks=Xs.verticalAlign;(function(kc,Mc,ou,au,zc,su,lu,uu,Bc){var Js,Dc=(Mc-ou)*zc;Js=su!==lu?-uu*au- -17:(-au*Bc+.5)*lu;for(var Ys=0,cu=kc;Ys<cu.length;Ys+=1)for(var Wa=0,pu=cu[Ys].positionedGlyphs;Wa<pu.length;Wa+=1){var Qs=pu[Wa];Qs.x+=Dc,Qs.y+=Js}})(Ne.positionedLines,cr,ia,Ks,Br,Jr,Et,nu,We.length),Ne.top+=-Ks*nu,Ne.bottom=Ne.top+nu,Ne.left+=-ia*Br,Ne.right=Ne.left+Br}(Ye,t,r,a,J,f,v,x,T,b,C,$),!function(Ne){for(var ct=0,it=Ne;ct<it.length;ct+=1)if(it[ct].positionedGlyphs.length!==0)return!1;return!0}(lt)&&Ye}Xr.fromFeature=function(e,t){for(var r=new Xr,a=0;a<e.sections.length;a++){var u=e.sections[a];u.image?r.addImageSection(u):r.addTextSection(u,t)}return r},Xr.prototype.length=function(){return this.text.length},Xr.prototype.getSection=function(e){return this.sections[this.sectionIndex[e]]},Xr.prototype.getSectionIndex=function(e){return this.sectionIndex[e]},Xr.prototype.getCharCode=function(e){return this.text.charCodeAt(e)},Xr.prototype.verticalizePunctuation=function(){this.text=function(e){for(var t="",r=0;r<e.length;r++){var a=e.charCodeAt(r+1)||null,u=e.charCodeAt(r-1)||null;t+=a&&Fl(a)&&!Yl[e[r+1]]||u&&Fl(u)&&!Yl[e[r-1]]||!Yl[e[r]]?e[r]:Yl[e[r]]}return t}(this.text)},Xr.prototype.trim=function(){for(var e=0,t=0;t<this.text.length&&gc[this.text.charCodeAt(t)];t++)e++;for(var r=this.text.length,a=this.text.length-1;a>=0&&a>=e&&gc[this.text.charCodeAt(a)];a--)r--;this.text=this.text.substring(e,r),this.sectionIndex=this.sectionIndex.slice(e,r)},Xr.prototype.substring=function(e,t){var r=new Xr;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r},Xr.prototype.toString=function(){return this.text},Xr.prototype.getMaxScale=function(){var e=this;return this.sectionIndex.reduce(function(t,r){return Math.max(t,e.sections[r].scale)},0)},Xr.prototype.addTextSection=function(e,t){this.text+=e.text,this.sections.push(Fs.forText(e.scale,e.fontStack||t));for(var r=this.sections.length-1,a=0;a<e.text.length;++a)this.sectionIndex.push(r)},Xr.prototype.addImageSection=function(e){var t=e.image?e.image.name:"";if(t.length!==0){var r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(Fs.forImage(t)),this.sectionIndex.push(this.sections.length-1)):It("Reached maximum number of images 6401")}else It("Can't add FormattedSection with an empty image.")},Xr.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var gc={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},wi={};function dm(e,t,r,a,u,c){if(t.imageName){var f=a[t.imageName];return f?f.displaySize[0]*t.scale*24/c+u:0}var v=r[t.fontStack],x=v&&v[e];return x?x.metrics.advance*t.scale+u:0}function mm(e,t,r,a){var u=Math.pow(e-t,2);return a?e<t?u/2:2*u:u+Math.abs(r)*r}function Db(e,t,r){var a=0;return e===10&&(a-=1e4),r&&(a+=150),e!==40&&e!==65288||(a+=50),t!==41&&t!==65289||(a+=50),a}function ym(e,t,r,a,u,c){for(var f=null,v=mm(t,r,u,c),x=0,b=a;x<b.length;x+=1){var S=b[x],T=mm(t-S.x,r,u,c)+S.badness;T<=v&&(f=S,v=T)}return{index:e,x:t,priorBreak:f,badness:v}}function ih(e,t,r,a,u,c,f){if(c!=="point")return[];if(!e)return[];for(var v,x=[],b=function(J,H,te,oe,se,ue){for(var ye=0,we=0;we<J.length();we++){var Ie=J.getSection(we);ye+=dm(J.getCharCode(we),Ie,oe,se,H,ue)}return ye/Math.max(1,Math.ceil(ye/te))}(e,t,r,a,u,f),S=e.text.indexOf("")>=0,T=0,C=0;C<e.length();C++){var z=e.getSection(C),N=e.getCharCode(C);if(gc[N]||(T+=dm(N,z,a,u,t,f)),C<e.length()-1){var $=!((v=N)<11904||!(Pe["Bopomofo Extended"](v)||Pe.Bopomofo(v)||Pe["CJK Compatibility Forms"](v)||Pe["CJK Compatibility Ideographs"](v)||Pe["CJK Compatibility"](v)||Pe["CJK Radicals Supplement"](v)||Pe["CJK Strokes"](v)||Pe["CJK Symbols and Punctuation"](v)||Pe["CJK Unified Ideographs Extension A"](v)||Pe["CJK Unified Ideographs"](v)||Pe["Enclosed CJK Letters and Months"](v)||Pe["Halfwidth and Fullwidth Forms"](v)||Pe.Hiragana(v)||Pe["Ideographic Description Characters"](v)||Pe["Kangxi Radicals"](v)||Pe["Katakana Phonetic Extensions"](v)||Pe.Katakana(v)||Pe["Vertical Forms"](v)||Pe["Yi Radicals"](v)||Pe["Yi Syllables"](v)));(wi[N]||$||z.imageName)&&x.push(ym(C+1,T,b,x,Db(N,e.getCharCode(C+1),$&&S),!1))}}return function J(H){return H?J(H.priorBreak).concat(H.index):[]}(ym(e.length(),T,b,x,0,!0))}function nh(e){var t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function Lb(e,t,r,a,u){if(a||u)for(var c=e[r],f=(e[r].x+c.metrics.advance*c.scale)*a,v=t;v<=r;v++)e[v].x-=f,e[v].y+=u}function vm(e,t,r,a,u,c){var f,v=e.image;if(v.content){var x=v.content,b=v.pixelRatio||1;f=[x[0]/b,x[1]/b,v.displaySize[0]-x[2]/b,v.displaySize[1]-x[3]/b]}var S,T,C,z,N=t.left*c,$=t.right*c;r==="width"||r==="both"?(z=u[0]+N-a[3],T=u[0]+$+a[1]):T=(z=u[0]+(N+$-v.displaySize[0])/2)+v.displaySize[0];var J=t.top*c,H=t.bottom*c;return r==="height"||r==="both"?(S=u[1]+J-a[0],C=u[1]+H+a[2]):C=(S=u[1]+(J+H-v.displaySize[1])/2)+v.displaySize[1],{image:v,top:S,right:T,bottom:C,left:z,collisionPadding:f}}wi[10]=!0,wi[32]=!0,wi[38]=!0,wi[40]=!0,wi[41]=!0,wi[43]=!0,wi[45]=!0,wi[47]=!0,wi[173]=!0,wi[183]=!0,wi[8203]=!0,wi[8208]=!0,wi[8211]=!0,wi[8231]=!0;var Os=function(e){function t(r,a,u,c){e.call(this,r,a),this.angle=u,c!==void 0&&(this.segment=c)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.clone=function(){return new t(this.x,this.y,this.angle,this.segment)},t}(pe);function oh(e,t){var r=t.expression;if(r.kind==="constant")return{kind:"constant",layoutSize:r.evaluate(new ft(e+1))};if(r.kind==="source")return{kind:"source"};for(var a=r.zoomStops,u=r.interpolationType,c=0;c<a.length&&a[c]<=e;)c++;for(var f=c=Math.max(0,c-1);f<a.length&&a[f]<e+1;)f++;f=Math.min(a.length-1,f);var v=a[c],x=a[f];return r.kind==="composite"?{kind:"composite",minZoom:v,maxZoom:x,interpolationType:u}:{kind:"camera",minZoom:v,maxZoom:x,minSize:r.evaluate(new ft(v)),maxSize:r.evaluate(new ft(x)),interpolationType:u}}function gm(e,t,r){var a=t.uSize,u=r.lowerSize;return e.kind==="source"?u/128:e.kind==="composite"?dr(u/128,r.upperSize/128,t.uSizeT):a}function _m(e,t){var r=0,a=0;if(e.kind==="constant")a=e.layoutSize;else if(e.kind!=="source"){var u=e.interpolationType,c=u?qe(Rr.interpolationFactor(u,t,e.minZoom,e.maxZoom),0,1):0;e.kind==="camera"?a=dr(e.minSize,e.maxSize,c):r=c}return{uSizeT:r,uSize:a}}Oe("Anchor",Os);var Rb=Object.freeze({__proto__:null,getSizeData:oh,evaluateSizeForFeature:gm,evaluateSizeForZoom:_m,SIZE_PACK_FACTOR:128});function xm(e,t,r,a,u){if(t.segment===void 0)return!0;for(var c=t,f=t.segment+1,v=0;v>-r/2;){if(--f<0)return!1;v-=e[f].dist(c),c=e[f]}v+=e[f].dist(e[f+1]),f++;for(var x=[],b=0;v<r/2;){var S=e[f],T=e[f+1];if(!T)return!1;var C=e[f-1].angleTo(S)-S.angleTo(T);for(C=Math.abs((C+3*Math.PI)%(2*Math.PI)-Math.PI),x.push({distance:v,angleDelta:C}),b+=C;v-x[0].distance>a;)b-=x.shift().angleDelta;if(b>u)return!1;f++,v+=S.dist(T)}return!0}function bm(e){for(var t=0,r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function wm(e,t,r){return e?.6*t*r:0}function Sm(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function Fb(e,t,r,a,u,c){for(var f=wm(r,u,c),v=Sm(r,a)*c,x=0,b=bm(e)/2,S=0;S<e.length-1;S++){var T=e[S],C=e[S+1],z=T.dist(C);if(x+z>b){var N=(b-x)/z,$=dr(T.x,C.x,N),J=dr(T.y,C.y,N),H=new Os($,J,C.angleTo(T),S);return H._round(),!f||xm(e,H,v,f,t)?H:void 0}x+=z}}function Ob(e,t,r,a,u,c,f,v,x){var b=wm(a,c,f),S=Sm(a,u),T=S*f,C=e[0].x===0||e[0].x===x||e[0].y===0||e[0].y===x;return t-T<t/4&&(t=T+t/4),function z(N,$,J,H,te,oe,se,ue,ye){for(var we=oe/2,Ie=bm(N),$e=0,Me=$-J,Ze=[],Be=0;Be<N.length-1;Be++){for(var lt=N[Be],Ye=N[Be+1],Ne=lt.dist(Ye),ct=Ye.angleTo(lt);Me+J<$e+Ne;){var it=((Me+=J)-$e)/Ne,xt=dr(lt.x,Ye.x,it),We=dr(lt.y,Ye.y,it);if(xt>=0&&xt<ye&&We>=0&&We<ye&&Me-we>=0&&Me+we<=Ie){var Et=new Os(xt,We,ct,Be);Et._round(),H&&!xm(N,Et,oe,H,te)||Ze.push(Et)}}$e+=Ne}return ue||Ze.length||se||(Ze=z(N,$e/2,J,H,te,oe,se,!0,ye)),Ze}(e,C?t/2*v%t:(S/2+2*c)*f*v%t,t,b,r,T,C,!1,x)}function Tm(e,t,r,a,u){for(var c=[],f=0;f<e.length;f++)for(var v=e[f],x=void 0,b=0;b<v.length-1;b++){var S=v[b],T=v[b+1];S.x<t&&T.x<t||(S.x<t?S=new pe(t,S.y+(t-S.x)/(T.x-S.x)*(T.y-S.y))._round():T.x<t&&(T=new pe(t,S.y+(t-S.x)/(T.x-S.x)*(T.y-S.y))._round()),S.y<r&&T.y<r||(S.y<r?S=new pe(S.x+(r-S.y)/(T.y-S.y)*(T.x-S.x),r)._round():T.y<r&&(T=new pe(S.x+(r-S.y)/(T.y-S.y)*(T.x-S.x),r)._round()),S.x>=a&&T.x>=a||(S.x>=a?S=new pe(a,S.y+(a-S.x)/(T.x-S.x)*(T.y-S.y))._round():T.x>=a&&(T=new pe(a,S.y+(a-S.x)/(T.x-S.x)*(T.y-S.y))._round()),S.y>=u&&T.y>=u||(S.y>=u?S=new pe(S.x+(u-S.y)/(T.y-S.y)*(T.x-S.x),u)._round():T.y>=u&&(T=new pe(S.x+(u-S.y)/(T.y-S.y)*(T.x-S.x),u)._round()),x&&S.equals(x[x.length-1])||c.push(x=[S]),x.push(T)))))}return c}function Im(e,t,r,a){var u=[],c=e.image,f=c.pixelRatio,v=c.paddedRect.w-2,x=c.paddedRect.h-2,b=e.right-e.left,S=e.bottom-e.top,T=c.stretchX||[[0,v]],C=c.stretchY||[[0,x]],z=function(xt,We){return xt+We[1]-We[0]},N=T.reduce(z,0),$=C.reduce(z,0),J=v-N,H=x-$,te=0,oe=N,se=0,ue=$,ye=0,we=J,Ie=0,$e=H;if(c.content&&a){var Me=c.content;te=_c(T,0,Me[0]),se=_c(C,0,Me[1]),oe=_c(T,Me[0],Me[2]),ue=_c(C,Me[1],Me[3]),ye=Me[0]-te,Ie=Me[1]-se,we=Me[2]-Me[0]-oe,$e=Me[3]-Me[1]-ue}var Ze=function(xt,We,Et,Jt){var nr=xc(xt.stretch-te,oe,b,e.left),rr=bc(xt.fixed-ye,we,xt.stretch,N),Yt=xc(We.stretch-se,ue,S,e.top),or=bc(We.fixed-Ie,$e,We.stretch,$),Ir=xc(Et.stretch-te,oe,b,e.left),Ar=bc(Et.fixed-ye,we,Et.stretch,N),Kr=xc(Jt.stretch-se,ue,S,e.top),Br=bc(Jt.fixed-Ie,$e,Jt.stretch,$),Jr=new pe(nr,Yt),cr=new pe(Ir,Yt),Dr=new pe(Ir,Kr),dt=new pe(nr,Kr),$t=new pe(rr/f,or/f),Lt=new pe(Ar/f,Br/f),St=t*Math.PI/180;if(St){var si=Math.sin(St),Ur=Math.cos(St),Zt=[Ur,-si,si,Ur];Jr._matMult(Zt),cr._matMult(Zt),dt._matMult(Zt),Dr._matMult(Zt)}var yr=xt.stretch+xt.fixed,Nr=We.stretch+We.fixed;return{tl:Jr,tr:cr,bl:dt,br:Dr,tex:{x:c.paddedRect.x+1+yr,y:c.paddedRect.y+1+Nr,w:Et.stretch+Et.fixed-yr,h:Jt.stretch+Jt.fixed-Nr},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:$t,pixelOffsetBR:Lt,minFontScaleX:we/f/b,minFontScaleY:$e/f/S,isSDF:r}};if(a&&(c.stretchX||c.stretchY))for(var Be=Am(T,J,N),lt=Am(C,H,$),Ye=0;Ye<Be.length-1;Ye++)for(var Ne=Be[Ye],ct=Be[Ye+1],it=0;it<lt.length-1;it++)u.push(Ze(Ne,lt[it],ct,lt[it+1]));else u.push(Ze({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:v+1},{fixed:0,stretch:x+1}));return u}function _c(e,t,r){for(var a=0,u=0,c=e;u<c.length;u+=1){var f=c[u];a+=Math.max(t,Math.min(r,f[1]))-Math.max(t,Math.min(r,f[0]))}return a}function Am(e,t,r){for(var a=[{fixed:-1,stretch:0}],u=0,c=e;u<c.length;u+=1){var f=c[u],v=f[0],x=f[1],b=a[a.length-1];a.push({fixed:v-b.stretch,stretch:b.stretch}),a.push({fixed:v-b.stretch,stretch:b.stretch+(x-v)})}return a.push({fixed:t+1,stretch:r}),a}function xc(e,t,r,a){return e/t*r+a}function bc(e,t,r,a){return e-t*r/a}var wc=function(e,t,r,a,u,c,f,v,x,b){if(this.boxStartIndex=e.length,x){var S=c.top,T=c.bottom,C=c.collisionPadding;C&&(S-=C[1],T+=C[3]);var z=T-S;z>0&&(z=Math.max(10,z),this.circleDiameter=z)}else{var N=c.top*f-v,$=c.bottom*f+v,J=c.left*f-v,H=c.right*f+v,te=c.collisionPadding;if(te&&(J-=te[0]*f,N-=te[1]*f,H+=te[2]*f,$+=te[3]*f),b){var oe=new pe(J,N),se=new pe(H,N),ue=new pe(J,$),ye=new pe(H,$),we=b*Math.PI/180;oe._rotate(we),se._rotate(we),ue._rotate(we),ye._rotate(we),J=Math.min(oe.x,se.x,ue.x,ye.x),H=Math.max(oe.x,se.x,ue.x,ye.x),N=Math.min(oe.y,se.y,ue.y,ye.y),$=Math.max(oe.y,se.y,ue.y,ye.y)}e.emplaceBack(t.x,t.y,J,N,H,$,r,a,u)}this.boxEndIndex=e.length},Vs=function(e,t){if(e===void 0&&(e=[]),t===void 0&&(t=Vb),this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(var r=(this.length>>1)-1;r>=0;r--)this._down(r)};function Vb(e,t){return e<t?-1:e>t?1:0}function Ub(e,t,r){r===void 0&&(r=!1);for(var a=1/0,u=1/0,c=-1/0,f=-1/0,v=e[0],x=0;x<v.length;x++){var b=v[x];(!x||b.x<a)&&(a=b.x),(!x||b.y<u)&&(u=b.y),(!x||b.x>c)&&(c=b.x),(!x||b.y>f)&&(f=b.y)}var S=Math.min(c-a,f-u),T=S/2,C=new Vs([],Nb);if(S===0)return new pe(a,u);for(var z=a;z<c;z+=S)for(var N=u;N<f;N+=S)C.push(new Us(z+T,N+T,T,e));for(var $=function(te){for(var oe=0,se=0,ue=0,ye=te[0],we=0,Ie=ye.length,$e=Ie-1;we<Ie;$e=we++){var Me=ye[we],Ze=ye[$e],Be=Me.x*Ze.y-Ze.x*Me.y;se+=(Me.x+Ze.x)*Be,ue+=(Me.y+Ze.y)*Be,oe+=3*Be}return new Us(se/oe,ue/oe,0,te)}(e),J=C.length;C.length;){var H=C.pop();(H.d>$.d||!$.d)&&($=H,r&&console.log("found best %d after %d probes",Math.round(1e4*H.d)/1e4,J)),H.max-$.d<=t||(C.push(new Us(H.p.x-(T=H.h/2),H.p.y-T,T,e)),C.push(new Us(H.p.x+T,H.p.y-T,T,e)),C.push(new Us(H.p.x-T,H.p.y+T,T,e)),C.push(new Us(H.p.x+T,H.p.y+T,T,e)),J+=4)}return r&&(console.log("num probes: "+J),console.log("best distance: "+$.d)),$.p}function Nb(e,t){return t.max-e.max}function Us(e,t,r,a){this.p=new pe(e,t),this.h=r,this.d=function(u,c){for(var f=!1,v=1/0,x=0;x<c.length;x++)for(var b=c[x],S=0,T=b.length,C=T-1;S<T;C=S++){var z=b[S],N=b[C];z.y>u.y!=N.y>u.y&&u.x<(N.x-z.x)*(u.y-z.y)/(N.y-z.y)+z.x&&(f=!f),v=Math.min(v,Qo(u,z,N))}return(f?1:-1)*Math.sqrt(v)}(this.p,a),this.max=this.d+this.h*Math.SQRT2}Vs.prototype.push=function(e){this.data.push(e),this.length++,this._up(this.length-1)},Vs.prototype.pop=function(){if(this.length!==0){var e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}},Vs.prototype.peek=function(){return this.data[0]},Vs.prototype._up=function(e){for(var t=this.data,r=this.compare,a=t[e];e>0;){var u=e-1>>1,c=t[u];if(r(a,c)>=0)break;t[e]=c,e=u}t[e]=a},Vs.prototype._down=function(e){for(var t=this.data,r=this.compare,a=this.length>>1,u=t[e];e<a;){var c=1+(e<<1),f=t[c],v=c+1;if(v<this.length&&r(t[v],f)<0&&(c=v,f=t[v]),r(f,u)>=0)break;t[e]=f,e=c}t[e]=u};var ah=Number.POSITIVE_INFINITY;function Em(e,t){return t[1]!==ah?function(r,a,u){var c=0,f=0;switch(a=Math.abs(a),u=Math.abs(u),r){case"top-right":case"top-left":case"top":f=u-7;break;case"bottom-right":case"bottom-left":case"bottom":f=7-u}switch(r){case"top-right":case"bottom-right":case"right":c=-a;break;case"top-left":case"bottom-left":case"left":c=a}return[c,f]}(e,t[0],t[1]):function(r,a){var u=0,c=0;a<0&&(a=0);var f=a/Math.sqrt(2);switch(r){case"top-right":case"top-left":c=f-7;break;case"bottom-right":case"bottom-left":c=7-f;break;case"bottom":c=7-a;break;case"top":c=a-7}switch(r){case"top-right":case"bottom-right":u=-f;break;case"top-left":case"bottom-left":u=f;break;case"left":u=a;break;case"right":u=-a}return[u,c]}(e,t[0])}function sh(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Pm(e,t,r,a,u,c,f,v,x,b,S,T,C,z,N){var $=function(se,ue,ye,we,Ie,$e,Me,Ze){for(var Be=we.layout.get("text-rotate").evaluate($e,{})*Math.PI/180,lt=[],Ye=0,Ne=ue.positionedLines;Ye<Ne.length;Ye+=1)for(var ct=Ne[Ye],it=0,xt=ct.positionedGlyphs;it<xt.length;it+=1){var We=xt[it];if(We.rect){var Et=We.rect||{},Jt=4,nr=!0,rr=1,Yt=0,or=(Ie||Ze)&&We.vertical,Ir=We.metrics.advance*We.scale/2;if(Ze&&ue.verticalizable&&(Yt=ct.lineOffset/2-(We.imageName?-(24-We.metrics.width*We.scale)/2:24*(We.scale-1))),We.imageName){var Ar=Me[We.imageName];nr=Ar.sdf,Jt=1/(rr=Ar.pixelRatio)}var Kr=Ie?[We.x+Ir,We.y]:[0,0],Br=Ie?[0,0]:[We.x+Ir+ye[0],We.y+ye[1]-Yt],Jr=[0,0];or&&(Jr=Br,Br=[0,0]);var cr=(We.metrics.left-Jt)*We.scale-Ir+Br[0],Dr=(-We.metrics.top-Jt)*We.scale+Br[1],dt=cr+Et.w*We.scale/rr,$t=Dr+Et.h*We.scale/rr,Lt=new pe(cr,Dr),St=new pe(dt,Dr),si=new pe(cr,$t),Ur=new pe(dt,$t);if(or){var Zt=new pe(-Ir,Ir- -17),yr=-Math.PI/2,Nr=12-Ir,Pt=new pe(22-Nr,-(We.imageName?Nr:0)),Un=new(Function.prototype.bind.apply(pe,[null].concat(Jr)));Lt._rotateAround(yr,Zt)._add(Pt)._add(Un),St._rotateAround(yr,Zt)._add(Pt)._add(Un),si._rotateAround(yr,Zt)._add(Pt)._add(Un),Ur._rotateAround(yr,Zt)._add(Pt)._add(Un)}if(Be){var Ri=Math.sin(Be),Nn=Math.cos(Be),pr=[Nn,-Ri,Ri,Nn];Lt._matMult(pr),St._matMult(pr),si._matMult(pr),Ur._matMult(pr)}var $n=new pe(0,0),on=new pe(0,0);lt.push({tl:Lt,tr:St,bl:si,br:Ur,tex:Et,writingMode:ue.writingMode,glyphOffset:Kr,sectionIndex:We.sectionIndex,isSDF:nr,pixelOffsetTL:$n,pixelOffsetBR:on,minFontScaleX:0,minFontScaleY:0})}}return lt}(0,r,v,u,c,f,a,e.allowVerticalPlacement),J=e.textSizeData,H=null;J.kind==="source"?(H=[128*u.layout.get("text-size").evaluate(f,{})])[0]>32640&&It(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):J.kind==="composite"&&((H=[128*z.compositeTextSizes[0].evaluate(f,{},N),128*z.compositeTextSizes[1].evaluate(f,{},N)])[0]>32640||H[1]>32640)&&It(e.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),e.addSymbols(e.text,$,H,v,c,f,b,t,x.lineStartIndex,x.lineLength,C,N);for(var te=0,oe=S;te<oe.length;te+=1)T[oe[te]]=e.text.placedSymbolArray.length-1;return 4*$.length}function Cm(e){for(var t in e)return e[t];return null}function $b(e,t,r,a){var u=e.compareText;if(t in u){for(var c=u[t],f=c.length-1;f>=0;f--)if(a.dist(c[f])<r)return!0}else u[t]=[];return u[t].push(a),!1}var qb=Ds.VectorTileFeature.types,jb=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Sc(e,t,r,a,u,c,f,v,x,b,S,T,C){var z=v?Math.min(32640,Math.round(v[0])):0,N=v?Math.min(32640,Math.round(v[1])):0;e.emplaceBack(t,r,Math.round(32*a),Math.round(32*u),c,f,(z<<1)+(x?1:0),N,16*b,16*S,256*T,256*C)}function lh(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function Gb(e){for(var t=0,r=e.sections;t<r.length;t+=1)if(Ss(r[t].text))return!0;return!1}var Ns=function(e){this.layoutVertexArray=new Es,this.indexArray=new Dn,this.programConfigurations=e,this.segments=new L,this.dynamicLayoutVertexArray=new Ko,this.opacityVertexArray=new Ra,this.placedSymbolArray=new s};Ns.prototype.isEmpty=function(){return this.layoutVertexArray.length===0&&this.indexArray.length===0&&this.dynamicLayoutVertexArray.length===0&&this.opacityVertexArray.length===0},Ns.prototype.upload=function(e,t,r,a){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,vb.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,gb.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,jb,!0),this.opacityVertexBuffer.itemSize=1),(r||a)&&this.programConfigurations.upload(e))},Ns.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Oe("SymbolBuffers",Ns);var tu=function(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new L,this.collisionVertexArray=new ql};tu.prototype.upload=function(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,_b.members,!0)},tu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Oe("CollisionBuffers",tu);var Ot=function(e){this.collisionBoxArray=e.collisionBoxArray,this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map(function(c){return c.id}),this.index=e.index,this.pixelRatio=e.pixelRatio,this.sourceLayerIndex=e.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=bi([]),this.placementViewportMatrix=bi([]);var t=this.layers[0]._unevaluatedLayout._values;this.textSizeData=oh(this.zoom,t["text-size"]),this.iconSizeData=oh(this.zoom,t["icon-size"]);var r=this.layers[0].layout,a=r.get("symbol-sort-key"),u=r.get("symbol-z-order");this.canOverlap=r.get("text-allow-overlap")||r.get("icon-allow-overlap")||r.get("text-ignore-placement")||r.get("icon-ignore-placement"),this.sortFeaturesByKey=u!=="viewport-y"&&a.constantOr(1)!==void 0,this.sortFeaturesByY=(u==="viewport-y"||u==="auto"&&!this.sortFeaturesByKey)&&this.canOverlap,r.get("symbol-placement")==="point"&&(this.writingModes=r.get("text-writing-mode").map(function(c){return Li[c]})),this.stateDependentLayerIds=this.layers.filter(function(c){return c.isStateDependent()}).map(function(c){return c.id}),this.sourceID=e.sourceID};Ot.prototype.createArrays=function(){this.text=new Ns(new Ke(this.layers,this.zoom,function(e){return/^text/.test(e)})),this.icon=new Ns(new Ke(this.layers,this.zoom,function(e){return/^icon/.test(e)})),this.glyphOffsetArray=new y,this.lineVertexArray=new g,this.symbolInstances=new m},Ot.prototype.calculateGlyphDependencies=function(e,t,r,a,u){for(var c=0;c<e.length;c++)if(t[e.charCodeAt(c)]=!0,(r||a)&&u){var f=Yl[e.charAt(c)];f&&(t[f.charCodeAt(0)]=!0)}},Ot.prototype.populate=function(e,t,r){var a=this.layers[0],u=a.layout,c=u.get("text-font"),f=u.get("text-field"),v=u.get("icon-image"),x=(f.value.kind!=="constant"||f.value.value instanceof Pr&&!f.value.value.isEmpty()||f.value.value.toString().length>0)&&(c.value.kind!=="constant"||c.value.value.length>0),b=v.value.kind!=="constant"||!!v.value.value||Object.keys(v.parameters).length>0,S=u.get("symbol-sort-key");if(this.features=[],x||b){for(var T=t.iconDependencies,C=t.glyphDependencies,z=t.availableImages,N=new ft(this.zoom),$=0,J=e;$<J.length;$+=1){var H=J[$],te=H.feature,oe=H.id,se=H.index,ue=H.sourceLayerIndex,ye=a._featureFilter.needGeometry,we=ur(te,ye);if(a._featureFilter.filter(N,we,r)){ye||(we.geometry=tr(te));var Ie=void 0;if(x){var $e=a.getValueAndResolveTokens("text-field",we,r,z),Me=Pr.factory($e);Gb(Me)&&(this.hasRTLText=!0),(!this.hasRTLText||Vl()==="unavailable"||this.hasRTLText&&xi.isParsed())&&(Ie=bb(Me,a,we))}var Ze=void 0;if(b){var Be=a.getValueAndResolveTokens("icon-image",we,r,z);Ze=Be instanceof ii?Be:ii.fromString(Be)}if(Ie||Ze){var lt=this.sortFeaturesByKey?S.evaluate(we,{},r):void 0;if(this.features.push({id:oe,text:Ie,icon:Ze,index:se,sourceLayerIndex:ue,geometry:we.geometry,properties:te.properties,type:qb[te.type],sortKey:lt}),Ze&&(T[Ze.name]=!0),Ie){var Ye=c.evaluate(we,{},r).join(","),Ne=u.get("text-rotation-alignment")==="map"&&u.get("symbol-placement")!=="point";this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(Li.vertical)>=0;for(var ct=0,it=Ie.sections;ct<it.length;ct+=1){var xt=it[ct];if(xt.image)T[xt.image.name]=!0;else{var We=Rl(Ie.toString()),Et=xt.fontStack||Ye,Jt=C[Et]=C[Et]||{};this.calculateGlyphDependencies(xt.text,Jt,Ne,this.allowVerticalPlacement,We)}}}}}}u.get("symbol-placement")==="line"&&(this.features=function(nr){var rr={},Yt={},or=[],Ir=0;function Ar(Zt){or.push(nr[Zt]),Ir++}function Kr(Zt,yr,Nr){var Pt=Yt[Zt];return delete Yt[Zt],Yt[yr]=Pt,or[Pt].geometry[0].pop(),or[Pt].geometry[0]=or[Pt].geometry[0].concat(Nr[0]),Pt}function Br(Zt,yr,Nr){var Pt=rr[yr];return delete rr[yr],rr[Zt]=Pt,or[Pt].geometry[0].shift(),or[Pt].geometry[0]=Nr[0].concat(or[Pt].geometry[0]),Pt}function Jr(Zt,yr,Nr){var Pt=Nr?yr[0][yr[0].length-1]:yr[0][0];return Zt+":"+Pt.x+":"+Pt.y}for(var cr=0;cr<nr.length;cr++){var Dr=nr[cr],dt=Dr.geometry,$t=Dr.text?Dr.text.toString():null;if($t){var Lt=Jr($t,dt),St=Jr($t,dt,!0);if(Lt in Yt&&St in rr&&Yt[Lt]!==rr[St]){var si=Br(Lt,St,dt),Ur=Kr(Lt,St,or[si].geometry);delete rr[Lt],delete Yt[St],Yt[Jr($t,or[Ur].geometry,!0)]=Ur,or[si].geometry=null}else Lt in Yt?Kr(Lt,St,dt):St in rr?Br(Lt,St,dt):(Ar(cr),rr[Lt]=Ir-1,Yt[St]=Ir-1)}else Ar(cr)}return or.filter(function(Zt){return Zt.geometry})}(this.features)),this.sortFeaturesByKey&&this.features.sort(function(nr,rr){return nr.sortKey-rr.sortKey})}},Ot.prototype.update=function(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,r),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,r))},Ot.prototype.isEmpty=function(){return this.symbolInstances.length===0&&!this.hasRTLText},Ot.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Ot.prototype.upload=function(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},Ot.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},Ot.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},Ot.prototype.addToLineVertexArray=function(e,t){var r=this.lineVertexArray.length;if(e.segment!==void 0){for(var a=e.dist(t[e.segment+1]),u=e.dist(t[e.segment]),c={},f=e.segment+1;f<t.length;f++)c[f]={x:t[f].x,y:t[f].y,tileUnitDistanceFromAnchor:a},f<t.length-1&&(a+=t[f+1].dist(t[f]));for(var v=e.segment||0;v>=0;v--)c[v]={x:t[v].x,y:t[v].y,tileUnitDistanceFromAnchor:u},v>0&&(u+=t[v-1].dist(t[v]));for(var x=0;x<t.length;x++){var b=c[x];this.lineVertexArray.emplaceBack(b.x,b.y,b.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},Ot.prototype.addSymbols=function(e,t,r,a,u,c,f,v,x,b,S,T){for(var C=e.indexArray,z=e.layoutVertexArray,N=e.segments.prepareSegment(4*t.length,z,C,this.canOverlap?c.sortKey:void 0),$=this.glyphOffsetArray.length,J=N.vertexLength,H=this.allowVerticalPlacement&&f===Li.vertical?Math.PI/2:0,te=c.text&&c.text.sections,oe=0;oe<t.length;oe++){var se=t[oe],ue=se.tl,ye=se.tr,we=se.bl,Ie=se.br,$e=se.tex,Me=se.pixelOffsetTL,Ze=se.pixelOffsetBR,Be=se.minFontScaleX,lt=se.minFontScaleY,Ye=se.glyphOffset,Ne=se.isSDF,ct=se.sectionIndex,it=N.vertexLength,xt=Ye[1];Sc(z,v.x,v.y,ue.x,xt+ue.y,$e.x,$e.y,r,Ne,Me.x,Me.y,Be,lt),Sc(z,v.x,v.y,ye.x,xt+ye.y,$e.x+$e.w,$e.y,r,Ne,Ze.x,Me.y,Be,lt),Sc(z,v.x,v.y,we.x,xt+we.y,$e.x,$e.y+$e.h,r,Ne,Me.x,Ze.y,Be,lt),Sc(z,v.x,v.y,Ie.x,xt+Ie.y,$e.x+$e.w,$e.y+$e.h,r,Ne,Ze.x,Ze.y,Be,lt),lh(e.dynamicLayoutVertexArray,v,H),C.emplaceBack(it,it+1,it+2),C.emplaceBack(it+1,it+2,it+3),N.vertexLength+=4,N.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Ye[0]),oe!==t.length-1&&ct===t[oe+1].sectionIndex||e.programConfigurations.populatePaintArrays(z.length,c,c.index,{},T,te&&te[ct])}e.placedSymbolArray.emplaceBack(v.x,v.y,$,this.glyphOffsetArray.length-$,J,x,b,v.segment,r?r[0]:0,r?r[1]:0,a[0],a[1],f,0,!1,0,S)},Ot.prototype._addCollisionDebugVertex=function(e,t,r,a,u,c){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,a,u,Math.round(c.x),Math.round(c.y))},Ot.prototype.addCollisionDebugVertices=function(e,t,r,a,u,c,f){var v=u.segments.prepareSegment(4,u.layoutVertexArray,u.indexArray),x=v.vertexLength,b=u.layoutVertexArray,S=u.collisionVertexArray,T=f.anchorX,C=f.anchorY;this._addCollisionDebugVertex(b,S,c,T,C,new pe(e,t)),this._addCollisionDebugVertex(b,S,c,T,C,new pe(r,t)),this._addCollisionDebugVertex(b,S,c,T,C,new pe(r,a)),this._addCollisionDebugVertex(b,S,c,T,C,new pe(e,a)),v.vertexLength+=4;var z=u.indexArray;z.emplaceBack(x,x+1),z.emplaceBack(x+1,x+2),z.emplaceBack(x+2,x+3),z.emplaceBack(x+3,x),v.primitiveLength+=4},Ot.prototype.addDebugCollisionBoxes=function(e,t,r,a){for(var u=e;u<t;u++){var c=this.collisionBoxArray.get(u);this.addCollisionDebugVertices(c.x1,c.y1,c.x2,c.y2,a?this.textCollisionBox:this.iconCollisionBox,c.anchorPoint,r)}},Ot.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new tu(Jo,sm.members,Fa),this.iconCollisionBox=new tu(Jo,sm.members,Fa);for(var e=0;e<this.symbolInstances.length;e++){var t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}},Ot.prototype._deserializeCollisionBoxesForSymbol=function(e,t,r,a,u,c,f,v,x){for(var b={},S=t;S<r;S++){var T=e.get(S);b.textBox={x1:T.x1,y1:T.y1,x2:T.x2,y2:T.y2,anchorPointX:T.anchorPointX,anchorPointY:T.anchorPointY},b.textFeatureIndex=T.featureIndex;break}for(var C=a;C<u;C++){var z=e.get(C);b.verticalTextBox={x1:z.x1,y1:z.y1,x2:z.x2,y2:z.y2,anchorPointX:z.anchorPointX,anchorPointY:z.anchorPointY},b.verticalTextFeatureIndex=z.featureIndex;break}for(var N=c;N<f;N++){var $=e.get(N);b.iconBox={x1:$.x1,y1:$.y1,x2:$.x2,y2:$.y2,anchorPointX:$.anchorPointX,anchorPointY:$.anchorPointY},b.iconFeatureIndex=$.featureIndex;break}for(var J=v;J<x;J++){var H=e.get(J);b.verticalIconBox={x1:H.x1,y1:H.y1,x2:H.x2,y2:H.y2,anchorPointX:H.anchorPointX,anchorPointY:H.anchorPointY},b.verticalIconFeatureIndex=H.featureIndex;break}return b},Ot.prototype.deserializeCollisionBoxes=function(e){this.collisionArrays=[];for(var t=0;t<this.symbolInstances.length;t++){var r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},Ot.prototype.hasTextData=function(){return this.text.segments.get().length>0},Ot.prototype.hasIconData=function(){return this.icon.segments.get().length>0},Ot.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Ot.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0},Ot.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0},Ot.prototype.addIndicesForPlacedSymbol=function(e,t){for(var r=e.placedSymbolArray.get(t),a=r.vertexStartIndex+4*r.numGlyphs,u=r.vertexStartIndex;u<a;u+=4)e.indexArray.emplaceBack(u,u+1,u+2),e.indexArray.emplaceBack(u+1,u+2,u+3)},Ot.prototype.getSortedSymbolIndexes=function(e){if(this.sortedAngle===e&&this.symbolInstanceIndexes!==void 0)return this.symbolInstanceIndexes;for(var t=Math.sin(e),r=Math.cos(e),a=[],u=[],c=[],f=0;f<this.symbolInstances.length;++f){c.push(f);var v=this.symbolInstances.get(f);a.push(0|Math.round(t*v.anchorX+r*v.anchorY)),u.push(v.featureIndex)}return c.sort(function(x,b){return a[x]-a[b]||u[b]-u[x]}),c},Ot.prototype.addToSortKeyRanges=function(e,t){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})},Ot.prototype.sortFeatures=function(e){var t=this;if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,a=this.symbolInstanceIndexes;r<a.length;r+=1){var u=this.symbolInstances.get(a[r]);this.featureSortOrder.push(u.featureIndex),[u.rightJustifiedTextSymbolIndex,u.centerJustifiedTextSymbolIndex,u.leftJustifiedTextSymbolIndex].forEach(function(c,f,v){c>=0&&v.indexOf(c)===f&&t.addIndicesForPlacedSymbol(t.text,c)}),u.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,u.verticalPlacedTextSymbolIndex),u.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,u.placedIconSymbolIndex),u.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,u.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Oe("SymbolBucket",Ot,{omit:["layers","collisionBoxArray","features","compareText"]}),Ot.MAX_GLYPHS=65535,Ot.addDynamicAttributes=lh;var Zb=new Or({"symbol-placement":new je(D.layout_symbol["symbol-placement"]),"symbol-spacing":new je(D.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new je(D.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new Ue(D.layout_symbol["symbol-sort-key"]),"symbol-z-order":new je(D.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new je(D.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new je(D.layout_symbol["icon-ignore-placement"]),"icon-optional":new je(D.layout_symbol["icon-optional"]),"icon-rotation-alignment":new je(D.layout_symbol["icon-rotation-alignment"]),"icon-size":new Ue(D.layout_symbol["icon-size"]),"icon-text-fit":new je(D.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new je(D.layout_symbol["icon-text-fit-padding"]),"icon-image":new Ue(D.layout_symbol["icon-image"]),"icon-rotate":new Ue(D.layout_symbol["icon-rotate"]),"icon-padding":new je(D.layout_symbol["icon-padding"]),"icon-keep-upright":new je(D.layout_symbol["icon-keep-upright"]),"icon-offset":new Ue(D.layout_symbol["icon-offset"]),"icon-anchor":new Ue(D.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new je(D.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new je(D.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new je(D.layout_symbol["text-rotation-alignment"]),"text-field":new Ue(D.layout_symbol["text-field"]),"text-font":new Ue(D.layout_symbol["text-font"]),"text-size":new Ue(D.layout_symbol["text-size"]),"text-max-width":new Ue(D.layout_symbol["text-max-width"]),"text-line-height":new je(D.layout_symbol["text-line-height"]),"text-letter-spacing":new Ue(D.layout_symbol["text-letter-spacing"]),"text-justify":new Ue(D.layout_symbol["text-justify"]),"text-radial-offset":new Ue(D.layout_symbol["text-radial-offset"]),"text-variable-anchor":new je(D.layout_symbol["text-variable-anchor"]),"text-anchor":new Ue(D.layout_symbol["text-anchor"]),"text-max-angle":new je(D.layout_symbol["text-max-angle"]),"text-writing-mode":new je(D.layout_symbol["text-writing-mode"]),"text-rotate":new Ue(D.layout_symbol["text-rotate"]),"text-padding":new je(D.layout_symbol["text-padding"]),"text-keep-upright":new je(D.layout_symbol["text-keep-upright"]),"text-transform":new Ue(D.layout_symbol["text-transform"]),"text-offset":new Ue(D.layout_symbol["text-offset"]),"text-allow-overlap":new je(D.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new je(D.layout_symbol["text-ignore-placement"]),"text-optional":new je(D.layout_symbol["text-optional"])}),uh={paint:new Or({"icon-opacity":new Ue(D.paint_symbol["icon-opacity"]),"icon-color":new Ue(D.paint_symbol["icon-color"]),"icon-halo-color":new Ue(D.paint_symbol["icon-halo-color"]),"icon-halo-width":new Ue(D.paint_symbol["icon-halo-width"]),"icon-halo-blur":new Ue(D.paint_symbol["icon-halo-blur"]),"icon-translate":new je(D.paint_symbol["icon-translate"]),"icon-translate-anchor":new je(D.paint_symbol["icon-translate-anchor"]),"text-opacity":new Ue(D.paint_symbol["text-opacity"]),"text-color":new Ue(D.paint_symbol["text-color"],{runtimeType:Ce,getOverride:function(e){return e.textColor},hasOverride:function(e){return!!e.textColor}}),"text-halo-color":new Ue(D.paint_symbol["text-halo-color"]),"text-halo-width":new Ue(D.paint_symbol["text-halo-width"]),"text-halo-blur":new Ue(D.paint_symbol["text-halo-blur"]),"text-translate":new je(D.paint_symbol["text-translate"]),"text-translate-anchor":new je(D.paint_symbol["text-translate-anchor"])}),layout:Zb},$s=function(e){this.type=e.property.overrides?e.property.overrides.runtimeType:Fe,this.defaultValue=e};$s.prototype.evaluate=function(e){if(e.formattedSection){var t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default},$s.prototype.eachChild=function(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)},$s.prototype.outputDefined=function(){return!1},$s.prototype.serialize=function(){return null},Oe("FormatSectionOverride",$s,{omit:["defaultValue"]});var Wb=function(e){function t(r){e.call(this,r,uh)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.recalculate=function(r,a){if(e.prototype.recalculate.call(this,r,a),this.layout.get("icon-rotation-alignment")==="auto"&&(this.layout._values["icon-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-rotation-alignment")==="auto"&&(this.layout._values["text-rotation-alignment"]=this.layout.get("symbol-placement")!=="point"?"map":"viewport"),this.layout.get("text-pitch-alignment")==="auto"&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),this.layout.get("icon-pitch-alignment")==="auto"&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),this.layout.get("symbol-placement")==="point"){var u=this.layout.get("text-writing-mode");if(u){for(var c=[],f=0,v=u;f<v.length;f+=1){var x=v[f];c.indexOf(x)<0&&c.push(x)}this.layout._values["text-writing-mode"]=c}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()},t.prototype.getValueAndResolveTokens=function(r,a,u,c){var f=this.layout.get(r).evaluate(a,{},u,c),v=this._unevaluatedLayout._values[r];return v.isDataDriven()||Ia(v.value)||!f?f:function(x,b){return b.replace(/{([^{}]+)}/g,function(S,T){return T in x?String(x[T]):""})}(a.properties,f)},t.prototype.createBucket=function(r){return new Ot(r)},t.prototype.queryRadius=function(){return 0},t.prototype.queryIntersectsFeature=function(){return!1},t.prototype._setPaintOverrides=function(){for(var r=0,a=uh.paint.overridableProperties;r<a.length;r+=1){var u=a[r];if(t.hasPaintOverride(this.layout,u)){var c,f=this.paint.get(u),v=new $s(f),x=new jo(v,f.property.specification);c=f.value.kind==="constant"||f.value.kind==="source"?new Aa("source",x):new Go("composite",x,f.value.zoomStops,f.value._interpolationType),this.paint._values[u]=new Zr(f.property,c,f.parameters)}}},t.prototype._handleOverridablePaintPropertyUpdate=function(r,a,u){return!(!this.layout||a.isDataDriven()||u.isDataDriven())&&t.hasPaintOverride(this.layout,r)},t.hasPaintOverride=function(r,a){var u=r.get("text-field"),c=uh.paint.properties[a],f=!1,v=function(S){for(var T=0,C=S;T<C.length;T+=1)if(c.overrides&&c.overrides.hasOverride(C[T]))return void(f=!0)};if(u.value.kind==="constant"&&u.value.value instanceof Pr)v(u.value.value.sections);else if(u.value.kind==="source"){var x=function(S){f||(S instanceof jr&&lr(S.value)===Ut?v(S.value.sections):S instanceof $i?v(S.sections):S.eachChild(x))},b=u.value;b._styleExpression&&x(b._styleExpression.expression)}return f},t}(en),Hb={paint:new Or({"background-color":new je(D.paint_background["background-color"]),"background-pattern":new Wr(D.paint_background["background-pattern"]),"background-opacity":new je(D.paint_background["background-opacity"])})},Xb=function(e){function t(r){e.call(this,r,Hb)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(en),Kb={paint:new Or({"raster-opacity":new je(D.paint_raster["raster-opacity"]),"raster-hue-rotate":new je(D.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new je(D.paint_raster["raster-brightness-min"]),"raster-brightness-max":new je(D.paint_raster["raster-brightness-max"]),"raster-saturation":new je(D.paint_raster["raster-saturation"]),"raster-contrast":new je(D.paint_raster["raster-contrast"]),"raster-resampling":new je(D.paint_raster["raster-resampling"]),"raster-fade-duration":new je(D.paint_raster["raster-fade-duration"])})},Jb=function(e){function t(r){e.call(this,r,Kb)}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t}(en),Yb=function(e){function t(r){e.call(this,r,{}),this.implementation=r}return e&&(t.__proto__=e),(t.prototype=Object.create(e&&e.prototype)).constructor=t,t.prototype.is3D=function(){return this.implementation.renderingMode==="3d"},t.prototype.hasOffscreenPass=function(){return this.implementation.prerender!==void 0},t.prototype.recalculate=function(){},t.prototype.updateTransitions=function(){},t.prototype.hasTransition=function(){},t.prototype.serialize=function(){},t.prototype.onAdd=function(r){this.implementation.onAdd&&this.implementation.onAdd(r,r.painter.context.gl)},t.prototype.onRemove=function(r){this.implementation.onRemove&&this.implementation.onRemove(r,r.painter.context.gl)},t}(en),Qb={circle:Wp,heatmap:Rx,hillshade:Ox,fill:tb,"fill-extrusion":cb,line:yb,symbol:Wb,background:Xb,raster:Jb},km=ae.HTMLImageElement,Mm=ae.HTMLCanvasElement,zm=ae.HTMLVideoElement,Bm=ae.ImageData,Tc=ae.ImageBitmap,qa=function(e,t,r,a){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(t,a)};qa.prototype.update=function(e,t,r){var a=e.width,u=e.height,c=!(this.size&&this.size[0]===a&&this.size[1]===u||r),f=this.context,v=f.gl;if(this.useMipmap=!!(t&&t.useMipmap),v.bindTexture(v.TEXTURE_2D,this.texture),f.pixelStoreUnpackFlipY.set(!1),f.pixelStoreUnpack.set(1),f.pixelStoreUnpackPremultiplyAlpha.set(this.format===v.RGBA&&(!t||t.premultiply!==!1)),c)this.size=[a,u],e instanceof km||e instanceof Mm||e instanceof zm||e instanceof Bm||Tc&&e instanceof Tc?v.texImage2D(v.TEXTURE_2D,0,this.format,this.format,v.UNSIGNED_BYTE,e):v.texImage2D(v.TEXTURE_2D,0,this.format,a,u,0,this.format,v.UNSIGNED_BYTE,e.data);else{var x=r||{x:0,y:0},b=x.x,S=x.y;e instanceof km||e instanceof Mm||e instanceof zm||e instanceof Bm||Tc&&e instanceof Tc?v.texSubImage2D(v.TEXTURE_2D,0,b,S,v.RGBA,v.UNSIGNED_BYTE,e):v.texSubImage2D(v.TEXTURE_2D,0,b,S,a,u,v.RGBA,v.UNSIGNED_BYTE,e.data)}this.useMipmap&&this.isSizePowerOfTwo()&&v.generateMipmap(v.TEXTURE_2D)},qa.prototype.bind=function(e,t,r){var a=this.context.gl;a.bindTexture(a.TEXTURE_2D,this.texture),r!==a.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=a.LINEAR),e!==this.filter&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MAG_FILTER,e),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_MIN_FILTER,r||e),this.filter=e),t!==this.wrap&&(a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_S,t),a.texParameteri(a.TEXTURE_2D,a.TEXTURE_WRAP_T,t),this.wrap=t)},qa.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},qa.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null};var ch=function(e){var t=this;this._callback=e,this._triggered=!1,typeof MessageChannel<"u"&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){t._triggered=!1,t._callback()})};ch.prototype.trigger=function(){var e=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout(function(){e._triggered=!1,e._callback()},0))},ch.prototype.remove=function(){delete this._channel,this._callback=function(){}};var qs=function(e,t,r){this.target=e,this.parent=t,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},vr(["receive","process"],this),this.invoker=new ch(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=li()?e:ae};function Dm(e,t,r){var a=2*Math.PI*6378137/256/Math.pow(2,r);return[e*a-2*Math.PI*6378137/2,t*a-2*Math.PI*6378137/2]}qs.prototype.send=function(e,t,r,a,u){var c=this;u===void 0&&(u=!1);var f=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[f]=r);var v=ns(this.globalScope)?void 0:[];return this.target.postMessage({id:f,type:e,hasCallback:!!r,targetMapId:a,mustQueue:u,sourceMapId:this.mapId,data:ji(t,v)},v),{cancel:function(){r&&delete c.callbacks[f],c.target.postMessage({id:f,type:"<cancel>",targetMapId:a,sourceMapId:c.mapId})}}},qs.prototype.receive=function(e){var t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if(t.type==="<cancel>"){delete this.tasks[r];var a=this.cancelCallbacks[r];delete this.cancelCallbacks[r],a&&a()}else li()||t.mustQueue?(this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,t)},qs.prototype.process=function(){if(this.taskQueue.length){var e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t&&this.processTask(e,t)}},qs.prototype.processTask=function(e,t){var r=this;if(t.type==="<response>"){var a=this.callbacks[e];delete this.callbacks[e],a&&(t.error?a(pi(t.error)):a(null,pi(t.data)))}else{var u=!1,c=ns(this.globalScope)?void 0:[],f=t.hasCallback?function(S,T){u=!0,delete r.cancelCallbacks[e],r.target.postMessage({id:e,type:"<response>",sourceMapId:r.mapId,error:S?ji(S):null,data:ji(T,c)},c)}:function(S){u=!0},v=null,x=pi(t.data);if(this.parent[t.type])v=this.parent[t.type](t.sourceMapId,x,f);else if(this.parent.getWorkerSource){var b=t.type.split(".");v=this.parent.getWorkerSource(t.sourceMapId,b[0],x.source)[b[1]](x,f)}else f(new Error("Could not find function "+t.type));!u&&v&&v.cancel&&(this.cancelCallbacks[e]=v.cancel)}},qs.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)};var br=function(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):e.length===4?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))};br.prototype.setNorthEast=function(e){return this._ne=e instanceof Kt?new Kt(e.lng,e.lat):Kt.convert(e),this},br.prototype.setSouthWest=function(e){return this._sw=e instanceof Kt?new Kt(e.lng,e.lat):Kt.convert(e),this},br.prototype.extend=function(e){var t,r,a=this._sw,u=this._ne;if(e instanceof Kt)t=e,r=e;else{if(!(e instanceof br))return Array.isArray(e)?e.length===4||e.every(Array.isArray)?this.extend(br.convert(e)):this.extend(Kt.convert(e)):this;if(r=e._ne,!(t=e._sw)||!r)return this}return a||u?(a.lng=Math.min(t.lng,a.lng),a.lat=Math.min(t.lat,a.lat),u.lng=Math.max(r.lng,u.lng),u.lat=Math.max(r.lat,u.lat)):(this._sw=new Kt(t.lng,t.lat),this._ne=new Kt(r.lng,r.lat)),this},br.prototype.getCenter=function(){return new Kt((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},br.prototype.getSouthWest=function(){return this._sw},br.prototype.getNorthEast=function(){return this._ne},br.prototype.getNorthWest=function(){return new Kt(this.getWest(),this.getNorth())},br.prototype.getSouthEast=function(){return new Kt(this.getEast(),this.getSouth())},br.prototype.getWest=function(){return this._sw.lng},br.prototype.getSouth=function(){return this._sw.lat},br.prototype.getEast=function(){return this._ne.lng},br.prototype.getNorth=function(){return this._ne.lat},br.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},br.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},br.prototype.isEmpty=function(){return!(this._sw&&this._ne)},br.prototype.contains=function(e){var t=Kt.convert(e),r=t.lng,a=t.lat,u=this._sw.lng<=r&&r<=this._ne.lng;return this._sw.lng>this._ne.lng&&(u=this._sw.lng>=r&&r>=this._ne.lng),this._sw.lat<=a&&a<=this._ne.lat&&u},br.convert=function(e){return!e||e instanceof br?e:new br(e)};var Kt=function(e,t){if(isNaN(e)||isNaN(t))throw new Error("Invalid LngLat object: ("+e+", "+t+")");if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};Kt.prototype.wrap=function(){return new Kt(pt(this.lng,-180,180),this.lat)},Kt.prototype.toArray=function(){return[this.lng,this.lat]},Kt.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},Kt.prototype.distanceTo=function(e){var t=Math.PI/180,r=this.lat*t,a=e.lat*t,u=Math.sin(r)*Math.sin(a)+Math.cos(r)*Math.cos(a)*Math.cos((e.lng-this.lng)*t);return 63710088e-1*Math.acos(Math.min(u,1))},Kt.prototype.toBounds=function(e){e===void 0&&(e=0);var t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new br(new Kt(this.lng-r,this.lat-t),new Kt(this.lng+r,this.lat+t))},Kt.convert=function(e){if(e instanceof Kt)return e;if(Array.isArray(e)&&(e.length===2||e.length===3))return new Kt(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&typeof e=="object"&&e!==null)return new Kt(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")};var Lm=2*Math.PI*63710088e-1;function Rm(e){return Lm*Math.cos(e*Math.PI/180)}function Fm(e){return(180+e)/360}function Om(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function Vm(e,t){return e/Rm(t)}function ph(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}var ja=function(e,t,r){r===void 0&&(r=0),this.x=+e,this.y=+t,this.z=+r};ja.fromLngLat=function(e,t){t===void 0&&(t=0);var r=Kt.convert(e);return new ja(Fm(r.lng),Om(r.lat),Vm(t,r.lat))},ja.prototype.toLngLat=function(){return new Kt(360*this.x-180,ph(this.y))},ja.prototype.toAltitude=function(){return this.z*Rm(ph(this.y))},ja.prototype.meterInMercatorCoordinateUnits=function(){return 1/Lm*(e=ph(this.y),1/Math.cos(e*Math.PI/180));var e};var Ga=function(e,t,r){this.z=e,this.x=t,this.y=r,this.key=ru(0,e,e,t,r)};Ga.prototype.equals=function(e){return this.z===e.z&&this.x===e.x&&this.y===e.y},Ga.prototype.url=function(e,t){var r,a,u,c,f,v=(a=this.y,u=this.z,c=Dm(256*(r=this.x),256*(a=Math.pow(2,u)-a-1),u),f=Dm(256*(r+1),256*(a+1),u),c[0]+","+c[1]+","+f[0]+","+f[1]),x=function(b,S,T){for(var C,z="",N=b;N>0;N--)z+=(S&(C=1<<N-1)?1:0)+(T&C?2:0);return z}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace("{prefix}",(this.x%16).toString(16)+(this.y%16).toString(16)).replace("{z}",String(this.z)).replace("{x}",String(this.x)).replace("{y}",String(t==="tms"?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",x).replace("{bbox-epsg-3857}",v)},Ga.prototype.getTilePoint=function(e){var t=Math.pow(2,this.z);return new pe(8192*(e.x*t-this.x),8192*(e.y*t-this.y))},Ga.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y};var Um=function(e,t){this.wrap=e,this.canonical=t,this.key=ru(e,t.z,t.z,t.x,t.y)},wr=function(e,t,r,a,u){this.overscaledZ=e,this.wrap=t,this.canonical=new Ga(r,+a,+u),this.key=ru(t,e,r,a,u)};function ru(e,t,r,a,u){(e*=2)<0&&(e=-1*e-1);var c=1<<r;return(c*c*e+c*u+a).toString(36)+r.toString(36)+t.toString(36)}wr.prototype.equals=function(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)},wr.prototype.scaledTo=function(e){var t=this.canonical.z-e;return e>this.canonical.z?new wr(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new wr(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)},wr.prototype.calculateScaledKey=function(e,t){var r=this.canonical.z-e;return e>this.canonical.z?ru(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):ru(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)},wr.prototype.isChildOf=function(e){if(e.wrap!==this.wrap)return!1;var t=this.canonical.z-e.canonical.z;return e.overscaledZ===0||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t},wr.prototype.children=function(e){if(this.overscaledZ>=e)return[new wr(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var t=this.canonical.z+1,r=2*this.canonical.x,a=2*this.canonical.y;return[new wr(t,this.wrap,t,r,a),new wr(t,this.wrap,t,r+1,a),new wr(t,this.wrap,t,r,a+1),new wr(t,this.wrap,t,r+1,a+1)]},wr.prototype.isLessThan=function(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))},wr.prototype.wrapped=function(){return new wr(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},wr.prototype.unwrapTo=function(e){return new wr(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)},wr.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},wr.prototype.toUnwrapped=function(){return new Um(this.wrap,this.canonical)},wr.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},wr.prototype.getTilePoint=function(e){return this.canonical.getTilePoint(new ja(e.x-this.wrap,e.y))},Oe("CanonicalTileID",Ga),Oe("OverscaledTileID",wr,{omit:["posMatrix"]});var wo=function(e,t,r){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&r!=="mapbox"&&r!=="terrarium")return It('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=t.height;var a=this.dim=t.height-2;this.data=new Uint32Array(t.data.buffer),this.encoding=r||"mapbox";for(var u=0;u<a;u++)this.data[this._idx(-1,u)]=this.data[this._idx(0,u)],this.data[this._idx(a,u)]=this.data[this._idx(a-1,u)],this.data[this._idx(u,-1)]=this.data[this._idx(u,0)],this.data[this._idx(u,a)]=this.data[this._idx(u,a-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(a,-1)]=this.data[this._idx(a-1,0)],this.data[this._idx(-1,a)]=this.data[this._idx(0,a-1)],this.data[this._idx(a,a)]=this.data[this._idx(a-1,a-1)]};wo.prototype.get=function(e,t){var r=new Uint8Array(this.data.buffer),a=4*this._idx(e,t);return(this.encoding==="terrarium"?this._unpackTerrarium:this._unpackMapbox)(r[a],r[a+1],r[a+2])},wo.prototype.getUnpackVector=function(){return this.encoding==="terrarium"?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},wo.prototype._idx=function(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)},wo.prototype._unpackMapbox=function(e,t,r){return(256*e*256+256*t+r)/10-1e4},wo.prototype._unpackTerrarium=function(e,t,r){return 256*e+t+r/256-32768},wo.prototype.getPixels=function(){return new yi({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},wo.prototype.backfillBorder=function(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");var a=t*this.dim,u=t*this.dim+this.dim,c=r*this.dim,f=r*this.dim+this.dim;switch(t){case-1:a=u-1;break;case 1:u=a+1}switch(r){case-1:c=f-1;break;case 1:f=c+1}for(var v=-t*this.dim,x=-r*this.dim,b=c;b<f;b++)for(var S=a;S<u;S++)this.data[this._idx(S,b)]=e.data[this._idx(S+v,b+x)]},Oe("DEMData",wo);var Ic=function(e){this._stringToNumber={},this._numberToString=[];for(var t=0;t<e.length;t++){var r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}};Ic.prototype.encode=function(e){return this._stringToNumber[e]},Ic.prototype.decode=function(e){return this._numberToString[e]};var Ac=function(e,t,r,a,u){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=r,e._y=a,this.properties=e.properties,this.id=u},hh={geometry:{configurable:!0}};hh.geometry.get=function(){return this._geometry===void 0&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},hh.geometry.set=function(e){this._geometry=e},Ac.prototype.toJSON=function(){var e={geometry:this.geometry};for(var t in this)t!=="_geometry"&&t!=="_vectorTileFeature"&&(e[t]=this[t]);return e},Object.defineProperties(Ac.prototype,hh);var js=function(){this.state={},this.stateChanges={},this.deletedStates={}};js.prototype.updateState=function(e,t,r){var a=String(t);if(this.stateChanges[e]=this.stateChanges[e]||{},this.stateChanges[e][a]=this.stateChanges[e][a]||{},ot(this.stateChanges[e][a],r),this.deletedStates[e]===null)for(var u in this.deletedStates[e]={},this.state[e])u!==a&&(this.deletedStates[e][u]=null);else if(this.deletedStates[e]&&this.deletedStates[e][a]===null)for(var c in this.deletedStates[e][a]={},this.state[e][a])r[c]||(this.deletedStates[e][a][c]=null);else for(var f in r)this.deletedStates[e]&&this.deletedStates[e][a]&&this.deletedStates[e][a][f]===null&&delete this.deletedStates[e][a][f]},js.prototype.removeFeatureState=function(e,t,r){if(this.deletedStates[e]!==null){var a=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&t!==void 0)this.deletedStates[e][a]!==null&&(this.deletedStates[e][a]=this.deletedStates[e][a]||{},this.deletedStates[e][a][r]=null);else if(t!==void 0)if(this.stateChanges[e]&&this.stateChanges[e][a])for(r in this.deletedStates[e][a]={},this.stateChanges[e][a])this.deletedStates[e][a][r]=null;else this.deletedStates[e][a]=null;else this.deletedStates[e]=null}},js.prototype.getState=function(e,t){var r=String(t),a=ot({},(this.state[e]||{})[r],(this.stateChanges[e]||{})[r]);if(this.deletedStates[e]===null)return{};if(this.deletedStates[e]){var u=this.deletedStates[e][t];if(u===null)return{};for(var c in u)delete a[c]}return a},js.prototype.initializeTileState=function(e,t){e.setFeatureState(this.state,t)},js.prototype.coalesceChanges=function(e,t){var r={};for(var a in this.stateChanges){this.state[a]=this.state[a]||{};var u={};for(var c in this.stateChanges[a])this.state[a][c]||(this.state[a][c]={}),ot(this.state[a][c],this.stateChanges[a][c]),u[c]=this.state[a][c];r[a]=u}for(var f in this.deletedStates){this.state[f]=this.state[f]||{};var v={};if(this.deletedStates[f]===null)for(var x in this.state[f])v[x]={},this.state[f][x]={};else for(var b in this.deletedStates[f]){if(this.deletedStates[f][b]===null)this.state[f][b]={};else for(var S=0,T=Object.keys(this.deletedStates[f][b]);S<T.length;S+=1)delete this.state[f][b][T[S]];v[b]=this.state[f][b]}r[f]=r[f]||{},ot(r[f],v)}if(this.stateChanges={},this.deletedStates={},Object.keys(r).length!==0)for(var C in e)e[C].setFeatureState(r,t)};var So=function(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new hn(8192,16,0),this.grid3D=new hn(8192,16,0),this.featureIndexArray=new A,this.promoteId=t};function Nm(e,t,r,a,u){return er(e,function(c,f){var v=t instanceof La?t.get(f):null;return v&&v.evaluate?v.evaluate(r,a,u):v})}function $m(e){for(var t=1/0,r=1/0,a=-1/0,u=-1/0,c=0,f=e;c<f.length;c+=1){var v=f[c];t=Math.min(t,v.x),r=Math.min(r,v.y),a=Math.max(a,v.x),u=Math.max(u,v.y)}return{minX:t,minY:r,maxX:a,maxY:u}}function e0(e,t){return t-e}So.prototype.insert=function(e,t,r,a,u,c){var f=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,a,u);for(var v=c?this.grid3D:this.grid,x=0;x<t.length;x++){for(var b=t[x],S=[1/0,1/0,-1/0,-1/0],T=0;T<b.length;T++){var C=b[T];S[0]=Math.min(S[0],C.x),S[1]=Math.min(S[1],C.y),S[2]=Math.max(S[2],C.x),S[3]=Math.max(S[3],C.y)}S[0]<8192&&S[1]<8192&&S[2]>=0&&S[3]>=0&&v.insert(f,S[0],S[1],S[2],S[3])}},So.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new Ds.VectorTile(new dc(this.rawTileData)).layers,this.sourceLayerCoder=new Ic(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},So.prototype.query=function(e,t,r,a){var u=this;this.loadVTLayers();for(var c=e.params||{},f=8192/e.tileSize/e.scale,v=vs(c.filter),x=e.queryGeometry,b=e.queryPadding*f,S=$m(x),T=this.grid.query(S.minX-b,S.minY-b,S.maxX+b,S.maxY+b),C=$m(e.cameraQueryGeometry),z=this.grid3D.query(C.minX-b,C.minY-b,C.maxX+b,C.maxY+b,function(se,ue,ye,we){return function(Ie,$e,Me,Ze,Be){for(var lt=0,Ye=Ie;lt<Ye.length;lt+=1){var Ne=Ye[lt];if($e<=Ne.x&&Me<=Ne.y&&Ze>=Ne.x&&Be>=Ne.y)return!0}var ct=[new pe($e,Me),new pe($e,Be),new pe(Ze,Be),new pe(Ze,Me)];if(Ie.length>2){for(var it=0,xt=ct;it<xt.length;it+=1)if(rn(Ie,xt[it]))return!0}for(var We=0;We<Ie.length-1;We++)if(Ua(Ie[We],Ie[We+1],ct))return!0;return!1}(e.cameraQueryGeometry,se-b,ue-b,ye+b,we+b)}),N=0,$=z;N<$.length;N+=1)T.push($[N]);T.sort(e0);for(var J,H={},te=function(se){var ue=T[se];if(ue!==J){J=ue;var ye=u.featureIndexArray.get(ue),we=null;u.loadMatchingFeature(H,ye.bucketIndex,ye.sourceLayerIndex,ye.featureIndex,v,c.layers,c.availableImages,t,r,a,function(Ie,$e,Me){return we||(we=tr(Ie)),$e.queryIntersectsFeature(x,Ie,Me,we,u.z,e.transform,f,e.pixelPosMatrix)})}},oe=0;oe<T.length;oe++)te(oe);return H},So.prototype.loadMatchingFeature=function(e,t,r,a,u,c,f,v,x,b,S){var T=this.bucketLayerIDs[t];if(!c||function(Ie,$e){for(var Me=0;Me<Ie.length;Me++)if($e.indexOf(Ie[Me])>=0)return!0;return!1}(c,T)){var C=this.sourceLayerCoder.decode(r),z=this.vtLayers[C].feature(a);if(u.needGeometry){var N=ur(z,!0);if(!u.filter(new ft(this.tileID.overscaledZ),N,this.tileID.canonical))return}else if(!u.filter(new ft(this.tileID.overscaledZ),z))return;for(var $=this.getId(z,C),J=0;J<T.length;J++){var H=T[J];if(!(c&&c.indexOf(H)<0)){var te=v[H];if(te){var oe={};$!==void 0&&b&&(oe=b.getState(te.sourceLayer||"_geojsonTileLayer",$));var se=ot({},x[H]);se.paint=Nm(se.paint,te.paint,z,oe,f),se.layout=Nm(se.layout,te.layout,z,oe,f);var ue=!S||S(z,te,oe);if(ue){var ye=new Ac(z,this.z,this.x,this.y,$);ye.layer=se;var we=e[H];we===void 0&&(we=e[H]=[]),we.push({featureIndex:a,feature:ye,intersectionZ:ue})}}}}}},So.prototype.lookupSymbolFeatures=function(e,t,r,a,u,c,f,v){var x={};this.loadVTLayers();for(var b=vs(u),S=0,T=e;S<T.length;S+=1)this.loadMatchingFeature(x,r,a,T[S],b,c,f,v,t);return x},So.prototype.hasLayer=function(e){for(var t=0,r=this.bucketLayerIDs;t<r.length;t+=1)for(var a=0,u=r[t];a<u.length;a+=1)if(e===u[a])return!0;return!1},So.prototype.getId=function(e,t){var r=e.id;return this.promoteId&&typeof(r=e.properties[typeof this.promoteId=="string"?this.promoteId:this.promoteId[t]])=="boolean"&&(r=Number(r)),r},Oe("FeatureIndex",So,{omit:["rawTileData","sourceLayerCoder"]});var zr=function(e,t){this.tileID=e,this.uid=bt(),this.uses=0,this.tileSize=t,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"};zr.prototype.registerFadeDuration=function(e){var t=e+this.timeAdded;t<ln.now()||this.fadeEndTime&&t<this.fadeEndTime||(this.fadeEndTime=t)},zr.prototype.wasRequested=function(){return this.state==="errored"||this.state==="loaded"||this.state==="reloading"},zr.prototype.loadVectorData=function(e,t,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",e){for(var a in e.featureIndex&&(this.latestFeatureIndex=e.featureIndex,e.rawTileData?(this.latestRawTileData=e.rawTileData,this.latestFeatureIndex.rawTileData=e.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=e.collisionBoxArray,this.buckets=function(b,S){var T={};if(!S)return T;for(var C=function(){var $=N[z],J=$.layerIds.map(function(oe){return S.getLayer(oe)}).filter(Boolean);if(J.length!==0){$.layers=J,$.stateDependentLayerIds&&($.stateDependentLayers=$.stateDependentLayerIds.map(function(oe){return J.filter(function(se){return se.id===oe})[0]}));for(var H=0,te=J;H<te.length;H+=1)T[te[H].id]=$}},z=0,N=b;z<N.length;z+=1)C();return T}(e.buckets,t.style),this.hasSymbolBuckets=!1,this.buckets){var u=this.buckets[a];if(u instanceof Ot){if(this.hasSymbolBuckets=!0,!r)break;u.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var c in this.buckets){var f=this.buckets[c];if(f instanceof Ot&&f.hasRTLText){this.hasRTLText=!0,xi.isLoading()||xi.isLoaded()||Vl()!=="deferred"||Gi();break}}for(var v in this.queryPadding=0,this.buckets){var x=this.buckets[v];this.queryPadding=Math.max(this.queryPadding,t.style.getLayer(v).queryRadius(x))}e.imageAtlas&&(this.imageAtlas=e.imageAtlas),e.glyphAtlasImage&&(this.glyphAtlasImage=e.glyphAtlasImage)}else this.collisionBoxArray=new o},zr.prototype.unloadVectorData=function(){for(var e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},zr.prototype.getBucket=function(e){return this.buckets[e.id]},zr.prototype.upload=function(e){for(var t in this.buckets){var r=this.buckets[t];r.uploadPending()&&r.upload(e)}var a=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new qa(e,this.imageAtlas.image,a.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new qa(e,this.glyphAtlasImage,a.ALPHA),this.glyphAtlasImage=null)},zr.prototype.prepare=function(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)},zr.prototype.queryRenderedFeatures=function(e,t,r,a,u,c,f,v,x,b){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:a,cameraQueryGeometry:u,scale:c,tileSize:this.tileSize,pixelPosMatrix:b,transform:v,params:f,queryPadding:this.queryPadding*x},e,t,r):{}},zr.prototype.querySourceFeatures=function(e,t){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var a=r.loadVTLayers(),u=t?t.sourceLayer:"",c=a._geojsonTileLayer||a[u];if(c)for(var f=vs(t&&t.filter),v=this.tileID.canonical,x=v.z,b=v.x,S=v.y,T={z:x,x:b,y:S},C=0;C<c.length;C++){var z=c.feature(C);if(f.needGeometry){var N=ur(z,!0);if(!f.filter(new ft(this.tileID.overscaledZ),N,this.tileID.canonical))continue}else if(!f.filter(new ft(this.tileID.overscaledZ),z))continue;var $=r.getId(z,u),J=new Ac(z,x,b,S,$);J.tile=T,e.push(J)}}},zr.prototype.hasData=function(){return this.state==="loaded"||this.state==="reloading"||this.state==="expired"},zr.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},zr.prototype.setExpiryData=function(e){var t=this.expirationTime;if(e.cacheControl){var r=Do(e.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else e.expires&&(this.expirationTime=new Date(e.expires).getTime());if(this.expirationTime){var a=Date.now(),u=!1;if(this.expirationTime>a)u=!1;else if(t)if(this.expirationTime<t)u=!0;else{var c=this.expirationTime-t;c?this.expirationTime=a+Math.max(c,3e4):u=!0}else u=!0;u?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}},zr.prototype.getExpiryTimeout=function(){if(this.expirationTime)return this.expiredRequestCount?1e3*(1<<Math.min(this.expiredRequestCount-1,31)):Math.min(this.expirationTime-new Date().getTime(),Math.pow(2,31)-1)},zr.prototype.setFeatureState=function(e,t){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&Object.keys(e).length!==0){var r=this.latestFeatureIndex.loadVTLayers();for(var a in this.buckets)if(t.style.hasLayer(a)){var u=this.buckets[a],c=u.layers[0].sourceLayer||"_geojsonTileLayer",f=r[c],v=e[c];if(f&&v&&Object.keys(v).length!==0){u.update(v,f,this.imageAtlas&&this.imageAtlas.patternPositions||{});var x=t&&t.style&&t.style.getLayer(a);x&&(this.queryPadding=Math.max(this.queryPadding,x.queryRadius(u)))}}}},zr.prototype.holdingForFade=function(){return this.symbolFadeHoldUntil!==void 0},zr.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<ln.now()},zr.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},zr.prototype.setHoldDuration=function(e){this.symbolFadeHoldUntil=ln.now()+e},zr.prototype.setDependencies=function(e,t){for(var r={},a=0,u=t;a<u.length;a+=1)r[u[a]]=!0;this.dependencies[e]=r},zr.prototype.hasDependency=function(e,t){for(var r=0,a=e;r<a.length;r+=1){var u=this.dependencies[a[r]];if(u){for(var c=0,f=t;c<f.length;c+=1)if(u[f[c]])return!0}}return!1};var ra=ae.performance,qm=function(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},ra.mark(this._marks.start)};qm.prototype.finish=function(){ra.mark(this._marks.end);var e=ra.getEntriesByName(this._marks.measure);return e.length===0&&(ra.measure(this._marks.measure,this._marks.start,this._marks.end),e=ra.getEntriesByName(this._marks.measure),ra.clearMarks(this._marks.start),ra.clearMarks(this._marks.end),ra.clearMeasures(this._marks.measure)),e},l.Actor=qs,l.AlphaImage=$a,l.CanonicalTileID=Ga,l.CollisionBoxArray=o,l.Color=Mt,l.DEMData=wo,l.DataConstantProperty=je,l.DictionaryCoder=Ic,l.EXTENT=8192,l.ErrorEvent=Y,l.EvaluationParameters=ft,l.Event=G,l.Evented=ee,l.FeatureIndex=So,l.FillBucket=yn,l.FillExtrusionBucket=vn,l.ImageAtlas=eu,l.ImagePosition=yc,l.LineBucket=ai,l.LngLat=Kt,l.LngLatBounds=br,l.MercatorCoordinate=ja,l.ONE_EM=24,l.OverscaledTileID=wr,l.Point=pe,l.Point$1=pe,l.Properties=Or,l.Protobuf=dc,l.RGBAImage=yi,l.RequestManager=ti,l.RequestPerformance=qm,l.ResourceType=ls,l.SegmentVector=L,l.SourceFeatureState=js,l.StructArrayLayout1ui2=Gl,l.StructArrayLayout2f1f2i16=go,l.StructArrayLayout2i4=vo,l.StructArrayLayout3ui6=Dn,l.StructArrayLayout4i8=Nl,l.SymbolBucket=Ot,l.Texture=qa,l.Tile=zr,l.Transitionable=Fr,l.Uniform1f=Te,l.Uniform1i=ge,l.Uniform2f=Se,l.Uniform3f=Le,l.Uniform4f=Ge,l.UniformColor=Xe,l.UniformMatrix4f=wt,l.UnwrappedTileID=Um,l.ValidationError=W,l.WritingMode=Li,l.ZoomHistory=Ll,l.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e},l.addDynamicAttributes=lh,l.asyncAll=function(e,t,r){if(!e.length)return r(null,[]);var a=e.length,u=new Array(e.length),c=null;e.forEach(function(f,v){t(f,function(x,b){x&&(c=x),u[v]=b,--a==0&&r(c,u)})})},l.bezier=Ae,l.bindAll=vr,l.browser=ln,l.cacheEntryPossiblyAdded=function(e){++ma>ss&&(e.getActor().send("enforceCacheSizeLimit",Oo),ma=0)},l.clamp=qe,l.clearTileCache=function(e){var t=ae.caches.delete("mapbox-tiles");e&&t.catch(e).then(function(){return e()})},l.clipLine=Tm,l.clone=function(e){var t=new zt(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},l.clone$1=ei,l.clone$2=function(e){var t=new zt(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},l.collisionCircleLayout=xb,l.config=Vt,l.create=function(){var e=new zt(16);return zt!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},l.create$1=function(){var e=new zt(9);return zt!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e},l.create$2=function(){var e=new zt(4);return zt!=Float32Array&&(e[1]=0,e[2]=0),e[0]=1,e[3]=1,e},l.createCommonjsModule=re,l.createExpression=ms,l.createLayout=kr,l.createStyleLayer=function(e){return e.type==="custom"?new Yb(e):new Qb[e.type](e)},l.cross=function(e,t,r){var a=t[0],u=t[1],c=t[2],f=r[0],v=r[1],x=r[2];return e[0]=u*x-c*v,e[1]=c*f-a*x,e[2]=a*v-u*f,e},l.deepEqual=function e(t,r){if(Array.isArray(t)){if(!Array.isArray(r)||t.length!==r.length)return!1;for(var a=0;a<t.length;a++)if(!e(t[a],r[a]))return!1;return!0}if(typeof t=="object"&&t!==null&&r!==null){if(typeof r!="object"||Object.keys(t).length!==Object.keys(r).length)return!1;for(var u in t)if(!e(t[u],r[u]))return!1;return!0}return t===r},l.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},l.dot$1=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},l.ease=Je,l.emitValidationErrors=za,l.endsWith=Er,l.enforceCacheSizeLimit=function(e){Vo(),Ei&&Ei.then(function(t){t.keys().then(function(r){for(var a=0;a<r.length-e;a++)t.delete(r[a])})})},l.evaluateSizeForFeature=gm,l.evaluateSizeForZoom=_m,l.evaluateVariableOffset=Em,l.evented=Ol,l.extend=ot,l.featureFilter=vs,l.filterObject=Qr,l.fromRotation=function(e,t){var r=Math.sin(t),a=Math.cos(t);return e[0]=a,e[1]=r,e[2]=0,e[3]=-r,e[4]=a,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},l.getAnchorAlignment=nh,l.getAnchorJustification=sh,l.getArrayBuffer=va,l.getImage=P,l.getJSON=function(e,t){return Uo(ot(e,{type:"json"}),t)},l.getRTLTextPluginStatus=Vl,l.getReferrer=eo,l.getVideo=function(e,t){var r,a,u=ae.document.createElement("video");u.muted=!0,u.onloadstart=function(){t(null,u)};for(var c=0;c<e.length;c++){var f=ae.document.createElement("source");r=e[c],a=void 0,(a=ae.document.createElement("a")).href=r,(a.protocol!==ae.document.location.protocol||a.host!==ae.document.location.host)&&(u.crossOrigin="Anonymous"),f.src=e[c],u.appendChild(f)}return{cancel:function(){}}},l.identity=bi,l.invert=function(e,t){var r=t[0],a=t[1],u=t[2],c=t[3],f=t[4],v=t[5],x=t[6],b=t[7],S=t[8],T=t[9],C=t[10],z=t[11],N=t[12],$=t[13],J=t[14],H=t[15],te=r*v-a*f,oe=r*x-u*f,se=r*b-c*f,ue=a*x-u*v,ye=a*b-c*v,we=u*b-c*x,Ie=S*$-T*N,$e=S*J-C*N,Me=S*H-z*N,Ze=T*J-C*$,Be=T*H-z*$,lt=C*H-z*J,Ye=te*lt-oe*Be+se*Ze+ue*Me-ye*$e+we*Ie;return Ye?(e[0]=(v*lt-x*Be+b*Ze)*(Ye=1/Ye),e[1]=(u*Be-a*lt-c*Ze)*Ye,e[2]=($*we-J*ye+H*ue)*Ye,e[3]=(C*ye-T*we-z*ue)*Ye,e[4]=(x*Me-f*lt-b*$e)*Ye,e[5]=(r*lt-u*Me+c*$e)*Ye,e[6]=(J*se-N*we-H*oe)*Ye,e[7]=(S*we-C*se+z*oe)*Ye,e[8]=(f*Be-v*Me+b*Ie)*Ye,e[9]=(a*Me-r*Be-c*Ie)*Ye,e[10]=(N*ye-$*se+H*te)*Ye,e[11]=(T*se-S*ye-z*te)*Ye,e[12]=(v*$e-f*Ze-x*Ie)*Ye,e[13]=(r*Ze-a*$e+u*Ie)*Ye,e[14]=($*oe-N*ue-J*te)*Ye,e[15]=(S*ue-T*oe+C*te)*Ye,e):null},l.isChar=Pe,l.isMapboxURL=Ti,l.keysDifference=function(e,t){var r=[];for(var a in e)a in t||r.push(a);return r},l.makeRequest=Uo,l.mapObject=er,l.mercatorXfromLng=Fm,l.mercatorYfromLat=Om,l.mercatorZfromAltitude=Vm,l.mul=Zp,l.multiply=oi,l.mvt=Ds,l.nextPowerOfTwo=function(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},l.normalize=function(e,t){var r=t[0],a=t[1],u=t[2],c=r*r+a*a+u*u;return c>0&&(c=1/Math.sqrt(c)),e[0]=t[0]*c,e[1]=t[1]*c,e[2]=t[2]*c,e},l.number=dr,l.offscreenCanvasSupported=ya,l.ortho=function(e,t,r,a,u,c,f){var v=1/(t-r),x=1/(a-u),b=1/(c-f);return e[0]=-2*v,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*x,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*b,e[11]=0,e[12]=(t+r)*v,e[13]=(u+a)*x,e[14]=(f+c)*b,e[15]=1,e},l.parseGlyphPBF=function(e){return new dc(e).readFields(Mb,[])},l.pbf=dc,l.performSymbolLayout=function(e,t,r,a,u,c,f){e.createArrays(),e.tilePixelRatio=8192/(512*e.overscaling),e.compareText={},e.iconsNeedLinear=!1;var v=e.layers[0].layout,x=e.layers[0]._unevaluatedLayout._values,b={};if(e.textSizeData.kind==="composite"){var S=e.textSizeData,T=S.maxZoom;b.compositeTextSizes=[x["text-size"].possiblyEvaluate(new ft(S.minZoom),f),x["text-size"].possiblyEvaluate(new ft(T),f)]}if(e.iconSizeData.kind==="composite"){var C=e.iconSizeData,z=C.maxZoom;b.compositeIconSizes=[x["icon-size"].possiblyEvaluate(new ft(C.minZoom),f),x["icon-size"].possiblyEvaluate(new ft(z),f)]}b.layoutTextSize=x["text-size"].possiblyEvaluate(new ft(e.zoom+1),f),b.layoutIconSize=x["icon-size"].possiblyEvaluate(new ft(e.zoom+1),f),b.textMaxSize=x["text-size"].possiblyEvaluate(new ft(18));for(var N=24*v.get("text-line-height"),$=v.get("text-rotation-alignment")==="map"&&v.get("symbol-placement")!=="point",J=v.get("text-keep-upright"),H=v.get("text-size"),te=function(){var ue=se[oe],ye=v.get("text-font").evaluate(ue,{},f).join(","),we=H.evaluate(ue,{},f),Ie=b.layoutTextSize.evaluate(ue,{},f),$e=b.layoutIconSize.evaluate(ue,{},f),Me={horizontal:{},vertical:void 0},Ze=ue.text,Be=[0,0];if(Ze){var lt=Ze.toString(),Ye=24*v.get("text-letter-spacing").evaluate(ue,{},f),Ne=function(dt){for(var $t=0,Lt=dt;$t<Lt.length;$t+=1)if(St=Lt[$t].charCodeAt(0),Pe.Arabic(St)||Pe["Arabic Supplement"](St)||Pe["Arabic Extended-A"](St)||Pe["Arabic Presentation Forms-A"](St)||Pe["Arabic Presentation Forms-B"](St))return!1;var St;return!0}(lt)?Ye:0,ct=v.get("text-anchor").evaluate(ue,{},f),it=v.get("text-variable-anchor");if(!it){var xt=v.get("text-radial-offset").evaluate(ue,{},f);Be=xt?Em(ct,[24*xt,ah]):v.get("text-offset").evaluate(ue,{},f).map(function(dt){return 24*dt})}var We=$?"center":v.get("text-justify").evaluate(ue,{},f),Et=v.get("symbol-placement"),Jt=Et==="point"?24*v.get("text-max-width").evaluate(ue,{},f):0,nr=function(){e.allowVerticalPlacement&&Rl(lt)&&(Me.vertical=vc(Ze,t,r,u,ye,Jt,N,ct,"left",Ne,Be,Li.vertical,!0,Et,Ie,we))};if(!$&&it){for(var rr=We==="auto"?it.map(function(dt){return sh(dt)}):[We],Yt=!1,or=0;or<rr.length;or++){var Ir=rr[or];if(!Me.horizontal[Ir])if(Yt)Me.horizontal[Ir]=Me.horizontal[0];else{var Ar=vc(Ze,t,r,u,ye,Jt,N,"center",Ir,Ne,Be,Li.horizontal,!1,Et,Ie,we);Ar&&(Me.horizontal[Ir]=Ar,Yt=Ar.positionedLines.length===1)}}nr()}else{We==="auto"&&(We=sh(ct));var Kr=vc(Ze,t,r,u,ye,Jt,N,ct,We,Ne,Be,Li.horizontal,!1,Et,Ie,we);Kr&&(Me.horizontal[We]=Kr),nr(),Rl(lt)&&$&&J&&(Me.vertical=vc(Ze,t,r,u,ye,Jt,N,ct,We,Ne,Be,Li.vertical,!1,Et,Ie,we))}}var Br=void 0,Jr=!1;if(ue.icon&&ue.icon.name){var cr=a[ue.icon.name];cr&&(Br=function(dt,$t,Lt){var St=nh(Lt),si=$t[0]-dt.displaySize[0]*St.horizontalAlign,Ur=$t[1]-dt.displaySize[1]*St.verticalAlign;return{image:dt,top:Ur,bottom:Ur+dt.displaySize[1],left:si,right:si+dt.displaySize[0]}}(u[ue.icon.name],v.get("icon-offset").evaluate(ue,{},f),v.get("icon-anchor").evaluate(ue,{},f)),Jr=cr.sdf,e.sdfIcons===void 0?e.sdfIcons=cr.sdf:e.sdfIcons!==cr.sdf&&It("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(cr.pixelRatio!==e.pixelRatio||v.get("icon-rotate").constantOr(1)!==0)&&(e.iconsNeedLinear=!0))}var Dr=Cm(Me.horizontal)||Me.vertical;e.iconsInText=!!Dr&&Dr.iconsInText,(Dr||Br)&&function(dt,$t,Lt,St,si,Ur,Zt,yr,Nr,Pt,Un){var Ri=Ur.textMaxSize.evaluate($t,{});Ri===void 0&&(Ri=Zt);var Nn,pr=dt.layers[0].layout,$n=pr.get("icon-offset").evaluate($t,{},Un),on=Cm(Lt.horizontal),Gs=Zt/24,Za=dt.tilePixelRatio*Gs,Zs=dt.tilePixelRatio*Ri/24,To=dt.tilePixelRatio*yr,Ws=dt.tilePixelRatio*pr.get("symbol-spacing"),Ec=pr.get("text-padding")*dt.tilePixelRatio,Hs=pr.get("icon-padding")*dt.tilePixelRatio,iu=pr.get("text-max-angle")/180*Math.PI,Pc=pr.get("text-rotation-alignment")==="map"&&pr.get("symbol-placement")!=="point",Cc=pr.get("icon-rotation-alignment")==="map"&&pr.get("symbol-placement")!=="point",Io=pr.get("symbol-placement"),nu=Ws/2,Xs=pr.get("icon-text-fit");St&&Xs!=="none"&&(dt.allowVerticalPlacement&&Lt.vertical&&(Nn=vm(St,Lt.vertical,Xs,pr.get("icon-text-fit-padding"),$n,Gs)),on&&(St=vm(St,on,Xs,pr.get("icon-text-fit-padding"),$n,Gs)));var ia=function(t0,hu){hu.x<0||hu.x>=8192||hu.y<0||hu.y>=8192||function(hr,gn,r0,na,yh,Zm,Lc,qn,Rc,fu,Fc,Oc,vh,Wm,du,Hm,Xm,Km,Jm,Ym,Fi,Vc,Qm,jn,i0){var ey,Ha,el,tl,rl,il=hr.addToLineVertexArray(gn,r0),ty=0,ry=0,iy=0,ny=0,gh=-1,_h=-1,Ao={},oy=U(""),xh=0,bh=0;if(qn._unevaluatedLayout.getValue("text-radial-offset")===void 0?(xh=(ey=qn.layout.get("text-offset").evaluate(Fi,{},jn).map(function(yu){return 24*yu}))[0],bh=ey[1]):(xh=24*qn.layout.get("text-radial-offset").evaluate(Fi,{},jn),bh=ah),hr.allowVerticalPlacement&&na.vertical){var ay=qn.layout.get("text-rotate").evaluate(Fi,{},jn)+90;tl=new wc(Rc,gn,fu,Fc,Oc,na.vertical,vh,Wm,du,ay),Lc&&(rl=new wc(Rc,gn,fu,Fc,Oc,Lc,Xm,Km,du,ay))}if(yh){var wh=qn.layout.get("icon-rotate").evaluate(Fi,{}),sy=qn.layout.get("icon-text-fit")!=="none",ly=Im(yh,wh,Qm,sy),Sh=Lc?Im(Lc,wh,Qm,sy):void 0;el=new wc(Rc,gn,fu,Fc,Oc,yh,Xm,Km,!1,wh),ty=4*ly.length;var uy=hr.iconSizeData,mu=null;uy.kind==="source"?(mu=[128*qn.layout.get("icon-size").evaluate(Fi,{})])[0]>32640&&It(hr.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):uy.kind==="composite"&&((mu=[128*Vc.compositeIconSizes[0].evaluate(Fi,{},jn),128*Vc.compositeIconSizes[1].evaluate(Fi,{},jn)])[0]>32640||mu[1]>32640)&&It(hr.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),hr.addSymbols(hr.icon,ly,mu,Ym,Jm,Fi,!1,gn,il.lineStartIndex,il.lineLength,-1,jn),gh=hr.icon.placedSymbolArray.length-1,Sh&&(ry=4*Sh.length,hr.addSymbols(hr.icon,Sh,mu,Ym,Jm,Fi,Li.vertical,gn,il.lineStartIndex,il.lineLength,-1,jn),_h=hr.icon.placedSymbolArray.length-1)}for(var cy in na.horizontal){var Uc=na.horizontal[cy];if(!Ha){oy=U(Uc.text);var n0=qn.layout.get("text-rotate").evaluate(Fi,{},jn);Ha=new wc(Rc,gn,fu,Fc,Oc,Uc,vh,Wm,du,n0)}var py=Uc.positionedLines.length===1;if(iy+=Pm(hr,gn,Uc,Zm,qn,du,Fi,Hm,il,na.vertical?Li.horizontal:Li.horizontalOnly,py?Object.keys(na.horizontal):[cy],Ao,gh,Vc,jn),py)break}na.vertical&&(ny+=Pm(hr,gn,na.vertical,Zm,qn,du,Fi,Hm,il,Li.vertical,["vertical"],Ao,_h,Vc,jn));var o0=Ha?Ha.boxStartIndex:hr.collisionBoxArray.length,a0=Ha?Ha.boxEndIndex:hr.collisionBoxArray.length,s0=tl?tl.boxStartIndex:hr.collisionBoxArray.length,l0=tl?tl.boxEndIndex:hr.collisionBoxArray.length,u0=el?el.boxStartIndex:hr.collisionBoxArray.length,c0=el?el.boxEndIndex:hr.collisionBoxArray.length,p0=rl?rl.boxStartIndex:hr.collisionBoxArray.length,h0=rl?rl.boxEndIndex:hr.collisionBoxArray.length,Gn=-1,Nc=function(yu,fy){return yu&&yu.circleDiameter?Math.max(yu.circleDiameter,fy):fy};Gn=Nc(Ha,Gn),Gn=Nc(tl,Gn),Gn=Nc(el,Gn);var hy=(Gn=Nc(rl,Gn))>-1?1:0;hy&&(Gn*=i0/24),hr.glyphOffsetArray.length>=Ot.MAX_GLYPHS&&It("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),Fi.sortKey!==void 0&&hr.addToSortKeyRanges(hr.symbolInstances.length,Fi.sortKey),hr.symbolInstances.emplaceBack(gn.x,gn.y,Ao.right>=0?Ao.right:-1,Ao.center>=0?Ao.center:-1,Ao.left>=0?Ao.left:-1,Ao.vertical||-1,gh,_h,oy,o0,a0,s0,l0,u0,c0,p0,h0,fu,iy,ny,ty,ry,hy,0,vh,xh,bh,Gn)}(dt,hu,t0,Lt,St,si,Nn,dt.layers[0],dt.collisionBoxArray,$t.index,$t.sourceLayerIndex,dt.index,Za,Ec,Pc,Nr,To,Hs,Cc,$n,$t,Ur,Pt,Un,Zt)};if(Io==="line")for(var Ks=0,kc=Tm($t.geometry,0,0,8192,8192);Ks<kc.length;Ks+=1)for(var Mc=kc[Ks],ou=0,au=Ob(Mc,Ws,iu,Lt.vertical||on,St,24,Zs,dt.overscaling,8192);ou<au.length;ou+=1){var zc=au[ou];on&&$b(dt,on.text,nu,zc)||ia(Mc,zc)}else if(Io==="line-center")for(var su=0,lu=$t.geometry;su<lu.length;su+=1){var uu=lu[su];if(uu.length>1){var Bc=Fb(uu,iu,Lt.vertical||on,St,24,Zs);Bc&&ia(uu,Bc)}}else if($t.type==="Polygon")for(var Js=0,Dc=Qp($t.geometry,0);Js<Dc.length;Js+=1){var Ys=Dc[Js],cu=Ub(Ys,16);ia(Ys[0],new Os(cu.x,cu.y,0))}else if($t.type==="LineString")for(var Wa=0,pu=$t.geometry;Wa<pu.length;Wa+=1){var Qs=pu[Wa];ia(Qs,new Os(Qs[0].x,Qs[0].y,0))}else if($t.type==="Point")for(var fh=0,jm=$t.geometry;fh<jm.length;fh+=1)for(var dh=0,Gm=jm[fh];dh<Gm.length;dh+=1){var mh=Gm[dh];ia([mh],new Os(mh.x,mh.y,0))}}(e,ue,Me,Br,a,b,Ie,$e,Be,Jr,f)},oe=0,se=e.features;oe<se.length;oe+=1)te();c&&e.generateCollisionDebugBuffers()},l.perspective=function(e,t,r,a,u){var c,f=1/Math.tan(t/2);return e[0]=f/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=f,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,u!=null&&u!==1/0?(e[10]=(u+a)*(c=1/(a-u)),e[14]=2*u*a*c):(e[10]=-1,e[14]=-2*a),e},l.pick=function(e,t){for(var r={},a=0;a<t.length;a++){var u=t[a];u in e&&(r[u]=e[u])}return r},l.plugin=xi,l.polygonIntersectsPolygon=Fn,l.postMapLoadEvent=fa,l.postTurnstileEvent=as,l.potpack=fm,l.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],l.register=Oe,l.registerForPluginStateChange=function(e){return e({pluginStatus:fi,pluginURL:fn}),Ol.on("pluginStateChange",e),e},l.renderColorRamp=Hd,l.rotate=function(e,t,r){var a=t[0],u=t[1],c=t[2],f=t[3],v=Math.sin(r),x=Math.cos(r);return e[0]=a*x+c*v,e[1]=u*x+f*v,e[2]=a*-v+c*x,e[3]=u*-v+f*x,e},l.rotateX=function(e,t,r){var a=Math.sin(r),u=Math.cos(r),c=t[4],f=t[5],v=t[6],x=t[7],b=t[8],S=t[9],T=t[10],C=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=c*u+b*a,e[5]=f*u+S*a,e[6]=v*u+T*a,e[7]=x*u+C*a,e[8]=b*u-c*a,e[9]=S*u-f*a,e[10]=T*u-v*a,e[11]=C*u-x*a,e},l.rotateZ=function(e,t,r){var a=Math.sin(r),u=Math.cos(r),c=t[0],f=t[1],v=t[2],x=t[3],b=t[4],S=t[5],T=t[6],C=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=c*u+b*a,e[1]=f*u+S*a,e[2]=v*u+T*a,e[3]=x*u+C*a,e[4]=b*u-c*a,e[5]=S*u-f*a,e[6]=T*u-v*a,e[7]=C*u-x*a,e},l.scale=function(e,t,r){var a=r[0],u=r[1],c=r[2];return e[0]=t[0]*a,e[1]=t[1]*a,e[2]=t[2]*a,e[3]=t[3]*a,e[4]=t[4]*u,e[5]=t[5]*u,e[6]=t[6]*u,e[7]=t[7]*u,e[8]=t[8]*c,e[9]=t[9]*c,e[10]=t[10]*c,e[11]=t[11]*c,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},l.scale$1=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e},l.scale$2=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e},l.setCacheLimits=function(e,t){Oo=e,ss=t},l.setRTLTextPlugin=function(e,t,r){if(r===void 0&&(r=!1),fi==="deferred"||fi==="loading"||fi==="loaded")throw new Error("setRTLTextPlugin cannot be called multiple times.");fn=ln.resolveURL(e),fi="deferred",Ts=t,Da(),r||Gi()},l.sphericalToCartesian=function(e){var t=e[0],r=e[1],a=e[2];return r+=90,r*=Math.PI/180,a*=Math.PI/180,{x:t*Math.cos(r)*Math.sin(a),y:t*Math.sin(r)*Math.sin(a),z:t*Math.cos(a)}},l.sqrLen=function(e){var t=e[0],r=e[1];return t*t+r*r},l.styleSpec=D,l.sub=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e},l.symbolSize=Rb,l.transformMat3=function(e,t,r){var a=t[0],u=t[1],c=t[2];return e[0]=a*r[0]+u*r[3]+c*r[6],e[1]=a*r[1]+u*r[4]+c*r[7],e[2]=a*r[2]+u*r[5]+c*r[8],e},l.transformMat4=ks,l.translate=function(e,t,r){var a,u,c,f,v,x,b,S,T,C,z,N,$=r[0],J=r[1],H=r[2];return t===e?(e[12]=t[0]*$+t[4]*J+t[8]*H+t[12],e[13]=t[1]*$+t[5]*J+t[9]*H+t[13],e[14]=t[2]*$+t[6]*J+t[10]*H+t[14],e[15]=t[3]*$+t[7]*J+t[11]*H+t[15]):(u=t[1],c=t[2],f=t[3],v=t[4],x=t[5],b=t[6],S=t[7],T=t[8],C=t[9],z=t[10],N=t[11],e[0]=a=t[0],e[1]=u,e[2]=c,e[3]=f,e[4]=v,e[5]=x,e[6]=b,e[7]=S,e[8]=T,e[9]=C,e[10]=z,e[11]=N,e[12]=a*$+v*J+T*H+t[12],e[13]=u*$+x*J+C*H+t[13],e[14]=c*$+b*J+z*H+t[14],e[15]=f*$+S*J+N*H+t[15]),e},l.triggerPluginCompletionEvent=sc,l.uniqueId=bt,l.validateCustomStyleLayer=function(e){var t=[],r=e.id;return r===void 0&&t.push({message:"layers."+r+': missing required property "id"'}),e.render===void 0&&t.push({message:"layers."+r+': missing required method "render"'}),e.renderingMode&&e.renderingMode!=="2d"&&e.renderingMode!=="3d"&&t.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),t},l.validateLight=jp,l.validateStyle=ka,l.values=function(e){var t=[];for(var r in e)t.push(e[r]);return t},l.vectorTile=Ds,l.version="1.13.3",l.warnOnce=It,l.webpSupported=Ji,l.window=ae,l.wrap=pt}),V(["./shared"],function(l){function re(I){var P=typeof I;if(P==="number"||P==="boolean"||P==="string"||I==null)return JSON.stringify(I);if(Array.isArray(I)){for(var M="[",O=0,G=I;O<G.length;O+=1)M+=re(G[O])+",";return M+"]"}for(var Y=Object.keys(I).sort(),ee="{",D=0;D<Y.length;D++)ee+=JSON.stringify(Y[D])+":"+re(I[Y[D]])+",";return ee+"}"}function q(I){for(var P="",M=0,O=l.refProperties;M<O.length;M+=1)P+="/"+re(I[O[M]]);return P}var me=function(I){this.keyCache={},I&&this.replace(I)};me.prototype.replace=function(I){this._layerConfigs={},this._layers={},this.update(I,[])},me.prototype.update=function(I,P){for(var M=this,O=0,G=I;O<G.length;O+=1){var Y=G[O];this._layerConfigs[Y.id]=Y;var ee=this._layers[Y.id]=l.createStyleLayer(Y);ee._featureFilter=l.featureFilter(ee.filter),this.keyCache[Y.id]&&delete this.keyCache[Y.id]}for(var D=0,W=P;D<W.length;D+=1){var ne=W[D];delete this.keyCache[ne],delete this._layerConfigs[ne],delete this._layers[ne]}this.familiesBySource={};for(var _e=0,be=function(Ee,Ce){for(var ut={},ze=0;ze<Ee.length;ze++){var vt=Ce&&Ce[Ee[ze].id]||q(Ee[ze]);Ce&&(Ce[Ee[ze].id]=vt);var Ut=ut[vt];Ut||(Ut=ut[vt]=[]),Ut.push(Ee[ze])}var ht=[];for(var kt in ut)ht.push(ut[kt]);return ht}(l.values(this._layerConfigs),this.keyCache);_e<be.length;_e+=1){var fe=be[_e].map(function(Ee){return M._layers[Ee.id]}),xe=fe[0];if(xe.visibility!=="none"){var Ve=xe.source||"",Fe=this.familiesBySource[Ve];Fe||(Fe=this.familiesBySource[Ve]={});var de=xe.sourceLayer||"_geojsonTileLayer",De=Fe[de];De||(De=Fe[de]=[]),De.push(fe)}}};var pe=function(I){var P={},M=[];for(var O in I){var G=I[O],Y=P[O]={};for(var ee in G){var D=G[+ee];if(D&&D.bitmap.width!==0&&D.bitmap.height!==0){var W={x:0,y:0,w:D.bitmap.width+2,h:D.bitmap.height+2};M.push(W),Y[ee]={rect:W,metrics:D.metrics}}}}var ne=l.potpack(M),_e=new l.AlphaImage({width:ne.w||1,height:ne.h||1});for(var be in I){var fe=I[be];for(var xe in fe){var Ve=fe[+xe];if(Ve&&Ve.bitmap.width!==0&&Ve.bitmap.height!==0){var Fe=P[be][xe].rect;l.AlphaImage.copy(Ve.bitmap,_e,{x:0,y:0},{x:Fe.x+1,y:Fe.y+1},Ve.bitmap)}}}this.image=_e,this.positions=P};l.register("GlyphAtlas",pe);var ke=function(I){this.tileID=new l.OverscaledTileID(I.tileID.overscaledZ,I.tileID.wrap,I.tileID.canonical.z,I.tileID.canonical.x,I.tileID.canonical.y),this.uid=I.uid,this.zoom=I.zoom,this.pixelRatio=I.pixelRatio,this.tileSize=I.tileSize,this.source=I.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=I.showCollisionBoxes,this.collectResourceTiming=!!I.collectResourceTiming,this.returnDependencies=!!I.returnDependencies,this.promoteId=I.promoteId};function ae(I,P,M){for(var O=new l.EvaluationParameters(P),G=0,Y=I;G<Y.length;G+=1)Y[G].recalculate(O,M)}function ve(I,P){var M=l.getArrayBuffer(I.request,function(O,G,Y,ee){O?P(O):G&&P(null,{vectorTile:new l.vectorTile.VectorTile(new l.pbf(G)),rawData:G,cacheControl:Y,expires:ee})});return function(){M.cancel(),P()}}ke.prototype.parse=function(I,P,M,O,G){var Y=this;this.status="parsing",this.data=I,this.collisionBoxArray=new l.CollisionBoxArray;var ee=new l.DictionaryCoder(Object.keys(I.layers).sort()),D=new l.FeatureIndex(this.tileID,this.promoteId);D.bucketLayerIDs=[];var W,ne,_e,be,fe={},xe={featureIndex:D,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:M},Ve=P.familiesBySource[this.source];for(var Fe in Ve){var de=I.layers[Fe];if(de){de.version===1&&l.warnOnce('Vector tile source "'+this.source+'" layer "'+Fe+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var De=ee.encode(Fe),Ee=[],Ce=0;Ce<de.length;Ce++){var ut=de.feature(Ce),ze=D.getId(ut,Fe);Ee.push({feature:ut,id:ze,index:Ce,sourceLayerIndex:De})}for(var vt=0,Ut=Ve[Fe];vt<Ut.length;vt+=1){var ht=Ut[vt],kt=ht[0];kt.minzoom&&this.zoom<Math.floor(kt.minzoom)||kt.maxzoom&&this.zoom>=kt.maxzoom||kt.visibility!=="none"&&(ae(ht,this.zoom,M),(fe[kt.id]=kt.createBucket({index:D.bucketLayerIDs.length,layers:ht,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:De,sourceID:this.source})).populate(Ee,xe,this.tileID.canonical),D.bucketLayerIDs.push(ht.map(function(Ft){return Ft.id})))}}}var _t=l.mapObject(xe.glyphDependencies,function(Ft){return Object.keys(Ft).map(Number)});Object.keys(_t).length?O.send("getGlyphs",{uid:this.uid,stacks:_t},function(Ft,mt){W||(W=Ft,ne=mt,sr.call(Y))}):ne={};var qr=Object.keys(xe.iconDependencies);qr.length?O.send("getImages",{icons:qr,source:this.source,tileID:this.tileID,type:"icons"},function(Ft,mt){W||(W=Ft,_e=mt,sr.call(Y))}):_e={};var Bt=Object.keys(xe.patternDependencies);function sr(){if(W)return G(W);if(ne&&_e&&be){var Ft=new pe(ne),mt=new l.ImageAtlas(_e,be);for(var Mt in fe){var ri=fe[Mt];ri instanceof l.SymbolBucket?(ae(ri.layers,this.zoom,M),l.performSymbolLayout(ri,ne,Ft.positions,_e,mt.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):ri.hasPattern&&(ri instanceof l.LineBucket||ri instanceof l.FillBucket||ri instanceof l.FillExtrusionBucket)&&(ae(ri.layers,this.zoom,M),ri.addFeatures(xe,this.tileID.canonical,mt.patternPositions))}this.status="done",G(null,{buckets:l.values(fe).filter(function(ga){return!ga.isEmpty()}),featureIndex:D,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:Ft.image,imageAtlas:mt,glyphMap:this.returnDependencies?ne:null,iconMap:this.returnDependencies?_e:null,glyphPositions:this.returnDependencies?Ft.positions:null})}}Bt.length?O.send("getImages",{icons:Bt,source:this.source,tileID:this.tileID,type:"patterns"},function(Ft,mt){W||(W=Ft,be=mt,sr.call(Y))}):be={},sr.call(this)};var Ae=function(I,P,M,O){this.actor=I,this.layerIndex=P,this.availableImages=M,this.loadVectorData=O||ve,this.loading={},this.loaded={}};Ae.prototype.loadTile=function(I,P){var M=this,O=I.uid;this.loading||(this.loading={});var G=!!(I&&I.request&&I.request.collectResourceTiming)&&new l.RequestPerformance(I.request),Y=this.loading[O]=new ke(I);Y.abort=this.loadVectorData(I,function(ee,D){if(delete M.loading[O],ee||!D)return Y.status="done",M.loaded[O]=Y,P(ee);var W=D.rawData,ne={};D.expires&&(ne.expires=D.expires),D.cacheControl&&(ne.cacheControl=D.cacheControl);var _e={};if(G){var be=G.finish();be&&(_e.resourceTiming=JSON.parse(JSON.stringify(be)))}Y.vectorTile=D.vectorTile,Y.parse(D.vectorTile,M.layerIndex,M.availableImages,M.actor,function(fe,xe){if(fe||!xe)return P(fe);P(null,l.extend({rawTileData:W.slice(0)},xe,ne,_e))}),M.loaded=M.loaded||{},M.loaded[O]=Y})},Ae.prototype.reloadTile=function(I,P){var M=this,O=this.loaded,G=I.uid,Y=this;if(O&&O[G]){var ee=O[G];ee.showCollisionBoxes=I.showCollisionBoxes;var D=function(W,ne){var _e=ee.reloadCallback;_e&&(delete ee.reloadCallback,ee.parse(ee.vectorTile,Y.layerIndex,M.availableImages,Y.actor,_e)),P(W,ne)};ee.status==="parsing"?ee.reloadCallback=D:ee.status==="done"&&(ee.vectorTile?ee.parse(ee.vectorTile,this.layerIndex,this.availableImages,this.actor,D):D())}},Ae.prototype.abortTile=function(I,P){var M=this.loading,O=I.uid;M&&M[O]&&M[O].abort&&(M[O].abort(),delete M[O]),P()},Ae.prototype.removeTile=function(I,P){var M=this.loaded,O=I.uid;M&&M[O]&&delete M[O],P()};var Je=l.window.ImageBitmap,qe=function(){this.loaded={}};function pt(I,P){if(I.length!==0){ot(I[0],P);for(var M=1;M<I.length;M++)ot(I[M],!P)}}function ot(I,P){for(var M=0,O=0,G=0,Y=I.length,ee=Y-1;G<Y;ee=G++){var D=(I[G][0]-I[ee][0])*(I[ee][1]+I[G][1]),W=M+D;O+=Math.abs(M)>=Math.abs(D)?M-W+D:D-W+M,M=W}M+O>=0!=!!P&&I.reverse()}qe.prototype.loadTile=function(I,P){var M=I.uid,O=I.encoding,G=I.rawImageData,Y=Je&&G instanceof Je?this.getImageData(G):G,ee=new l.DEMData(M,Y,O);this.loaded=this.loaded||{},this.loaded[M]=ee,P(null,ee)},qe.prototype.getImageData=function(I){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(I.width,I.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=I.width,this.offscreenCanvas.height=I.height,this.offscreenCanvasContext.drawImage(I,0,0,I.width,I.height);var P=this.offscreenCanvasContext.getImageData(-1,-1,I.width+2,I.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new l.RGBAImage({width:P.width,height:P.height},P.data)},qe.prototype.removeTile=function(I){var P=this.loaded,M=I.uid;P&&P[M]&&delete P[M]};var Rt=l.vectorTile.VectorTileFeature.prototype.toGeoJSON,bt=function(I){this._feature=I,this.extent=l.EXTENT,this.type=I.type,this.properties=I.tags,"id"in I&&!isNaN(I.id)&&(this.id=parseInt(I.id,10))};bt.prototype.loadGeometry=function(){if(this._feature.type===1){for(var I=[],P=0,M=this._feature.geometry;P<M.length;P+=1){var O=M[P];I.push([new l.Point$1(O[0],O[1])])}return I}for(var G=[],Y=0,ee=this._feature.geometry;Y<ee.length;Y+=1){for(var D=[],W=0,ne=ee[Y];W<ne.length;W+=1){var _e=ne[W];D.push(new l.Point$1(_e[0],_e[1]))}G.push(D)}return G},bt.prototype.toGeoJSON=function(I,P,M){return Rt.call(this,I,P,M)};var Ct=function(I){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=l.EXTENT,this.length=I.length,this._features=I};Ct.prototype.feature=function(I){return new bt(this._features[I])};var Qt=l.vectorTile.VectorTileFeature,vr=Er;function Er(I,P){this.options=P||{},this.features=I,this.length=I.length}function er(I,P){this.id=typeof I.id=="number"?I.id:void 0,this.type=I.type,this.rawGeometry=I.type===1?[I.geometry]:I.geometry,this.properties=I.tags,this.extent=P||4096}Er.prototype.feature=function(I){return new er(this.features[I],this.options.extent)},er.prototype.loadGeometry=function(){var I=this.rawGeometry;this.geometry=[];for(var P=0;P<I.length;P++){for(var M=I[P],O=[],G=0;G<M.length;G++)O.push(new l.Point$1(M[G][0],M[G][1]));this.geometry.push(O)}return this.geometry},er.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var I=this.geometry,P=1/0,M=-1/0,O=1/0,G=-1/0,Y=0;Y<I.length;Y++)for(var ee=I[Y],D=0;D<ee.length;D++){var W=ee[D];P=Math.min(P,W.x),M=Math.max(M,W.x),O=Math.min(O,W.y),G=Math.max(G,W.y)}return[P,O,M,G]},er.prototype.toGeoJSON=Qt.prototype.toGeoJSON;var Qr=vi,ei=vr;function vi(I){var P=new l.pbf;return function(M,O){for(var G in M.layers)O.writeMessage(3,It,M.layers[G])}(I,P),P.finish()}function It(I,P){var M;P.writeVarintField(15,I.version||1),P.writeStringField(1,I.name||""),P.writeVarintField(5,I.extent||4096);var O={keys:[],values:[],keycache:{},valuecache:{}};for(M=0;M<I.length;M++)O.feature=I.feature(M),P.writeMessage(2,gr,O);var G=O.keys;for(M=0;M<G.length;M++)P.writeStringField(3,G[M]);var Y=O.values;for(M=0;M<Y.length;M++)P.writeMessage(4,ns,Y[M])}function gr(I,P){var M=I.feature;M.id!==void 0&&P.writeVarintField(1,M.id),P.writeMessage(2,Bo,I),P.writeVarintField(3,M.type),P.writeMessage(4,Lo,M)}function Bo(I,P){var M=I.feature,O=I.keys,G=I.values,Y=I.keycache,ee=I.valuecache;for(var D in M.properties){var W=Y[D];W===void 0&&(O.push(D),Y[D]=W=O.length-1),P.writeVarint(W);var ne=M.properties[D],_e=typeof ne;_e!=="string"&&_e!=="boolean"&&_e!=="number"&&(ne=JSON.stringify(ne));var be=_e+":"+ne,fe=ee[be];fe===void 0&&(G.push(ne),ee[be]=fe=G.length-1),P.writeVarint(fe)}}function li(I,P){return(P<<3)+(7&I)}function Do(I){return I<<1^I>>31}function Lo(I,P){for(var M=I.loadGeometry(),O=I.type,G=0,Y=0,ee=M.length,D=0;D<ee;D++){var W=M[D],ne=1;O===1&&(ne=W.length),P.writeVarint(li(1,ne));for(var _e=O===3?W.length-1:W.length,be=0;be<_e;be++){be===1&&O!==1&&P.writeVarint(li(2,_e-1));var fe=W[be].x-G,xe=W[be].y-Y;P.writeVarint(Do(fe)),P.writeVarint(Do(xe)),G+=fe,Y+=xe}O===3&&P.writeVarint(li(7,1))}}function ns(I,P){var M=typeof I;M==="string"?P.writeStringField(1,I):M==="boolean"?P.writeBooleanField(7,I):M==="number"&&(I%1!=0?P.writeDoubleField(3,I):I<0?P.writeSVarintField(6,I):P.writeVarintField(5,I))}function xn(I,P,M,O){Oi(I,M,O),Oi(P,2*M,2*O),Oi(P,2*M+1,2*O+1)}function Oi(I,P,M){var O=I[P];I[P]=I[M],I[M]=O}function Ki(I,P,M,O){var G=I-M,Y=P-O;return G*G+Y*Y}Qr.fromVectorTileJs=vi,Qr.fromGeojsonVt=function(I,P){P=P||{};var M={};for(var O in I)M[O]=new vr(I[O].features,P),M[O].name=O,M[O].version=P.version,M[O].extent=P.extent;return vi({layers:M})},Qr.GeoJSONWrapper=ei;var Xn=function(I){return I[0]},Kn=function(I){return I[1]},bn=function(I,P,M,O,G){P===void 0&&(P=Xn),M===void 0&&(M=Kn),O===void 0&&(O=64),G===void 0&&(G=Float64Array),this.nodeSize=O,this.points=I;for(var Y=I.length<65536?Uint16Array:Uint32Array,ee=this.ids=new Y(I.length),D=this.coords=new G(2*I.length),W=0;W<I.length;W++)ee[W]=W,D[2*W]=P(I[W]),D[2*W+1]=M(I[W]);(function ne(_e,be,fe,xe,Ve,Fe){if(!(Ve-xe<=fe)){var de=xe+Ve>>1;(function De(Ee,Ce,ut,ze,vt,Ut){for(;vt>ze;){if(vt-ze>600){var ht=vt-ze+1,kt=ut-ze+1,_t=Math.log(ht),qr=.5*Math.exp(2*_t/3),Bt=.5*Math.sqrt(_t*qr*(ht-qr)/ht)*(kt-ht/2<0?-1:1);De(Ee,Ce,ut,Math.max(ze,Math.floor(ut-kt*qr/ht+Bt)),Math.min(vt,Math.floor(ut+(ht-kt)*qr/ht+Bt)),Ut)}var sr=Ce[2*ut+Ut],Ft=ze,mt=vt;for(xn(Ee,Ce,ze,ut),Ce[2*vt+Ut]>sr&&xn(Ee,Ce,ze,vt);Ft<mt;){for(xn(Ee,Ce,Ft,mt),Ft++,mt--;Ce[2*Ft+Ut]<sr;)Ft++;for(;Ce[2*mt+Ut]>sr;)mt--}Ce[2*ze+Ut]===sr?xn(Ee,Ce,ze,mt):xn(Ee,Ce,++mt,vt),mt<=ut&&(ze=mt+1),ut<=mt&&(vt=mt-1)}})(_e,be,de,xe,Ve,Fe%2),ne(_e,be,fe,xe,de-1,Fe+1),ne(_e,be,fe,de+1,Ve,Fe+1)}})(ee,D,O,0,ee.length-1,0)};bn.prototype.range=function(I,P,M,O){return function(G,Y,ee,D,W,ne,_e){for(var be,fe,xe=[0,G.length-1,0],Ve=[];xe.length;){var Fe=xe.pop(),de=xe.pop(),De=xe.pop();if(de-De<=_e)for(var Ee=De;Ee<=de;Ee++)fe=Y[2*Ee+1],(be=Y[2*Ee])>=ee&&be<=W&&fe>=D&&fe<=ne&&Ve.push(G[Ee]);else{var Ce=Math.floor((De+de)/2);fe=Y[2*Ce+1],(be=Y[2*Ce])>=ee&&be<=W&&fe>=D&&fe<=ne&&Ve.push(G[Ce]);var ut=(Fe+1)%2;(Fe===0?ee<=be:D<=fe)&&(xe.push(De),xe.push(Ce-1),xe.push(ut)),(Fe===0?W>=be:ne>=fe)&&(xe.push(Ce+1),xe.push(de),xe.push(ut))}}return Ve}(this.ids,this.coords,I,P,M,O,this.nodeSize)},bn.prototype.within=function(I,P,M){return function(O,G,Y,ee,D,W){for(var ne=[0,O.length-1,0],_e=[],be=D*D;ne.length;){var fe=ne.pop(),xe=ne.pop(),Ve=ne.pop();if(xe-Ve<=W)for(var Fe=Ve;Fe<=xe;Fe++)Ki(G[2*Fe],G[2*Fe+1],Y,ee)<=be&&_e.push(O[Fe]);else{var de=Math.floor((Ve+xe)/2),De=G[2*de],Ee=G[2*de+1];Ki(De,Ee,Y,ee)<=be&&_e.push(O[de]);var Ce=(fe+1)%2;(fe===0?Y-D<=De:ee-D<=Ee)&&(ne.push(Ve),ne.push(de-1),ne.push(Ce)),(fe===0?Y+D>=De:ee+D>=Ee)&&(ne.push(de+1),ne.push(xe),ne.push(Ce))}}return _e}(this.ids,this.coords,I,P,M,this.nodeSize)};var _l={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:function(I){return I}},$r=function(I){this.options=wn(Object.create(_l),I),this.trees=new Array(this.options.maxZoom+1)};function ln(I,P,M,O,G){return{x:I,y:P,zoom:1/0,id:M,parentId:-1,numPoints:O,properties:G}}function Vt(I,P){var M=I.geometry.coordinates,O=M[1];return{x:Vi(M[0]),y:yt(O),zoom:1/0,index:P,parentId:-1}}function Ji(I){return{type:"Feature",id:I.id,properties:Ro(I),geometry:{type:"Point",coordinates:[(O=I.x,360*(O-.5)),(P=I.y,M=(180-360*P)*Math.PI/180,360*Math.atan(Math.exp(M))/Math.PI-90)]}};var P,M,O}function Ro(I){var P=I.numPoints,M=P>=1e4?Math.round(P/1e3)+"k":P>=1e3?Math.round(P/100)/10+"k":P;return wn(wn({},I.properties),{cluster:!0,cluster_id:I.id,point_count:P,point_count_abbreviated:M})}function Vi(I){return I/360+.5}function yt(I){var P=Math.sin(I*Math.PI/180),M=.5-.25*Math.log((1+P)/(1-P))/Math.PI;return M<0?0:M>1?1:M}function wn(I,P){for(var M in P)I[M]=P[M];return I}function ti(I){return I.x}function Ti(I){return I.y}function xl(I,P,M,O,G,Y){var ee=G-M,D=Y-O;if(ee!==0||D!==0){var W=((I-M)*ee+(P-O)*D)/(ee*ee+D*D);W>1?(M=G,O=Y):W>0&&(M+=ee*W,O+=D*W)}return(ee=I-M)*ee+(D=P-O)*D}function Ui(I,P,M,O){var G={id:I===void 0?null:I,type:P,geometry:M,tags:O,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(Y){var ee=Y.geometry,D=Y.type;if(D==="Point"||D==="MultiPoint"||D==="LineString")pa(Y,ee);else if(D==="Polygon"||D==="MultiLineString")for(var W=0;W<ee.length;W++)pa(Y,ee[W]);else if(D==="MultiPolygon")for(W=0;W<ee.length;W++)for(var ne=0;ne<ee[W].length;ne++)pa(Y,ee[W][ne])}(G),G}function pa(I,P){for(var M=0;M<P.length;M+=3)I.minX=Math.min(I.minX,P[M]),I.minY=Math.min(I.minY,P[M+1]),I.maxX=Math.max(I.maxX,P[M]),I.maxY=Math.max(I.maxY,P[M+1])}function Ii(I,P,M,O){if(P.geometry){var G=P.geometry.coordinates,Y=P.geometry.type,ee=Math.pow(M.tolerance/((1<<M.maxZoom)*M.extent),2),D=[],W=P.id;if(M.promoteId?W=P.properties[M.promoteId]:M.generateId&&(W=O||0),Y==="Point")Jn(G,D);else if(Y==="MultiPoint")for(var ne=0;ne<G.length;ne++)Jn(G[ne],D);else if(Y==="LineString")Fo(G,D,ee,!1);else if(Y==="MultiLineString"){if(M.lineMetrics){for(ne=0;ne<G.length;ne++)Fo(G[ne],D=[],ee,!1),I.push(Ui(W,"LineString",D,P.properties));return}Ai(G,D,ee,!1)}else if(Y==="Polygon")Ai(G,D,ee,!0);else{if(Y!=="MultiPolygon"){if(Y==="GeometryCollection"){for(ne=0;ne<P.geometry.geometries.length;ne++)Ii(I,{id:W,geometry:P.geometry.geometries[ne],properties:P.properties},M,O);return}throw new Error("Input data is not a valid GeoJSON object.")}for(ne=0;ne<G.length;ne++){var _e=[];Ai(G[ne],_e,ee,!0),D.push(_e)}}I.push(Ui(W,Y,D,P.properties))}}function Jn(I,P){P.push(Ei(I[0])),P.push(Yn(I[1])),P.push(0)}function Fo(I,P,M,O){for(var G,Y,ee=0,D=0;D<I.length;D++){var W=Ei(I[D][0]),ne=Yn(I[D][1]);P.push(W),P.push(ne),P.push(0),D>0&&(ee+=O?(G*ne-W*Y)/2:Math.sqrt(Math.pow(W-G,2)+Math.pow(ne-Y,2))),G=W,Y=ne}var _e=P.length-3;P[2]=1,function be(fe,xe,Ve,Fe){for(var de,De=Fe,Ee=Ve-xe>>1,Ce=Ve-xe,ut=fe[xe],ze=fe[xe+1],vt=fe[Ve],Ut=fe[Ve+1],ht=xe+3;ht<Ve;ht+=3){var kt=xl(fe[ht],fe[ht+1],ut,ze,vt,Ut);if(kt>De)de=ht,De=kt;else if(kt===De){var _t=Math.abs(ht-Ee);_t<Ce&&(de=ht,Ce=_t)}}De>Fe&&(de-xe>3&&be(fe,xe,de,Fe),fe[de+2]=De,Ve-de>3&&be(fe,de,Ve,Fe))}(P,0,_e,M),P[_e+2]=1,P.size=Math.abs(ee),P.start=0,P.end=P.size}function Ai(I,P,M,O){for(var G=0;G<I.length;G++){var Y=[];Fo(I[G],Y,M,O),P.push(Y)}}function Ei(I){return I/360+.5}function Yn(I){var P=Math.sin(I*Math.PI/180),M=.5-.25*Math.log((1+P)/(1-P))/Math.PI;return M<0?0:M>1?1:M}function Ni(I,P,M,O,G,Y,ee,D){if(O/=P,Y>=(M/=P)&&ee<O)return I;if(ee<M||Y>=O)return null;for(var W=[],ne=0;ne<I.length;ne++){var _e=I[ne],be=_e.geometry,fe=_e.type,xe=G===0?_e.minX:_e.minY,Ve=G===0?_e.maxX:_e.maxY;if(xe>=M&&Ve<O)W.push(_e);else if(!(Ve<M||xe>=O)){var Fe=[];if(fe==="Point"||fe==="MultiPoint")os(be,Fe,M,O,G);else if(fe==="LineString")as(be,Fe,M,O,G,!1,D.lineMetrics);else if(fe==="MultiLineString")fa(be,Fe,M,O,G,!1);else if(fe==="Polygon")fa(be,Fe,M,O,G,!0);else if(fe==="MultiPolygon")for(var de=0;de<be.length;de++){var De=[];fa(be[de],De,M,O,G,!0),De.length&&Fe.push(De)}if(Fe.length){if(D.lineMetrics&&fe==="LineString"){for(de=0;de<Fe.length;de++)W.push(Ui(_e.id,fe,Fe[de],_e.tags));continue}fe!=="LineString"&&fe!=="MultiLineString"||(Fe.length===1?(fe="LineString",Fe=Fe[0]):fe="MultiLineString"),fe!=="Point"&&fe!=="MultiPoint"||(fe=Fe.length===3?"Point":"MultiPoint"),W.push(Ui(_e.id,fe,Fe,_e.tags))}}}return W.length?W:null}function os(I,P,M,O,G){for(var Y=0;Y<I.length;Y+=3){var ee=I[Y+G];ee>=M&&ee<=O&&(P.push(I[Y]),P.push(I[Y+1]),P.push(I[Y+2]))}}function as(I,P,M,O,G,Y,ee){for(var D,W,ne=ha(I),_e=G===0?ss:Vo,be=I.start,fe=0;fe<I.length-3;fe+=3){var xe=I[fe],Ve=I[fe+1],Fe=I[fe+2],de=I[fe+3],De=I[fe+4],Ee=G===0?xe:Ve,Ce=G===0?de:De,ut=!1;ee&&(D=Math.sqrt(Math.pow(xe-de,2)+Math.pow(Ve-De,2))),Ee<M?Ce>M&&(W=_e(ne,xe,Ve,de,De,M),ee&&(ne.start=be+D*W)):Ee>O?Ce<O&&(W=_e(ne,xe,Ve,de,De,O),ee&&(ne.start=be+D*W)):Oo(ne,xe,Ve,Fe),Ce<M&&Ee>=M&&(W=_e(ne,xe,Ve,de,De,M),ut=!0),Ce>O&&Ee<=O&&(W=_e(ne,xe,Ve,de,De,O),ut=!0),!Y&&ut&&(ee&&(ne.end=be+D*W),P.push(ne),ne=ha(I)),ee&&(be+=D)}var ze=I.length-3;xe=I[ze],Ve=I[ze+1],Fe=I[ze+2],(Ee=G===0?xe:Ve)>=M&&Ee<=O&&Oo(ne,xe,Ve,Fe),ze=ne.length-3,Y&&ze>=3&&(ne[ze]!==ne[0]||ne[ze+1]!==ne[1])&&Oo(ne,ne[0],ne[1],ne[2]),ne.length&&P.push(ne)}function ha(I){var P=[];return P.size=I.size,P.start=I.start,P.end=I.end,P}function fa(I,P,M,O,G,Y){for(var ee=0;ee<I.length;ee++)as(I[ee],P,M,O,G,Y,!1)}function Oo(I,P,M,O){I.push(P),I.push(M),I.push(O)}function ss(I,P,M,O,G,Y){var ee=(Y-P)/(O-P);return I.push(Y),I.push(M+(G-M)*ee),I.push(1),ee}function Vo(I,P,M,O,G,Y){var ee=(Y-M)/(G-M);return I.push(P+(O-P)*ee),I.push(Y),I.push(1),ee}function da(I,P){for(var M=[],O=0;O<I.length;O++){var G,Y=I[O],ee=Y.type;if(ee==="Point"||ee==="MultiPoint"||ee==="LineString")G=Qn(Y.geometry,P);else if(ee==="MultiLineString"||ee==="Polygon"){G=[];for(var D=0;D<Y.geometry.length;D++)G.push(Qn(Y.geometry[D],P))}else if(ee==="MultiPolygon")for(G=[],D=0;D<Y.geometry.length;D++){for(var W=[],ne=0;ne<Y.geometry[D].length;ne++)W.push(Qn(Y.geometry[D][ne],P));G.push(W)}M.push(Ui(Y.id,ee,G,Y.tags))}return M}function Qn(I,P){var M=[];M.size=I.size,I.start!==void 0&&(M.start=I.start,M.end=I.end);for(var O=0;O<I.length;O+=3)M.push(I[O]+P,I[O+1],I[O+2]);return M}function ma(I,P){if(I.transformed)return I;var M,O,G,Y=1<<I.z,ee=I.x,D=I.y;for(M=0;M<I.features.length;M++){var W=I.features[M],ne=W.geometry,_e=W.type;if(W.geometry=[],_e===1)for(O=0;O<ne.length;O+=2)W.geometry.push(ya(ne[O],ne[O+1],P,Y,ee,D));else for(O=0;O<ne.length;O++){var be=[];for(G=0;G<ne[O].length;G+=2)be.push(ya(ne[O][G],ne[O][G+1],P,Y,ee,D));W.geometry.push(be)}}return I.transformed=!0,I}function ya(I,P,M,O,G,Y){return[Math.round(M*(I*O-G)),Math.round(M*(P*O-Y))]}function ls(I,P,M,O,G){for(var Y=P===G.maxZoom?0:G.tolerance/((1<<P)*G.extent),ee={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:M,y:O,z:P,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},D=0;D<I.length;D++){ee.numFeatures++,us(ee,I[D],Y,G);var W=I[D].minX,ne=I[D].minY,_e=I[D].maxX,be=I[D].maxY;W<ee.minX&&(ee.minX=W),ne<ee.minY&&(ee.minY=ne),_e>ee.maxX&&(ee.maxX=_e),be>ee.maxY&&(ee.maxY=be)}return ee}function us(I,P,M,O){var G=P.geometry,Y=P.type,ee=[];if(Y==="Point"||Y==="MultiPoint")for(var D=0;D<G.length;D+=3)ee.push(G[D]),ee.push(G[D+1]),I.numPoints++,I.numSimplified++;else if(Y==="LineString")eo(ee,G,I,M,!1,!1);else if(Y==="MultiLineString"||Y==="Polygon")for(D=0;D<G.length;D++)eo(ee,G[D],I,M,Y==="Polygon",D===0);else if(Y==="MultiPolygon")for(var W=0;W<G.length;W++){var ne=G[W];for(D=0;D<ne.length;D++)eo(ee,ne[D],I,M,!0,D===0)}if(ee.length){var _e=P.tags||null;if(Y==="LineString"&&O.lineMetrics){for(var be in _e={},P.tags)_e[be]=P.tags[be];_e.mapbox_clip_start=G.start/G.size,_e.mapbox_clip_end=G.end/G.size}var fe={geometry:ee,type:Y==="Polygon"||Y==="MultiPolygon"?3:Y==="LineString"||Y==="MultiLineString"?2:1,tags:_e};P.id!==null&&(fe.id=P.id),I.features.push(fe)}}function eo(I,P,M,O,G,Y){var ee=O*O;if(O>0&&P.size<(G?ee:O))M.numPoints+=P.length/3;else{for(var D=[],W=0;W<P.length;W+=3)(O===0||P[W+2]>ee)&&(M.numSimplified++,D.push(P[W]),D.push(P[W+1])),M.numPoints++;G&&function(ne,_e){for(var be=0,fe=0,xe=ne.length,Ve=xe-2;fe<xe;Ve=fe,fe+=2)be+=(ne[fe]-ne[Ve])*(ne[fe+1]+ne[Ve+1]);if(be>0===_e)for(fe=0,xe=ne.length;fe<xe/2;fe+=2){var Fe=ne[fe],de=ne[fe+1];ne[fe]=ne[xe-2-fe],ne[fe+1]=ne[xe-1-fe],ne[xe-2-fe]=Fe,ne[xe-1-fe]=de}}(D,Y),I.push(D)}}function un(I,P){var M=(P=this.options=function(G,Y){for(var ee in Y)G[ee]=Y[ee];return G}(Object.create(this.options),P)).debug;if(M&&console.time("preprocess data"),P.maxZoom<0||P.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(P.promoteId&&P.generateId)throw new Error("promoteId and generateId cannot be used together.");var O=function(G,Y){var ee=[];if(G.type==="FeatureCollection")for(var D=0;D<G.features.length;D++)Ii(ee,G.features[D],Y,D);else Ii(ee,G.type==="Feature"?G:{geometry:G},Y);return ee}(I,P);this.tiles={},this.tileCoords=[],M&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",P.indexMaxZoom,P.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),(O=function(G,Y){var ee=Y.buffer/Y.extent,D=G,W=Ni(G,1,-1-ee,ee,0,-1,2,Y),ne=Ni(G,1,1-ee,2+ee,0,-1,2,Y);return(W||ne)&&(D=Ni(G,1,-ee,1+ee,0,-1,2,Y)||[],W&&(D=da(W,1).concat(D)),ne&&(D=D.concat(da(ne,-1)))),D}(O,P)).length&&this.splitTile(O,0,0,0),M&&(O.length&&console.log("features: %d, points: %d",this.tiles[0].numFeatures,this.tiles[0].numPoints),console.timeEnd("generate tiles"),console.log("tiles generated:",this.total,JSON.stringify(this.stats)))}function cn(I,P,M){return 32*((1<<I)*M+P)+I}function Uo(I,P){var M=I.tileID.canonical;if(!this._geoJSONIndex)return P(null,null);var O=this._geoJSONIndex.getTile(M.z,M.x,M.y);if(!O)return P(null,null);var G=new Ct(O.features),Y=Qr(G);Y.byteOffset===0&&Y.byteLength===Y.buffer.byteLength||(Y=new Uint8Array(Y)),P(null,{vectorTile:G,rawData:Y.buffer})}$r.prototype.load=function(I){var P=this.options,M=P.log,O=P.minZoom,G=P.maxZoom,Y=P.nodeSize;M&&console.time("total time");var ee="prepare "+I.length+" points";M&&console.time(ee),this.points=I;for(var D=[],W=0;W<I.length;W++)I[W].geometry&&D.push(Vt(I[W],W));this.trees[G+1]=new bn(D,ti,Ti,Y,Float32Array),M&&console.timeEnd(ee);for(var ne=G;ne>=O;ne--){var _e=+Date.now();D=this._cluster(D,ne),this.trees[ne]=new bn(D,ti,Ti,Y,Float32Array),M&&console.log("z%d: %d clusters in %dms",ne,D.length,+Date.now()-_e)}return M&&console.timeEnd("total time"),this},$r.prototype.getClusters=function(I,P){var M=((I[0]+180)%360+360)%360-180,O=Math.max(-90,Math.min(90,I[1])),G=I[2]===180?180:((I[2]+180)%360+360)%360-180,Y=Math.max(-90,Math.min(90,I[3]));if(I[2]-I[0]>=360)M=-180,G=180;else if(M>G){var ee=this.getClusters([M,O,180,Y],P),D=this.getClusters([-180,O,G,Y],P);return ee.concat(D)}for(var W=this.trees[this._limitZoom(P)],ne=[],_e=0,be=W.range(Vi(M),yt(Y),Vi(G),yt(O));_e<be.length;_e+=1){var fe=W.points[be[_e]];ne.push(fe.numPoints?Ji(fe):this.points[fe.index])}return ne},$r.prototype.getChildren=function(I){var P=this._getOriginId(I),M=this._getOriginZoom(I),O="No cluster with the specified id.",G=this.trees[M];if(!G)throw new Error(O);var Y=G.points[P];if(!Y)throw new Error(O);for(var ee=this.options.radius/(this.options.extent*Math.pow(2,M-1)),D=[],W=0,ne=G.within(Y.x,Y.y,ee);W<ne.length;W+=1){var _e=G.points[ne[W]];_e.parentId===I&&D.push(_e.numPoints?Ji(_e):this.points[_e.index])}if(D.length===0)throw new Error(O);return D},$r.prototype.getLeaves=function(I,P,M){var O=[];return this._appendLeaves(O,I,P=P||10,M=M||0,0),O},$r.prototype.getTile=function(I,P,M){var O=this.trees[this._limitZoom(I)],G=Math.pow(2,I),Y=this.options,ee=Y.radius/Y.extent,D=(M-ee)/G,W=(M+1+ee)/G,ne={features:[]};return this._addTileFeatures(O.range((P-ee)/G,D,(P+1+ee)/G,W),O.points,P,M,G,ne),P===0&&this._addTileFeatures(O.range(1-ee/G,D,1,W),O.points,G,M,G,ne),P===G-1&&this._addTileFeatures(O.range(0,D,ee/G,W),O.points,-1,M,G,ne),ne.features.length?ne:null},$r.prototype.getClusterExpansionZoom=function(I){for(var P=this._getOriginZoom(I)-1;P<=this.options.maxZoom;){var M=this.getChildren(I);if(P++,M.length!==1)break;I=M[0].properties.cluster_id}return P},$r.prototype._appendLeaves=function(I,P,M,O,G){for(var Y=0,ee=this.getChildren(P);Y<ee.length;Y+=1){var D=ee[Y],W=D.properties;if(W&&W.cluster?G+W.point_count<=O?G+=W.point_count:G=this._appendLeaves(I,W.cluster_id,M,O,G):G<O?G++:I.push(D),I.length===M)break}return G},$r.prototype._addTileFeatures=function(I,P,M,O,G,Y){for(var ee=0,D=I;ee<D.length;ee+=1){var W=P[D[ee]],ne=W.numPoints,_e={type:1,geometry:[[Math.round(this.options.extent*(W.x*G-M)),Math.round(this.options.extent*(W.y*G-O))]],tags:ne?Ro(W):this.points[W.index].properties},be=void 0;ne?be=W.id:this.options.generateId?be=W.index:this.points[W.index].id&&(be=this.points[W.index].id),be!==void 0&&(_e.id=be),Y.features.push(_e)}},$r.prototype._limitZoom=function(I){return Math.max(this.options.minZoom,Math.min(+I,this.options.maxZoom+1))},$r.prototype._cluster=function(I,P){for(var M=[],O=this.options,G=O.reduce,Y=O.minPoints,ee=O.radius/(O.extent*Math.pow(2,P)),D=0;D<I.length;D++){var W=I[D];if(!(W.zoom<=P)){W.zoom=P;for(var ne=this.trees[P+1],_e=ne.within(W.x,W.y,ee),be=W.numPoints||1,fe=be,xe=0,Ve=_e;xe<Ve.length;xe+=1){var Fe=ne.points[Ve[xe]];Fe.zoom>P&&(fe+=Fe.numPoints||1)}if(fe>=Y){for(var de=W.x*be,De=W.y*be,Ee=G&&be>1?this._map(W,!0):null,Ce=(D<<5)+(P+1)+this.points.length,ut=0,ze=_e;ut<ze.length;ut+=1){var vt=ne.points[ze[ut]];if(!(vt.zoom<=P)){vt.zoom=P;var Ut=vt.numPoints||1;de+=vt.x*Ut,De+=vt.y*Ut,vt.parentId=Ce,G&&(Ee||(Ee=this._map(W,!0)),G(Ee,this._map(vt)))}}W.parentId=Ce,M.push(ln(de/fe,De/fe,Ce,fe,Ee))}else if(M.push(W),fe>1)for(var ht=0,kt=_e;ht<kt.length;ht+=1){var _t=ne.points[kt[ht]];_t.zoom<=P||(_t.zoom=P,M.push(_t))}}}return M},$r.prototype._getOriginId=function(I){return I-this.points.length>>5},$r.prototype._getOriginZoom=function(I){return(I-this.points.length)%32},$r.prototype._map=function(I,P){if(I.numPoints)return P?wn({},I.properties):I.properties;var M=this.points[I.index].properties,O=this.options.map(M);return P&&O===M?wn({},O):O},un.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},un.prototype.splitTile=function(I,P,M,O,G,Y,ee){for(var D=[I,P,M,O],W=this.options,ne=W.debug;D.length;){O=D.pop(),M=D.pop(),P=D.pop(),I=D.pop();var _e=1<<P,be=cn(P,M,O),fe=this.tiles[be];if(!fe&&(ne>1&&console.time("creation"),fe=this.tiles[be]=ls(I,P,M,O,W),this.tileCoords.push({z:P,x:M,y:O}),ne)){ne>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",P,M,O,fe.numFeatures,fe.numPoints,fe.numSimplified),console.timeEnd("creation"));var xe="z"+P;this.stats[xe]=(this.stats[xe]||0)+1,this.total++}if(fe.source=I,G){if(P===W.maxZoom||P===G)continue;var Ve=1<<G-P;if(M!==Math.floor(Y/Ve)||O!==Math.floor(ee/Ve))continue}else if(P===W.indexMaxZoom||fe.numPoints<=W.indexMaxPoints)continue;if(fe.source=null,I.length!==0){ne>1&&console.time("clipping");var Fe,de,De,Ee,Ce,ut,ze=.5*W.buffer/W.extent,vt=.5-ze,Ut=.5+ze,ht=1+ze;Fe=de=De=Ee=null,Ce=Ni(I,_e,M-ze,M+Ut,0,fe.minX,fe.maxX,W),ut=Ni(I,_e,M+vt,M+ht,0,fe.minX,fe.maxX,W),I=null,Ce&&(Fe=Ni(Ce,_e,O-ze,O+Ut,1,fe.minY,fe.maxY,W),de=Ni(Ce,_e,O+vt,O+ht,1,fe.minY,fe.maxY,W),Ce=null),ut&&(De=Ni(ut,_e,O-ze,O+Ut,1,fe.minY,fe.maxY,W),Ee=Ni(ut,_e,O+vt,O+ht,1,fe.minY,fe.maxY,W),ut=null),ne>1&&console.timeEnd("clipping"),D.push(Fe||[],P+1,2*M,2*O),D.push(de||[],P+1,2*M,2*O+1),D.push(De||[],P+1,2*M+1,2*O),D.push(Ee||[],P+1,2*M+1,2*O+1)}}},un.prototype.getTile=function(I,P,M){var O=this.options,G=O.extent,Y=O.debug;if(I<0||I>24)return null;var ee=1<<I,D=cn(I,P=(P%ee+ee)%ee,M);if(this.tiles[D])return ma(this.tiles[D],G);Y>1&&console.log("drilling down to z%d-%d-%d",I,P,M);for(var W,ne=I,_e=P,be=M;!W&&ne>0;)ne--,_e=Math.floor(_e/2),be=Math.floor(be/2),W=this.tiles[cn(ne,_e,be)];return W&&W.source?(Y>1&&console.log("found parent tile z%d-%d-%d",ne,_e,be),Y>1&&console.time("drilling down"),this.splitTile(W.source,ne,_e,be,I,P,M),Y>1&&console.timeEnd("drilling down"),this.tiles[D]?ma(this.tiles[D],G):null):null};var va=function(I){function P(M,O,G,Y){I.call(this,M,O,G,Uo),Y&&(this.loadGeoJSON=Y)}return I&&(P.__proto__=I),(P.prototype=Object.create(I&&I.prototype)).constructor=P,P.prototype.loadData=function(M,O){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=O,this._pendingLoadDataParams=M,this._state&&this._state!=="Idle"?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},P.prototype._loadData=function(){var M=this;if(this._pendingCallback&&this._pendingLoadDataParams){var O=this._pendingCallback,G=this._pendingLoadDataParams;delete this._pendingCallback,delete this._pendingLoadDataParams;var Y=!!(G&&G.request&&G.request.collectResourceTiming)&&new l.RequestPerformance(G.request);this.loadGeoJSON(G,function(ee,D){if(ee||!D)return O(ee);if(typeof D!="object")return O(new Error("Input data given to '"+G.source+"' is not a valid GeoJSON object."));(function fe(xe,Ve){var Fe,de=xe&&xe.type;if(de==="FeatureCollection")for(Fe=0;Fe<xe.features.length;Fe++)fe(xe.features[Fe],Ve);else if(de==="GeometryCollection")for(Fe=0;Fe<xe.geometries.length;Fe++)fe(xe.geometries[Fe],Ve);else if(de==="Feature")fe(xe.geometry,Ve);else if(de==="Polygon")pt(xe.coordinates,Ve);else if(de==="MultiPolygon")for(Fe=0;Fe<xe.coordinates.length;Fe++)pt(xe.coordinates[Fe],Ve);return xe})(D,!0);try{if(G.filter){var W=l.createExpression(G.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if(W.result==="error")throw new Error(W.value.map(function(fe){return fe.key+": "+fe.message}).join(", "));var ne=D.features.filter(function(fe){return W.value.evaluate({zoom:0},fe)});D={type:"FeatureCollection",features:ne}}M._geoJSONIndex=G.cluster?new $r(function(fe){var xe=fe.superclusterOptions,Ve=fe.clusterProperties;if(!Ve||!xe)return xe;for(var Fe={},de={},De={accumulated:null,zoom:0},Ee={properties:null},Ce=Object.keys(Ve),ut=0,ze=Ce;ut<ze.length;ut+=1){var vt=ze[ut],Ut=Ve[vt],ht=Ut[0],kt=l.createExpression(Ut[1]),_t=l.createExpression(typeof ht=="string"?[ht,["accumulated"],["get",vt]]:ht);Fe[vt]=kt.value,de[vt]=_t.value}return xe.map=function(qr){Ee.properties=qr;for(var Bt={},sr=0,Ft=Ce;sr<Ft.length;sr+=1){var mt=Ft[sr];Bt[mt]=Fe[mt].evaluate(De,Ee)}return Bt},xe.reduce=function(qr,Bt){Ee.properties=Bt;for(var sr=0,Ft=Ce;sr<Ft.length;sr+=1){var mt=Ft[sr];De.accumulated=qr[mt],qr[mt]=de[mt].evaluate(De,Ee)}},xe}(G)).load(D.features):function(fe,xe){return new un(fe,xe)}(D,G.geojsonVtOptions)}catch(fe){return O(fe)}M.loaded={};var _e={};if(Y){var be=Y.finish();be&&(_e.resourceTiming={},_e.resourceTiming[G.source]=JSON.parse(JSON.stringify(be)))}O(null,_e)})}},P.prototype.coalesce=function(){this._state==="Coalescing"?this._state="Idle":this._state==="NeedsLoadData"&&(this._state="Coalescing",this._loadData())},P.prototype.reloadTile=function(M,O){var G=this.loaded;return G&&G[M.uid]?I.prototype.reloadTile.call(this,M,O):this.loadTile(M,O)},P.prototype.loadGeoJSON=function(M,O){if(M.request)l.getJSON(M.request,O);else{if(typeof M.data!="string")return O(new Error("Input data given to '"+M.source+"' is not a valid GeoJSON object."));try{return O(null,JSON.parse(M.data))}catch{return O(new Error("Input data given to '"+M.source+"' is not a valid GeoJSON object."))}}},P.prototype.removeSource=function(M,O){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),O()},P.prototype.getClusterExpansionZoom=function(M,O){try{O(null,this._geoJSONIndex.getClusterExpansionZoom(M.clusterId))}catch(G){O(G)}},P.prototype.getClusterChildren=function(M,O){try{O(null,this._geoJSONIndex.getChildren(M.clusterId))}catch(G){O(G)}},P.prototype.getClusterLeaves=function(M,O){try{O(null,this._geoJSONIndex.getLeaves(M.clusterId,M.limit,M.offset))}catch(G){O(G)}},P}(Ae),ar=function(I){var P=this;this.self=I,this.actor=new l.Actor(I,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:Ae,geojson:va},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(M,O){if(P.workerSourceTypes[M])throw new Error('Worker source with name "'+M+'" already registered.');P.workerSourceTypes[M]=O},this.self.registerRTLTextPlugin=function(M){if(l.plugin.isParsed())throw new Error("RTL text plugin already registered.");l.plugin.applyArabicShaping=M.applyArabicShaping,l.plugin.processBidirectionalText=M.processBidirectionalText,l.plugin.processStyledBidirectionalText=M.processStyledBidirectionalText}};return ar.prototype.setReferrer=function(I,P){this.referrer=P},ar.prototype.setImages=function(I,P,M){for(var O in this.availableImages[I]=P,this.workerSources[I]){var G=this.workerSources[I][O];for(var Y in G)G[Y].availableImages=P}M()},ar.prototype.setLayers=function(I,P,M){this.getLayerIndex(I).replace(P),M()},ar.prototype.updateLayers=function(I,P,M){this.getLayerIndex(I).update(P.layers,P.removedIds),M()},ar.prototype.loadTile=function(I,P,M){this.getWorkerSource(I,P.type,P.source).loadTile(P,M)},ar.prototype.loadDEMTile=function(I,P,M){this.getDEMWorkerSource(I,P.source).loadTile(P,M)},ar.prototype.reloadTile=function(I,P,M){this.getWorkerSource(I,P.type,P.source).reloadTile(P,M)},ar.prototype.abortTile=function(I,P,M){this.getWorkerSource(I,P.type,P.source).abortTile(P,M)},ar.prototype.removeTile=function(I,P,M){this.getWorkerSource(I,P.type,P.source).removeTile(P,M)},ar.prototype.removeDEMTile=function(I,P){this.getDEMWorkerSource(I,P.source).removeTile(P)},ar.prototype.removeSource=function(I,P,M){if(this.workerSources[I]&&this.workerSources[I][P.type]&&this.workerSources[I][P.type][P.source]){var O=this.workerSources[I][P.type][P.source];delete this.workerSources[I][P.type][P.source],O.removeSource!==void 0?O.removeSource(P,M):M()}},ar.prototype.loadWorkerSource=function(I,P,M){try{this.self.importScripts(P.url),M()}catch(O){M(O.toString())}},ar.prototype.syncRTLPluginState=function(I,P,M){try{l.plugin.setState(P);var O=l.plugin.getPluginURL();if(l.plugin.isLoaded()&&!l.plugin.isParsed()&&O!=null){this.self.importScripts(O);var G=l.plugin.isParsed();M(G?void 0:new Error("RTL Text Plugin failed to import scripts from "+O),G)}}catch(Y){M(Y.toString())}},ar.prototype.getAvailableImages=function(I){var P=this.availableImages[I];return P||(P=[]),P},ar.prototype.getLayerIndex=function(I){var P=this.layerIndexes[I];return P||(P=this.layerIndexes[I]=new me),P},ar.prototype.getWorkerSource=function(I,P,M){var O=this;return this.workerSources[I]||(this.workerSources[I]={}),this.workerSources[I][P]||(this.workerSources[I][P]={}),this.workerSources[I][P][M]||(this.workerSources[I][P][M]=new this.workerSourceTypes[P]({send:function(G,Y,ee){O.actor.send(G,Y,ee,I)}},this.getLayerIndex(I),this.getAvailableImages(I))),this.workerSources[I][P][M]},ar.prototype.getDEMWorkerSource=function(I,P){return this.demWorkerSources[I]||(this.demWorkerSources[I]={}),this.demWorkerSources[I][P]||(this.demWorkerSources[I][P]=new qe),this.demWorkerSources[I][P]},ar.prototype.enforceCacheSizeLimit=function(I,P){l.enforceCacheSizeLimit(P)},typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&(self.worker=new ar(self)),ar}),V(["./shared"],function(l){var re=l.createCommonjsModule(function(i){function o(p){return!n(p)}function n(p){return typeof window>"u"||typeof document>"u"?"not a browser":Array.prototype&&Array.prototype.every&&Array.prototype.filter&&Array.prototype.forEach&&Array.prototype.indexOf&&Array.prototype.lastIndexOf&&Array.prototype.map&&Array.prototype.some&&Array.prototype.reduce&&Array.prototype.reduceRight&&Array.isArray?Function.prototype&&Function.prototype.bind?Object.keys&&Object.create&&Object.getPrototypeOf&&Object.getOwnPropertyNames&&Object.isSealed&&Object.isFrozen&&Object.isExtensible&&Object.getOwnPropertyDescriptor&&Object.defineProperty&&Object.defineProperties&&Object.seal&&Object.freeze&&Object.preventExtensions?"JSON"in window&&"parse"in JSON&&"stringify"in JSON?function(){if(!("Worker"in window&&"Blob"in window&&"URL"in window))return!1;var y,g,w=new Blob([""],{type:"text/javascript"}),A=URL.createObjectURL(w);try{g=new Worker(A),y=!0}catch{y=!1}return g&&g.terminate(),URL.revokeObjectURL(A),y}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var y=document.createElement("canvas");y.width=y.height=1;var g=y.getContext("2d");if(!g)return!1;var w=g.getImageData(0,0,1,1);return w&&w.width===y.width}()?(s[m=p&&p.failIfMajorPerformanceCaveat]===void 0&&(s[m]=function(y){var g=function(A){var B=document.createElement("canvas"),L=Object.create(o.webGLContextAttributes);return L.failIfMajorPerformanceCaveat=A,B.probablySupportsContext?B.probablySupportsContext("webgl",L)||B.probablySupportsContext("experimental-webgl",L):B.supportsContext?B.supportsContext("webgl",L)||B.supportsContext("experimental-webgl",L):B.getContext("webgl",L)||B.getContext("experimental-webgl",L)}(y);if(!g)return!1;var w=g.createShader(g.VERTEX_SHADER);return!(!w||g.isContextLost())&&(g.shaderSource(w,"void main() {}"),g.compileShader(w),g.getShaderParameter(w,g.COMPILE_STATUS)===!0)}(m)),s[m]?void 0:"insufficient WebGL support"):"insufficient Canvas/getImageData support":"insufficient ArrayBuffer support":"insufficient Uint8ClampedArray support":"insufficient worker support":"insufficient JSON support":"insufficient Object support":"insufficient Function support":"insufficent Array support";var m}i.exports?i.exports=o:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=o,window.mapboxgl.notSupportedReason=n);var s={};o.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}}),q={create:function(i,o,n){var s=l.window.document.createElement(i);return o!==void 0&&(s.className=o),n&&n.appendChild(s),s},createNS:function(i,o){return l.window.document.createElementNS(i,o)}},me=l.window.document&&l.window.document.documentElement.style;function pe(i){if(!me)return i[0];for(var o=0;o<i.length;o++)if(i[o]in me)return i[o];return i[0]}var ke,ae=pe(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);q.disableDrag=function(){me&&ae&&(ke=me[ae],me[ae]="none")},q.enableDrag=function(){me&&ae&&(me[ae]=ke)};var ve=pe(["transform","WebkitTransform"]);q.setTransform=function(i,o){i.style[ve]=o};var Ae=!1;try{var Je=Object.defineProperty({},"passive",{get:function(){Ae=!0}});l.window.addEventListener("test",Je,Je),l.window.removeEventListener("test",Je,Je)}catch{Ae=!1}q.addEventListener=function(i,o,n,s){s===void 0&&(s={}),i.addEventListener(o,n,"passive"in s&&Ae?s:s.capture)},q.removeEventListener=function(i,o,n,s){s===void 0&&(s={}),i.removeEventListener(o,n,"passive"in s&&Ae?s:s.capture)};var qe=function(i){i.preventDefault(),i.stopPropagation(),l.window.removeEventListener("click",qe,!0)};function pt(i){var o=i.userImage;return!!(o&&o.render&&o.render())&&(i.data.replace(new Uint8Array(o.data.buffer)),!0)}q.suppressClick=function(){l.window.addEventListener("click",qe,!0),l.window.setTimeout(function(){l.window.removeEventListener("click",qe,!0)},0)},q.mousePos=function(i,o){var n=i.getBoundingClientRect();return new l.Point(o.clientX-n.left-i.clientLeft,o.clientY-n.top-i.clientTop)},q.touchPos=function(i,o){for(var n=i.getBoundingClientRect(),s=[],p=0;p<o.length;p++)s.push(new l.Point(o[p].clientX-n.left-i.clientLeft,o[p].clientY-n.top-i.clientTop));return s},q.mouseButton=function(i){return l.window.InstallTrigger!==void 0&&i.button===2&&i.ctrlKey&&l.window.navigator.platform.toUpperCase().indexOf("MAC")>=0?0:i.button},q.remove=function(i){i.parentNode&&i.parentNode.removeChild(i)};var ot=function(i){function o(){i.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new l.RGBAImage({width:1,height:1}),this.dirty=!0}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.isLoaded=function(){return this.loaded},o.prototype.setLoaded=function(n){if(this.loaded!==n&&(this.loaded=n,n)){for(var s=0,p=this.requestors;s<p.length;s+=1){var m=p[s];this._notify(m.ids,m.callback)}this.requestors=[]}},o.prototype.getImage=function(n){return this.images[n]},o.prototype.addImage=function(n,s){this._validate(n,s)&&(this.images[n]=s)},o.prototype._validate=function(n,s){var p=!0;return this._validateStretch(s.stretchX,s.data&&s.data.width)||(this.fire(new l.ErrorEvent(new Error('Image "'+n+'" has invalid "stretchX" value'))),p=!1),this._validateStretch(s.stretchY,s.data&&s.data.height)||(this.fire(new l.ErrorEvent(new Error('Image "'+n+'" has invalid "stretchY" value'))),p=!1),this._validateContent(s.content,s)||(this.fire(new l.ErrorEvent(new Error('Image "'+n+'" has invalid "content" value'))),p=!1),p},o.prototype._validateStretch=function(n,s){if(!n)return!0;for(var p=0,m=0,y=n;m<y.length;m+=1){var g=y[m];if(g[0]<p||g[1]<g[0]||s<g[1])return!1;p=g[1]}return!0},o.prototype._validateContent=function(n,s){return!(n&&(n.length!==4||n[0]<0||s.data.width<n[0]||n[1]<0||s.data.height<n[1]||n[2]<0||s.data.width<n[2]||n[3]<0||s.data.height<n[3]||n[2]<n[0]||n[3]<n[1]))},o.prototype.updateImage=function(n,s){s.version=this.images[n].version+1,this.images[n]=s,this.updatedImages[n]=!0},o.prototype.removeImage=function(n){var s=this.images[n];delete this.images[n],delete this.patterns[n],s.userImage&&s.userImage.onRemove&&s.userImage.onRemove()},o.prototype.listImages=function(){return Object.keys(this.images)},o.prototype.getImages=function(n,s){var p=!0;if(!this.isLoaded())for(var m=0,y=n;m<y.length;m+=1)this.images[y[m]]||(p=!1);this.isLoaded()||p?this._notify(n,s):this.requestors.push({ids:n,callback:s})},o.prototype._notify=function(n,s){for(var p={},m=0,y=n;m<y.length;m+=1){var g=y[m];this.images[g]||this.fire(new l.Event("styleimagemissing",{id:g}));var w=this.images[g];w?p[g]={data:w.data.clone(),pixelRatio:w.pixelRatio,sdf:w.sdf,version:w.version,stretchX:w.stretchX,stretchY:w.stretchY,content:w.content,hasRenderCallback:!!(w.userImage&&w.userImage.render)}:l.warnOnce('Image "'+g+'" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.')}s(null,p)},o.prototype.getPixelSize=function(){var n=this.atlasImage;return{width:n.width,height:n.height}},o.prototype.getPattern=function(n){var s=this.patterns[n],p=this.getImage(n);if(!p)return null;if(s&&s.position.version===p.version)return s.position;if(s)s.position.version=p.version;else{var m={w:p.data.width+2,h:p.data.height+2,x:0,y:0},y=new l.ImagePosition(m,p);this.patterns[n]={bin:m,position:y}}return this._updatePatternAtlas(),this.patterns[n].position},o.prototype.bind=function(n){var s=n.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new l.Texture(n,this.atlasImage,s.RGBA),this.atlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE)},o.prototype._updatePatternAtlas=function(){var n=[];for(var s in this.patterns)n.push(this.patterns[s].bin);var p=l.potpack(n),m=p.w,y=p.h,g=this.atlasImage;for(var w in g.resize({width:m||1,height:y||1}),this.patterns){var A=this.patterns[w].bin,B=A.x+1,L=A.y+1,R=this.images[w].data,Z=R.width,j=R.height;l.RGBAImage.copy(R,g,{x:0,y:0},{x:B,y:L},{width:Z,height:j}),l.RGBAImage.copy(R,g,{x:0,y:j-1},{x:B,y:L-1},{width:Z,height:1}),l.RGBAImage.copy(R,g,{x:0,y:0},{x:B,y:L+j},{width:Z,height:1}),l.RGBAImage.copy(R,g,{x:Z-1,y:0},{x:B-1,y:L},{width:1,height:j}),l.RGBAImage.copy(R,g,{x:0,y:0},{x:B+Z,y:L},{width:1,height:j})}this.dirty=!0},o.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},o.prototype.dispatchRenderCallbacks=function(n){for(var s=0,p=n;s<p.length;s+=1){var m=p[s];if(!this.callbackDispatchedThisFrame[m]){this.callbackDispatchedThisFrame[m]=!0;var y=this.images[m];pt(y)&&this.updateImage(m,y)}}},o}(l.Evented),Rt=Qt,bt=Qt,Ct=1e20;function Qt(i,o,n,s,p,m){this.fontSize=i||24,this.buffer=o===void 0?3:o,this.cutoff=s||.25,this.fontFamily=p||"sans-serif",this.fontWeight=m||"normal",this.radius=n||8;var y=this.size=this.fontSize+2*this.buffer;this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=y,this.ctx=this.canvas.getContext("2d"),this.ctx.font=this.fontWeight+" "+this.fontSize+"px "+this.fontFamily,this.ctx.textBaseline="middle",this.ctx.fillStyle="black",this.gridOuter=new Float64Array(y*y),this.gridInner=new Float64Array(y*y),this.f=new Float64Array(y),this.d=new Float64Array(y),this.z=new Float64Array(y+1),this.v=new Int16Array(y),this.middle=Math.round(y/2*(navigator.userAgent.indexOf("Gecko/")>=0?1.2:1))}function vr(i,o,n,s,p,m,y){for(var g=0;g<o;g++){for(var w=0;w<n;w++)s[w]=i[w*o+g];for(Er(s,p,m,y,n),w=0;w<n;w++)i[w*o+g]=p[w]}for(w=0;w<n;w++){for(g=0;g<o;g++)s[g]=i[w*o+g];for(Er(s,p,m,y,o),g=0;g<o;g++)i[w*o+g]=Math.sqrt(p[g])}}function Er(i,o,n,s,p){n[0]=0,s[0]=-Ct,s[1]=+Ct;for(var m=1,y=0;m<p;m++){for(var g=(i[m]+m*m-(i[n[y]]+n[y]*n[y]))/(2*m-2*n[y]);g<=s[y];)y--,g=(i[m]+m*m-(i[n[y]]+n[y]*n[y]))/(2*m-2*n[y]);n[++y]=m,s[y]=g,s[y+1]=+Ct}for(m=0,y=0;m<p;m++){for(;s[y+1]<m;)y++;o[m]=(m-n[y])*(m-n[y])+i[n[y]]}}Qt.prototype.draw=function(i){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(i,this.buffer,this.middle);for(var o=this.ctx.getImageData(0,0,this.size,this.size),n=new Uint8ClampedArray(this.size*this.size),s=0;s<this.size*this.size;s++){var p=o.data[4*s+3]/255;this.gridOuter[s]=p===1?0:p===0?Ct:Math.pow(Math.max(0,.5-p),2),this.gridInner[s]=p===1?Ct:p===0?0:Math.pow(Math.max(0,p-.5),2)}for(vr(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),vr(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),s=0;s<this.size*this.size;s++)n[s]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[s]-this.gridInner[s])/this.radius+this.cutoff))));return n},Rt.default=bt;var er=function(i,o){this.requestManager=i,this.localIdeographFontFamily=o,this.entries={}};er.prototype.setURL=function(i){this.url=i},er.prototype.getGlyphs=function(i,o){var n=this,s=[];for(var p in i)for(var m=0,y=i[p];m<y.length;m+=1)s.push({stack:p,id:y[m]});l.asyncAll(s,function(g,w){var A=g.stack,B=g.id,L=n.entries[A];L||(L=n.entries[A]={glyphs:{},requests:{},ranges:{}});var R=L.glyphs[B];if(R===void 0){if(R=n._tinySDF(L,A,B))return L.glyphs[B]=R,void w(null,{stack:A,id:B,glyph:R});var Z=Math.floor(B/256);if(256*Z>65535)w(new Error("glyphs > 65535 not supported"));else if(L.ranges[Z])w(null,{stack:A,id:B,glyph:R});else{var j=L.requests[Z];j||(j=L.requests[Z]=[],er.loadGlyphRange(A,Z,n.url,n.requestManager,function(K,U){if(U){for(var X in U)n._doesCharSupportLocalGlyph(+X)||(L.glyphs[+X]=U[+X]);L.ranges[Z]=!0}for(var Q=0,ie=j;Q<ie.length;Q+=1)(0,ie[Q])(K,U);delete L.requests[Z]})),j.push(function(K,U){K?w(K):U&&w(null,{stack:A,id:B,glyph:U[B]||null})})}}else w(null,{stack:A,id:B,glyph:R})},function(g,w){if(g)o(g);else if(w){for(var A={},B=0,L=w;B<L.length;B+=1){var R=L[B],Z=R.stack,j=R.id,K=R.glyph;(A[Z]||(A[Z]={}))[j]=K&&{id:K.id,bitmap:K.bitmap.clone(),metrics:K.metrics}}o(null,A)}})},er.prototype._doesCharSupportLocalGlyph=function(i){return!!this.localIdeographFontFamily&&(l.isChar["CJK Unified Ideographs"](i)||l.isChar["Hangul Syllables"](i)||l.isChar.Hiragana(i)||l.isChar.Katakana(i))},er.prototype._tinySDF=function(i,o,n){var s=this.localIdeographFontFamily;if(s&&this._doesCharSupportLocalGlyph(n)){var p=i.tinySDF;if(!p){var m="400";/bold/i.test(o)?m="900":/medium/i.test(o)?m="500":/light/i.test(o)&&(m="200"),p=i.tinySDF=new er.TinySDF(24,3,8,.25,s,m)}return{id:n,bitmap:new l.AlphaImage({width:30,height:30},p.draw(String.fromCharCode(n))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},er.loadGlyphRange=function(i,o,n,s,p){var m=256*o,y=m+255,g=s.transformRequest(s.normalizeGlyphsURL(n).replace("{fontstack}",i).replace("{range}",m+"-"+y),l.ResourceType.Glyphs);l.getArrayBuffer(g,function(w,A){if(w)p(w);else if(A){for(var B={},L=0,R=l.parseGlyphPBF(A);L<R.length;L+=1){var Z=R[L];B[Z.id]=Z}p(null,B)}})},er.TinySDF=Rt;var Qr=function(){this.specification=l.styleSpec.light.position};Qr.prototype.possiblyEvaluate=function(i,o){return l.sphericalToCartesian(i.expression.evaluate(o))},Qr.prototype.interpolate=function(i,o,n){return{x:l.number(i.x,o.x,n),y:l.number(i.y,o.y,n),z:l.number(i.z,o.z,n)}};var ei=new l.Properties({anchor:new l.DataConstantProperty(l.styleSpec.light.anchor),position:new Qr,color:new l.DataConstantProperty(l.styleSpec.light.color),intensity:new l.DataConstantProperty(l.styleSpec.light.intensity)}),vi=function(i){function o(n){i.call(this),this._transitionable=new l.Transitionable(ei),this.setLight(n),this._transitioning=this._transitionable.untransitioned()}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getLight=function(){return this._transitionable.serialize()},o.prototype.setLight=function(n,s){if(s===void 0&&(s={}),!this._validate(l.validateLight,n,s))for(var p in n){var m=n[p];l.endsWith(p,"-transition")?this._transitionable.setTransition(p.slice(0,-11),m):this._transitionable.setValue(p,m)}},o.prototype.updateTransitions=function(n){this._transitioning=this._transitionable.transitioned(n,this._transitioning)},o.prototype.hasTransition=function(){return this._transitioning.hasTransition()},o.prototype.recalculate=function(n){this.properties=this._transitioning.possiblyEvaluate(n)},o.prototype._validate=function(n,s,p){return(!p||p.validate!==!1)&&l.emitValidationErrors(this,n.call(l.validateStyle,l.extend({value:s,style:{glyphs:!0,sprite:!0},styleSpec:l.styleSpec})))},o}(l.Evented),It=function(i,o){this.width=i,this.height=o,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};It.prototype.getDash=function(i,o){var n=i.join(",")+String(o);return this.dashEntry[n]||(this.dashEntry[n]=this.addDash(i,o)),this.dashEntry[n]},It.prototype.getDashRanges=function(i,o,n){var s=[],p=i.length%2==1?-i[i.length-1]*n:0,m=i[0]*n,y=!0;s.push({left:p,right:m,isDash:y,zeroLength:i[0]===0});for(var g=i[0],w=1;w<i.length;w++){var A=i[w];s.push({left:p=g*n,right:m=(g+=A)*n,isDash:y=!y,zeroLength:A===0})}return s},It.prototype.addRoundDash=function(i,o,n){for(var s=o/2,p=-n;p<=n;p++)for(var m=this.width*(this.nextRow+n+p),y=0,g=i[y],w=0;w<this.width;w++){w/g.right>1&&(g=i[++y]);var A=Math.abs(w-g.left),B=Math.abs(w-g.right),L=Math.min(A,B),R=void 0,Z=p/n*(s+1);if(g.isDash){var j=s-Math.abs(Z);R=Math.sqrt(L*L+j*j)}else R=s-Math.sqrt(L*L+Z*Z);this.data[m+w]=Math.max(0,Math.min(255,R+128))}},It.prototype.addRegularDash=function(i){for(var o=i.length-1;o>=0;--o){var n=i[o],s=i[o+1];n.zeroLength?i.splice(o,1):s&&s.isDash===n.isDash&&(s.left=n.left,i.splice(o,1))}var p=i[0],m=i[i.length-1];p.isDash===m.isDash&&(p.left=m.left-this.width,m.right=p.right+this.width);for(var y=this.width*this.nextRow,g=0,w=i[g],A=0;A<this.width;A++){A/w.right>1&&(w=i[++g]);var B=Math.abs(A-w.left),L=Math.abs(A-w.right),R=Math.min(B,L);this.data[y+A]=Math.max(0,Math.min(255,(w.isDash?R:-R)+128))}},It.prototype.addDash=function(i,o){var n=o?7:0,s=2*n+1;if(this.nextRow+s>this.height)return l.warnOnce("LineAtlas out of space"),null;for(var p=0,m=0;m<i.length;m++)p+=i[m];if(p!==0){var y=this.width/p,g=this.getDashRanges(i,this.width,y);o?this.addRoundDash(g,y,n):this.addRegularDash(g)}var w={y:(this.nextRow+n+.5)/this.height,height:2*n/this.height,width:p};return this.nextRow+=s,this.dirty=!0,w},It.prototype.bind=function(i){var o=i.gl;this.texture?(o.bindTexture(o.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,o.texSubImage2D(o.TEXTURE_2D,0,0,0,this.width,this.height,o.ALPHA,o.UNSIGNED_BYTE,this.data))):(this.texture=o.createTexture(),o.bindTexture(o.TEXTURE_2D,this.texture),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.REPEAT),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.REPEAT),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texImage2D(o.TEXTURE_2D,0,o.ALPHA,this.width,this.height,0,o.ALPHA,o.UNSIGNED_BYTE,this.data))};var gr=function i(o,n){this.workerPool=o,this.actors=[],this.currentActor=0,this.id=l.uniqueId();for(var s=this.workerPool.acquire(this.id),p=0;p<s.length;p++){var m=new i.Actor(s[p],n,this.id);m.name="Worker "+p,this.actors.push(m)}};function Bo(i,o,n){var s=function(p,m){if(p)return n(p);if(m){var y=l.pick(l.extend(m,i),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]);m.vector_layers&&(y.vectorLayers=m.vector_layers,y.vectorLayerIds=y.vectorLayers.map(function(g){return g.id})),y.tiles=o.canonicalizeTileset(y,i.url),n(null,y)}};return i.url?l.getJSON(o.transformRequest(o.normalizeSourceURL(i.url),l.ResourceType.Source),s):l.browser.frame(function(){return s(null,i)})}gr.prototype.broadcast=function(i,o,n){l.asyncAll(this.actors,function(s,p){s.send(i,o,p)},n=n||function(){})},gr.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},gr.prototype.remove=function(){this.actors.forEach(function(i){i.remove()}),this.actors=[],this.workerPool.release(this.id)},gr.Actor=l.Actor;var li=function(i,o,n){this.bounds=l.LngLatBounds.convert(this.validateBounds(i)),this.minzoom=o||0,this.maxzoom=n||24};li.prototype.validateBounds=function(i){return Array.isArray(i)&&i.length===4?[Math.max(-180,i[0]),Math.max(-90,i[1]),Math.min(180,i[2]),Math.min(90,i[3])]:[-180,-90,180,90]},li.prototype.contains=function(i){var o=Math.pow(2,i.z),n=Math.floor(l.mercatorXfromLng(this.bounds.getWest())*o),s=Math.floor(l.mercatorYfromLat(this.bounds.getNorth())*o),p=Math.ceil(l.mercatorXfromLng(this.bounds.getEast())*o),m=Math.ceil(l.mercatorYfromLat(this.bounds.getSouth())*o);return i.x>=n&&i.x<p&&i.y>=s&&i.y<m};var Do=function(i){function o(n,s,p,m){if(i.call(this),this.id=n,this.dispatcher=p,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,l.extend(this,l.pick(s,["url","scheme","tileSize","promoteId"])),this._options=l.extend({type:"vector"},s),this._collectResourceTiming=s.collectResourceTiming,this.tileSize!==512)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(m)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1,this.fire(new l.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Bo(this._options,this.map._requestManager,function(s,p){n._tileJSONRequest=null,n._loaded=!0,s?n.fire(new l.ErrorEvent(s)):p&&(l.extend(n,p),p.bounds&&(n.tileBounds=new li(p.bounds,n.minzoom,n.maxzoom)),l.postTurnstileEvent(p.tiles,n.map._requestManager._customAccessToken),l.postMapLoadEvent(p.tiles,n.map._getMapId(),n.map._requestManager._skuToken,n.map._requestManager._customAccessToken),n.fire(new l.Event("data",{dataType:"source",sourceDataType:"metadata"})),n.fire(new l.Event("data",{dataType:"source",sourceDataType:"content"})))})},o.prototype.loaded=function(){return this._loaded},o.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setSourceProperty=function(n){this._tileJSONRequest&&this._tileJSONRequest.cancel(),n(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},o.prototype.setTiles=function(n){var s=this;return this.setSourceProperty(function(){s._options.tiles=n}),this},o.prototype.setUrl=function(n){var s=this;return this.setSourceProperty(function(){s.url=n,s._options.url=n}),this},o.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},o.prototype.serialize=function(){return l.extend({},this._options)},o.prototype.loadTile=function(n,s){var p=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme)),m={request:this.map._requestManager.transformRequest(p,l.ResourceType.Tile),uid:n.uid,tileID:n.tileID,zoom:n.tileID.overscaledZ,tileSize:this.tileSize*n.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:l.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function y(g,w){return delete n.request,n.aborted?s(null):g&&g.status!==404?s(g):(w&&w.resourceTiming&&(n.resourceTiming=w.resourceTiming),this.map._refreshExpiredTiles&&w&&n.setExpiryData(w),n.loadVectorData(w,this.map.painter),l.cacheEntryPossiblyAdded(this.dispatcher),s(null),void(n.reloadCallback&&(this.loadTile(n,n.reloadCallback),n.reloadCallback=null)))}m.request.collectResourceTiming=this._collectResourceTiming,n.actor&&n.state!=="expired"?n.state==="loading"?n.reloadCallback=s:n.request=n.actor.send("reloadTile",m,y.bind(this)):(n.actor=this.dispatcher.getActor(),n.request=n.actor.send("loadTile",m,y.bind(this)))},o.prototype.abortTile=function(n){n.request&&(n.request.cancel(),delete n.request),n.actor&&n.actor.send("abortTile",{uid:n.uid,type:this.type,source:this.id},void 0)},o.prototype.unloadTile=function(n){n.unloadVectorData(),n.actor&&n.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id},void 0)},o.prototype.hasTransition=function(){return!1},o}(l.Evented),Lo=function(i){function o(n,s,p,m){i.call(this),this.id=n,this.dispatcher=p,this.setEventedParent(m),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=l.extend({type:"raster"},s),l.extend(this,l.pick(s,["url","scheme","tileSize"]))}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1,this.fire(new l.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=Bo(this._options,this.map._requestManager,function(s,p){n._tileJSONRequest=null,n._loaded=!0,s?n.fire(new l.ErrorEvent(s)):p&&(l.extend(n,p),p.bounds&&(n.tileBounds=new li(p.bounds,n.minzoom,n.maxzoom)),l.postTurnstileEvent(p.tiles),l.postMapLoadEvent(p.tiles,n.map._getMapId(),n.map._requestManager._skuToken),n.fire(new l.Event("data",{dataType:"source",sourceDataType:"metadata"})),n.fire(new l.Event("data",{dataType:"source",sourceDataType:"content"})))})},o.prototype.loaded=function(){return this._loaded},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},o.prototype.serialize=function(){return l.extend({},this._options)},o.prototype.hasTile=function(n){return!this.tileBounds||this.tileBounds.contains(n.canonical)},o.prototype.loadTile=function(n,s){var p=this,m=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);n.request=l.getImage(this.map._requestManager.transformRequest(m,l.ResourceType.Tile),function(y,g){if(delete n.request,n.aborted)n.state="unloaded",s(null);else if(y)n.state="errored",s(y);else if(g){p.map._refreshExpiredTiles&&n.setExpiryData(g),delete g.cacheControl,delete g.expires;var w=p.map.painter.context,A=w.gl;n.texture=p.map.painter.getTileTexture(g.width),n.texture?n.texture.update(g,{useMipmap:!0}):(n.texture=new l.Texture(w,g,A.RGBA,{useMipmap:!0}),n.texture.bind(A.LINEAR,A.CLAMP_TO_EDGE,A.LINEAR_MIPMAP_NEAREST),w.extTextureFilterAnisotropic&&A.texParameterf(A.TEXTURE_2D,w.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,w.extTextureFilterAnisotropicMax)),n.state="loaded",l.cacheEntryPossiblyAdded(p.dispatcher),s(null)}})},o.prototype.abortTile=function(n,s){n.request&&(n.request.cancel(),delete n.request),s()},o.prototype.unloadTile=function(n,s){n.texture&&this.map.painter.saveTileTexture(n.texture),s()},o.prototype.hasTransition=function(){return!1},o}(l.Evented),ns=function(i){function o(n,s,p,m){i.call(this,n,s,p,m),this.type="raster-dem",this.maxzoom=22,this._options=l.extend({type:"raster-dem"},s),this.encoding=s.encoding||"mapbox"}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},o.prototype.loadTile=function(n,s){var p=this.map._requestManager.normalizeTileURL(n.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);function m(y,g){y&&(n.state="errored",s(y)),g&&(n.dem=g,n.needsHillshadePrepare=!0,n.state="loaded",s(null))}n.request=l.getImage(this.map._requestManager.transformRequest(p,l.ResourceType.Tile),(function(y,g){if(delete n.request,n.aborted)n.state="unloaded",s(null);else if(y)n.state="errored",s(y);else if(g){this.map._refreshExpiredTiles&&n.setExpiryData(g),delete g.cacheControl,delete g.expires;var w=l.window.ImageBitmap&&g instanceof l.window.ImageBitmap&&l.offscreenCanvasSupported()?g:l.browser.getImageData(g,1),A={uid:n.uid,coord:n.tileID,source:this.id,rawImageData:w,encoding:this.encoding};n.actor&&n.state!=="expired"||(n.actor=this.dispatcher.getActor(),n.actor.send("loadDEMTile",A,m.bind(this)))}}).bind(this)),n.neighboringTiles=this._getNeighboringTiles(n.tileID)},o.prototype._getNeighboringTiles=function(n){var s=n.canonical,p=Math.pow(2,s.z),m=(s.x-1+p)%p,y=s.x===0?n.wrap-1:n.wrap,g=(s.x+1+p)%p,w=s.x+1===p?n.wrap+1:n.wrap,A={};return A[new l.OverscaledTileID(n.overscaledZ,y,s.z,m,s.y).key]={backfilled:!1},A[new l.OverscaledTileID(n.overscaledZ,w,s.z,g,s.y).key]={backfilled:!1},s.y>0&&(A[new l.OverscaledTileID(n.overscaledZ,y,s.z,m,s.y-1).key]={backfilled:!1},A[new l.OverscaledTileID(n.overscaledZ,n.wrap,s.z,s.x,s.y-1).key]={backfilled:!1},A[new l.OverscaledTileID(n.overscaledZ,w,s.z,g,s.y-1).key]={backfilled:!1}),s.y+1<p&&(A[new l.OverscaledTileID(n.overscaledZ,y,s.z,m,s.y+1).key]={backfilled:!1},A[new l.OverscaledTileID(n.overscaledZ,n.wrap,s.z,s.x,s.y+1).key]={backfilled:!1},A[new l.OverscaledTileID(n.overscaledZ,w,s.z,g,s.y+1).key]={backfilled:!1}),A},o.prototype.unloadTile=function(n){n.demTexture&&this.map.painter.saveTileTexture(n.demTexture),n.fbo&&(n.fbo.destroy(),delete n.fbo),n.dem&&delete n.dem,delete n.neighboringTiles,n.state="unloaded",n.actor&&n.actor.send("removeDEMTile",{uid:n.uid,source:this.id})},o}(Lo),xn=function(i){function o(n,s,p,m){i.call(this),this.id=n,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._loaded=!1,this.actor=p.getActor(),this.setEventedParent(m),this._data=s.data,this._options=l.extend({},s),this._collectResourceTiming=s.collectResourceTiming,this._resourceTiming=[],s.maxzoom!==void 0&&(this.maxzoom=s.maxzoom),s.type&&(this.type=s.type),s.attribution&&(this.attribution=s.attribution),this.promoteId=s.promoteId;var y=l.EXTENT/this.tileSize;this.workerOptions=l.extend({source:this.id,cluster:s.cluster||!1,geojsonVtOptions:{buffer:(s.buffer!==void 0?s.buffer:128)*y,tolerance:(s.tolerance!==void 0?s.tolerance:.375)*y,extent:l.EXTENT,maxZoom:this.maxzoom,lineMetrics:s.lineMetrics||!1,generateId:s.generateId||!1},superclusterOptions:{maxZoom:s.clusterMaxZoom!==void 0?Math.min(s.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,s.clusterMinPoints||2),extent:l.EXTENT,radius:(s.clusterRadius||50)*y,log:!1,generateId:s.generateId||!1},clusterProperties:s.clusterProperties,filter:s.filter},s.workerOptions)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this.fire(new l.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(s){if(s)n.fire(new l.ErrorEvent(s));else{var p={dataType:"source",sourceDataType:"metadata"};n._collectResourceTiming&&n._resourceTiming&&n._resourceTiming.length>0&&(p.resourceTiming=n._resourceTiming,n._resourceTiming=[]),n.fire(new l.Event("data",p))}})},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setData=function(n){var s=this;return this._data=n,this.fire(new l.Event("dataloading",{dataType:"source"})),this._updateWorkerData(function(p){if(p)s.fire(new l.ErrorEvent(p));else{var m={dataType:"source",sourceDataType:"content"};s._collectResourceTiming&&s._resourceTiming&&s._resourceTiming.length>0&&(m.resourceTiming=s._resourceTiming,s._resourceTiming=[]),s.fire(new l.Event("data",m))}}),this},o.prototype.getClusterExpansionZoom=function(n,s){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:n,source:this.id},s),this},o.prototype.getClusterChildren=function(n,s){return this.actor.send("geojson.getClusterChildren",{clusterId:n,source:this.id},s),this},o.prototype.getClusterLeaves=function(n,s,p,m){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:n,limit:s,offset:p},m),this},o.prototype._updateWorkerData=function(n){var s=this;this._loaded=!1;var p=l.extend({},this.workerOptions),m=this._data;typeof m=="string"?(p.request=this.map._requestManager.transformRequest(l.browser.resolveURL(m),l.ResourceType.Source),p.request.collectResourceTiming=this._collectResourceTiming):p.data=JSON.stringify(m),this.actor.send(this.type+".loadData",p,function(y,g){s._removed||g&&g.abandoned||(s._loaded=!0,g&&g.resourceTiming&&g.resourceTiming[s.id]&&(s._resourceTiming=g.resourceTiming[s.id].slice(0)),s.actor.send(s.type+".coalesce",{source:p.source},null),n(y))})},o.prototype.loaded=function(){return this._loaded},o.prototype.loadTile=function(n,s){var p=this,m=n.actor?"reloadTile":"loadTile";n.actor=this.actor,n.request=this.actor.send(m,{type:this.type,uid:n.uid,tileID:n.tileID,zoom:n.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:l.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},function(y,g){return delete n.request,n.unloadVectorData(),n.aborted?s(null):y?s(y):(n.loadVectorData(g,p.map.painter,m==="reloadTile"),s(null))})},o.prototype.abortTile=function(n){n.request&&(n.request.cancel(),delete n.request),n.aborted=!0},o.prototype.unloadTile=function(n){n.unloadVectorData(),this.actor.send("removeTile",{uid:n.uid,type:this.type,source:this.id})},o.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},o.prototype.serialize=function(){return l.extend({},this._options,{type:this.type,data:this._data})},o.prototype.hasTransition=function(){return!1},o}(l.Evented),Oi=l.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),Ki=function(i){function o(n,s,p,m){i.call(this),this.id=n,this.dispatcher=p,this.coordinates=s.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(m),this.options=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(n,s){var p=this;this._loaded=!1,this.fire(new l.Event("dataloading",{dataType:"source"})),this.url=this.options.url,l.getImage(this.map._requestManager.transformRequest(this.url,l.ResourceType.Image),function(m,y){p._loaded=!0,m?p.fire(new l.ErrorEvent(m)):y&&(p.image=y,n&&(p.coordinates=n),s&&s(),p._finishLoading())})},o.prototype.loaded=function(){return this._loaded},o.prototype.updateImage=function(n){var s=this;return this.image&&n.url?(this.options.url=n.url,this.load(n.coordinates,function(){s.texture=null}),this):this},o.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new l.Event("data",{dataType:"source",sourceDataType:"metadata"})))},o.prototype.onAdd=function(n){this.map=n,this.load()},o.prototype.setCoordinates=function(n){var s=this;this.coordinates=n;var p=n.map(l.MercatorCoordinate.fromLngLat);this.tileID=function(y){for(var g=1/0,w=1/0,A=-1/0,B=-1/0,L=0,R=y;L<R.length;L+=1){var Z=R[L];g=Math.min(g,Z.x),w=Math.min(w,Z.y),A=Math.max(A,Z.x),B=Math.max(B,Z.y)}var j=Math.max(A-g,B-w),K=Math.max(0,Math.floor(-Math.log(j)/Math.LN2)),U=Math.pow(2,K);return new l.CanonicalTileID(K,Math.floor((g+A)/2*U),Math.floor((w+B)/2*U))}(p),this.minzoom=this.maxzoom=this.tileID.z;var m=p.map(function(y){return s.tileID.getTilePoint(y)._round()});return this._boundsArray=new l.StructArrayLayout4i8,this._boundsArray.emplaceBack(m[0].x,m[0].y,0,0),this._boundsArray.emplaceBack(m[1].x,m[1].y,l.EXTENT,0),this._boundsArray.emplaceBack(m[3].x,m[3].y,0,l.EXTENT),this._boundsArray.emplaceBack(m[2].x,m[2].y,l.EXTENT,l.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new l.Event("data",{dataType:"source",sourceDataType:"content"})),this},o.prototype.prepare=function(){if(Object.keys(this.tiles).length!==0&&this.image){var n=this.map.painter.context,s=n.gl;for(var p in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Oi.members)),this.boundsSegments||(this.boundsSegments=l.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new l.Texture(n,this.image,s.RGBA),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE)),this.tiles){var m=this.tiles[p];m.state!=="loaded"&&(m.state="loaded",m.texture=this.texture)}}},o.prototype.loadTile=function(n,s){this.tileID&&this.tileID.equals(n.tileID.canonical)?(this.tiles[String(n.tileID.wrap)]=n,n.buckets={},s(null)):(n.state="errored",s(null))},o.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},o.prototype.hasTransition=function(){return!1},o}(l.Evented),Xn=function(i){function o(n,s,p,m){i.call(this,n,s,p,m),this.roundZoom=!0,this.type="video",this.options=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){var n=this;this._loaded=!1;var s=this.options;this.urls=[];for(var p=0,m=s.urls;p<m.length;p+=1)this.urls.push(this.map._requestManager.transformRequest(m[p],l.ResourceType.Source).url);l.getVideo(this.urls,function(y,g){n._loaded=!0,y?n.fire(new l.ErrorEvent(y)):g&&(n.video=g,n.video.loop=!0,n.video.setAttribute("playsinline",""),n.video.addEventListener("playing",function(){n.map.triggerRepaint()}),n.map&&n.video.play(),n._finishLoading())})},o.prototype.pause=function(){this.video&&this.video.pause()},o.prototype.play=function(){this.video&&this.video.play()},o.prototype.seek=function(n){if(this.video){var s=this.video.seekable;n<s.start(0)||n>s.end(0)?this.fire(new l.ErrorEvent(new l.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+s.start(0)+" and "+s.end(0)+"-second mark."))):this.video.currentTime=n}},o.prototype.getVideo=function(){return this.video},o.prototype.onAdd=function(n){this.map||(this.map=n,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},o.prototype.prepare=function(){if(!(Object.keys(this.tiles).length===0||this.video.readyState<2)){var n=this.map.painter.context,s=n.gl;for(var p in this.boundsBuffer||(this.boundsBuffer=n.createVertexBuffer(this._boundsArray,Oi.members)),this.boundsSegments||(this.boundsSegments=l.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE),s.texSubImage2D(s.TEXTURE_2D,0,0,0,s.RGBA,s.UNSIGNED_BYTE,this.video)):(this.texture=new l.Texture(n,this.video,s.RGBA),this.texture.bind(s.LINEAR,s.CLAMP_TO_EDGE)),this.tiles){var m=this.tiles[p];m.state!=="loaded"&&(m.state="loaded",m.texture=this.texture)}}},o.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},o.prototype.hasTransition=function(){return this.video&&!this.video.paused},o}(Ki),Kn=function(i){function o(n,s,p,m){i.call(this,n,s,p,m),s.coordinates?Array.isArray(s.coordinates)&&s.coordinates.length===4&&!s.coordinates.some(function(y){return!Array.isArray(y)||y.length!==2||y.some(function(g){return typeof g!="number"})})||this.fire(new l.ErrorEvent(new l.ValidationError("sources."+n,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new l.ErrorEvent(new l.ValidationError("sources."+n,null,'missing required property "coordinates"'))),s.animate&&typeof s.animate!="boolean"&&this.fire(new l.ErrorEvent(new l.ValidationError("sources."+n,null,'optional "animate" property must be a boolean value'))),s.canvas?typeof s.canvas=="string"||s.canvas instanceof l.window.HTMLCanvasElement||this.fire(new l.ErrorEvent(new l.ValidationError("sources."+n,null,'"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))):this.fire(new l.ErrorEvent(new l.ValidationError("sources."+n,null,'missing required property "canvas"'))),this.options=s,this.animate=s.animate===void 0||s.animate}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof l.window.HTMLCanvasElement?this.options.canvas:l.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new l.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))):(this.play=function(){this._playing=!0,this.map.triggerRepaint()},this.pause=function(){this._playing&&(this.prepare(),this._playing=!1)},this._finishLoading())},o.prototype.getCanvas=function(){return this.canvas},o.prototype.onAdd=function(n){this.map=n,this.load(),this.canvas&&this.animate&&this.play()},o.prototype.onRemove=function(){this.pause()},o.prototype.prepare=function(){var n=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,n=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,n=!0),!this._hasInvalidDimensions()&&Object.keys(this.tiles).length!==0){var s=this.map.painter.context,p=s.gl;for(var m in this.boundsBuffer||(this.boundsBuffer=s.createVertexBuffer(this._boundsArray,Oi.members)),this.boundsSegments||(this.boundsSegments=l.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(n||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new l.Texture(s,this.canvas,p.RGBA,{premultiply:!0}),this.tiles){var y=this.tiles[m];y.state!=="loaded"&&(y.state="loaded",y.texture=this.texture)}}},o.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},o.prototype.hasTransition=function(){return this._playing},o.prototype._hasInvalidDimensions=function(){for(var n=0,s=[this.canvas.width,this.canvas.height];n<s.length;n+=1){var p=s[n];if(isNaN(p)||p<=0)return!0}return!1},o}(Ki),bn={vector:Do,raster:Lo,"raster-dem":ns,geojson:xn,video:Xn,image:Ki,canvas:Kn};function _l(i,o){var n=l.identity([]);return l.translate(n,n,[1,1,0]),l.scale(n,n,[.5*i.width,.5*i.height,1]),l.multiply(n,n,i.calculatePosMatrix(o.toUnwrapped()))}function $r(i,o,n,s,p,m){var y=function(K,U,X){if(K)for(var Q=0,ie=K;Q<ie.length;Q+=1){var ce=U[ie[Q]];if(ce&&ce.source===X&&ce.type==="fill-extrusion")return!0}else for(var le in U){var he=U[le];if(he.source===X&&he.type==="fill-extrusion")return!0}return!1}(p&&p.layers,o,i.id),g=m.maxPitchScaleFactor(),w=i.tilesIn(s,g,y);w.sort(ln);for(var A=[],B=0,L=w;B<L.length;B+=1){var R=L[B];A.push({wrappedTileID:R.tileID.wrapped().key,queryResults:R.tile.queryRenderedFeatures(o,n,i._state,R.queryGeometry,R.cameraQueryGeometry,R.scale,p,m,g,_l(i.transform,R.tileID))})}var Z=function(K){for(var U={},X={},Q=0,ie=K;Q<ie.length;Q+=1){var ce=ie[Q],le=ce.queryResults,he=ce.wrappedTileID,ge=X[he]=X[he]||{};for(var Te in le)for(var Se=le[Te],Le=ge[Te]=ge[Te]||{},Ge=U[Te]=U[Te]||[],Xe=0,He=Se;Xe<He.length;Xe+=1){var wt=He[Xe];Le[wt.featureIndex]||(Le[wt.featureIndex]=!0,Ge.push(wt))}}return U}(A);for(var j in Z)Z[j].forEach(function(K){var U=K.feature,X=i.getFeatureState(U.layer["source-layer"],U.id);U.source=U.layer.source,U.layer["source-layer"]&&(U.sourceLayer=U.layer["source-layer"]),U.state=X});return Z}function ln(i,o){var n=i.tileID,s=o.tileID;return n.overscaledZ-s.overscaledZ||n.canonical.y-s.canonical.y||n.wrap-s.wrap||n.canonical.x-s.canonical.x}var Vt=function(i,o){this.max=i,this.onRemove=o,this.reset()};Vt.prototype.reset=function(){for(var i in this.data)for(var o=0,n=this.data[i];o<n.length;o+=1){var s=n[o];s.timeout&&clearTimeout(s.timeout),this.onRemove(s.value)}return this.data={},this.order=[],this},Vt.prototype.add=function(i,o,n){var s=this,p=i.wrapped().key;this.data[p]===void 0&&(this.data[p]=[]);var m={value:o,timeout:void 0};if(n!==void 0&&(m.timeout=setTimeout(function(){s.remove(i,m)},n)),this.data[p].push(m),this.order.push(p),this.order.length>this.max){var y=this._getAndRemoveByKey(this.order[0]);y&&this.onRemove(y)}return this},Vt.prototype.has=function(i){return i.wrapped().key in this.data},Vt.prototype.getAndRemove=function(i){return this.has(i)?this._getAndRemoveByKey(i.wrapped().key):null},Vt.prototype._getAndRemoveByKey=function(i){var o=this.data[i].shift();return o.timeout&&clearTimeout(o.timeout),this.data[i].length===0&&delete this.data[i],this.order.splice(this.order.indexOf(i),1),o.value},Vt.prototype.getByKey=function(i){var o=this.data[i];return o?o[0].value:null},Vt.prototype.get=function(i){return this.has(i)?this.data[i.wrapped().key][0].value:null},Vt.prototype.remove=function(i,o){if(!this.has(i))return this;var n=i.wrapped().key,s=o===void 0?0:this.data[n].indexOf(o),p=this.data[n][s];return this.data[n].splice(s,1),p.timeout&&clearTimeout(p.timeout),this.data[n].length===0&&delete this.data[n],this.onRemove(p.value),this.order.splice(this.order.indexOf(n),1),this},Vt.prototype.setMaxSize=function(i){for(this.max=i;this.order.length>this.max;){var o=this._getAndRemoveByKey(this.order[0]);o&&this.onRemove(o)}return this},Vt.prototype.filter=function(i){var o=[];for(var n in this.data)for(var s=0,p=this.data[n];s<p.length;s+=1){var m=p[s];i(m.value)||o.push(m)}for(var y=0,g=o;y<g.length;y+=1){var w=g[y];this.remove(w.value.tileID,w)}};var Ji=function(i,o,n){this.context=i;var s=i.gl;this.buffer=s.createBuffer(),this.dynamicDraw=!!n,this.context.unbindVAO(),i.bindElementBuffer.set(this.buffer),s.bufferData(s.ELEMENT_ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?s.DYNAMIC_DRAW:s.STATIC_DRAW),this.dynamicDraw||delete o.arrayBuffer};Ji.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},Ji.prototype.updateData=function(i){var o=this.context.gl;this.context.unbindVAO(),this.bind(),o.bufferSubData(o.ELEMENT_ARRAY_BUFFER,0,i.arrayBuffer)},Ji.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var Ro={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},Vi=function(i,o,n,s){this.length=o.length,this.attributes=n,this.itemSize=o.bytesPerElement,this.dynamicDraw=s,this.context=i;var p=i.gl;this.buffer=p.createBuffer(),i.bindVertexBuffer.set(this.buffer),p.bufferData(p.ARRAY_BUFFER,o.arrayBuffer,this.dynamicDraw?p.DYNAMIC_DRAW:p.STATIC_DRAW),this.dynamicDraw||delete o.arrayBuffer};Vi.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},Vi.prototype.updateData=function(i){var o=this.context.gl;this.bind(),o.bufferSubData(o.ARRAY_BUFFER,0,i.arrayBuffer)},Vi.prototype.enableAttributes=function(i,o){for(var n=0;n<this.attributes.length;n++){var s=o.attributes[this.attributes[n].name];s!==void 0&&i.enableVertexAttribArray(s)}},Vi.prototype.setVertexAttribPointers=function(i,o,n){for(var s=0;s<this.attributes.length;s++){var p=this.attributes[s],m=o.attributes[p.name];m!==void 0&&i.vertexAttribPointer(m,p.components,i[Ro[p.type]],!1,this.itemSize,p.offset+this.itemSize*(n||0))}},Vi.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var yt=function(i){this.gl=i.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1};yt.prototype.get=function(){return this.current},yt.prototype.set=function(i){},yt.prototype.getDefault=function(){return this.default},yt.prototype.setDefault=function(){this.set(this.default)};var wn=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return l.Color.transparent},o.prototype.set=function(n){var s=this.current;(n.r!==s.r||n.g!==s.g||n.b!==s.b||n.a!==s.a||this.dirty)&&(this.gl.clearColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)},o}(yt),ti=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 1},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.clearDepth(n),this.current=n,this.dirty=!1)},o}(yt),Ti=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.clearStencil(n),this.current=n,this.dirty=!1)},o}(yt),xl=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return[!0,!0,!0,!0]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||n[3]!==s[3]||this.dirty)&&(this.gl.colorMask(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)},o}(yt),Ui=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.depthMask(n),this.current=n,this.dirty=!1)},o}(yt),pa=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 255},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.stencilMask(n),this.current=n,this.dirty=!1)},o}(yt),Ii=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},o.prototype.set=function(n){var s=this.current;(n.func!==s.func||n.ref!==s.ref||n.mask!==s.mask||this.dirty)&&(this.gl.stencilFunc(n.func,n.ref,n.mask),this.current=n,this.dirty=!1)},o}(yt),Jn=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[n.KEEP,n.KEEP,n.KEEP]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||this.dirty)&&(this.gl.stencilOp(n[0],n[1],n[2]),this.current=n,this.dirty=!1)},o}(yt),Fo=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.STENCIL_TEST):s.disable(s.STENCIL_TEST),this.current=n,this.dirty=!1}},o}(yt),Ai=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return[0,1]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||this.dirty)&&(this.gl.depthRange(n[0],n[1]),this.current=n,this.dirty=!1)},o}(yt),Ei=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.DEPTH_TEST):s.disable(s.DEPTH_TEST),this.current=n,this.dirty=!1}},o}(yt),Yn=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.LESS},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.depthFunc(n),this.current=n,this.dirty=!1)},o}(yt),Ni=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.BLEND):s.disable(s.BLEND),this.current=n,this.dirty=!1}},o}(yt),os=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[n.ONE,n.ZERO]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||this.dirty)&&(this.gl.blendFunc(n[0],n[1]),this.current=n,this.dirty=!1)},o}(yt),as=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return l.Color.transparent},o.prototype.set=function(n){var s=this.current;(n.r!==s.r||n.g!==s.g||n.b!==s.b||n.a!==s.a||this.dirty)&&(this.gl.blendColor(n.r,n.g,n.b,n.a),this.current=n,this.dirty=!1)},o}(yt),ha=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.FUNC_ADD},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.blendEquation(n),this.current=n,this.dirty=!1)},o}(yt),fa=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;n?s.enable(s.CULL_FACE):s.disable(s.CULL_FACE),this.current=n,this.dirty=!1}},o}(yt),Oo=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.BACK},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.cullFace(n),this.current=n,this.dirty=!1)},o}(yt),ss=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.CCW},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.frontFace(n),this.current=n,this.dirty=!1)},o}(yt),Vo=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.useProgram(n),this.current=n,this.dirty=!1)},o}(yt),da=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return this.gl.TEXTURE0},o.prototype.set=function(n){(n!==this.current||this.dirty)&&(this.gl.activeTexture(n),this.current=n,this.dirty=!1)},o}(yt),Qn=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){var n=this.gl;return[0,0,n.drawingBufferWidth,n.drawingBufferHeight]},o.prototype.set=function(n){var s=this.current;(n[0]!==s[0]||n[1]!==s[1]||n[2]!==s[2]||n[3]!==s[3]||this.dirty)&&(this.gl.viewport(n[0],n[1],n[2],n[3]),this.current=n,this.dirty=!1)},o}(yt),ma=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindFramebuffer(s.FRAMEBUFFER,n),this.current=n,this.dirty=!1}},o}(yt),ya=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindRenderbuffer(s.RENDERBUFFER,n),this.current=n,this.dirty=!1}},o}(yt),ls=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindTexture(s.TEXTURE_2D,n),this.current=n,this.dirty=!1}},o}(yt),us=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.bindBuffer(s.ARRAY_BUFFER,n),this.current=n,this.dirty=!1}},o}(yt),eo=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){var s=this.gl;s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,n),this.current=n,this.dirty=!1},o}(yt),un=function(i){function o(n){i.call(this,n),this.vao=n.extVertexArrayObject}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o.prototype.set=function(n){this.vao&&(n!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(n),this.current=n,this.dirty=!1)},o}(yt),cn=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return 4},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_ALIGNMENT,n),this.current=n,this.dirty=!1}},o}(yt),Uo=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,n),this.current=n,this.dirty=!1}},o}(yt),va=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return!1},o.prototype.set=function(n){if(n!==this.current||this.dirty){var s=this.gl;s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,n),this.current=n,this.dirty=!1}},o}(yt),ar=function(i){function o(n,s){i.call(this,n),this.context=n,this.parent=s}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getDefault=function(){return null},o}(yt),I=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.setDirty=function(){this.dirty=!0},o.prototype.set=function(n){if(n!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var s=this.gl;s.framebufferTexture2D(s.FRAMEBUFFER,s.COLOR_ATTACHMENT0,s.TEXTURE_2D,n,0),this.current=n,this.dirty=!1}},o}(ar),P=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.set=function(n){if(n!==this.current||this.dirty){this.context.bindFramebuffer.set(this.parent);var s=this.gl;s.framebufferRenderbuffer(s.FRAMEBUFFER,s.DEPTH_ATTACHMENT,s.RENDERBUFFER,n),this.current=n,this.dirty=!1}},o}(ar),M=function(i,o,n,s){this.context=i,this.width=o,this.height=n;var p=this.framebuffer=i.gl.createFramebuffer();this.colorAttachment=new I(i,p),s&&(this.depthAttachment=new P(i,p))};M.prototype.destroy=function(){var i=this.context.gl,o=this.colorAttachment.get();if(o&&i.deleteTexture(o),this.depthAttachment){var n=this.depthAttachment.get();n&&i.deleteRenderbuffer(n)}i.deleteFramebuffer(this.framebuffer)};var O=function(i,o,n){this.func=i,this.mask=o,this.range=n};O.ReadOnly=!1,O.ReadWrite=!0,O.disabled=new O(519,O.ReadOnly,[0,1]);var G=function(i,o,n,s,p,m){this.test=i,this.ref=o,this.mask=n,this.fail=s,this.depthFail=p,this.pass=m};G.disabled=new G({func:519,mask:0},0,0,7680,7680,7680);var Y=function(i,o,n){this.blendFunction=i,this.blendColor=o,this.mask=n};Y.disabled=new Y(Y.Replace=[1,0],l.Color.transparent,[!1,!1,!1,!1]),Y.unblended=new Y(Y.Replace,l.Color.transparent,[!0,!0,!0,!0]),Y.alphaBlended=new Y([1,771],l.Color.transparent,[!0,!0,!0,!0]);var ee=function(i,o,n){this.enable=i,this.mode=o,this.frontFace=n};ee.disabled=new ee(!1,1029,2305),ee.backCCW=new ee(!0,1029,2305);var D=function(i){this.gl=i,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new wn(this),this.clearDepth=new ti(this),this.clearStencil=new Ti(this),this.colorMask=new xl(this),this.depthMask=new Ui(this),this.stencilMask=new pa(this),this.stencilFunc=new Ii(this),this.stencilOp=new Jn(this),this.stencilTest=new Fo(this),this.depthRange=new Ai(this),this.depthTest=new Ei(this),this.depthFunc=new Yn(this),this.blend=new Ni(this),this.blendFunc=new os(this),this.blendColor=new as(this),this.blendEquation=new ha(this),this.cullFace=new fa(this),this.cullFaceSide=new Oo(this),this.frontFace=new ss(this),this.program=new Vo(this),this.activeTexture=new da(this),this.viewport=new Qn(this),this.bindFramebuffer=new ma(this),this.bindRenderbuffer=new ya(this),this.bindTexture=new ls(this),this.bindVertexBuffer=new us(this),this.bindElementBuffer=new eo(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new un(this),this.pixelStoreUnpack=new cn(this),this.pixelStoreUnpackPremultiplyAlpha=new Uo(this),this.pixelStoreUnpackFlipY=new va(this),this.extTextureFilterAnisotropic=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=i.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=i.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(i.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=i.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=i.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=i.getParameter(i.MAX_TEXTURE_SIZE)};D.prototype.setDefault=function(){this.unbindVAO(),this.clearColor.setDefault(),this.clearDepth.setDefault(),this.clearStencil.setDefault(),this.colorMask.setDefault(),this.depthMask.setDefault(),this.stencilMask.setDefault(),this.stencilFunc.setDefault(),this.stencilOp.setDefault(),this.stencilTest.setDefault(),this.depthRange.setDefault(),this.depthTest.setDefault(),this.depthFunc.setDefault(),this.blend.setDefault(),this.blendFunc.setDefault(),this.blendColor.setDefault(),this.blendEquation.setDefault(),this.cullFace.setDefault(),this.cullFaceSide.setDefault(),this.frontFace.setDefault(),this.program.setDefault(),this.activeTexture.setDefault(),this.bindFramebuffer.setDefault(),this.pixelStoreUnpack.setDefault(),this.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.pixelStoreUnpackFlipY.setDefault()},D.prototype.setDirty=function(){this.clearColor.dirty=!0,this.clearDepth.dirty=!0,this.clearStencil.dirty=!0,this.colorMask.dirty=!0,this.depthMask.dirty=!0,this.stencilMask.dirty=!0,this.stencilFunc.dirty=!0,this.stencilOp.dirty=!0,this.stencilTest.dirty=!0,this.depthRange.dirty=!0,this.depthTest.dirty=!0,this.depthFunc.dirty=!0,this.blend.dirty=!0,this.blendFunc.dirty=!0,this.blendColor.dirty=!0,this.blendEquation.dirty=!0,this.cullFace.dirty=!0,this.cullFaceSide.dirty=!0,this.frontFace.dirty=!0,this.program.dirty=!0,this.activeTexture.dirty=!0,this.viewport.dirty=!0,this.bindFramebuffer.dirty=!0,this.bindRenderbuffer.dirty=!0,this.bindTexture.dirty=!0,this.bindVertexBuffer.dirty=!0,this.bindElementBuffer.dirty=!0,this.extVertexArrayObject&&(this.bindVertexArrayOES.dirty=!0),this.pixelStoreUnpack.dirty=!0,this.pixelStoreUnpackPremultiplyAlpha.dirty=!0,this.pixelStoreUnpackFlipY.dirty=!0},D.prototype.createIndexBuffer=function(i,o){return new Ji(this,i,o)},D.prototype.createVertexBuffer=function(i,o,n){return new Vi(this,i,o,n)},D.prototype.createRenderbuffer=function(i,o,n){var s=this.gl,p=s.createRenderbuffer();return this.bindRenderbuffer.set(p),s.renderbufferStorage(s.RENDERBUFFER,i,o,n),this.bindRenderbuffer.set(null),p},D.prototype.createFramebuffer=function(i,o,n){return new M(this,i,o,n)},D.prototype.clear=function(i){var o=i.color,n=i.depth,s=this.gl,p=0;o&&(p|=s.COLOR_BUFFER_BIT,this.clearColor.set(o),this.colorMask.set([!0,!0,!0,!0])),n!==void 0&&(p|=s.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(n),this.depthMask.set(!0)),s.clear(p)},D.prototype.setCullFace=function(i){i.enable===!1?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(i.mode),this.frontFace.set(i.frontFace))},D.prototype.setDepthMode=function(i){i.func!==this.gl.ALWAYS||i.mask?(this.depthTest.set(!0),this.depthFunc.set(i.func),this.depthMask.set(i.mask),this.depthRange.set(i.range)):this.depthTest.set(!1)},D.prototype.setStencilMode=function(i){i.test.func!==this.gl.ALWAYS||i.mask?(this.stencilTest.set(!0),this.stencilMask.set(i.mask),this.stencilOp.set([i.fail,i.depthFail,i.pass]),this.stencilFunc.set({func:i.test.func,ref:i.ref,mask:i.test.mask})):this.stencilTest.set(!1)},D.prototype.setColorMode=function(i){l.deepEqual(i.blendFunction,Y.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(i.blendFunction),this.blendColor.set(i.blendColor)),this.colorMask.set(i.mask)},D.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var W=function(i){function o(n,s,p){var m=this;i.call(this),this.id=n,this.dispatcher=p,this.on("data",function(y){y.dataType==="source"&&y.sourceDataType==="metadata"&&(m._sourceLoaded=!0),m._sourceLoaded&&!m._paused&&y.dataType==="source"&&y.sourceDataType==="content"&&(m.reload(),m.transform&&m.update(m.transform))}),this.on("error",function(){m._sourceErrored=!0}),this._source=function(y,g,w,A){var B=new bn[g.type](y,g,w,A);if(B.id!==y)throw new Error("Expected Source id to be "+y+" instead of "+B.id);return l.bindAll(["load","abort","unload","serialize","prepare"],B),B}(n,s,p,this),this._tiles={},this._cache=new Vt(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new l.SourceFeatureState}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.onAdd=function(n){this.map=n,this._maxTileCacheSize=n?n._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(n)},o.prototype.onRemove=function(n){this._source&&this._source.onRemove&&this._source.onRemove(n)},o.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded||!this._source.loaded())return!1;for(var n in this._tiles){var s=this._tiles[n];if(s.state!=="loaded"&&s.state!=="errored")return!1}return!0},o.prototype.getSource=function(){return this._source},o.prototype.pause=function(){this._paused=!0},o.prototype.resume=function(){if(this._paused){var n=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,n&&this.reload(),this.transform&&this.update(this.transform)}},o.prototype._loadTile=function(n,s){return this._source.loadTile(n,s)},o.prototype._unloadTile=function(n){if(this._source.unloadTile)return this._source.unloadTile(n,function(){})},o.prototype._abortTile=function(n){if(this._source.abortTile)return this._source.abortTile(n,function(){})},o.prototype.serialize=function(){return this._source.serialize()},o.prototype.prepare=function(n){for(var s in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var p=this._tiles[s];p.upload(n),p.prepare(this.map.style.imageManager)}},o.prototype.getIds=function(){return l.values(this._tiles).map(function(n){return n.tileID}).sort(ne).map(function(n){return n.key})},o.prototype.getRenderableIds=function(n){var s=this,p=[];for(var m in this._tiles)this._isIdRenderable(m,n)&&p.push(this._tiles[m]);return n?p.sort(function(y,g){var w=y.tileID,A=g.tileID,B=new l.Point(w.canonical.x,w.canonical.y)._rotate(s.transform.angle),L=new l.Point(A.canonical.x,A.canonical.y)._rotate(s.transform.angle);return w.overscaledZ-A.overscaledZ||L.y-B.y||L.x-B.x}).map(function(y){return y.tileID.key}):p.map(function(y){return y.tileID}).sort(ne).map(function(y){return y.key})},o.prototype.hasRenderableParent=function(n){var s=this.findLoadedParent(n,0);return!!s&&this._isIdRenderable(s.tileID.key)},o.prototype._isIdRenderable=function(n,s){return this._tiles[n]&&this._tiles[n].hasData()&&!this._coveredTiles[n]&&(s||!this._tiles[n].holdingForFade())},o.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var n in this._cache.reset(),this._tiles)this._tiles[n].state!=="errored"&&this._reloadTile(n,"reloading")},o.prototype._reloadTile=function(n,s){var p=this._tiles[n];p&&(p.state!=="loading"&&(p.state=s),this._loadTile(p,this._tileLoaded.bind(this,p,n,s)))},o.prototype._tileLoaded=function(n,s,p,m){if(m)return n.state="errored",void(m.status!==404?this._source.fire(new l.ErrorEvent(m,{tile:n})):this.update(this.transform));n.timeAdded=l.browser.now(),p==="expired"&&(n.refreshedUponExpiration=!0),this._setTileReloadTimer(s,n),this.getSource().type==="raster-dem"&&n.dem&&this._backfillDEM(n),this._state.initializeTileState(n,this.map?this.map.painter:null),this._source.fire(new l.Event("data",{dataType:"source",tile:n,coord:n.tileID}))},o.prototype._backfillDEM=function(n){for(var s=this.getRenderableIds(),p=0;p<s.length;p++){var m=s[p];if(n.neighboringTiles&&n.neighboringTiles[m]){var y=this.getTileByID(m);g(n,y),g(y,n)}}function g(w,A){w.needsHillshadePrepare=!0;var B=A.tileID.canonical.x-w.tileID.canonical.x,L=A.tileID.canonical.y-w.tileID.canonical.y,R=Math.pow(2,w.tileID.canonical.z),Z=A.tileID.key;B===0&&L===0||Math.abs(L)>1||(Math.abs(B)>1&&(Math.abs(B+R)===1?B+=R:Math.abs(B-R)===1&&(B-=R)),A.dem&&w.dem&&(w.dem.backfillBorder(A.dem,B,L),w.neighboringTiles&&w.neighboringTiles[Z]&&(w.neighboringTiles[Z].backfilled=!0)))}},o.prototype.getTile=function(n){return this.getTileByID(n.key)},o.prototype.getTileByID=function(n){return this._tiles[n]},o.prototype._retainLoadedChildren=function(n,s,p,m){for(var y in this._tiles){var g=this._tiles[y];if(!(m[y]||!g.hasData()||g.tileID.overscaledZ<=s||g.tileID.overscaledZ>p)){for(var w=g.tileID;g&&g.tileID.overscaledZ>s+1;){var A=g.tileID.scaledTo(g.tileID.overscaledZ-1);(g=this._tiles[A.key])&&g.hasData()&&(w=A)}for(var B=w;B.overscaledZ>s;)if(n[(B=B.scaledTo(B.overscaledZ-1)).key]){m[w.key]=w;break}}}},o.prototype.findLoadedParent=function(n,s){if(n.key in this._loadedParentTiles){var p=this._loadedParentTiles[n.key];return p&&p.tileID.overscaledZ>=s?p:null}for(var m=n.overscaledZ-1;m>=s;m--){var y=n.scaledTo(m),g=this._getLoadedTile(y);if(g)return g}},o.prototype._getLoadedTile=function(n){var s=this._tiles[n.key];return s&&s.hasData()?s:this._cache.getByKey(n.wrapped().key)},o.prototype.updateCacheSize=function(n){var s=Math.ceil(n.width/this._source.tileSize)+1,p=Math.ceil(n.height/this._source.tileSize)+1,m=Math.floor(s*p*5),y=typeof this._maxTileCacheSize=="number"?Math.min(this._maxTileCacheSize,m):m;this._cache.setMaxSize(y)},o.prototype.handleWrapJump=function(n){var s=Math.round((n-(this._prevLng===void 0?n:this._prevLng))/360);if(this._prevLng=n,s){var p={};for(var m in this._tiles){var y=this._tiles[m];y.tileID=y.tileID.unwrapTo(y.tileID.wrap+s),p[y.tileID.key]=y}for(var g in this._tiles=p,this._timers)clearTimeout(this._timers[g]),delete this._timers[g];for(var w in this._tiles)this._setTileReloadTimer(w,this._tiles[w])}},o.prototype.update=function(n){var s=this;if(this.transform=n,this._sourceLoaded&&!this._paused){var p;this.updateCacheSize(n),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?p=n.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(ge){return new l.OverscaledTileID(ge.canonical.z,ge.wrap,ge.canonical.z,ge.canonical.x,ge.canonical.y)}):(p=n.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(p=p.filter(function(ge){return s._source.hasTile(ge)}))):p=[];var m=n.coveringZoomLevel(this._source),y=Math.max(m-o.maxOverzooming,this._source.minzoom),g=Math.max(m+o.maxUnderzooming,this._source.minzoom),w=this._updateRetainedTiles(p,m);if(_e(this._source.type)){for(var A={},B={},L=0,R=Object.keys(w);L<R.length;L+=1){var Z=R[L],j=w[Z],K=this._tiles[Z];if(K&&!(K.fadeEndTime&&K.fadeEndTime<=l.browser.now())){var U=this.findLoadedParent(j,y);U&&(this._addTile(U.tileID),A[U.tileID.key]=U.tileID),B[Z]=j}}for(var X in this._retainLoadedChildren(B,m,g,w),A)w[X]||(this._coveredTiles[X]=!0,w[X]=A[X])}for(var Q in w)this._tiles[Q].clearFadeHold();for(var ie=0,ce=l.keysDifference(this._tiles,w);ie<ce.length;ie+=1){var le=ce[ie],he=this._tiles[le];he.hasSymbolBuckets&&!he.holdingForFade()?he.setHoldDuration(this.map._fadeDuration):he.hasSymbolBuckets&&!he.symbolFadeFinished()||this._removeTile(le)}this._updateLoadedParentTileCache()}},o.prototype.releaseSymbolFadeTiles=function(){for(var n in this._tiles)this._tiles[n].holdingForFade()&&this._removeTile(n)},o.prototype._updateRetainedTiles=function(n,s){for(var p={},m={},y=Math.max(s-o.maxOverzooming,this._source.minzoom),g=Math.max(s+o.maxUnderzooming,this._source.minzoom),w={},A=0,B=n;A<B.length;A+=1){var L=B[A],R=this._addTile(L);p[L.key]=L,R.hasData()||s<this._source.maxzoom&&(w[L.key]=L)}this._retainLoadedChildren(w,s,g,p);for(var Z=0,j=n;Z<j.length;Z+=1){var K=j[Z],U=this._tiles[K.key];if(!U.hasData()){if(s+1>this._source.maxzoom){var X=K.children(this._source.maxzoom)[0],Q=this.getTile(X);if(Q&&Q.hasData()){p[X.key]=X;continue}}else{var ie=K.children(this._source.maxzoom);if(p[ie[0].key]&&p[ie[1].key]&&p[ie[2].key]&&p[ie[3].key])continue}for(var ce=U.wasRequested(),le=K.overscaledZ-1;le>=y;--le){var he=K.scaledTo(le);if(m[he.key]||(m[he.key]=!0,!(U=this.getTile(he))&&ce&&(U=this._addTile(he)),U&&(p[he.key]=he,ce=U.wasRequested(),U.hasData())))break}}}return p},o.prototype._updateLoadedParentTileCache=function(){for(var n in this._loadedParentTiles={},this._tiles){for(var s=[],p=void 0,m=this._tiles[n].tileID;m.overscaledZ>0;){if(m.key in this._loadedParentTiles){p=this._loadedParentTiles[m.key];break}s.push(m.key);var y=m.scaledTo(m.overscaledZ-1);if(p=this._getLoadedTile(y))break;m=y}for(var g=0,w=s;g<w.length;g+=1)this._loadedParentTiles[w[g]]=p}},o.prototype._addTile=function(n){var s=this._tiles[n.key];if(s)return s;(s=this._cache.getAndRemove(n))&&(this._setTileReloadTimer(n.key,s),s.tileID=n,this._state.initializeTileState(s,this.map?this.map.painter:null),this._cacheTimers[n.key]&&(clearTimeout(this._cacheTimers[n.key]),delete this._cacheTimers[n.key],this._setTileReloadTimer(n.key,s)));var p=!!s;return p||(s=new l.Tile(n,this._source.tileSize*n.overscaleFactor()),this._loadTile(s,this._tileLoaded.bind(this,s,n.key,s.state))),s?(s.uses++,this._tiles[n.key]=s,p||this._source.fire(new l.Event("dataloading",{tile:s,coord:s.tileID,dataType:"source"})),s):null},o.prototype._setTileReloadTimer=function(n,s){var p=this;n in this._timers&&(clearTimeout(this._timers[n]),delete this._timers[n]);var m=s.getExpiryTimeout();m&&(this._timers[n]=setTimeout(function(){p._reloadTile(n,"expired"),delete p._timers[n]},m))},o.prototype._removeTile=function(n){var s=this._tiles[n];s&&(s.uses--,delete this._tiles[n],this._timers[n]&&(clearTimeout(this._timers[n]),delete this._timers[n]),s.uses>0||(s.hasData()&&s.state!=="reloading"?this._cache.add(s.tileID,s,s.getExpiryTimeout()):(s.aborted=!0,this._abortTile(s),this._unloadTile(s))))},o.prototype.clearTiles=function(){for(var n in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(n);this._cache.reset()},o.prototype.tilesIn=function(n,s,p){var m=this,y=[],g=this.transform;if(!g)return y;for(var w=p?g.getCameraQueryGeometry(n):n,A=n.map(function(le){return g.pointCoordinate(le)}),B=w.map(function(le){return g.pointCoordinate(le)}),L=this.getIds(),R=1/0,Z=1/0,j=-1/0,K=-1/0,U=0,X=B;U<X.length;U+=1){var Q=X[U];R=Math.min(R,Q.x),Z=Math.min(Z,Q.y),j=Math.max(j,Q.x),K=Math.max(K,Q.y)}for(var ie=function(le){var he=m._tiles[L[le]];if(!he.holdingForFade()){var ge=he.tileID,Te=Math.pow(2,g.zoom-he.tileID.overscaledZ),Se=s*he.queryPadding*l.EXTENT/he.tileSize/Te,Le=[ge.getTilePoint(new l.MercatorCoordinate(R,Z)),ge.getTilePoint(new l.MercatorCoordinate(j,K))];if(Le[0].x-Se<l.EXTENT&&Le[0].y-Se<l.EXTENT&&Le[1].x+Se>=0&&Le[1].y+Se>=0){var Ge=A.map(function(He){return ge.getTilePoint(He)}),Xe=B.map(function(He){return ge.getTilePoint(He)});y.push({tile:he,tileID:ge,queryGeometry:Ge,cameraQueryGeometry:Xe,scale:Te})}}},ce=0;ce<L.length;ce++)ie(ce);return y},o.prototype.getVisibleCoordinates=function(n){for(var s=this,p=this.getRenderableIds(n).map(function(w){return s._tiles[w].tileID}),m=0,y=p;m<y.length;m+=1){var g=y[m];g.posMatrix=this.transform.calculatePosMatrix(g.toUnwrapped())}return p},o.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(_e(this._source.type))for(var n in this._tiles){var s=this._tiles[n];if(s.fadeEndTime!==void 0&&s.fadeEndTime>=l.browser.now())return!0}return!1},o.prototype.setFeatureState=function(n,s,p){this._state.updateState(n=n||"_geojsonTileLayer",s,p)},o.prototype.removeFeatureState=function(n,s,p){this._state.removeFeatureState(n=n||"_geojsonTileLayer",s,p)},o.prototype.getFeatureState=function(n,s){return this._state.getState(n=n||"_geojsonTileLayer",s)},o.prototype.setDependencies=function(n,s,p){var m=this._tiles[n];m&&m.setDependencies(s,p)},o.prototype.reloadTilesForDependencies=function(n,s){for(var p in this._tiles)this._tiles[p].hasDependency(n,s)&&this._reloadTile(p,"reloading");this._cache.filter(function(m){return!m.hasDependency(n,s)})},o}(l.Evented);function ne(i,o){var n=Math.abs(2*i.wrap)-+(i.wrap<0),s=Math.abs(2*o.wrap)-+(o.wrap<0);return i.overscaledZ-o.overscaledZ||s-n||o.canonical.y-i.canonical.y||o.canonical.x-i.canonical.x}function _e(i){return i==="raster"||i==="image"||i==="video"}function be(){return new l.window.Worker(Cs.workerUrl)}W.maxOverzooming=10,W.maxUnderzooming=3;var fe="mapboxgl_preloaded_worker_pool",xe=function(){this.active={}};xe.prototype.acquire=function(i){if(!this.workers)for(this.workers=[];this.workers.length<xe.workerCount;)this.workers.push(new be);return this.active[i]=!0,this.workers.slice()},xe.prototype.release=function(i){delete this.active[i],this.numActive()===0&&(this.workers.forEach(function(o){o.terminate()}),this.workers=null)},xe.prototype.isPreloaded=function(){return!!this.active[fe]},xe.prototype.numActive=function(){return Object.keys(this.active).length};var Ve,Fe=Math.floor(l.browser.hardwareConcurrency/2);function de(){return Ve||(Ve=new xe),Ve}function De(i,o){var n={};for(var s in i)s!=="ref"&&(n[s]=i[s]);return l.refProperties.forEach(function(p){p in o&&(n[p]=o[p])}),n}function Ee(i){i=i.slice();for(var o=Object.create(null),n=0;n<i.length;n++)o[i[n].id]=i[n];for(var s=0;s<i.length;s++)"ref"in i[s]&&(i[s]=De(i[s],o[i[s].ref]));return i}xe.workerCount=Math.max(Math.min(Fe,6),1);var Ce={setStyle:"setStyle",addLayer:"addLayer",removeLayer:"removeLayer",setPaintProperty:"setPaintProperty",setLayoutProperty:"setLayoutProperty",setFilter:"setFilter",addSource:"addSource",removeSource:"removeSource",setGeoJSONSourceData:"setGeoJSONSourceData",setLayerZoomRange:"setLayerZoomRange",setLayerProperty:"setLayerProperty",setCenter:"setCenter",setZoom:"setZoom",setBearing:"setBearing",setPitch:"setPitch",setSprite:"setSprite",setGlyphs:"setGlyphs",setTransition:"setTransition",setLight:"setLight"};function ut(i,o,n){n.push({command:Ce.addSource,args:[i,o[i]]})}function ze(i,o,n){o.push({command:Ce.removeSource,args:[i]}),n[i]=!0}function vt(i,o,n,s){ze(i,n,s),ut(i,o,n)}function Ut(i,o,n){var s;for(s in i[n])if(i[n].hasOwnProperty(s)&&s!=="data"&&!l.deepEqual(i[n][s],o[n][s]))return!1;for(s in o[n])if(o[n].hasOwnProperty(s)&&s!=="data"&&!l.deepEqual(i[n][s],o[n][s]))return!1;return!0}function ht(i,o,n,s,p,m){var y;for(y in o=o||{},i=i||{})i.hasOwnProperty(y)&&(l.deepEqual(i[y],o[y])||n.push({command:m,args:[s,y,o[y],p]}));for(y in o)o.hasOwnProperty(y)&&!i.hasOwnProperty(y)&&(l.deepEqual(i[y],o[y])||n.push({command:m,args:[s,y,o[y],p]}))}function kt(i){return i.id}function _t(i,o){return i[o.id]=o,i}var qr=function(i,o){this.reset(i,o)};qr.prototype.reset=function(i,o){this.points=i||[],this._distances=[0];for(var n=1;n<this.points.length;n++)this._distances[n]=this._distances[n-1]+this.points[n].dist(this.points[n-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(o||0,.5*this.length),this.paddedLength=this.length-2*this.padding},qr.prototype.lerp=function(i){if(this.points.length===1)return this.points[0];i=l.clamp(i,0,1);for(var o=1,n=this._distances[o],s=i*this.paddedLength+this.padding;n<s&&o<this._distances.length;)n=this._distances[++o];var p=o-1,m=this._distances[p],y=n-m,g=y>0?(s-m)/y:0;return this.points[p].mult(1-g).add(this.points[o].mult(g))};var Bt=function(i,o,n){var s=this.boxCells=[],p=this.circleCells=[];this.xCellCount=Math.ceil(i/n),this.yCellCount=Math.ceil(o/n);for(var m=0;m<this.xCellCount*this.yCellCount;m++)s.push([]),p.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=i,this.height=o,this.xScale=this.xCellCount/i,this.yScale=this.yCellCount/o,this.boxUid=0,this.circleUid=0};function sr(i,o,n,s,p){var m=l.create();return o?(l.scale(m,m,[1/p,1/p,1]),n||l.rotateZ(m,m,s.angle)):l.multiply(m,s.labelPlaneMatrix,i),m}function Ft(i,o,n,s,p){if(o){var m=l.clone(i);return l.scale(m,m,[p,p,1]),n||l.rotateZ(m,m,-s.angle),m}return s.glCoordMatrix}function mt(i,o){var n=[i.x,i.y,0,1];Cr(n,n,o);var s=n[3];return{point:new l.Point(n[0]/s,n[1]/s),signedDistanceFromCamera:s}}function Mt(i,o){return .5+i/o*.5}function ri(i,o){var n=i[0]/i[3],s=i[1]/i[3];return n>=-o[0]&&n<=o[0]&&s>=-o[1]&&s<=o[1]}function ga(i,o,n,s,p,m,y,g){var w=s?i.textSizeData:i.iconSizeData,A=l.evaluateSizeForZoom(w,n.transform.zoom),B=[256/n.width*2+1,256/n.height*2+1],L=s?i.text.dynamicLayoutVertexArray:i.icon.dynamicLayoutVertexArray;L.clear();for(var R=i.lineVertexArray,Z=s?i.text.placedSymbolArray:i.icon.placedSymbolArray,j=n.transform.width/n.transform.height,K=!1,U=0;U<Z.length;U++){var X=Z.get(U);if(X.hidden||X.writingMode===l.WritingMode.vertical&&!K)jr(X.numGlyphs,L);else{K=!1;var Q=[X.anchorX,X.anchorY,0,1];if(l.transformMat4(Q,Q,o),ri(Q,B)){var ie=Mt(n.transform.cameraToCenterDistance,Q[3]),ce=l.evaluateSizeForFeature(w,A,X),le=y?ce/ie:ce*ie,he=new l.Point(X.anchorX,X.anchorY),ge=mt(he,p).point,Te={},Se=bl(X,le,!1,g,o,p,m,i.glyphOffsetArray,R,L,ge,he,Te,j);K=Se.useVertical,(Se.notEnoughRoom||K||Se.needsFlipping&&bl(X,le,!0,g,o,p,m,i.glyphOffsetArray,R,L,ge,he,Te,j).notEnoughRoom)&&jr(X.numGlyphs,L)}else jr(X.numGlyphs,L)}}s?i.text.dynamicLayoutVertexBuffer.updateData(L):i.icon.dynamicLayoutVertexBuffer.updateData(L)}function Pr(i,o,n,s,p,m,y,g,w,A,B){var L=g.glyphStartIndex+g.numGlyphs,R=g.lineStartIndex,Z=g.lineStartIndex+g.lineLength,j=o.getoffsetX(g.glyphStartIndex),K=o.getoffsetX(L-1),U=lr(i*j,n,s,p,m,y,g.segment,R,Z,w,A,B);if(!U)return null;var X=lr(i*K,n,s,p,m,y,g.segment,R,Z,w,A,B);return X?{first:U,last:X}:null}function ii(i,o,n,s){return i===l.WritingMode.horizontal&&Math.abs(n.y-o.y)>Math.abs(n.x-o.x)*s?{useVertical:!0}:(i===l.WritingMode.vertical?o.y<n.y:o.x>n.x)?{needsFlipping:!0}:null}function bl(i,o,n,s,p,m,y,g,w,A,B,L,R,Z){var j,K=o/24,U=i.lineOffsetX*K,X=i.lineOffsetY*K;if(i.numGlyphs>1){var Q=i.glyphStartIndex+i.numGlyphs,ie=i.lineStartIndex,ce=i.lineStartIndex+i.lineLength,le=Pr(K,g,U,X,n,B,L,i,w,m,R);if(!le)return{notEnoughRoom:!0};var he=mt(le.first.point,y).point,ge=mt(le.last.point,y).point;if(s&&!n){var Te=ii(i.writingMode,he,ge,Z);if(Te)return Te}j=[le.first];for(var Se=i.glyphStartIndex+1;Se<Q-1;Se++)j.push(lr(K*g.getoffsetX(Se),U,X,n,B,L,i.segment,ie,ce,w,m,R));j.push(le.last)}else{if(s&&!n){var Le=mt(L,p).point,Ge=i.lineStartIndex+i.segment+1,Xe=new l.Point(w.getx(Ge),w.gety(Ge)),He=mt(Xe,p),wt=He.signedDistanceFromCamera>0?He.point:_a(L,Xe,Le,1,p),Re=ii(i.writingMode,Le,wt,Z);if(Re)return Re}var rt=lr(K*g.getoffsetX(i.glyphStartIndex),U,X,n,B,L,i.segment,i.lineStartIndex,i.lineStartIndex+i.lineLength,w,m,R);if(!rt)return{notEnoughRoom:!0};j=[rt]}for(var at=0,tt=j;at<tt.length;at+=1){var et=tt[at];l.addDynamicAttributes(A,et.point,et.angle)}return{}}function _a(i,o,n,s,p){var m=mt(i.add(i.sub(o)._unit()),p).point,y=n.sub(m);return n.add(y._mult(s/y.mag()))}function lr(i,o,n,s,p,m,y,g,w,A,B,L){var R=s?i-o:i+o,Z=R>0?1:-1,j=0;s&&(Z*=-1,j=Math.PI),Z<0&&(j+=Math.PI);for(var K=Z>0?g+y:g+y+1,U=p,X=p,Q=0,ie=0,ce=Math.abs(R),le=[];Q+ie<=ce;){if((K+=Z)<g||K>=w)return null;if(X=U,le.push(U),(U=L[K])===void 0){var he=new l.Point(A.getx(K),A.gety(K)),ge=mt(he,B);if(ge.signedDistanceFromCamera>0)U=L[K]=ge.point;else{var Te=K-Z;U=_a(Q===0?m:new l.Point(A.getx(Te),A.gety(Te)),he,X,ce-Q+1,B)}}Q+=ie,ie=X.dist(U)}var Se=(ce-Q)/ie,Le=U.sub(X),Ge=Le.mult(Se)._add(X);Ge._add(Le._unit()._perp()._mult(n*Z));var Xe=j+Math.atan2(U.y-X.y,U.x-X.x);return le.push(Ge),{point:Ge,angle:Xe,path:le}}Bt.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Bt.prototype.insert=function(i,o,n,s,p){this._forEachCell(o,n,s,p,this._insertBoxCell,this.boxUid++),this.boxKeys.push(i),this.bboxes.push(o),this.bboxes.push(n),this.bboxes.push(s),this.bboxes.push(p)},Bt.prototype.insertCircle=function(i,o,n,s){this._forEachCell(o-s,n-s,o+s,n+s,this._insertCircleCell,this.circleUid++),this.circleKeys.push(i),this.circles.push(o),this.circles.push(n),this.circles.push(s)},Bt.prototype._insertBoxCell=function(i,o,n,s,p,m){this.boxCells[p].push(m)},Bt.prototype._insertCircleCell=function(i,o,n,s,p,m){this.circleCells[p].push(m)},Bt.prototype._query=function(i,o,n,s,p,m){if(n<0||i>this.width||s<0||o>this.height)return!p&&[];var y=[];if(i<=0&&o<=0&&this.width<=n&&this.height<=s){if(p)return!0;for(var g=0;g<this.boxKeys.length;g++)y.push({key:this.boxKeys[g],x1:this.bboxes[4*g],y1:this.bboxes[4*g+1],x2:this.bboxes[4*g+2],y2:this.bboxes[4*g+3]});for(var w=0;w<this.circleKeys.length;w++){var A=this.circles[3*w],B=this.circles[3*w+1],L=this.circles[3*w+2];y.push({key:this.circleKeys[w],x1:A-L,y1:B-L,x2:A+L,y2:B+L})}return m?y.filter(m):y}return this._forEachCell(i,o,n,s,this._queryCell,y,{hitTest:p,seenUids:{box:{},circle:{}}},m),p?y.length>0:y},Bt.prototype._queryCircle=function(i,o,n,s,p){var m=i-n,y=i+n,g=o-n,w=o+n;if(y<0||m>this.width||w<0||g>this.height)return!s&&[];var A=[];return this._forEachCell(m,g,y,w,this._queryCellCircle,A,{hitTest:s,circle:{x:i,y:o,radius:n},seenUids:{box:{},circle:{}}},p),s?A.length>0:A},Bt.prototype.query=function(i,o,n,s,p){return this._query(i,o,n,s,!1,p)},Bt.prototype.hitTest=function(i,o,n,s,p){return this._query(i,o,n,s,!0,p)},Bt.prototype.hitTestCircle=function(i,o,n,s){return this._queryCircle(i,o,n,!0,s)},Bt.prototype._queryCell=function(i,o,n,s,p,m,y,g){var w=y.seenUids,A=this.boxCells[p];if(A!==null)for(var B=this.bboxes,L=0,R=A;L<R.length;L+=1){var Z=R[L];if(!w.box[Z]){w.box[Z]=!0;var j=4*Z;if(i<=B[j+2]&&o<=B[j+3]&&n>=B[j+0]&&s>=B[j+1]&&(!g||g(this.boxKeys[Z]))){if(y.hitTest)return m.push(!0),!0;m.push({key:this.boxKeys[Z],x1:B[j],y1:B[j+1],x2:B[j+2],y2:B[j+3]})}}}var K=this.circleCells[p];if(K!==null)for(var U=this.circles,X=0,Q=K;X<Q.length;X+=1){var ie=Q[X];if(!w.circle[ie]){w.circle[ie]=!0;var ce=3*ie;if(this._circleAndRectCollide(U[ce],U[ce+1],U[ce+2],i,o,n,s)&&(!g||g(this.circleKeys[ie]))){if(y.hitTest)return m.push(!0),!0;var le=U[ce],he=U[ce+1],ge=U[ce+2];m.push({key:this.circleKeys[ie],x1:le-ge,y1:he-ge,x2:le+ge,y2:he+ge})}}}},Bt.prototype._queryCellCircle=function(i,o,n,s,p,m,y,g){var w=y.circle,A=y.seenUids,B=this.boxCells[p];if(B!==null)for(var L=this.bboxes,R=0,Z=B;R<Z.length;R+=1){var j=Z[R];if(!A.box[j]){A.box[j]=!0;var K=4*j;if(this._circleAndRectCollide(w.x,w.y,w.radius,L[K+0],L[K+1],L[K+2],L[K+3])&&(!g||g(this.boxKeys[j])))return m.push(!0),!0}}var U=this.circleCells[p];if(U!==null)for(var X=this.circles,Q=0,ie=U;Q<ie.length;Q+=1){var ce=ie[Q];if(!A.circle[ce]){A.circle[ce]=!0;var le=3*ce;if(this._circlesCollide(X[le],X[le+1],X[le+2],w.x,w.y,w.radius)&&(!g||g(this.circleKeys[ce])))return m.push(!0),!0}}},Bt.prototype._forEachCell=function(i,o,n,s,p,m,y,g){for(var w=this._convertToXCellCoord(i),A=this._convertToYCellCoord(o),B=this._convertToXCellCoord(n),L=this._convertToYCellCoord(s),R=w;R<=B;R++)for(var Z=A;Z<=L;Z++)if(p.call(this,i,o,n,s,this.xCellCount*Z+R,m,y,g))return},Bt.prototype._convertToXCellCoord=function(i){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(i*this.xScale)))},Bt.prototype._convertToYCellCoord=function(i){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(i*this.yScale)))},Bt.prototype._circlesCollide=function(i,o,n,s,p,m){var y=s-i,g=p-o,w=n+m;return w*w>y*y+g*g},Bt.prototype._circleAndRectCollide=function(i,o,n,s,p,m,y){var g=(m-s)/2,w=Math.abs(i-(s+g));if(w>g+n)return!1;var A=(y-p)/2,B=Math.abs(o-(p+A));if(B>A+n)return!1;if(w<=g||B<=A)return!0;var L=w-g,R=B-A;return L*L+R*R<=n*n};var xa=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function jr(i,o){for(var n=0;n<i;n++){var s=o.length;o.resize(s+4),o.float32.set(xa,3*s)}}function Cr(i,o,n){var s=o[0],p=o[1];return i[0]=n[0]*s+n[4]*p+n[12],i[1]=n[1]*s+n[5]*p+n[13],i[3]=n[3]*s+n[7]*p+n[15],i}var Pi=function(i,o,n){o===void 0&&(o=new Bt(i.width+200,i.height+200,25)),n===void 0&&(n=new Bt(i.width+200,i.height+200,25)),this.transform=i,this.grid=o,this.ignoredGrid=n,this.pitchfactor=Math.cos(i._pitch)*i.cameraToCenterDistance,this.screenRightBoundary=i.width+100,this.screenBottomBoundary=i.height+100,this.gridRightBoundary=i.width+200,this.gridBottomBoundary=i.height+200};function Ht(i,o,n){return o*(l.EXTENT/(i.tileSize*Math.pow(2,n-i.tileID.overscaledZ)))}Pi.prototype.placeCollisionBox=function(i,o,n,s,p){var m=this.projectAndGetPerspectiveRatio(s,i.anchorPointX,i.anchorPointY),y=n*m.perspectiveRatio,g=i.x1*y+m.point.x,w=i.y1*y+m.point.y,A=i.x2*y+m.point.x,B=i.y2*y+m.point.y;return!this.isInsideGrid(g,w,A,B)||!o&&this.grid.hitTest(g,w,A,B,p)?{box:[],offscreen:!1}:{box:[g,w,A,B],offscreen:this.isOffscreen(g,w,A,B)}},Pi.prototype.placeCollisionCircles=function(i,o,n,s,p,m,y,g,w,A,B,L,R){var Z=[],j=new l.Point(o.anchorX,o.anchorY),K=mt(j,m),U=Mt(this.transform.cameraToCenterDistance,K.signedDistanceFromCamera),X=(A?p/U:p*U)/l.ONE_EM,Q=mt(j,y).point,ie=Pr(X,s,o.lineOffsetX*X,o.lineOffsetY*X,!1,Q,j,o,n,y,{}),ce=!1,le=!1,he=!0;if(ie){for(var ge=.5*L*U+R,Te=new l.Point(-100,-100),Se=new l.Point(this.screenRightBoundary,this.screenBottomBoundary),Le=new qr,Ge=ie.first,Xe=ie.last,He=[],wt=Ge.path.length-1;wt>=1;wt--)He.push(Ge.path[wt]);for(var Re=1;Re<Xe.path.length;Re++)He.push(Xe.path[Re]);var rt=2.5*ge;if(g){var at=He.map(function(Di){return mt(Di,g)});He=at.some(function(Di){return Di.signedDistanceFromCamera<=0})?[]:at.map(function(Di){return Di.point})}var tt=[];if(He.length>0){for(var et=He[0].clone(),nt=He[0].clone(),Qe=1;Qe<He.length;Qe++)et.x=Math.min(et.x,He[Qe].x),et.y=Math.min(et.y,He[Qe].y),nt.x=Math.max(nt.x,He[Qe].x),nt.y=Math.max(nt.y,He[Qe].y);tt=et.x>=Te.x&&nt.x<=Se.x&&et.y>=Te.y&&nt.y<=Se.y?[He]:nt.x<Te.x||et.x>Se.x||nt.y<Te.y||et.y>Se.y?[]:l.clipLine([He],Te.x,Te.y,Se.x,Se.y)}for(var Ke=0,Sr=tt;Ke<Sr.length;Ke+=1){var ir;Le.reset(Sr[Ke],.25*ge),ir=Le.length<=.5*ge?1:Math.ceil(Le.paddedLength/rt)+1;for(var Vr=0;Vr<ir;Vr++){var Mr=Vr/Math.max(ir-1,1),tr=Le.lerp(Mr),ur=tr.x+100,mi=tr.y+100;Z.push(ur,mi,ge,0);var Hr=ur-ge,Fn=mi-ge,ni=ur+ge,Hi=mi+ge;if(he=he&&this.isOffscreen(Hr,Fn,ni,Hi),le=le||this.isInsideGrid(Hr,Fn,ni,Hi),!i&&this.grid.hitTestCircle(ur,mi,ge,B)&&(ce=!0,!w))return{circles:[],offscreen:!1,collisionDetected:ce}}}}return{circles:!w&&ce||!le?[]:Z,offscreen:he,collisionDetected:ce}},Pi.prototype.queryRenderedSymbols=function(i){if(i.length===0||this.grid.keysLength()===0&&this.ignoredGrid.keysLength()===0)return{};for(var o=[],n=1/0,s=1/0,p=-1/0,m=-1/0,y=0,g=i;y<g.length;y+=1){var w=g[y],A=new l.Point(w.x+100,w.y+100);n=Math.min(n,A.x),s=Math.min(s,A.y),p=Math.max(p,A.x),m=Math.max(m,A.y),o.push(A)}for(var B={},L={},R=0,Z=this.grid.query(n,s,p,m).concat(this.ignoredGrid.query(n,s,p,m));R<Z.length;R+=1){var j=Z[R],K=j.key;if(B[K.bucketInstanceId]===void 0&&(B[K.bucketInstanceId]={}),!B[K.bucketInstanceId][K.featureIndex]){var U=[new l.Point(j.x1,j.y1),new l.Point(j.x2,j.y1),new l.Point(j.x2,j.y2),new l.Point(j.x1,j.y2)];l.polygonIntersectsPolygon(o,U)&&(B[K.bucketInstanceId][K.featureIndex]=!0,L[K.bucketInstanceId]===void 0&&(L[K.bucketInstanceId]=[]),L[K.bucketInstanceId].push(K.featureIndex))}}return L},Pi.prototype.insertCollisionBox=function(i,o,n,s,p){(o?this.ignoredGrid:this.grid).insert({bucketInstanceId:n,featureIndex:s,collisionGroupID:p},i[0],i[1],i[2],i[3])},Pi.prototype.insertCollisionCircles=function(i,o,n,s,p){for(var m=o?this.ignoredGrid:this.grid,y={bucketInstanceId:n,featureIndex:s,collisionGroupID:p},g=0;g<i.length;g+=4)m.insertCircle(y,i[g],i[g+1],i[g+2])},Pi.prototype.projectAndGetPerspectiveRatio=function(i,o,n){var s=[o,n,0,1];return Cr(s,s,i),{point:new l.Point((s[0]/s[3]+1)/2*this.transform.width+100,(-s[1]/s[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/s[3]*.5}},Pi.prototype.isOffscreen=function(i,o,n,s){return n<100||i>=this.screenRightBoundary||s<100||o>this.screenBottomBoundary},Pi.prototype.isInsideGrid=function(i,o,n,s){return n>=0&&i<this.gridRightBoundary&&s>=0&&o<this.gridBottomBoundary},Pi.prototype.getViewportMatrix=function(){var i=l.identity([]);return l.translate(i,i,[-100,-100,0]),i};var $i=function(i,o,n,s){this.opacity=i?Math.max(0,Math.min(1,i.opacity+(i.placed?o:-o))):s&&n?1:0,this.placed=n};$i.prototype.isHidden=function(){return this.opacity===0&&!this.placed};var gi=function(i,o,n,s,p){this.text=new $i(i?i.text:null,o,n,p),this.icon=new $i(i?i.icon:null,o,s,p)};gi.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()};var zu=function(i,o,n){this.text=i,this.icon=o,this.skipFade=n},Ci=function(){this.invProjMatrix=l.create(),this.viewportMatrix=l.create(),this.circles=[]},zp=function(i,o,n,s,p){this.bucketInstanceId=i,this.featureIndex=o,this.sourceLayerIndex=n,this.bucketIndex=s,this.tileID=p},pn=function(i){this.crossSourceCollisions=i,this.maxGroupID=0,this.collisionGroups={}};function Lr(i,o,n,s,p){var m=l.getAnchorAlignment(i),y=-(m.horizontalAlign-.5)*o,g=-(m.verticalAlign-.5)*n,w=l.evaluateVariableOffset(i,s);return new l.Point(y+w[0]*p,g+w[1]*p)}function Yi(i,o,n,s,p,m){var y=i.x1,g=i.x2,w=i.y1,A=i.y2,B=i.anchorPointX,L=i.anchorPointY,R=new l.Point(o,n);return s&&R._rotate(p?m:-m),{x1:y+R.x,y1:w+R.y,x2:g+R.x,y2:A+R.y,anchorPointX:B,anchorPointY:L}}pn.prototype.get=function(i){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[i]){var o=++this.maxGroupID;this.collisionGroups[i]={ID:o,predicate:function(n){return n.collisionGroupID===o}}}return this.collisionGroups[i]};var Gr=function(i,o,n,s){this.transform=i.clone(),this.collisionIndex=new Pi(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=o,this.retainedQueryData={},this.collisionGroups=new pn(n),this.collisionCircleArrays={},this.prevPlacement=s,s&&(s.prevPlacement=void 0),this.placedOrientations={}};function to(i,o,n,s,p){i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0),i.emplaceBack(o?1:0,n?1:0,s||0,p||0)}Gr.prototype.getBucketParts=function(i,o,n,s){var p=n.getBucket(o),m=n.latestFeatureIndex;if(p&&m&&o.id===p.layerIds[0]){var y=n.collisionBoxArray,g=p.layers[0].layout,w=Math.pow(2,this.transform.zoom-n.tileID.overscaledZ),A=n.tileSize/l.EXTENT,B=this.transform.calculatePosMatrix(n.tileID.toUnwrapped()),L=g.get("text-pitch-alignment")==="map",R=g.get("text-rotation-alignment")==="map",Z=Ht(n,1,this.transform.zoom),j=sr(B,L,R,this.transform,Z),K=null;if(L){var U=Ft(B,L,R,this.transform,Z);K=l.multiply([],this.transform.labelPlaneMatrix,U)}this.retainedQueryData[p.bucketInstanceId]=new zp(p.bucketInstanceId,m,p.sourceLayerIndex,p.index,n.tileID);var X={bucket:p,layout:g,posMatrix:B,textLabelPlaneMatrix:j,labelToScreenMatrix:K,scale:w,textPixelRatio:A,holdingForFade:n.holdingForFade(),collisionBoxArray:y,partiallyEvaluatedTextSize:l.evaluateSizeForZoom(p.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(p.sourceID)};if(s)for(var Q=0,ie=p.sortKeyRanges;Q<ie.length;Q+=1){var ce=ie[Q];i.push({sortKey:ce.sortKey,symbolInstanceStart:ce.symbolInstanceStart,symbolInstanceEnd:ce.symbolInstanceEnd,parameters:X})}else i.push({symbolInstanceStart:0,symbolInstanceEnd:p.symbolInstances.length,parameters:X})}},Gr.prototype.attemptAnchorPlacement=function(i,o,n,s,p,m,y,g,w,A,B,L,R,Z,j){var K,U=[L.textOffset0,L.textOffset1],X=Lr(i,n,s,U,p),Q=this.collisionIndex.placeCollisionBox(Yi(o,X.x,X.y,m,y,this.transform.angle),B,g,w,A.predicate);if(!j||this.collisionIndex.placeCollisionBox(Yi(j,X.x,X.y,m,y,this.transform.angle),B,g,w,A.predicate).box.length!==0)return Q.box.length>0?(this.prevPlacement&&this.prevPlacement.variableOffsets[L.crossTileID]&&this.prevPlacement.placements[L.crossTileID]&&this.prevPlacement.placements[L.crossTileID].text&&(K=this.prevPlacement.variableOffsets[L.crossTileID].anchor),this.variableOffsets[L.crossTileID]={textOffset:U,width:n,height:s,anchor:i,textBoxScale:p,prevAnchor:K},this.markUsedJustification(R,i,L,Z),R.allowVerticalPlacement&&(this.markUsedOrientation(R,Z,L),this.placedOrientations[L.crossTileID]=Z),{shift:X,placedGlyphBoxes:Q}):void 0},Gr.prototype.placeLayerBucketPart=function(i,o,n){var s=this,p=i.parameters,m=p.bucket,y=p.layout,g=p.posMatrix,w=p.textLabelPlaneMatrix,A=p.labelToScreenMatrix,B=p.textPixelRatio,L=p.holdingForFade,R=p.collisionBoxArray,Z=p.partiallyEvaluatedTextSize,j=p.collisionGroup,K=y.get("text-optional"),U=y.get("icon-optional"),X=y.get("text-allow-overlap"),Q=y.get("icon-allow-overlap"),ie=y.get("text-rotation-alignment")==="map",ce=y.get("text-pitch-alignment")==="map",le=y.get("icon-text-fit")!=="none",he=y.get("symbol-z-order")==="viewport-y",ge=X&&(Q||!m.hasIconData()||U),Te=Q&&(X||!m.hasTextData()||K);!m.collisionArrays&&R&&m.deserializeCollisionBoxes(R);var Se=function(Re,rt){if(!o[Re.crossTileID])if(L)s.placements[Re.crossTileID]=new zu(!1,!1,!1);else{var at,tt=!1,et=!1,nt=!0,Qe=null,Ke={box:null,offscreen:null},Sr={box:null,offscreen:null},ir=null,Vr=null,Mr=0,tr=0,ur=0;rt.textFeatureIndex?Mr=rt.textFeatureIndex:Re.useRuntimeCollisionCircles&&(Mr=Re.featureIndex),rt.verticalTextFeatureIndex&&(tr=rt.verticalTextFeatureIndex);var mi=rt.textBox;if(mi){var Hr=function(zt){var bi=l.WritingMode.horizontal;if(m.allowVerticalPlacement&&!zt&&s.prevPlacement){var oi=s.prevPlacement.placedOrientations[Re.crossTileID];oi&&(s.placedOrientations[Re.crossTileID]=oi,s.markUsedOrientation(m,bi=oi,Re))}return bi},Fn=function(zt,bi){if(m.allowVerticalPlacement&&Re.numVerticalGlyphVertices>0&&rt.verticalTextBox)for(var oi=0,xo=m.writingModes;oi<xo.length&&(xo[oi]===l.WritingMode.vertical?(Ke=bi(),Sr=Ke):Ke=zt(),!(Ke&&Ke.box&&Ke.box.length));oi+=1);else Ke=zt()};if(y.get("text-variable-anchor")){var ni=y.get("text-variable-anchor");if(s.prevPlacement&&s.prevPlacement.variableOffsets[Re.crossTileID]){var Hi=s.prevPlacement.variableOffsets[Re.crossTileID];ni.indexOf(Hi.anchor)>0&&(ni=ni.filter(function(zt){return zt!==Hi.anchor})).unshift(Hi.anchor)}var Di=function(zt,bi,oi){for(var xo=zt.x2-zt.x1,Zp=zt.y2-zt.y1,ks=Re.textBoxScale,Wp=le&&!Q?bi:null,Na={box:[],offscreen:!1},uc=X?2*ni.length:ni.length,ea=0;ea<uc;++ea){var Ms=s.attemptAnchorPlacement(ni[ea%ni.length],zt,xo,Zp,ks,ie,ce,B,g,j,ea>=ni.length,Re,m,oi,Wp);if(Ms&&(Na=Ms.placedGlyphBoxes)&&Na.box&&Na.box.length){tt=!0,Qe=Ms.shift;break}}return Na};Fn(function(){return Di(mi,rt.iconBox,l.WritingMode.horizontal)},function(){var zt=rt.verticalTextBox;return m.allowVerticalPlacement&&!(Ke&&Ke.box&&Ke.box.length)&&Re.numVerticalGlyphVertices>0&&zt?Di(zt,rt.verticalIconBox,l.WritingMode.vertical):{box:null,offscreen:null}}),Ke&&(tt=Ke.box,nt=Ke.offscreen);var Oa=Hr(Ke&&Ke.box);if(!tt&&s.prevPlacement){var Yo=s.prevPlacement.variableOffsets[Re.crossTileID];Yo&&(s.variableOffsets[Re.crossTileID]=Yo,s.markUsedJustification(m,Yo.anchor,Re,Oa))}}else{var On=function(zt,bi){var oi=s.collisionIndex.placeCollisionBox(zt,X,B,g,j.predicate);return oi&&oi.box&&oi.box.length&&(s.markUsedOrientation(m,bi,Re),s.placedOrientations[Re.crossTileID]=bi),oi};Fn(function(){return On(mi,l.WritingMode.horizontal)},function(){var zt=rt.verticalTextBox;return m.allowVerticalPlacement&&Re.numVerticalGlyphVertices>0&&zt?On(zt,l.WritingMode.vertical):{box:null,offscreen:null}}),Hr(Ke&&Ke.box&&Ke.box.length)}}if(tt=(at=Ke)&&at.box&&at.box.length>0,nt=at&&at.offscreen,Re.useRuntimeCollisionCircles){var Qo=m.text.placedSymbolArray.get(Re.centerJustifiedTextSymbolIndex),Va=l.evaluateSizeForFeature(m.textSizeData,Z,Qo),rn=y.get("text-padding");ir=s.collisionIndex.placeCollisionCircles(X,Qo,m.lineVertexArray,m.glyphOffsetArray,Va,g,w,A,n,ce,j.predicate,Re.collisionCircleDiameter,rn),tt=X||ir.circles.length>0&&!ir.collisionDetected,nt=nt&&ir.offscreen}if(rt.iconFeatureIndex&&(ur=rt.iconFeatureIndex),rt.iconBox){var Ua=function(zt){var bi=le&&Qe?Yi(zt,Qe.x,Qe.y,ie,ce,s.transform.angle):zt;return s.collisionIndex.placeCollisionBox(bi,Q,B,g,j.predicate)};et=Sr&&Sr.box&&Sr.box.length&&rt.verticalIconBox?(Vr=Ua(rt.verticalIconBox)).box.length>0:(Vr=Ua(rt.iconBox)).box.length>0,nt=nt&&Vr.offscreen}var nn=K||Re.numHorizontalGlyphVertices===0&&Re.numVerticalGlyphVertices===0,Tr=U||Re.numIconVertices===0;if(nn||Tr?Tr?nn||(et=et&&tt):tt=et&&tt:et=tt=et&&tt,tt&&at&&at.box&&s.collisionIndex.insertCollisionBox(at.box,y.get("text-ignore-placement"),m.bucketInstanceId,Sr&&Sr.box&&tr?tr:Mr,j.ID),et&&Vr&&s.collisionIndex.insertCollisionBox(Vr.box,y.get("icon-ignore-placement"),m.bucketInstanceId,ur,j.ID),ir&&(tt&&s.collisionIndex.insertCollisionCircles(ir.circles,y.get("text-ignore-placement"),m.bucketInstanceId,Mr,j.ID),n)){var mn=m.bucketInstanceId,Vn=s.collisionCircleArrays[mn];Vn===void 0&&(Vn=s.collisionCircleArrays[mn]=new Ci);for(var _o=0;_o<ir.circles.length;_o+=4)Vn.circles.push(ir.circles[_o+0]),Vn.circles.push(ir.circles[_o+1]),Vn.circles.push(ir.circles[_o+2]),Vn.circles.push(ir.collisionDetected?1:0)}s.placements[Re.crossTileID]=new zu(tt||ge,et||Te,nt||m.justReloaded),o[Re.crossTileID]=!0}};if(he)for(var Le=m.getSortedSymbolIndexes(this.transform.angle),Ge=Le.length-1;Ge>=0;--Ge){var Xe=Le[Ge];Se(m.symbolInstances.get(Xe),m.collisionArrays[Xe])}else for(var He=i.symbolInstanceStart;He<i.symbolInstanceEnd;He++)Se(m.symbolInstances.get(He),m.collisionArrays[He]);if(n&&m.bucketInstanceId in this.collisionCircleArrays){var wt=this.collisionCircleArrays[m.bucketInstanceId];l.invert(wt.invProjMatrix,g),wt.viewportMatrix=this.collisionIndex.getViewportMatrix()}m.justReloaded=!1},Gr.prototype.markUsedJustification=function(i,o,n,s){var p;p=s===l.WritingMode.vertical?n.verticalPlacedTextSymbolIndex:{left:n.leftJustifiedTextSymbolIndex,center:n.centerJustifiedTextSymbolIndex,right:n.rightJustifiedTextSymbolIndex}[l.getAnchorJustification(o)];for(var m=0,y=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex,n.verticalPlacedTextSymbolIndex];m<y.length;m+=1){var g=y[m];g>=0&&(i.text.placedSymbolArray.get(g).crossTileID=p>=0&&g!==p?0:n.crossTileID)}},Gr.prototype.markUsedOrientation=function(i,o,n){for(var s=o===l.WritingMode.horizontal||o===l.WritingMode.horizontalOnly?o:0,p=o===l.WritingMode.vertical?o:0,m=0,y=[n.leftJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.rightJustifiedTextSymbolIndex];m<y.length;m+=1)i.text.placedSymbolArray.get(y[m]).placedOrientation=s;n.verticalPlacedTextSymbolIndex&&(i.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).placedOrientation=p)},Gr.prototype.commit=function(i){this.commitTime=i,this.zoomAtLastRecencyCheck=this.transform.zoom;var o=this.prevPlacement,n=!1;this.prevZoomAdjustment=o?o.zoomAdjustment(this.transform.zoom):0;var s=o?o.symbolFadeChange(i):1,p=o?o.opacities:{},m=o?o.variableOffsets:{},y=o?o.placedOrientations:{};for(var g in this.placements){var w=this.placements[g],A=p[g];A?(this.opacities[g]=new gi(A,s,w.text,w.icon),n=n||w.text!==A.text.placed||w.icon!==A.icon.placed):(this.opacities[g]=new gi(null,s,w.text,w.icon,w.skipFade),n=n||w.text||w.icon)}for(var B in p){var L=p[B];if(!this.opacities[B]){var R=new gi(L,s,!1,!1);R.isHidden()||(this.opacities[B]=R,n=n||L.text.placed||L.icon.placed)}}for(var Z in m)this.variableOffsets[Z]||!this.opacities[Z]||this.opacities[Z].isHidden()||(this.variableOffsets[Z]=m[Z]);for(var j in y)this.placedOrientations[j]||!this.opacities[j]||this.opacities[j].isHidden()||(this.placedOrientations[j]=y[j]);n?this.lastPlacementChangeTime=i:typeof this.lastPlacementChangeTime!="number"&&(this.lastPlacementChangeTime=o?o.lastPlacementChangeTime:i)},Gr.prototype.updateLayerOpacities=function(i,o){for(var n={},s=0,p=o;s<p.length;s+=1){var m=p[s],y=m.getBucket(i);y&&m.latestFeatureIndex&&i.id===y.layerIds[0]&&this.updateBucketOpacities(y,n,m.collisionBoxArray)}},Gr.prototype.updateBucketOpacities=function(i,o,n){var s=this;i.hasTextData()&&i.text.opacityVertexArray.clear(),i.hasIconData()&&i.icon.opacityVertexArray.clear(),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexArray.clear(),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexArray.clear();var p=i.layers[0].layout,m=new gi(null,0,!1,!1,!0),y=p.get("text-allow-overlap"),g=p.get("icon-allow-overlap"),w=p.get("text-variable-anchor"),A=p.get("text-rotation-alignment")==="map",B=p.get("text-pitch-alignment")==="map",L=p.get("icon-text-fit")!=="none",R=new gi(null,0,y&&(g||!i.hasIconData()||p.get("icon-optional")),g&&(y||!i.hasTextData()||p.get("text-optional")),!0);!i.collisionArrays&&n&&(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData())&&i.deserializeCollisionBoxes(n);for(var Z=function(X,Q,ie){for(var ce=0;ce<Q/4;ce++)X.opacityVertexArray.emplaceBack(ie)},j=function(X){var Q=i.symbolInstances.get(X),ie=Q.numHorizontalGlyphVertices,ce=Q.numVerticalGlyphVertices,le=Q.crossTileID,he=s.opacities[le];o[le]?he=m:he||(s.opacities[le]=he=R),o[le]=!0;var ge=Q.numIconVertices>0,Te=s.placedOrientations[Q.crossTileID],Se=Te===l.WritingMode.vertical,Le=Te===l.WritingMode.horizontal||Te===l.WritingMode.horizontalOnly;if(ie>0||ce>0){var Ge=Lu(he.text);Z(i.text,ie,Se?No:Ge),Z(i.text,ce,Le?No:Ge);var Xe=he.text.isHidden();[Q.rightJustifiedTextSymbolIndex,Q.centerJustifiedTextSymbolIndex,Q.leftJustifiedTextSymbolIndex].forEach(function(Ke){Ke>=0&&(i.text.placedSymbolArray.get(Ke).hidden=Xe||Se?1:0)}),Q.verticalPlacedTextSymbolIndex>=0&&(i.text.placedSymbolArray.get(Q.verticalPlacedTextSymbolIndex).hidden=Xe||Le?1:0);var He=s.variableOffsets[Q.crossTileID];He&&s.markUsedJustification(i,He.anchor,Q,Te);var wt=s.placedOrientations[Q.crossTileID];wt&&(s.markUsedJustification(i,"left",Q,wt),s.markUsedOrientation(i,wt,Q))}if(ge){var Re=Lu(he.icon),rt=!(L&&Q.verticalPlacedIconSymbolIndex&&Se);Q.placedIconSymbolIndex>=0&&(Z(i.icon,Q.numIconVertices,rt?Re:No),i.icon.placedSymbolArray.get(Q.placedIconSymbolIndex).hidden=he.icon.isHidden()),Q.verticalPlacedIconSymbolIndex>=0&&(Z(i.icon,Q.numVerticalIconVertices,rt?No:Re),i.icon.placedSymbolArray.get(Q.verticalPlacedIconSymbolIndex).hidden=he.icon.isHidden())}if(i.hasIconCollisionBoxData()||i.hasTextCollisionBoxData()){var at=i.collisionArrays[X];if(at){var tt=new l.Point(0,0);if(at.textBox||at.verticalTextBox){var et=!0;if(w){var nt=s.variableOffsets[le];nt?(tt=Lr(nt.anchor,nt.width,nt.height,nt.textOffset,nt.textBoxScale),A&&tt._rotate(B?s.transform.angle:-s.transform.angle)):et=!1}at.textBox&&to(i.textCollisionBox.collisionVertexArray,he.text.placed,!et||Se,tt.x,tt.y),at.verticalTextBox&&to(i.textCollisionBox.collisionVertexArray,he.text.placed,!et||Le,tt.x,tt.y)}var Qe=!!(!Le&&at.verticalIconBox);at.iconBox&&to(i.iconCollisionBox.collisionVertexArray,he.icon.placed,Qe,L?tt.x:0,L?tt.y:0),at.verticalIconBox&&to(i.iconCollisionBox.collisionVertexArray,he.icon.placed,!Qe,L?tt.x:0,L?tt.y:0)}}},K=0;K<i.symbolInstances.length;K++)j(K);if(i.sortFeatures(this.transform.angle),this.retainedQueryData[i.bucketInstanceId]&&(this.retainedQueryData[i.bucketInstanceId].featureSortOrder=i.featureSortOrder),i.hasTextData()&&i.text.opacityVertexBuffer&&i.text.opacityVertexBuffer.updateData(i.text.opacityVertexArray),i.hasIconData()&&i.icon.opacityVertexBuffer&&i.icon.opacityVertexBuffer.updateData(i.icon.opacityVertexArray),i.hasIconCollisionBoxData()&&i.iconCollisionBox.collisionVertexBuffer&&i.iconCollisionBox.collisionVertexBuffer.updateData(i.iconCollisionBox.collisionVertexArray),i.hasTextCollisionBoxData()&&i.textCollisionBox.collisionVertexBuffer&&i.textCollisionBox.collisionVertexBuffer.updateData(i.textCollisionBox.collisionVertexArray),i.bucketInstanceId in this.collisionCircleArrays){var U=this.collisionCircleArrays[i.bucketInstanceId];i.placementInvProjMatrix=U.invProjMatrix,i.placementViewportMatrix=U.viewportMatrix,i.collisionCircleArray=U.circles,delete this.collisionCircleArrays[i.bucketInstanceId]}},Gr.prototype.symbolFadeChange=function(i){return this.fadeDuration===0?1:(i-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},Gr.prototype.zoomAdjustment=function(i){return Math.max(0,(this.transform.zoom-i)/1.5)},Gr.prototype.hasTransitions=function(i){return this.stale||i-this.lastPlacementChangeTime<this.fadeDuration},Gr.prototype.stillRecent=function(i,o){var n=this.zoomAtLastRecencyCheck===o?1-this.zoomAdjustment(o):1;return this.zoomAtLastRecencyCheck=o,this.commitTime+this.fadeDuration*n>i},Gr.prototype.setStale=function(){this.stale=!0};var Bp=Math.pow(2,25),Dp=Math.pow(2,24),wl=Math.pow(2,17),Lp=Math.pow(2,16),Bu=Math.pow(2,9),Rp=Math.pow(2,8),Du=Math.pow(2,1);function Lu(i){if(i.opacity===0&&!i.placed)return 0;if(i.opacity===1&&i.placed)return 4294967295;var o=i.placed?1:0,n=Math.floor(127*i.opacity);return n*Bp+o*Dp+n*wl+o*Lp+n*Bu+o*Rp+n*Du+o}var No=0,Sl=function(i){this._sortAcrossTiles=i.layout.get("symbol-z-order")!=="viewport-y"&&i.layout.get("symbol-sort-key").constantOr(1)!==void 0,this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]};Sl.prototype.continuePlacement=function(i,o,n,s,p){for(var m=this._bucketParts;this._currentTileIndex<i.length;)if(o.getBucketParts(m,s,i[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,p())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,m.sort(function(y,g){return y.sortKey-g.sortKey}));this._currentPartIndex<m.length;)if(o.placeLayerBucketPart(m[this._currentPartIndex],this._seenCrossTileIDs,n),this._currentPartIndex++,p())return!0;return!1};var ba=function(i,o,n,s,p,m,y){this.placement=new Gr(i,p,m,y),this._currentPlacementIndex=o.length-1,this._forceFullPlacement=n,this._showCollisionBoxes=s,this._done=!1};ba.prototype.isDone=function(){return this._done},ba.prototype.continuePlacement=function(i,o,n){for(var s=this,p=l.browser.now(),m=function(){var w=l.browser.now()-p;return!s._forceFullPlacement&&w>2};this._currentPlacementIndex>=0;){var y=o[i[this._currentPlacementIndex]],g=this.placement.collisionIndex.transform.zoom;if(y.type==="symbol"&&(!y.minzoom||y.minzoom<=g)&&(!y.maxzoom||y.maxzoom>g)){if(this._inProgressLayer||(this._inProgressLayer=new Sl(y)),this._inProgressLayer.continuePlacement(n[y.source],this.placement,this._showCollisionBoxes,y,m))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},ba.prototype.commit=function(i){return this.placement.commit(i),this.placement};var Ru=512/l.EXTENT/2,cs=function(i,o,n){this.tileID=i,this.indexedSymbolInstances={},this.bucketInstanceId=n;for(var s=0;s<o.length;s++){var p=o.get(s),m=p.key;this.indexedSymbolInstances[m]||(this.indexedSymbolInstances[m]=[]),this.indexedSymbolInstances[m].push({crossTileID:p.crossTileID,coord:this.getScaledCoordinates(p,i)})}};cs.prototype.getScaledCoordinates=function(i,o){var n=Ru/Math.pow(2,o.canonical.z-this.tileID.canonical.z);return{x:Math.floor((o.canonical.x*l.EXTENT+i.anchorX)*n),y:Math.floor((o.canonical.y*l.EXTENT+i.anchorY)*n)}},cs.prototype.findMatches=function(i,o,n){for(var s=this.tileID.canonical.z<o.canonical.z?1:Math.pow(2,this.tileID.canonical.z-o.canonical.z),p=0;p<i.length;p++){var m=i.get(p);if(!m.crossTileID){var y=this.indexedSymbolInstances[m.key];if(y)for(var g=this.getScaledCoordinates(m,o),w=0,A=y;w<A.length;w+=1){var B=A[w];if(Math.abs(B.coord.x-g.x)<=s&&Math.abs(B.coord.y-g.y)<=s&&!n[B.crossTileID]){n[B.crossTileID]=!0,m.crossTileID=B.crossTileID;break}}}}};var ki=function(){this.maxCrossTileID=0};ki.prototype.generate=function(){return++this.maxCrossTileID};var Sn=function(){this.indexes={},this.usedCrossTileIDs={},this.lng=0};Sn.prototype.handleWrapJump=function(i){var o=Math.round((i-this.lng)/360);if(o!==0)for(var n in this.indexes){var s=this.indexes[n],p={};for(var m in s){var y=s[m];y.tileID=y.tileID.unwrapTo(y.tileID.wrap+o),p[y.tileID.key]=y}this.indexes[n]=p}this.lng=i},Sn.prototype.addBucket=function(i,o,n){if(this.indexes[i.overscaledZ]&&this.indexes[i.overscaledZ][i.key]){if(this.indexes[i.overscaledZ][i.key].bucketInstanceId===o.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(i.overscaledZ,this.indexes[i.overscaledZ][i.key])}for(var s=0;s<o.symbolInstances.length;s++)o.symbolInstances.get(s).crossTileID=0;this.usedCrossTileIDs[i.overscaledZ]||(this.usedCrossTileIDs[i.overscaledZ]={});var p=this.usedCrossTileIDs[i.overscaledZ];for(var m in this.indexes){var y=this.indexes[m];if(Number(m)>i.overscaledZ)for(var g in y){var w=y[g];w.tileID.isChildOf(i)&&w.findMatches(o.symbolInstances,i,p)}else{var A=y[i.scaledTo(Number(m)).key];A&&A.findMatches(o.symbolInstances,i,p)}}for(var B=0;B<o.symbolInstances.length;B++){var L=o.symbolInstances.get(B);L.crossTileID||(L.crossTileID=n.generate(),p[L.crossTileID]=!0)}return this.indexes[i.overscaledZ]===void 0&&(this.indexes[i.overscaledZ]={}),this.indexes[i.overscaledZ][i.key]=new cs(i,o.symbolInstances,o.bucketInstanceId),!0},Sn.prototype.removeBucketCrossTileIDs=function(i,o){for(var n in o.indexedSymbolInstances)for(var s=0,p=o.indexedSymbolInstances[n];s<p.length;s+=1)delete this.usedCrossTileIDs[i][p[s].crossTileID]},Sn.prototype.removeStaleBuckets=function(i){var o=!1;for(var n in this.indexes){var s=this.indexes[n];for(var p in s)i[s[p].bucketInstanceId]||(this.removeBucketCrossTileIDs(n,s[p]),delete s[p],o=!0)}return o};var Tn=function(){this.layerIndexes={},this.crossTileIDs=new ki,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};Tn.prototype.addLayer=function(i,o,n){var s=this.layerIndexes[i.id];s===void 0&&(s=this.layerIndexes[i.id]=new Sn);var p=!1,m={};s.handleWrapJump(n);for(var y=0,g=o;y<g.length;y+=1){var w=g[y],A=w.getBucket(i);A&&i.id===A.layerIds[0]&&(A.bucketInstanceId||(A.bucketInstanceId=++this.maxBucketInstanceId),s.addBucket(w.tileID,A,this.crossTileIDs)&&(p=!0),m[A.bucketInstanceId]=!0)}return s.removeStaleBuckets(m)&&(p=!0),p},Tn.prototype.pruneUnusedLayers=function(i){var o={};for(var n in i.forEach(function(s){o[s]=!0}),this.layerIndexes)o[n]||delete this.layerIndexes[n]};var ro=function(i,o){return l.emitValidationErrors(i,o&&o.filter(function(n){return n.identifier!=="source.canvas"}))},In=l.pick(Ce,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),An=l.pick(Ce,["setCenter","setZoom","setBearing","setPitch"]),ps=function(){var i={},o=l.styleSpec.$version;for(var n in l.styleSpec.$root){var s,p=l.styleSpec.$root[n];p.required&&(s=n==="version"?o:p.type==="array"?[]:{})!=null&&(i[n]=s)}return i}(),ui=function(i){function o(n,s){var p=this;s===void 0&&(s={}),i.call(this),this.map=n,this.dispatcher=new gr(de(),this),this.imageManager=new ot,this.imageManager.setEventedParent(this),this.glyphManager=new er(n._requestManager,s.localIdeographFontFamily),this.lineAtlas=new It(256,512),this.crossTileSymbolIndex=new Tn,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new l.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",l.getReferrer());var m=this;this._rtlTextPluginCallback=o.registerForPluginStateChange(function(y){m.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:y.pluginStatus,pluginURL:y.pluginURL},function(g,w){if(l.triggerPluginCompletionEvent(g),w&&w.every(function(B){return B}))for(var A in m.sourceCaches)m.sourceCaches[A].reload()})}),this.on("data",function(y){if(y.dataType==="source"&&y.sourceDataType==="metadata"){var g=p.sourceCaches[y.sourceId];if(g){var w=g.getSource();if(w&&w.vectorLayerIds)for(var A in p._layers){var B=p._layers[A];B.source===w.id&&p._validateLayer(B)}}}})}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.loadURL=function(n,s){var p=this;s===void 0&&(s={}),this.fire(new l.Event("dataloading",{dataType:"style"}));var m=typeof s.validate=="boolean"?s.validate:!l.isMapboxURL(n);n=this.map._requestManager.normalizeStyleURL(n,s.accessToken);var y=this.map._requestManager.transformRequest(n,l.ResourceType.Style);this._request=l.getJSON(y,function(g,w){p._request=null,g?p.fire(new l.ErrorEvent(g)):w&&p._load(w,m)})},o.prototype.loadJSON=function(n,s){var p=this;s===void 0&&(s={}),this.fire(new l.Event("dataloading",{dataType:"style"})),this._request=l.browser.frame(function(){p._request=null,p._load(n,s.validate!==!1)})},o.prototype.loadEmpty=function(){this.fire(new l.Event("dataloading",{dataType:"style"})),this._load(ps,!1)},o.prototype._load=function(n,s){if(!s||!ro(this,l.validateStyle(n))){for(var p in this._loaded=!0,this.stylesheet=n,n.sources)this.addSource(p,n.sources[p],{validate:!1});n.sprite?this._loadSprite(n.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(n.glyphs);var m=Ee(this.stylesheet.layers);this._order=m.map(function(A){return A.id}),this._layers={},this._serializedLayers={};for(var y=0,g=m;y<g.length;y+=1){var w=g[y];(w=l.createStyleLayer(w)).setEventedParent(this,{layer:{id:w.id}}),this._layers[w.id]=w,this._serializedLayers[w.id]=w.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new vi(this.stylesheet.light),this.fire(new l.Event("data",{dataType:"style"})),this.fire(new l.Event("style.load"))}},o.prototype._loadSprite=function(n){var s=this;this._spriteRequest=function(p,m,y){var g,w,A,B=l.browser.devicePixelRatio>1?"@2x":"",L=l.getJSON(m.transformRequest(m.normalizeSpriteURL(p,B,".json"),l.ResourceType.SpriteJSON),function(j,K){L=null,A||(A=j,g=K,Z())}),R=l.getImage(m.transformRequest(m.normalizeSpriteURL(p,B,".png"),l.ResourceType.SpriteImage),function(j,K){R=null,A||(A=j,w=K,Z())});function Z(){if(A)y(A);else if(g&&w){var j=l.browser.getImageData(w),K={};for(var U in g){var X=g[U],Q=X.width,ie=X.height,ce=X.x,le=X.y,he=X.sdf,ge=X.pixelRatio,Te=X.stretchX,Se=X.stretchY,Le=X.content,Ge=new l.RGBAImage({width:Q,height:ie});l.RGBAImage.copy(j,Ge,{x:ce,y:le},{x:0,y:0},{width:Q,height:ie}),K[U]={data:Ge,pixelRatio:ge,sdf:he,stretchX:Te,stretchY:Se,content:Le}}y(null,K)}}return{cancel:function(){L&&(L.cancel(),L=null),R&&(R.cancel(),R=null)}}}(n,this.map._requestManager,function(p,m){if(s._spriteRequest=null,p)s.fire(new l.ErrorEvent(p));else if(m)for(var y in m)s.imageManager.addImage(y,m[y]);s.imageManager.setLoaded(!0),s._availableImages=s.imageManager.listImages(),s.dispatcher.broadcast("setImages",s._availableImages),s.fire(new l.Event("data",{dataType:"style"}))})},o.prototype._validateLayer=function(n){var s=this.sourceCaches[n.source];if(s){var p=n.sourceLayer;if(p){var m=s.getSource();(m.type==="geojson"||m.vectorLayerIds&&m.vectorLayerIds.indexOf(p)===-1)&&this.fire(new l.ErrorEvent(new Error('Source layer "'+p+'" does not exist on source "'+m.id+'" as specified by style layer "'+n.id+'"')))}}},o.prototype.loaded=function(){if(!this._loaded||Object.keys(this._updatedSources).length)return!1;for(var n in this.sourceCaches)if(!this.sourceCaches[n].loaded())return!1;return!!this.imageManager.isLoaded()},o.prototype._serializeLayers=function(n){for(var s=[],p=0,m=n;p<m.length;p+=1){var y=this._layers[m[p]];y.type!=="custom"&&s.push(y.serialize())}return s},o.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var n in this.sourceCaches)if(this.sourceCaches[n].hasTransition())return!0;for(var s in this._layers)if(this._layers[s].hasTransition())return!0;return!1},o.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},o.prototype.update=function(n){if(this._loaded){var s=this._changed;if(this._changed){var p=Object.keys(this._updatedLayers),m=Object.keys(this._removedLayers);for(var y in(p.length||m.length)&&this._updateWorkerLayers(p,m),this._updatedSources){var g=this._updatedSources[y];g==="reload"?this._reloadSource(y):g==="clear"&&this._clearSource(y)}for(var w in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[w].updateTransitions(n);this.light.updateTransitions(n),this._resetUpdates()}var A={};for(var B in this.sourceCaches){var L=this.sourceCaches[B];A[B]=L.used,L.used=!1}for(var R=0,Z=this._order;R<Z.length;R+=1){var j=this._layers[Z[R]];j.recalculate(n,this._availableImages),!j.isHidden(n.zoom)&&j.source&&(this.sourceCaches[j.source].used=!0)}for(var K in A){var U=this.sourceCaches[K];A[K]!==U.used&&U.fire(new l.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:K}))}this.light.recalculate(n),this.z=n.zoom,s&&this.fire(new l.Event("data",{dataType:"style"}))}},o.prototype._updateTilesForChangedImages=function(){var n=Object.keys(this._changedImages);if(n.length){for(var s in this.sourceCaches)this.sourceCaches[s].reloadTilesForDependencies(["icons","patterns"],n);this._changedImages={}}},o.prototype._updateWorkerLayers=function(n,s){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(n),removedIds:s})},o.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},o.prototype.setState=function(n){var s=this;if(this._checkLoaded(),ro(this,l.validateStyle(n)))return!1;(n=l.clone$1(n)).layers=Ee(n.layers);var p=function(y,g){if(!y)return[{command:Ce.setStyle,args:[g]}];var w=[];try{if(!l.deepEqual(y.version,g.version))return[{command:Ce.setStyle,args:[g]}];l.deepEqual(y.center,g.center)||w.push({command:Ce.setCenter,args:[g.center]}),l.deepEqual(y.zoom,g.zoom)||w.push({command:Ce.setZoom,args:[g.zoom]}),l.deepEqual(y.bearing,g.bearing)||w.push({command:Ce.setBearing,args:[g.bearing]}),l.deepEqual(y.pitch,g.pitch)||w.push({command:Ce.setPitch,args:[g.pitch]}),l.deepEqual(y.sprite,g.sprite)||w.push({command:Ce.setSprite,args:[g.sprite]}),l.deepEqual(y.glyphs,g.glyphs)||w.push({command:Ce.setGlyphs,args:[g.glyphs]}),l.deepEqual(y.transition,g.transition)||w.push({command:Ce.setTransition,args:[g.transition]}),l.deepEqual(y.light,g.light)||w.push({command:Ce.setLight,args:[g.light]});var A={},B=[];(function(R,Z,j,K){var U;for(U in Z=Z||{},R=R||{})R.hasOwnProperty(U)&&(Z.hasOwnProperty(U)||ze(U,j,K));for(U in Z)Z.hasOwnProperty(U)&&(R.hasOwnProperty(U)?l.deepEqual(R[U],Z[U])||(R[U].type==="geojson"&&Z[U].type==="geojson"&&Ut(R,Z,U)?j.push({command:Ce.setGeoJSONSourceData,args:[U,Z[U].data]}):vt(U,Z,j,K)):ut(U,Z,j))})(y.sources,g.sources,B,A);var L=[];y.layers&&y.layers.forEach(function(R){A[R.source]?w.push({command:Ce.removeLayer,args:[R.id]}):L.push(R)}),w=w.concat(B),function(R,Z,j){Z=Z||[];var K,U,X,Q,ie,ce,le,he=(R=R||[]).map(kt),ge=Z.map(kt),Te=R.reduce(_t,{}),Se=Z.reduce(_t,{}),Le=he.slice(),Ge=Object.create(null);for(K=0,U=0;K<he.length;K++)Se.hasOwnProperty(X=he[K])?U++:(j.push({command:Ce.removeLayer,args:[X]}),Le.splice(Le.indexOf(X,U),1));for(K=0,U=0;K<ge.length;K++)Le[Le.length-1-K]!==(X=ge[ge.length-1-K])&&(Te.hasOwnProperty(X)?(j.push({command:Ce.removeLayer,args:[X]}),Le.splice(Le.lastIndexOf(X,Le.length-U),1)):U++,j.push({command:Ce.addLayer,args:[Se[X],ce=Le[Le.length-K]]}),Le.splice(Le.length-K,0,X),Ge[X]=!0);for(K=0;K<ge.length;K++)if(Q=Te[X=ge[K]],ie=Se[X],!Ge[X]&&!l.deepEqual(Q,ie))if(l.deepEqual(Q.source,ie.source)&&l.deepEqual(Q["source-layer"],ie["source-layer"])&&l.deepEqual(Q.type,ie.type)){for(le in ht(Q.layout,ie.layout,j,X,null,Ce.setLayoutProperty),ht(Q.paint,ie.paint,j,X,null,Ce.setPaintProperty),l.deepEqual(Q.filter,ie.filter)||j.push({command:Ce.setFilter,args:[X,ie.filter]}),l.deepEqual(Q.minzoom,ie.minzoom)&&l.deepEqual(Q.maxzoom,ie.maxzoom)||j.push({command:Ce.setLayerZoomRange,args:[X,ie.minzoom,ie.maxzoom]}),Q)Q.hasOwnProperty(le)&&le!=="layout"&&le!=="paint"&&le!=="filter"&&le!=="metadata"&&le!=="minzoom"&&le!=="maxzoom"&&(le.indexOf("paint.")===0?ht(Q[le],ie[le],j,X,le.slice(6),Ce.setPaintProperty):l.deepEqual(Q[le],ie[le])||j.push({command:Ce.setLayerProperty,args:[X,le,ie[le]]}));for(le in ie)ie.hasOwnProperty(le)&&!Q.hasOwnProperty(le)&&le!=="layout"&&le!=="paint"&&le!=="filter"&&le!=="metadata"&&le!=="minzoom"&&le!=="maxzoom"&&(le.indexOf("paint.")===0?ht(Q[le],ie[le],j,X,le.slice(6),Ce.setPaintProperty):l.deepEqual(Q[le],ie[le])||j.push({command:Ce.setLayerProperty,args:[X,le,ie[le]]}))}else j.push({command:Ce.removeLayer,args:[X]}),ce=Le[Le.lastIndexOf(X)+1],j.push({command:Ce.addLayer,args:[ie,ce]})}(L,g.layers,w)}catch(R){console.warn("Unable to compute style diff:",R),w=[{command:Ce.setStyle,args:[g]}]}return w}(this.serialize(),n).filter(function(y){return!(y.command in An)});if(p.length===0)return!1;var m=p.filter(function(y){return!(y.command in In)});if(m.length>0)throw new Error("Unimplemented: "+m.map(function(y){return y.command}).join(", ")+".");return p.forEach(function(y){y.command!=="setTransition"&&s[y.command].apply(s,y.args)}),this.stylesheet=n,!0},o.prototype.addImage=function(n,s){if(this.getImage(n))return this.fire(new l.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(n,s),this._afterImageUpdated(n)},o.prototype.updateImage=function(n,s){this.imageManager.updateImage(n,s)},o.prototype.getImage=function(n){return this.imageManager.getImage(n)},o.prototype.removeImage=function(n){if(!this.getImage(n))return this.fire(new l.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(n),this._afterImageUpdated(n)},o.prototype._afterImageUpdated=function(n){this._availableImages=this.imageManager.listImages(),this._changedImages[n]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new l.Event("data",{dataType:"style"}))},o.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},o.prototype.addSource=function(n,s,p){var m=this;if(p===void 0&&(p={}),this._checkLoaded(),this.sourceCaches[n]!==void 0)throw new Error("There is already a source with this ID");if(!s.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(s).join(", ")+".");if(!(["vector","raster","geojson","video","image"].indexOf(s.type)>=0&&this._validate(l.validateStyle.source,"sources."+n,s,null,p))){this.map&&this.map._collectResourceTiming&&(s.collectResourceTiming=!0);var y=this.sourceCaches[n]=new W(n,s,this.dispatcher);y.style=this,y.setEventedParent(this,function(){return{isSourceLoaded:m.loaded(),source:y.serialize(),sourceId:n}}),y.onAdd(this.map),this._changed=!0}},o.prototype.removeSource=function(n){if(this._checkLoaded(),this.sourceCaches[n]===void 0)throw new Error("There is no source with this ID");for(var s in this._layers)if(this._layers[s].source===n)return this.fire(new l.ErrorEvent(new Error('Source "'+n+'" cannot be removed while layer "'+s+'" is using it.')));var p=this.sourceCaches[n];delete this.sourceCaches[n],delete this._updatedSources[n],p.fire(new l.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:n})),p.setEventedParent(null),p.clearTiles(),p.onRemove&&p.onRemove(this.map),this._changed=!0},o.prototype.setGeoJSONSourceData=function(n,s){this._checkLoaded(),this.sourceCaches[n].getSource().setData(s),this._changed=!0},o.prototype.getSource=function(n){return this.sourceCaches[n]&&this.sourceCaches[n].getSource()},o.prototype.addLayer=function(n,s,p){p===void 0&&(p={}),this._checkLoaded();var m=n.id;if(this.getLayer(m))this.fire(new l.ErrorEvent(new Error('Layer with id "'+m+'" already exists on this map')));else{var y;if(n.type==="custom"){if(ro(this,l.validateCustomStyleLayer(n)))return;y=l.createStyleLayer(n)}else{if(typeof n.source=="object"&&(this.addSource(m,n.source),n=l.clone$1(n),n=l.extend(n,{source:m})),this._validate(l.validateStyle.layer,"layers."+m,n,{arrayIndex:-1},p))return;y=l.createStyleLayer(n),this._validateLayer(y),y.setEventedParent(this,{layer:{id:m}}),this._serializedLayers[y.id]=y.serialize()}var g=s?this._order.indexOf(s):this._order.length;if(s&&g===-1)this.fire(new l.ErrorEvent(new Error('Layer with id "'+s+'" does not exist on this map.')));else{if(this._order.splice(g,0,m),this._layerOrderChanged=!0,this._layers[m]=y,this._removedLayers[m]&&y.source&&y.type!=="custom"){var w=this._removedLayers[m];delete this._removedLayers[m],w.type!==y.type?this._updatedSources[y.source]="clear":(this._updatedSources[y.source]="reload",this.sourceCaches[y.source].pause())}this._updateLayer(y),y.onAdd&&y.onAdd(this.map)}}},o.prototype.moveLayer=function(n,s){if(this._checkLoaded(),this._changed=!0,this._layers[n]){if(n!==s){var p=this._order.indexOf(n);this._order.splice(p,1);var m=s?this._order.indexOf(s):this._order.length;s&&m===-1?this.fire(new l.ErrorEvent(new Error('Layer with id "'+s+'" does not exist on this map.'))):(this._order.splice(m,0,n),this._layerOrderChanged=!0)}}else this.fire(new l.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be moved.")))},o.prototype.removeLayer=function(n){this._checkLoaded();var s=this._layers[n];if(s){s.setEventedParent(null);var p=this._order.indexOf(n);this._order.splice(p,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[n]=s,delete this._layers[n],delete this._serializedLayers[n],delete this._updatedLayers[n],delete this._updatedPaintProps[n],s.onRemove&&s.onRemove(this.map)}else this.fire(new l.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be removed.")))},o.prototype.getLayer=function(n){return this._layers[n]},o.prototype.hasLayer=function(n){return n in this._layers},o.prototype.setLayerZoomRange=function(n,s,p){this._checkLoaded();var m=this.getLayer(n);m?m.minzoom===s&&m.maxzoom===p||(s!=null&&(m.minzoom=s),p!=null&&(m.maxzoom=p),this._updateLayer(m)):this.fire(new l.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot have zoom extent.")))},o.prototype.setFilter=function(n,s,p){p===void 0&&(p={}),this._checkLoaded();var m=this.getLayer(n);if(m){if(!l.deepEqual(m.filter,s))return s==null?(m.filter=void 0,void this._updateLayer(m)):void(this._validate(l.validateStyle.filter,"layers."+m.id+".filter",s,null,p)||(m.filter=l.clone$1(s),this._updateLayer(m)))}else this.fire(new l.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be filtered.")))},o.prototype.getFilter=function(n){return l.clone$1(this.getLayer(n).filter)},o.prototype.setLayoutProperty=function(n,s,p,m){m===void 0&&(m={}),this._checkLoaded();var y=this.getLayer(n);y?l.deepEqual(y.getLayoutProperty(s),p)||(y.setLayoutProperty(s,p,m),this._updateLayer(y)):this.fire(new l.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be styled.")))},o.prototype.getLayoutProperty=function(n,s){var p=this.getLayer(n);if(p)return p.getLayoutProperty(s);this.fire(new l.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style.")))},o.prototype.setPaintProperty=function(n,s,p,m){m===void 0&&(m={}),this._checkLoaded();var y=this.getLayer(n);y?l.deepEqual(y.getPaintProperty(s),p)||(y.setPaintProperty(s,p,m)&&this._updateLayer(y),this._changed=!0,this._updatedPaintProps[n]=!0):this.fire(new l.ErrorEvent(new Error("The layer '"+n+"' does not exist in the map's style and cannot be styled.")))},o.prototype.getPaintProperty=function(n,s){return this.getLayer(n).getPaintProperty(s)},o.prototype.setFeatureState=function(n,s){this._checkLoaded();var p=n.source,m=n.sourceLayer,y=this.sourceCaches[p];if(y!==void 0){var g=y.getSource().type;g==="geojson"&&m?this.fire(new l.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):g!=="vector"||m?(n.id===void 0&&this.fire(new l.ErrorEvent(new Error("The feature id parameter must be provided."))),y.setFeatureState(m,n.id,s)):this.fire(new l.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new l.ErrorEvent(new Error("The source '"+p+"' does not exist in the map's style.")))},o.prototype.removeFeatureState=function(n,s){this._checkLoaded();var p=n.source,m=this.sourceCaches[p];if(m!==void 0){var y=m.getSource().type,g=y==="vector"?n.sourceLayer:void 0;y!=="vector"||g?s&&typeof n.id!="string"&&typeof n.id!="number"?this.fire(new l.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):m.removeFeatureState(g,n.id,s):this.fire(new l.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new l.ErrorEvent(new Error("The source '"+p+"' does not exist in the map's style.")))},o.prototype.getFeatureState=function(n){this._checkLoaded();var s=n.source,p=n.sourceLayer,m=this.sourceCaches[s];if(m!==void 0){if(m.getSource().type!=="vector"||p)return n.id===void 0&&this.fire(new l.ErrorEvent(new Error("The feature id parameter must be provided."))),m.getFeatureState(p,n.id);this.fire(new l.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new l.ErrorEvent(new Error("The source '"+s+"' does not exist in the map's style.")))},o.prototype.getTransition=function(){return l.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},o.prototype.serialize=function(){return l.filterObject({version:this.stylesheet.version,name:this.stylesheet.name,metadata:this.stylesheet.metadata,light:this.stylesheet.light,center:this.stylesheet.center,zoom:this.stylesheet.zoom,bearing:this.stylesheet.bearing,pitch:this.stylesheet.pitch,sprite:this.stylesheet.sprite,glyphs:this.stylesheet.glyphs,transition:this.stylesheet.transition,sources:l.mapObject(this.sourceCaches,function(n){return n.serialize()}),layers:this._serializeLayers(this._order)},function(n){return n!==void 0})},o.prototype._updateLayer=function(n){this._updatedLayers[n.id]=!0,n.source&&!this._updatedSources[n.source]&&this.sourceCaches[n.source].getSource().type!=="raster"&&(this._updatedSources[n.source]="reload",this.sourceCaches[n.source].pause()),this._changed=!0},o.prototype._flattenAndSortRenderedFeatures=function(n){for(var s=this,p=function(Te){return s._layers[Te].type==="fill-extrusion"},m={},y=[],g=this._order.length-1;g>=0;g--){var w=this._order[g];if(p(w)){m[w]=g;for(var A=0,B=n;A<B.length;A+=1){var L=B[A][w];if(L)for(var R=0,Z=L;R<Z.length;R+=1)y.push(Z[R])}}}y.sort(function(Te,Se){return Se.intersectionZ-Te.intersectionZ});for(var j=[],K=this._order.length-1;K>=0;K--){var U=this._order[K];if(p(U))for(var X=y.length-1;X>=0;X--){var Q=y[X].feature;if(m[Q.layer.id]<K)break;j.push(Q),y.pop()}else for(var ie=0,ce=n;ie<ce.length;ie+=1){var le=ce[ie][U];if(le)for(var he=0,ge=le;he<ge.length;he+=1)j.push(ge[he].feature)}}return j},o.prototype.queryRenderedFeatures=function(n,s,p){s&&s.filter&&this._validate(l.validateStyle.filter,"queryRenderedFeatures.filter",s.filter,null,s);var m={};if(s&&s.layers){if(!Array.isArray(s.layers))return this.fire(new l.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var y=0,g=s.layers;y<g.length;y+=1){var w=g[y],A=this._layers[w];if(!A)return this.fire(new l.ErrorEvent(new Error("The layer '"+w+"' does not exist in the map's style and cannot be queried for features."))),[];m[A.source]=!0}}var B=[];for(var L in s.availableImages=this._availableImages,this.sourceCaches)s.layers&&!m[L]||B.push($r(this.sourceCaches[L],this._layers,this._serializedLayers,n,s,p));return this.placement&&B.push(function(R,Z,j,K,U,X,Q){for(var ie={},ce=X.queryRenderedSymbols(K),le=[],he=0,ge=Object.keys(ce).map(Number);he<ge.length;he+=1)le.push(Q[ge[he]]);le.sort(ln);for(var Te=function(){var He=Le[Se],wt=He.featureIndex.lookupSymbolFeatures(ce[He.bucketInstanceId],Z,He.bucketIndex,He.sourceLayerIndex,U.filter,U.layers,U.availableImages,R);for(var Re in wt){var rt=ie[Re]=ie[Re]||[],at=wt[Re];at.sort(function(nt,Qe){var Ke=He.featureSortOrder;if(Ke){var Sr=Ke.indexOf(nt.featureIndex);return Ke.indexOf(Qe.featureIndex)-Sr}return Qe.featureIndex-nt.featureIndex});for(var tt=0,et=at;tt<et.length;tt+=1)rt.push(et[tt])}},Se=0,Le=le;Se<Le.length;Se+=1)Te();var Ge=function(He){ie[He].forEach(function(wt){var Re=wt.feature,rt=j[R[He].source].getFeatureState(Re.layer["source-layer"],Re.id);Re.source=Re.layer.source,Re.layer["source-layer"]&&(Re.sourceLayer=Re.layer["source-layer"]),Re.state=rt})};for(var Xe in ie)Ge(Xe);return ie}(this._layers,this._serializedLayers,this.sourceCaches,n,s,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(B)},o.prototype.querySourceFeatures=function(n,s){s&&s.filter&&this._validate(l.validateStyle.filter,"querySourceFeatures.filter",s.filter,null,s);var p=this.sourceCaches[n];return p?function(m,y){for(var g=m.getRenderableIds().map(function(Z){return m.getTileByID(Z)}),w=[],A={},B=0;B<g.length;B++){var L=g[B],R=L.tileID.canonical.key;A[R]||(A[R]=!0,L.querySourceFeatures(w,y))}return w}(p,s):[]},o.prototype.addSourceType=function(n,s,p){return o.getSourceType(n)?p(new Error('A source type called "'+n+'" already exists.')):(o.setSourceType(n,s),s.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:n,url:s.workerSourceURL},p):p(null,null))},o.prototype.getLight=function(){return this.light.getLight()},o.prototype.setLight=function(n,s){s===void 0&&(s={}),this._checkLoaded();var p=this.light.getLight(),m=!1;for(var y in n)if(!l.deepEqual(n[y],p[y])){m=!0;break}if(m){var g={now:l.browser.now(),transition:l.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(n,s),this.light.updateTransitions(g)}},o.prototype._validate=function(n,s,p,m,y){return y===void 0&&(y={}),(!y||y.validate!==!1)&&ro(this,n.call(l.validateStyle,l.extend({key:s,style:this.serialize(),value:p,styleSpec:l.styleSpec},m)))},o.prototype._remove=function(){for(var n in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),l.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[n].setEventedParent(null);for(var s in this.sourceCaches)this.sourceCaches[s].clearTiles(),this.sourceCaches[s].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},o.prototype._clearSource=function(n){this.sourceCaches[n].clearTiles()},o.prototype._reloadSource=function(n){this.sourceCaches[n].resume(),this.sourceCaches[n].reload()},o.prototype._updateSources=function(n){for(var s in this.sourceCaches)this.sourceCaches[s].update(n)},o.prototype._generateCollisionBoxes=function(){for(var n in this.sourceCaches)this._reloadSource(n)},o.prototype._updatePlacement=function(n,s,p,m,y){y===void 0&&(y=!1);for(var g=!1,w=!1,A={},B=0,L=this._order;B<L.length;B+=1){var R=this._layers[L[B]];if(R.type==="symbol"){if(!A[R.source]){var Z=this.sourceCaches[R.source];A[R.source]=Z.getRenderableIds(!0).map(function(Q){return Z.getTileByID(Q)}).sort(function(Q,ie){return ie.tileID.overscaledZ-Q.tileID.overscaledZ||(Q.tileID.isLessThan(ie.tileID)?-1:1)})}var j=this.crossTileSymbolIndex.addLayer(R,A[R.source],n.center.lng);g=g||j}}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((y=y||this._layerOrderChanged||p===0)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(l.browser.now(),n.zoom))&&(this.pauseablePlacement=new ba(n,this._order,y,s,p,m,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,A),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(l.browser.now()),w=!0),g&&this.pauseablePlacement.placement.setStale()),w||g)for(var K=0,U=this._order;K<U.length;K+=1){var X=this._layers[U[K]];X.type==="symbol"&&this.placement.updateLayerOpacities(X,A[X.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(l.browser.now())},o.prototype._releaseSymbolFadeTiles=function(){for(var n in this.sourceCaches)this.sourceCaches[n].releaseSymbolFadeTiles()},o.prototype.getImages=function(n,s,p){this.imageManager.getImages(s.icons,p),this._updateTilesForChangedImages();var m=this.sourceCaches[s.source];m&&m.setDependencies(s.tileID.key,s.type,s.icons)},o.prototype.getGlyphs=function(n,s,p){this.glyphManager.getGlyphs(s.stacks,p)},o.prototype.getResource=function(n,s,p){return l.makeRequest(s,p)},o}(l.Evented);ui.getSourceType=function(i){return bn[i]},ui.setSourceType=function(i,o){bn[i]=o},ui.registerForPluginStateChange=l.registerForPluginStateChange;var dr=l.createLayout([{name:"a_pos",type:"Int16",components:2}]),$o=Nt(`#ifdef GL_ES
|
|
2
2
|
precision mediump float;
|
|
3
3
|
#else
|
|
4
4
|
#if !defined(lowp)
|
|
@@ -24,15 +24,15 @@ precision highp float;
|
|
|
24
24
|
#endif
|
|
25
25
|
#endif
|
|
26
26
|
vec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0
|
|
27
|
-
);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}`),Fu=
|
|
27
|
+
);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}`),Fu=Nt(`uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;
|
|
28
28
|
#ifdef OVERDRAW_INSPECTOR
|
|
29
29
|
gl_FragColor=vec4(1.0);
|
|
30
30
|
#endif
|
|
31
|
-
}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Fp=
|
|
31
|
+
}`,"attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Fp=Nt(`uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;
|
|
32
32
|
#ifdef OVERDRAW_INSPECTOR
|
|
33
33
|
gl_FragColor=vec4(1.0);
|
|
34
34
|
#endif
|
|
35
|
-
}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),Op=
|
|
35
|
+
}`,"uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"),Op=Nt(`varying vec3 v_data;
|
|
36
36
|
#pragma mapbox: define highp vec4 color
|
|
37
37
|
#pragma mapbox: define mediump float radius
|
|
38
38
|
#pragma mapbox: define lowp float blur
|
|
@@ -68,7 +68,7 @@ void main(void) {
|
|
|
68
68
|
#pragma mapbox: initialize highp vec4 stroke_color
|
|
69
69
|
#pragma mapbox: initialize mediump float stroke_width
|
|
70
70
|
#pragma mapbox: initialize lowp float stroke_opacity
|
|
71
|
-
vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),Tl=
|
|
71
|
+
vec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}`),Tl=Nt("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),Il=Nt(`uniform highp float u_intensity;varying vec2 v_extrude;
|
|
72
72
|
#pragma mapbox: define highp float weight
|
|
73
73
|
#define GAUSS_COEF 0.3989422804014327
|
|
74
74
|
void main() {
|
|
@@ -85,11 +85,11 @@ const highp float ZERO=1.0/255.0/16.0;
|
|
|
85
85
|
void main(void) {
|
|
86
86
|
#pragma mapbox: initialize highp float weight
|
|
87
87
|
#pragma mapbox: initialize mediump float radius
|
|
88
|
-
vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),Al=
|
|
88
|
+
vec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}`),Al=Nt(`uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;
|
|
89
89
|
#ifdef OVERDRAW_INSPECTOR
|
|
90
90
|
gl_FragColor=vec4(0.0);
|
|
91
91
|
#endif
|
|
92
|
-
}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),El=
|
|
92
|
+
}`,"uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"),El=Nt("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"),Ou=Nt("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),Vu=Nt("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"),Vp=Nt(`#pragma mapbox: define highp vec4 color
|
|
93
93
|
#pragma mapbox: define lowp float opacity
|
|
94
94
|
void main() {
|
|
95
95
|
#pragma mapbox: initialize highp vec4 color
|
|
@@ -104,7 +104,7 @@ gl_FragColor=vec4(1.0);
|
|
|
104
104
|
void main() {
|
|
105
105
|
#pragma mapbox: initialize highp vec4 color
|
|
106
106
|
#pragma mapbox: initialize lowp float opacity
|
|
107
|
-
gl_Position=u_matrix*vec4(a_pos,0,1);}`),wa=
|
|
107
|
+
gl_Position=u_matrix*vec4(a_pos,0,1);}`),wa=Nt(`varying vec2 v_pos;
|
|
108
108
|
#pragma mapbox: define highp vec4 outline_color
|
|
109
109
|
#pragma mapbox: define lowp float opacity
|
|
110
110
|
void main() {
|
|
@@ -120,7 +120,7 @@ gl_FragColor=vec4(1.0);
|
|
|
120
120
|
void main() {
|
|
121
121
|
#pragma mapbox: initialize highp vec4 outline_color
|
|
122
122
|
#pragma mapbox: initialize lowp float opacity
|
|
123
|
-
gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),Sa=
|
|
123
|
+
gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),Sa=Nt(`uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;
|
|
124
124
|
#pragma mapbox: define lowp float opacity
|
|
125
125
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
126
126
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
@@ -144,7 +144,7 @@ void main() {
|
|
|
144
144
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
145
145
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
146
146
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
147
|
-
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),Uu=
|
|
147
|
+
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}`),Uu=Nt(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;
|
|
148
148
|
#pragma mapbox: define lowp float opacity
|
|
149
149
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
150
150
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
@@ -168,7 +168,7 @@ void main() {
|
|
|
168
168
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
169
169
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
170
170
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
171
|
-
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),
|
|
171
|
+
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}`),Rr=Nt(`varying vec4 v_color;void main() {gl_FragColor=v_color;
|
|
172
172
|
#ifdef OVERDRAW_INSPECTOR
|
|
173
173
|
gl_FragColor=vec4(1.0);
|
|
174
174
|
#endif
|
|
@@ -180,7 +180,7 @@ void main() {
|
|
|
180
180
|
#pragma mapbox: initialize highp float base
|
|
181
181
|
#pragma mapbox: initialize highp float height
|
|
182
182
|
#pragma mapbox: initialize highp vec4 color
|
|
183
|
-
vec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),Pl=
|
|
183
|
+
vec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}`),Pl=Nt(`uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;
|
|
184
184
|
#pragma mapbox: define lowp float base
|
|
185
185
|
#pragma mapbox: define lowp float height
|
|
186
186
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
@@ -214,20 +214,20 @@ void main() {
|
|
|
214
214
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
215
215
|
vec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0
|
|
216
216
|
? a_pos
|
|
217
|
-
: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),En=
|
|
217
|
+
: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}`),En=Nt(`#ifdef GL_ES
|
|
218
218
|
precision highp float;
|
|
219
219
|
#endif
|
|
220
220
|
uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);
|
|
221
221
|
#ifdef OVERDRAW_INSPECTOR
|
|
222
222
|
gl_FragColor=vec4(1.0);
|
|
223
223
|
#endif
|
|
224
|
-
}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),Pn=
|
|
224
|
+
}`,"uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"),Pn=Nt(`uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;
|
|
225
225
|
#define PI 3.141592653589793
|
|
226
226
|
void main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;
|
|
227
227
|
#ifdef OVERDRAW_INSPECTOR
|
|
228
228
|
gl_FragColor=vec4(1.0);
|
|
229
229
|
#endif
|
|
230
|
-
}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),
|
|
230
|
+
}`,"uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"),io=Nt(`uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;
|
|
231
231
|
#pragma mapbox: define highp vec4 color
|
|
232
232
|
#pragma mapbox: define lowp float blur
|
|
233
233
|
#pragma mapbox: define lowp float opacity
|
|
@@ -255,7 +255,7 @@ void main() {
|
|
|
255
255
|
#pragma mapbox: initialize mediump float gapwidth
|
|
256
256
|
#pragma mapbox: initialize lowp float offset
|
|
257
257
|
#pragma mapbox: initialize mediump float width
|
|
258
|
-
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`),
|
|
258
|
+
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`),no=Nt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;
|
|
259
259
|
#pragma mapbox: define lowp float blur
|
|
260
260
|
#pragma mapbox: define lowp float opacity
|
|
261
261
|
void main() {
|
|
@@ -279,7 +279,7 @@ void main() {
|
|
|
279
279
|
#pragma mapbox: initialize mediump float gapwidth
|
|
280
280
|
#pragma mapbox: initialize lowp float offset
|
|
281
281
|
#pragma mapbox: initialize mediump float width
|
|
282
|
-
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`),Cn=
|
|
282
|
+
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}`),Cn=Nt(`uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;
|
|
283
283
|
#pragma mapbox: define lowp vec4 pattern_from
|
|
284
284
|
#pragma mapbox: define lowp vec4 pattern_to
|
|
285
285
|
#pragma mapbox: define lowp float pixel_ratio_from
|
|
@@ -322,7 +322,7 @@ void main() {
|
|
|
322
322
|
#pragma mapbox: initialize mediump vec4 pattern_to
|
|
323
323
|
#pragma mapbox: initialize lowp float pixel_ratio_from
|
|
324
324
|
#pragma mapbox: initialize lowp float pixel_ratio_to
|
|
325
|
-
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),
|
|
325
|
+
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}`),oo=Nt(`uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;
|
|
326
326
|
#pragma mapbox: define highp vec4 color
|
|
327
327
|
#pragma mapbox: define lowp float blur
|
|
328
328
|
#pragma mapbox: define lowp float opacity
|
|
@@ -357,11 +357,11 @@ void main() {
|
|
|
357
357
|
#pragma mapbox: initialize lowp float offset
|
|
358
358
|
#pragma mapbox: initialize mediump float width
|
|
359
359
|
#pragma mapbox: initialize lowp float floorwidth
|
|
360
|
-
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),
|
|
360
|
+
float ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}`),ao=Nt(`uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);
|
|
361
361
|
#ifdef OVERDRAW_INSPECTOR
|
|
362
362
|
gl_FragColor=vec4(1.0);
|
|
363
363
|
#endif
|
|
364
|
-
}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),kn=
|
|
364
|
+
}`,"uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"),kn=Nt(`uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;
|
|
365
365
|
#pragma mapbox: define lowp float opacity
|
|
366
366
|
void main() {
|
|
367
367
|
#pragma mapbox: initialize lowp float opacity
|
|
@@ -375,7 +375,7 @@ void main() {
|
|
|
375
375
|
#pragma mapbox: initialize lowp float opacity
|
|
376
376
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
377
377
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
378
|
-
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`),Nu=
|
|
378
|
+
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}`),Nu=Nt(`#define SDF_PX 8.0
|
|
379
379
|
uniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;
|
|
380
380
|
#pragma mapbox: define highp vec4 fill_color
|
|
381
381
|
#pragma mapbox: define highp vec4 halo_color
|
|
@@ -406,7 +406,7 @@ void main() {
|
|
|
406
406
|
#pragma mapbox: initialize lowp float halo_blur
|
|
407
407
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
408
408
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
409
|
-
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),$u=
|
|
409
|
+
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}`),$u=Nt(`#define SDF_PX 8.0
|
|
410
410
|
#define SDF 1.0
|
|
411
411
|
#define ICON 0.0
|
|
412
412
|
uniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;
|
|
@@ -443,7 +443,7 @@ void main() {
|
|
|
443
443
|
#pragma mapbox: initialize lowp float halo_blur
|
|
444
444
|
vec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?
|
|
445
445
|
camera_to_anchor_distance/u_camera_to_center_distance :
|
|
446
|
-
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`);function
|
|
446
|
+
u_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}`);function Nt(i,o){var n=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,s=o.match(/attribute ([\w]+) ([\w]+)/g),p=i.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),m=o.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),y=m?m.concat(p):p,g={};return{fragmentSource:i=i.replace(n,function(w,A,B,L,R){return g[R]=!0,A==="define"?`
|
|
447
447
|
#ifndef HAS_UNIFORM_u_`+R+`
|
|
448
448
|
varying `+B+" "+L+" "+R+`;
|
|
449
449
|
#else
|
|
@@ -492,12 +492,12 @@ uniform `+B+" "+L+" u_"+R+`;
|
|
|
492
492
|
#else
|
|
493
493
|
`+B+" "+L+" "+R+" = u_"+R+`;
|
|
494
494
|
#endif
|
|
495
|
-
`}),staticAttributes:s,staticUniforms:y}}var Up=Object.freeze({__proto__:null,prelude:$o,background:Fu,backgroundPattern:Fp,circle:Op,clippingMask:Tl,heatmap:Il,heatmapTexture:Al,collisionBox:El,collisionCircle:Ou,debug:Vu,fill:Vp,fillOutline:wa,fillOutlinePattern:Sa,fillPattern:Uu,fillExtrusion:
|
|
495
|
+
`}),staticAttributes:s,staticUniforms:y}}var Up=Object.freeze({__proto__:null,prelude:$o,background:Fu,backgroundPattern:Fp,circle:Op,clippingMask:Tl,heatmap:Il,heatmapTexture:Al,collisionBox:El,collisionCircle:Ou,debug:Vu,fill:Vp,fillOutline:wa,fillOutlinePattern:Sa,fillPattern:Uu,fillExtrusion:Rr,fillExtrusionPattern:Pl,hillshadePrepare:En,hillshade:Pn,line:io,lineGradient:no,linePattern:Cn,lineSDF:oo,raster:ao,symbolIcon:kn,symbolSDF:Nu,symbolTextAndIcon:$u}),hs=function(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null};function qu(i){for(var o=[],n=0;n<i.length;n++)if(i[n]!==null){var s=i[n].split(" ");o.push(s.pop())}return o}hs.prototype.bind=function(i,o,n,s,p,m,y,g){this.context=i;for(var w=this.boundPaintVertexBuffers.length!==s.length,A=0;!w&&A<s.length;A++)this.boundPaintVertexBuffers[A]!==s[A]&&(w=!0);i.extVertexArrayObject&&this.vao&&this.boundProgram===o&&this.boundLayoutVertexBuffer===n&&!w&&this.boundIndexBuffer===p&&this.boundVertexOffset===m&&this.boundDynamicVertexBuffer===y&&this.boundDynamicVertexBuffer2===g?(i.bindVertexArrayOES.set(this.vao),y&&y.bind(),p&&p.dynamicDraw&&p.bind(),g&&g.bind()):this.freshBind(o,n,s,p,m,y,g)},hs.prototype.freshBind=function(i,o,n,s,p,m,y){var g,w=i.numAttributes,A=this.context,B=A.gl;if(A.extVertexArrayObject)this.vao&&this.destroy(),this.vao=A.extVertexArrayObject.createVertexArrayOES(),A.bindVertexArrayOES.set(this.vao),g=0,this.boundProgram=i,this.boundLayoutVertexBuffer=o,this.boundPaintVertexBuffers=n,this.boundIndexBuffer=s,this.boundVertexOffset=p,this.boundDynamicVertexBuffer=m,this.boundDynamicVertexBuffer2=y;else{g=A.currentNumAttributes||0;for(var L=w;L<g;L++)B.disableVertexAttribArray(L)}o.enableAttributes(B,i);for(var R=0,Z=n;R<Z.length;R+=1)Z[R].enableAttributes(B,i);m&&m.enableAttributes(B,i),y&&y.enableAttributes(B,i),o.bind(),o.setVertexAttribPointers(B,i,p);for(var j=0,K=n;j<K.length;j+=1){var U=K[j];U.bind(),U.setVertexAttribPointers(B,i,p)}m&&(m.bind(),m.setVertexAttribPointers(B,i,p)),s&&s.bind(),y&&(y.bind(),y.setVertexAttribPointers(B,i,p)),A.currentNumAttributes=w},hs.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)};var ju=function(i,o,n,s,p,m){var y=i.gl;this.program=y.createProgram();for(var g=qu(n.staticAttributes),w=s?s.getBinderAttributes():[],A=g.concat(w),B=n.staticUniforms?qu(n.staticUniforms):[],L=s?s.getBinderUniforms():[],R=[],Z=0,j=B.concat(L);Z<j.length;Z+=1){var K=j[Z];R.indexOf(K)<0&&R.push(K)}var U=s?s.defines():[];m&&U.push("#define OVERDRAW_INSPECTOR;");var X=U.concat($o.fragmentSource,n.fragmentSource).join(`
|
|
496
496
|
`),Q=U.concat($o.vertexSource,n.vertexSource).join(`
|
|
497
|
-
`),ie=y.createShader(y.FRAGMENT_SHADER);if(y.isContextLost())this.failedToCreate=!0;else{y.shaderSource(ie,X),y.compileShader(ie),y.attachShader(this.program,ie);var ce=y.createShader(y.VERTEX_SHADER);if(y.isContextLost())this.failedToCreate=!0;else{y.shaderSource(ce,Q),y.compileShader(ce),y.attachShader(this.program,ce),this.attributes={};var le={};this.numAttributes=A.length;for(var he=0;he<this.numAttributes;he++)A[he]&&(y.bindAttribLocation(this.program,he,A[he]),this.attributes[A[he]]=he);y.linkProgram(this.program),y.deleteShader(ce),y.deleteShader(ie);for(var ge=0;ge<R.length;ge++){var Te=R[ge];if(Te&&!le[Te]){var Se=y.getUniformLocation(this.program,Te);Se&&(le[Te]=Se)}}this.fixedUniforms=p(i,le),this.binderUniforms=s?s.getUniforms(i,le):[]}}};function Gu(i,o,n){var s=1/Ht(n,1,o.transform.tileZoom),p=Math.pow(2,n.tileID.overscaledZ),m=n.tileSize*Math.pow(2,o.transform.tileZoom)/p,y=m*(n.tileID.canonical.x+n.tileID.wrap*p),g=m*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[s,i.fromScale,i.toScale],u_fade:i.t,u_pixel_coord_upper:[y>>16,g>>16],u_pixel_coord_lower:[65535&y,65535&g]}}qu.prototype.draw=function(i,o,n,s,p,m,y,g,w,A,B,L,R,Z,j,K){var U,X=i.gl;if(!this.failedToCreate){for(var Q in i.program.set(this.program),i.setDepthMode(n),i.setStencilMode(s),i.setColorMode(p),i.setCullFace(m),this.fixedUniforms)this.fixedUniforms[Q].set(y[Q]);Z&&Z.setUniforms(i,this.binderUniforms,L,{zoom:R});for(var ie=(U={},U[X.LINES]=2,U[X.TRIANGLES]=3,U[X.LINE_STRIP]=1,U)[o],ce=0,le=B.get();ce<le.length;ce+=1){var he=le[ce],ge=he.vaos||(he.vaos={});(ge[g]||(ge[g]=new hs)).bind(i,this,w,Z?Z.getPaintVertexBuffers():[],A,he.vertexOffset,j,K),X.drawElements(o,he.primitiveLength*ie,X.UNSIGNED_SHORT,he.primitiveOffset*ie*2)}}};var Zu=function(i,o,n,s){var p=o.style.light,m=p.properties.get("position"),y=[m.x,m.y,m.z],g=l.create$1();p.properties.get("anchor")==="viewport"&&l.fromRotation(g,-o.transform.angle),l.transformMat3(y,y,g);var w=p.properties.get("color");return{u_matrix:i,u_lightpos:y,u_lightintensity:p.properties.get("intensity"),u_lightcolor:[w.r,w.g,w.b],u_vertical_gradient:+n,u_opacity:s}},ao=function(i,o,n,s,p,m,y){return l.extend(Zu(i,o,n,s),Gu(m,o,y),{u_height_factor:-Math.pow(2,p.overscaledZ)/y.tileSize/8})},Mn=function(i){return{u_matrix:i}},so=function(i,o,n,s){return l.extend(Mn(i),Gu(n,o,s))},Wu=function(i,o){return{u_matrix:i,u_world:o}},Hu=function(i,o,n,s,p){return l.extend(so(i,o,n,s),{u_world:p})},Cl=function(i,o,n,s){var p,m,y=i.transform;if(s.paint.get("circle-pitch-alignment")==="map"){var g=Ht(n,1,y.zoom);p=!0,m=[g,g]}else p=!1,m=y.pixelsToGLUnits;return{u_camera_to_center_distance:y.cameraToCenterDistance,u_scale_with_map:+(s.paint.get("circle-pitch-scale")==="map"),u_matrix:i.translatePosMatrix(o.posMatrix,n,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_pitch_with_map:+p,u_device_pixel_ratio:l.browser.devicePixelRatio,u_extrude_scale:m}},lo=function(i,o,n){var s=Ht(n,1,o.zoom),p=Math.pow(2,o.zoom-n.tileID.overscaledZ),m=n.tileID.overscaleFactor();return{u_matrix:i,u_camera_to_center_distance:o.cameraToCenterDistance,u_pixels_to_tile_units:s,u_extrude_scale:[o.pixelsToGLUnits[0]/(s*p),o.pixelsToGLUnits[1]/(s*p)],u_overscale_factor:m}},Xu=function(i,o,n){return{u_matrix:i,u_inv_matrix:o,u_camera_to_center_distance:n.cameraToCenterDistance,u_viewport_size:[n.width,n.height]}},uo=function(i,o,n){return n===void 0&&(n=1),{u_matrix:i,u_color:o,u_overlay:0,u_overlay_scale:n}},co=function(i){return{u_matrix:i}},Ku=function(i,o,n,s){return{u_matrix:i,u_extrude_scale:Ht(o,1,n),u_intensity:s}},Ta=function(i,o,n){var s=i.transform;return{u_matrix:Ju(i,o,n),u_ratio:1/Ht(o,1,s.zoom),u_device_pixel_ratio:l.browser.devicePixelRatio,u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]]}},$t=function(i,o,n,s){return l.extend(Ta(i,o,n),{u_image:0,u_image_height:s})},fs=function(i,o,n,s){var p=i.transform,m=jo(o,p);return{u_matrix:Ju(i,o,n),u_texsize:o.imageAtlasTexture.size,u_ratio:1/Ht(o,1,p.zoom),u_device_pixel_ratio:l.browser.devicePixelRatio,u_image:0,u_scale:[m,s.fromScale,s.toScale],u_fade:s.t,u_units_to_pixels:[1/p.pixelsToGLUnits[0],1/p.pixelsToGLUnits[1]]}},Np=function(i,o,n,s,p){var m=i.lineAtlas,y=jo(o,i.transform),g=n.layout.get("line-cap")==="round",w=m.getDash(s.from,g),A=m.getDash(s.to,g),B=w.width*p.fromScale,L=A.width*p.toScale;return l.extend(Ta(i,o,n),{u_patternscale_a:[y/B,-w.height/2],u_patternscale_b:[y/L,-A.height/2],u_sdfgamma:m.width/(256*Math.min(B,L)*l.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:w.y,u_tex_y_b:A.y,u_mix:p.t})};function jo(i,o){return 1/Ht(i,1,o.tileZoom)}function Ju(i,o,n){return i.translatePosMatrix(o.tileID.posMatrix,o,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}var $p=function(i,o,n,s,p){return{u_matrix:i,u_tl_parent:o,u_scale_parent:n,u_buffer_scale:1,u_fade_t:s.mix,u_opacity:s.opacity*p.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:p.paint.get("raster-brightness-min"),u_brightness_high:p.paint.get("raster-brightness-max"),u_saturation_factor:(y=p.paint.get("raster-saturation"),y>0?1-1/(1.001-y):-y),u_contrast_factor:(m=p.paint.get("raster-contrast"),m>0?1/(1-m):1+m),u_spin_weights:Yu(p.paint.get("raster-hue-rotate"))};var m,y};function Yu(i){i*=Math.PI/180;var o=Math.sin(i),n=Math.cos(i);return[(2*n+1)/3,(-Math.sqrt(3)*o-n+1)/3,(Math.sqrt(3)*o-n+1)/3]}var ds,qo=function(i,o,n,s,p,m,y,g,w,A){var B=p.transform;return{u_is_size_zoom_constant:+(i==="constant"||i==="source"),u_is_size_feature_constant:+(i==="constant"||i==="camera"),u_size_t:o?o.uSizeT:0,u_size:o?o.uSize:0,u_camera_to_center_distance:B.cameraToCenterDistance,u_pitch:B.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:B.width/B.height,u_fade_change:p.options.fadeDuration?p.symbolFadeChange:1,u_matrix:m,u_label_plane_matrix:y,u_coord_matrix:g,u_is_text:+w,u_pitch_with_map:+s,u_texsize:A,u_texture:0}},Ia=function(i,o,n,s,p,m,y,g,w,A,B){var L=p.transform;return l.extend(qo(i,o,n,s,p,m,y,g,w,A),{u_gamma_scale:s?Math.cos(L._pitch)*L.cameraToCenterDistance:1,u_device_pixel_ratio:l.browser.devicePixelRatio,u_is_halo:1})},ms=function(i,o,n,s,p,m,y,g,w,A){return l.extend(Ia(i,o,n,s,p,m,y,g,!0,w),{u_texsize_icon:A,u_texture_icon:1})},Aa=function(i,o,n){return{u_matrix:i,u_opacity:o,u_color:n}},Go=function(i,o,n,s,p,m){return l.extend(function(y,g,w,A){var B=w.imageManager.getPattern(y.from.toString()),L=w.imageManager.getPattern(y.to.toString()),R=w.imageManager.getPixelSize(),Z=R.width,j=R.height,K=Math.pow(2,A.tileID.overscaledZ),U=A.tileSize*Math.pow(2,w.transform.tileZoom)/K,X=U*(A.tileID.canonical.x+A.tileID.wrap*K),Q=U*A.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:B.tl,u_pattern_br_a:B.br,u_pattern_tl_b:L.tl,u_pattern_br_b:L.br,u_texsize:[Z,j],u_mix:g.t,u_pattern_size_a:B.displaySize,u_pattern_size_b:L.displaySize,u_scale_a:g.fromScale,u_scale_b:g.toScale,u_tile_units_to_pixels:1/Ht(A,1,w.transform.tileZoom),u_pixel_coord_upper:[X>>16,Q>>16],u_pixel_coord_lower:[65535&X,65535&Q]}}(s,m,n,p),{u_matrix:i,u_opacity:o})},Qu={fillExtrusion:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_lightpos:new l.Uniform3f(i,o.u_lightpos),u_lightintensity:new l.Uniform1f(i,o.u_lightintensity),u_lightcolor:new l.Uniform3f(i,o.u_lightcolor),u_vertical_gradient:new l.Uniform1f(i,o.u_vertical_gradient),u_opacity:new l.Uniform1f(i,o.u_opacity)}},fillExtrusionPattern:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_lightpos:new l.Uniform3f(i,o.u_lightpos),u_lightintensity:new l.Uniform1f(i,o.u_lightintensity),u_lightcolor:new l.Uniform3f(i,o.u_lightcolor),u_vertical_gradient:new l.Uniform1f(i,o.u_vertical_gradient),u_height_factor:new l.Uniform1f(i,o.u_height_factor),u_image:new l.Uniform1i(i,o.u_image),u_texsize:new l.Uniform2f(i,o.u_texsize),u_pixel_coord_upper:new l.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new l.Uniform2f(i,o.u_pixel_coord_lower),u_scale:new l.Uniform3f(i,o.u_scale),u_fade:new l.Uniform1f(i,o.u_fade),u_opacity:new l.Uniform1f(i,o.u_opacity)}},fill:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix)}},fillPattern:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_image:new l.Uniform1i(i,o.u_image),u_texsize:new l.Uniform2f(i,o.u_texsize),u_pixel_coord_upper:new l.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new l.Uniform2f(i,o.u_pixel_coord_lower),u_scale:new l.Uniform3f(i,o.u_scale),u_fade:new l.Uniform1f(i,o.u_fade)}},fillOutline:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_world:new l.Uniform2f(i,o.u_world)}},fillOutlinePattern:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_world:new l.Uniform2f(i,o.u_world),u_image:new l.Uniform1i(i,o.u_image),u_texsize:new l.Uniform2f(i,o.u_texsize),u_pixel_coord_upper:new l.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new l.Uniform2f(i,o.u_pixel_coord_lower),u_scale:new l.Uniform3f(i,o.u_scale),u_fade:new l.Uniform1f(i,o.u_fade)}},circle:function(i,o){return{u_camera_to_center_distance:new l.Uniform1f(i,o.u_camera_to_center_distance),u_scale_with_map:new l.Uniform1i(i,o.u_scale_with_map),u_pitch_with_map:new l.Uniform1i(i,o.u_pitch_with_map),u_extrude_scale:new l.Uniform2f(i,o.u_extrude_scale),u_device_pixel_ratio:new l.Uniform1f(i,o.u_device_pixel_ratio),u_matrix:new l.UniformMatrix4f(i,o.u_matrix)}},collisionBox:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_camera_to_center_distance:new l.Uniform1f(i,o.u_camera_to_center_distance),u_pixels_to_tile_units:new l.Uniform1f(i,o.u_pixels_to_tile_units),u_extrude_scale:new l.Uniform2f(i,o.u_extrude_scale),u_overscale_factor:new l.Uniform1f(i,o.u_overscale_factor)}},collisionCircle:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_inv_matrix:new l.UniformMatrix4f(i,o.u_inv_matrix),u_camera_to_center_distance:new l.Uniform1f(i,o.u_camera_to_center_distance),u_viewport_size:new l.Uniform2f(i,o.u_viewport_size)}},debug:function(i,o){return{u_color:new l.UniformColor(i,o.u_color),u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_overlay:new l.Uniform1i(i,o.u_overlay),u_overlay_scale:new l.Uniform1f(i,o.u_overlay_scale)}},clippingMask:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix)}},heatmap:function(i,o){return{u_extrude_scale:new l.Uniform1f(i,o.u_extrude_scale),u_intensity:new l.Uniform1f(i,o.u_intensity),u_matrix:new l.UniformMatrix4f(i,o.u_matrix)}},heatmapTexture:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_world:new l.Uniform2f(i,o.u_world),u_image:new l.Uniform1i(i,o.u_image),u_color_ramp:new l.Uniform1i(i,o.u_color_ramp),u_opacity:new l.Uniform1f(i,o.u_opacity)}},hillshade:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_image:new l.Uniform1i(i,o.u_image),u_latrange:new l.Uniform2f(i,o.u_latrange),u_light:new l.Uniform2f(i,o.u_light),u_shadow:new l.UniformColor(i,o.u_shadow),u_highlight:new l.UniformColor(i,o.u_highlight),u_accent:new l.UniformColor(i,o.u_accent)}},hillshadePrepare:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_image:new l.Uniform1i(i,o.u_image),u_dimension:new l.Uniform2f(i,o.u_dimension),u_zoom:new l.Uniform1f(i,o.u_zoom),u_unpack:new l.Uniform4f(i,o.u_unpack)}},line:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_ratio:new l.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new l.Uniform1f(i,o.u_device_pixel_ratio),u_units_to_pixels:new l.Uniform2f(i,o.u_units_to_pixels)}},lineGradient:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_ratio:new l.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new l.Uniform1f(i,o.u_device_pixel_ratio),u_units_to_pixels:new l.Uniform2f(i,o.u_units_to_pixels),u_image:new l.Uniform1i(i,o.u_image),u_image_height:new l.Uniform1f(i,o.u_image_height)}},linePattern:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_texsize:new l.Uniform2f(i,o.u_texsize),u_ratio:new l.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new l.Uniform1f(i,o.u_device_pixel_ratio),u_image:new l.Uniform1i(i,o.u_image),u_units_to_pixels:new l.Uniform2f(i,o.u_units_to_pixels),u_scale:new l.Uniform3f(i,o.u_scale),u_fade:new l.Uniform1f(i,o.u_fade)}},lineSDF:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_ratio:new l.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new l.Uniform1f(i,o.u_device_pixel_ratio),u_units_to_pixels:new l.Uniform2f(i,o.u_units_to_pixels),u_patternscale_a:new l.Uniform2f(i,o.u_patternscale_a),u_patternscale_b:new l.Uniform2f(i,o.u_patternscale_b),u_sdfgamma:new l.Uniform1f(i,o.u_sdfgamma),u_image:new l.Uniform1i(i,o.u_image),u_tex_y_a:new l.Uniform1f(i,o.u_tex_y_a),u_tex_y_b:new l.Uniform1f(i,o.u_tex_y_b),u_mix:new l.Uniform1f(i,o.u_mix)}},raster:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_tl_parent:new l.Uniform2f(i,o.u_tl_parent),u_scale_parent:new l.Uniform1f(i,o.u_scale_parent),u_buffer_scale:new l.Uniform1f(i,o.u_buffer_scale),u_fade_t:new l.Uniform1f(i,o.u_fade_t),u_opacity:new l.Uniform1f(i,o.u_opacity),u_image0:new l.Uniform1i(i,o.u_image0),u_image1:new l.Uniform1i(i,o.u_image1),u_brightness_low:new l.Uniform1f(i,o.u_brightness_low),u_brightness_high:new l.Uniform1f(i,o.u_brightness_high),u_saturation_factor:new l.Uniform1f(i,o.u_saturation_factor),u_contrast_factor:new l.Uniform1f(i,o.u_contrast_factor),u_spin_weights:new l.Uniform3f(i,o.u_spin_weights)}},symbolIcon:function(i,o){return{u_is_size_zoom_constant:new l.Uniform1i(i,o.u_is_size_zoom_constant),u_is_size_feature_constant:new l.Uniform1i(i,o.u_is_size_feature_constant),u_size_t:new l.Uniform1f(i,o.u_size_t),u_size:new l.Uniform1f(i,o.u_size),u_camera_to_center_distance:new l.Uniform1f(i,o.u_camera_to_center_distance),u_pitch:new l.Uniform1f(i,o.u_pitch),u_rotate_symbol:new l.Uniform1i(i,o.u_rotate_symbol),u_aspect_ratio:new l.Uniform1f(i,o.u_aspect_ratio),u_fade_change:new l.Uniform1f(i,o.u_fade_change),u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_label_plane_matrix:new l.UniformMatrix4f(i,o.u_label_plane_matrix),u_coord_matrix:new l.UniformMatrix4f(i,o.u_coord_matrix),u_is_text:new l.Uniform1i(i,o.u_is_text),u_pitch_with_map:new l.Uniform1i(i,o.u_pitch_with_map),u_texsize:new l.Uniform2f(i,o.u_texsize),u_texture:new l.Uniform1i(i,o.u_texture)}},symbolSDF:function(i,o){return{u_is_size_zoom_constant:new l.Uniform1i(i,o.u_is_size_zoom_constant),u_is_size_feature_constant:new l.Uniform1i(i,o.u_is_size_feature_constant),u_size_t:new l.Uniform1f(i,o.u_size_t),u_size:new l.Uniform1f(i,o.u_size),u_camera_to_center_distance:new l.Uniform1f(i,o.u_camera_to_center_distance),u_pitch:new l.Uniform1f(i,o.u_pitch),u_rotate_symbol:new l.Uniform1i(i,o.u_rotate_symbol),u_aspect_ratio:new l.Uniform1f(i,o.u_aspect_ratio),u_fade_change:new l.Uniform1f(i,o.u_fade_change),u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_label_plane_matrix:new l.UniformMatrix4f(i,o.u_label_plane_matrix),u_coord_matrix:new l.UniformMatrix4f(i,o.u_coord_matrix),u_is_text:new l.Uniform1i(i,o.u_is_text),u_pitch_with_map:new l.Uniform1i(i,o.u_pitch_with_map),u_texsize:new l.Uniform2f(i,o.u_texsize),u_texture:new l.Uniform1i(i,o.u_texture),u_gamma_scale:new l.Uniform1f(i,o.u_gamma_scale),u_device_pixel_ratio:new l.Uniform1f(i,o.u_device_pixel_ratio),u_is_halo:new l.Uniform1i(i,o.u_is_halo)}},symbolTextAndIcon:function(i,o){return{u_is_size_zoom_constant:new l.Uniform1i(i,o.u_is_size_zoom_constant),u_is_size_feature_constant:new l.Uniform1i(i,o.u_is_size_feature_constant),u_size_t:new l.Uniform1f(i,o.u_size_t),u_size:new l.Uniform1f(i,o.u_size),u_camera_to_center_distance:new l.Uniform1f(i,o.u_camera_to_center_distance),u_pitch:new l.Uniform1f(i,o.u_pitch),u_rotate_symbol:new l.Uniform1i(i,o.u_rotate_symbol),u_aspect_ratio:new l.Uniform1f(i,o.u_aspect_ratio),u_fade_change:new l.Uniform1f(i,o.u_fade_change),u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_label_plane_matrix:new l.UniformMatrix4f(i,o.u_label_plane_matrix),u_coord_matrix:new l.UniformMatrix4f(i,o.u_coord_matrix),u_is_text:new l.Uniform1i(i,o.u_is_text),u_pitch_with_map:new l.Uniform1i(i,o.u_pitch_with_map),u_texsize:new l.Uniform2f(i,o.u_texsize),u_texsize_icon:new l.Uniform2f(i,o.u_texsize_icon),u_texture:new l.Uniform1i(i,o.u_texture),u_texture_icon:new l.Uniform1i(i,o.u_texture_icon),u_gamma_scale:new l.Uniform1f(i,o.u_gamma_scale),u_device_pixel_ratio:new l.Uniform1f(i,o.u_device_pixel_ratio),u_is_halo:new l.Uniform1i(i,o.u_is_halo)}},background:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_opacity:new l.Uniform1f(i,o.u_opacity),u_color:new l.UniformColor(i,o.u_color)}},backgroundPattern:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_opacity:new l.Uniform1f(i,o.u_opacity),u_image:new l.Uniform1i(i,o.u_image),u_pattern_tl_a:new l.Uniform2f(i,o.u_pattern_tl_a),u_pattern_br_a:new l.Uniform2f(i,o.u_pattern_br_a),u_pattern_tl_b:new l.Uniform2f(i,o.u_pattern_tl_b),u_pattern_br_b:new l.Uniform2f(i,o.u_pattern_br_b),u_texsize:new l.Uniform2f(i,o.u_texsize),u_mix:new l.Uniform1f(i,o.u_mix),u_pattern_size_a:new l.Uniform2f(i,o.u_pattern_size_a),u_pattern_size_b:new l.Uniform2f(i,o.u_pattern_size_b),u_scale_a:new l.Uniform1f(i,o.u_scale_a),u_scale_b:new l.Uniform1f(i,o.u_scale_b),u_pixel_coord_upper:new l.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new l.Uniform2f(i,o.u_pixel_coord_lower),u_tile_units_to_pixels:new l.Uniform1f(i,o.u_tile_units_to_pixels)}}};function Zo(i,o,n,s,p,m,y){for(var g=i.context,w=g.gl,A=i.useProgram("collisionBox"),B=[],L=0,R=0,Z=0;Z<s.length;Z++){var j=s[Z],K=o.getTile(j),U=K.getBucket(n);if(U){var X=j.posMatrix;p[0]===0&&p[1]===0||(X=i.translatePosMatrix(j.posMatrix,K,p,m));var Q=y?U.textCollisionBox:U.iconCollisionBox,ie=U.collisionCircleArray;if(ie.length>0){var ce=l.create(),le=X;l.mul(ce,U.placementInvProjMatrix,i.transform.glCoordMatrix),l.mul(ce,ce,U.placementViewportMatrix),B.push({circleArray:ie,circleOffset:R,transform:le,invTransform:ce}),R=L+=ie.length/4}Q&&A.draw(g,w.LINES,O.disabled,q.disabled,i.colorModeForRenderPass(),ee.disabled,lo(X,i.transform,K),n.id,Q.layoutVertexBuffer,Q.indexBuffer,Q.segments,null,i.transform.zoom,null,null,Q.collisionVertexBuffer)}}if(y&&B.length){var he=i.useProgram("collisionCircle"),ge=new l.StructArrayLayout2f1f2i16;ge.resize(4*L),ge._trim();for(var Te=0,Se=0,Le=B;Se<Le.length;Se+=1)for(var Ge=Le[Se],Ke=0;Ke<Ge.circleArray.length/4;Ke++){var He=4*Ke,bt=Ge.circleArray[He+0],Re=Ge.circleArray[He+1],it=Ge.circleArray[He+2],at=Ge.circleArray[He+3];ge.emplace(Te++,bt,Re,it,at,0),ge.emplace(Te++,bt,Re,it,at,1),ge.emplace(Te++,bt,Re,it,at,2),ge.emplace(Te++,bt,Re,it,at,3)}(!ds||ds.length<2*L)&&(ds=function(rr){var Ur=2*rr,zr=new l.StructArrayLayout3ui6;zr.resize(Ur),zr._trim();for(var er=0;er<Ur;er++){var lr=6*er;zr.uint16[lr+0]=4*er+0,zr.uint16[lr+1]=4*er+1,zr.uint16[lr+2]=4*er+2,zr.uint16[lr+3]=4*er+2,zr.uint16[lr+4]=4*er+3,zr.uint16[lr+5]=4*er+0}return zr}(L));for(var rt=g.createIndexBuffer(ds,!0),tt=g.createVertexBuffer(ge,l.collisionCircleLayout.members,!0),ot=0,Qe=B;ot<Qe.length;ot+=1){var Je=Qe[ot],Sr=Xu(Je.transform,Je.invTransform,i.transform);he.draw(g,w.TRIANGLES,O.disabled,q.disabled,i.colorModeForRenderPass(),ee.disabled,Sr,n.id,tt,rt,l.SegmentVector.simpleSegment(0,2*Je.circleOffset,Je.circleArray.length,Je.circleArray.length/2),null,i.transform.zoom,null,null,null)}tt.destroy(),rt.destroy()}}var ji=l.identity(new Float32Array(16));function ec(i,o,n,s,p,m){var y=l.getAnchorAlignment(i),g=-(y.horizontalAlign-.5)*o,w=-(y.verticalAlign-.5)*n,A=l.evaluateVariableOffset(i,s);return new l.Point((g/p+A[0])*m,(w/p+A[1])*m)}function tc(i,o,n,s,p,m,y,g,w,A,B){var L=i.text.placedSymbolArray,R=i.text.dynamicLayoutVertexArray,Z=i.icon.dynamicLayoutVertexArray,j={};R.clear();for(var K=0;K<L.length;K++){var U=L.get(K),X=U.hidden||!U.crossTileID||i.allowVerticalPlacement&&!U.placedOrientation?null:s[U.crossTileID];if(X){var Q=new l.Point(U.anchorX,U.anchorY),ie=mt(Q,n?g:y),ce=Pt(m.cameraToCenterDistance,ie.signedDistanceFromCamera),le=p.evaluateSizeForFeature(i.textSizeData,A,U)*ce/l.ONE_EM;n&&(le*=i.tilePixelRatio/w);for(var he=ec(X.anchor,X.width,X.height,X.textOffset,X.textBoxScale,le),ge=n?mt(Q.add(he),y).point:ie.point.add(o?he.rotate(-m.angle):he),Te=i.allowVerticalPlacement&&U.placedOrientation===l.WritingMode.vertical?Math.PI/2:0,Se=0;Se<U.numGlyphs;Se++)l.addDynamicAttributes(R,ge,Te);B&&U.associatedIconIndex>=0&&(j[U.associatedIconIndex]={shiftedAnchor:ge,angle:Te})}else Gr(U.numGlyphs,R)}if(B){Z.clear();for(var Le=i.icon.placedSymbolArray,Ge=0;Ge<Le.length;Ge++){var Ke=Le.get(Ge);if(Ke.hidden)Gr(Ke.numGlyphs,Z);else{var He=j[Ge];if(He)for(var bt=0;bt<Ke.numGlyphs;bt++)l.addDynamicAttributes(Z,He.shiftedAnchor,He.angle);else Gr(Ke.numGlyphs,Z)}}i.icon.dynamicLayoutVertexBuffer.updateData(Z)}i.text.dynamicLayoutVertexBuffer.updateData(R)}function rc(i,o,n){return n.iconsInText&&o?"symbolTextAndIcon":i?"symbolSDF":"symbolIcon"}function po(i,o,n,s,p,m,y,g,w,A,B,L){for(var R=i.context,Z=R.gl,j=i.transform,K=g==="map",U=w==="map",X=K&&n.layout.get("symbol-placement")!=="point",Q=K&&!U&&!X,ie=n.layout.get("symbol-sort-key").constantOr(1)!==void 0,ce=!1,le=i.depthModeForSublayer(0,O.ReadOnly),he=n.layout.get("text-variable-anchor"),ge=[],Te=0,Se=s;Te<Se.length;Te+=1){var Le=Se[Te],Ge=o.getTile(Le),Ke=Ge.getBucket(n);if(Ke){var He=p?Ke.text:Ke.icon;if(He&&He.segments.get().length){var bt=He.programConfigurations.get(n.id),Re=p||Ke.sdfIcons,it=p?Ke.textSizeData:Ke.iconSizeData,at=U||j.pitch!==0,rt=i.useProgram(rc(Re,p,Ke),bt),tt=l.evaluateSizeForZoom(it,j.zoom),ot=void 0,Qe=[0,0],Je=void 0,Sr=void 0,rr=null,Ur=void 0;if(p)Je=Ge.glyphAtlasTexture,Sr=Z.LINEAR,ot=Ge.glyphAtlasTexture.size,Ke.iconsInText&&(Qe=Ge.imageAtlasTexture.size,rr=Ge.imageAtlasTexture,Ur=at||i.options.rotating||i.options.zooming||it.kind==="composite"||it.kind==="camera"?Z.LINEAR:Z.NEAREST);else{var zr=n.layout.get("icon-size").constantOr(0)!==1||Ke.iconsNeedLinear;Je=Ge.imageAtlasTexture,Sr=Re||i.options.rotating||i.options.zooming||zr||at?Z.LINEAR:Z.NEAREST,ot=Ge.imageAtlasTexture.size}var er=Ht(Ge,1,i.transform.zoom),lr=ar(Le.posMatrix,U,K,i.transform,er),mi=Dt(Le.posMatrix,U,K,i.transform,er),Xr=he&&Ke.hasTextData(),Fn=n.layout.get("icon-text-fit")!=="none"&&Xr&&Ke.hasIconData();X&&ga(Ke,Le.posMatrix,i,p,lr,mi,U,A);var ni=i.translatePosMatrix(Le.posMatrix,Ge,m,y),Hi=X||p&&he||Fn?ji:lr,Di=i.translatePosMatrix(mi,Ge,m,y,!0),Oa=Re&&n.paint.get(p?"text-halo-width":"icon-halo-width").constantOr(1)!==0,Yo={program:rt,buffers:He,uniformValues:Re?Ke.iconsInText?ms(it.kind,tt,Q,U,i,ni,Hi,Di,ot,Qe):Ia(it.kind,tt,Q,U,i,ni,Hi,Di,p,ot):qo(it.kind,tt,Q,U,i,ni,Hi,Di,p,ot),atlasTexture:Je,atlasTextureIcon:rr,atlasInterpolation:Sr,atlasInterpolationIcon:Ur,isSDF:Re,hasHalo:Oa};if(ie&&Ke.canOverlap){ce=!0;for(var On=0,Qo=He.segments.get();On<Qo.length;On+=1){var Va=Qo[On];ge.push({segments:new l.SegmentVector([Va]),sortKey:Va.sortKey,state:Yo})}}else ge.push({segments:He.segments,sortKey:0,state:Yo})}}}ce&&ge.sort(function(Vn,go){return Vn.sortKey-go.sortKey});for(var rn=0,Ua=ge;rn<Ua.length;rn+=1){var nn=Ua[rn],Tr=nn.state;if(R.activeTexture.set(Z.TEXTURE0),Tr.atlasTexture.bind(Tr.atlasInterpolation,Z.CLAMP_TO_EDGE),Tr.atlasTextureIcon&&(R.activeTexture.set(Z.TEXTURE1),Tr.atlasTextureIcon&&Tr.atlasTextureIcon.bind(Tr.atlasInterpolationIcon,Z.CLAMP_TO_EDGE)),Tr.isSDF){var mn=Tr.uniformValues;Tr.hasHalo&&(mn.u_is_halo=1,Ea(Tr.buffers,nn.segments,n,i,Tr.program,le,B,L,mn)),mn.u_is_halo=0}Ea(Tr.buffers,nn.segments,n,i,Tr.program,le,B,L,Tr.uniformValues)}}function Ea(i,o,n,s,p,m,y,g,w){var A=s.context;p.draw(A,A.gl.TRIANGLES,m,y,g,ee.disabled,w,n.id,i.layoutVertexBuffer,i.indexBuffer,o,n.paint,s.transform.zoom,i.programConfigurations.get(n.id),i.dynamicLayoutVertexBuffer,i.opacityVertexBuffer)}function ys(i,o,n,s,p,m,y){var g,w,A,B,L,R=i.context.gl,Z=n.paint.get("fill-pattern"),j=Z&&Z.constantOr(1),K=n.getCrossfadeParameters();y?(w=j&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",g=R.LINES):(w=j?"fillPattern":"fill",g=R.TRIANGLES);for(var U=0,X=s;U<X.length;U+=1){var Q=X[U],ie=o.getTile(Q);if(!j||ie.patternsLoaded()){var ce=ie.getBucket(n);if(ce){var le=ce.programConfigurations.get(n.id),he=i.useProgram(w,le);j&&(i.context.activeTexture.set(R.TEXTURE0),ie.imageAtlasTexture.bind(R.LINEAR,R.CLAMP_TO_EDGE),le.updatePaintBuffers(K));var ge=Z.constantOr(null);if(ge&&ie.imageAtlas){var Te=ie.imageAtlas,Se=Te.patternPositions[ge.to.toString()],Le=Te.patternPositions[ge.from.toString()];Se&&Le&&le.setConstantPatternPositions(Se,Le)}var Ge=i.translatePosMatrix(Q.posMatrix,ie,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(y){B=ce.indexBuffer2,L=ce.segments2;var Ke=[R.drawingBufferWidth,R.drawingBufferHeight];A=w==="fillOutlinePattern"&&j?Hu(Ge,i,K,ie,Ke):Wu(Ge,Ke)}else B=ce.indexBuffer,L=ce.segments,A=j?so(Ge,i,K,ie):Mn(Ge);he.draw(i.context,g,p,i.stencilModeForClipping(Q),m,ee.disabled,A,n.id,ce.layoutVertexBuffer,B,L,n.paint,i.transform.zoom,le)}}}}function kl(i,o,n,s,p,m,y){for(var g=i.context,w=g.gl,A=n.paint.get("fill-extrusion-pattern"),B=A.constantOr(1),L=n.getCrossfadeParameters(),R=n.paint.get("fill-extrusion-opacity"),Z=0,j=s;Z<j.length;Z+=1){var K=j[Z],U=o.getTile(K),X=U.getBucket(n);if(X){var Q=X.programConfigurations.get(n.id),ie=i.useProgram(B?"fillExtrusionPattern":"fillExtrusion",Q);B&&(i.context.activeTexture.set(w.TEXTURE0),U.imageAtlasTexture.bind(w.LINEAR,w.CLAMP_TO_EDGE),Q.updatePaintBuffers(L));var ce=A.constantOr(null);if(ce&&U.imageAtlas){var le=U.imageAtlas,he=le.patternPositions[ce.to.toString()],ge=le.patternPositions[ce.from.toString()];he&&ge&&Q.setConstantPatternPositions(he,ge)}var Te=i.translatePosMatrix(K.posMatrix,U,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),Se=n.paint.get("fill-extrusion-vertical-gradient"),Le=B?ao(Te,i,Se,R,K,L,U):Zu(Te,i,Se,R);ie.draw(g,g.gl.TRIANGLES,p,m,y,ee.backCCW,Le,n.id,X.layoutVertexBuffer,X.indexBuffer,X.segments,n.paint,i.transform.zoom,Q)}}}function vs(i,o,n,s,p,m){var y=i.context,g=y.gl,w=o.fbo;if(w){var A=i.useProgram("hillshade");y.activeTexture.set(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,w.colorAttachment.get());var B=function(L,R,Z){var j=Z.paint.get("hillshade-shadow-color"),K=Z.paint.get("hillshade-highlight-color"),U=Z.paint.get("hillshade-accent-color"),X=Z.paint.get("hillshade-illumination-direction")*(Math.PI/180);Z.paint.get("hillshade-illumination-anchor")==="viewport"&&(X-=L.transform.angle);var Q,ie,ce,le=!L.options.moving;return{u_matrix:L.transform.calculatePosMatrix(R.tileID.toUnwrapped(),le),u_image:0,u_latrange:(Q=R.tileID,ie=Math.pow(2,Q.canonical.z),ce=Q.canonical.y,[new l.MercatorCoordinate(0,ce/ie).toLngLat().lat,new l.MercatorCoordinate(0,(ce+1)/ie).toLngLat().lat]),u_light:[Z.paint.get("hillshade-exaggeration"),X],u_shadow:j,u_highlight:K,u_accent:U}}(i,o,n);A.draw(y,g.TRIANGLES,s,p,m,ee.disabled,B,n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments)}}function jp(i,o,n,s,p,m){var y=i.context,g=y.gl,w=o.dem;if(w&&w.data){var A=w.dim,B=w.stride,L=w.getPixels();if(y.activeTexture.set(g.TEXTURE1),y.pixelStoreUnpackPremultiplyAlpha.set(!1),o.demTexture=o.demTexture||i.getTileTexture(B),o.demTexture){var R=o.demTexture;R.update(L,{premultiply:!1}),R.bind(g.NEAREST,g.CLAMP_TO_EDGE)}else o.demTexture=new l.Texture(y,L,g.RGBA,{premultiply:!1}),o.demTexture.bind(g.NEAREST,g.CLAMP_TO_EDGE);y.activeTexture.set(g.TEXTURE0);var Z=o.fbo;if(!Z){var j=new l.Texture(y,{width:A,height:A,data:null},g.RGBA);j.bind(g.LINEAR,g.CLAMP_TO_EDGE),(Z=o.fbo=y.createFramebuffer(A,A,!0)).colorAttachment.set(j.texture)}y.bindFramebuffer.set(Z.framebuffer),y.viewport.set([0,0,A,A]),i.useProgram("hillshadePrepare").draw(y,g.TRIANGLES,s,p,m,ee.disabled,function(K,U){var X=U.stride,Q=l.create();return l.ortho(Q,0,l.EXTENT,-l.EXTENT,0,0,1),l.translate(Q,Q,[0,-l.EXTENT,0]),{u_matrix:Q,u_image:1,u_dimension:[X,X],u_zoom:K.overscaledZ,u_unpack:U.getUnpackVector()}}(o.tileID,w),n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments),o.needsHillshadePrepare=!1}}function gs(i,o,n,s,p){var m=s.paint.get("raster-fade-duration");if(m>0){var y=l.browser.now(),g=(y-i.timeAdded)/m,w=o?(y-o.timeAdded)/m:-1,A=n.getSource(),B=p.coveringZoomLevel({tileSize:A.tileSize,roundZoom:A.roundZoom}),L=!o||Math.abs(o.tileID.overscaledZ-B)>Math.abs(i.tileID.overscaledZ-B),R=L&&i.refreshedUponExpiration?1:l.clamp(L?g:1-w,0,1);return i.refreshedUponExpiration&&g>=1&&(i.refreshedUponExpiration=!1),o?{opacity:1,mix:1-R}:{opacity:R,mix:0}}return{opacity:1,mix:0}}var Ml=new l.Color(1,0,0,1),ic=new l.Color(0,1,0,1),nc=new l.Color(0,0,1,1),_s=new l.Color(1,0,1,1),zl=new l.Color(0,1,1,1);function Bl(i,o,n,s){Pa(i,0,o+n/2,i.transform.width,n,s)}function Dl(i,o,n,s){Pa(i,o-n/2,0,n,i.transform.height,s)}function Pa(i,o,n,s,p,m){var y=i.context,g=y.gl;g.enable(g.SCISSOR_TEST),g.scissor(o*l.browser.devicePixelRatio,n*l.browser.devicePixelRatio,s*l.browser.devicePixelRatio,p*l.browser.devicePixelRatio),y.clear({color:m}),g.disable(g.SCISSOR_TEST)}function oc(i,o,n){var s=i.context,p=s.gl,m=n.posMatrix,y=i.useProgram("debug"),g=O.disabled,w=q.disabled,A=i.colorModeForRenderPass();s.activeTexture.set(p.TEXTURE0),i.emptyTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),y.draw(s,p.LINE_STRIP,g,w,A,ee.disabled,uo(m,l.Color.red),"$debug",i.debugBuffer,i.tileBorderIndexBuffer,i.debugSegments);var B=o.getTileByID(n.key).latestRawTileData,L=Math.floor((B&&B.byteLength||0)/1024),R=o.getTile(n).tileSize,Z=512/Math.min(R,512)*(n.overscaledZ/i.transform.zoom)*.5,j=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(j+=" => "+n.overscaledZ),function(K,U){K.initDebugOverlayCanvas();var X=K.debugOverlayCanvas,Q=K.context.gl,ie=K.debugOverlayCanvas.getContext("2d");ie.clearRect(0,0,X.width,X.height),ie.shadowColor="white",ie.shadowBlur=2,ie.lineWidth=1.5,ie.strokeStyle="white",ie.textBaseline="top",ie.font="bold 36px Open Sans, sans-serif",ie.fillText(U,5,5),ie.strokeText(U,5,5),K.debugOverlayTexture.update(X),K.debugOverlayTexture.bind(Q.LINEAR,Q.CLAMP_TO_EDGE)}(i,j+" "+L+"kb"),y.draw(s,p.TRIANGLES,g,w,Y.alphaBlended,ee.disabled,uo(m,l.Color.transparent,Z),"$debug",i.debugBuffer,i.quadTriangleIndexBuffer,i.debugSegments)}var ho={symbol:function(i,o,n,s,p){if(i.renderPass==="translucent"){var m=q.disabled,y=i.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(g,w,A,B,L,R,Z){for(var j=w.transform,K=L==="map",U=R==="map",X=0,Q=g;X<Q.length;X+=1){var ie=Q[X],ce=B.getTile(ie),le=ce.getBucket(A);if(le&&le.text&&le.text.segments.get().length){var he=l.evaluateSizeForZoom(le.textSizeData,j.zoom),ge=Ht(ce,1,w.transform.zoom),Te=ar(ie.posMatrix,U,K,w.transform,ge),Se=A.layout.get("icon-text-fit")!=="none"&&le.hasIconData();if(he){var Le=Math.pow(2,j.zoom-ce.tileID.overscaledZ);tc(le,K,U,Z,l.symbolSize,j,Te,ie.posMatrix,Le,he,Se)}}}}(s,i,n,o,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),p),n.paint.get("icon-opacity").constantOr(1)!==0&&po(i,o,n,s,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),m,y),n.paint.get("text-opacity").constantOr(1)!==0&&po(i,o,n,s,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),m,y),o.map.showCollisionBoxes&&(Zo(i,o,n,s,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),Zo(i,o,n,s,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))}},circle:function(i,o,n,s){if(i.renderPass==="translucent"){var p=n.paint.get("circle-opacity"),m=n.paint.get("circle-stroke-width"),y=n.paint.get("circle-stroke-opacity"),g=n.layout.get("circle-sort-key").constantOr(1)!==void 0;if(p.constantOr(1)!==0||m.constantOr(1)!==0&&y.constantOr(1)!==0){for(var w=i.context,A=w.gl,B=i.depthModeForSublayer(0,O.ReadOnly),L=q.disabled,R=i.colorModeForRenderPass(),Z=[],j=0;j<s.length;j++){var K=s[j],U=o.getTile(K),X=U.getBucket(n);if(X){var Q=X.programConfigurations.get(n.id),ie={programConfiguration:Q,program:i.useProgram("circle",Q),layoutVertexBuffer:X.layoutVertexBuffer,indexBuffer:X.indexBuffer,uniformValues:Cl(i,K,U,n)};if(g)for(var ce=0,le=X.segments.get();ce<le.length;ce+=1){var he=le[ce];Z.push({segments:new l.SegmentVector([he]),sortKey:he.sortKey,state:ie})}else Z.push({segments:X.segments,sortKey:0,state:ie})}}g&&Z.sort(function(Ge,Ke){return Ge.sortKey-Ke.sortKey});for(var ge=0,Te=Z;ge<Te.length;ge+=1){var Se=Te[ge],Le=Se.state;Le.program.draw(w,A.TRIANGLES,B,L,R,ee.disabled,Le.uniformValues,n.id,Le.layoutVertexBuffer,Le.indexBuffer,Se.segments,n.paint,i.transform.zoom,Le.programConfiguration)}}}},heatmap:function(i,o,n,s){if(n.paint.get("heatmap-opacity")!==0)if(i.renderPass==="offscreen"){var p=i.context,m=p.gl,y=q.disabled,g=new Y([m.ONE,m.ONE],l.Color.transparent,[!0,!0,!0,!0]);(function(Z,j,K){var U=Z.gl;Z.activeTexture.set(U.TEXTURE1),Z.viewport.set([0,0,j.width/4,j.height/4]);var X=K.heatmapFbo;if(X)U.bindTexture(U.TEXTURE_2D,X.colorAttachment.get()),Z.bindFramebuffer.set(X.framebuffer);else{var Q=U.createTexture();U.bindTexture(U.TEXTURE_2D,Q),U.texParameteri(U.TEXTURE_2D,U.TEXTURE_WRAP_S,U.CLAMP_TO_EDGE),U.texParameteri(U.TEXTURE_2D,U.TEXTURE_WRAP_T,U.CLAMP_TO_EDGE),U.texParameteri(U.TEXTURE_2D,U.TEXTURE_MIN_FILTER,U.LINEAR),U.texParameteri(U.TEXTURE_2D,U.TEXTURE_MAG_FILTER,U.LINEAR),X=K.heatmapFbo=Z.createFramebuffer(j.width/4,j.height/4,!1),function(ie,ce,le,he){var ge=ie.gl;ge.texImage2D(ge.TEXTURE_2D,0,ge.RGBA,ce.width/4,ce.height/4,0,ge.RGBA,ie.extRenderToTextureHalfFloat?ie.extTextureHalfFloat.HALF_FLOAT_OES:ge.UNSIGNED_BYTE,null),he.colorAttachment.set(le)}(Z,j,Q,X)}})(p,i,n),p.clear({color:l.Color.transparent});for(var w=0;w<s.length;w++){var A=s[w];if(!o.hasRenderableParent(A)){var B=o.getTile(A),L=B.getBucket(n);if(L){var R=L.programConfigurations.get(n.id);i.useProgram("heatmap",R).draw(p,m.TRIANGLES,O.disabled,y,g,ee.disabled,Ku(A.posMatrix,B,i.transform.zoom,n.paint.get("heatmap-intensity")),n.id,L.layoutVertexBuffer,L.indexBuffer,L.segments,n.paint,i.transform.zoom,R)}}}p.viewport.set([0,0,i.width,i.height])}else i.renderPass==="translucent"&&(i.context.setColorMode(i.colorModeForRenderPass()),function(Z,j){var K=Z.context,U=K.gl,X=j.heatmapFbo;if(X){K.activeTexture.set(U.TEXTURE0),U.bindTexture(U.TEXTURE_2D,X.colorAttachment.get()),K.activeTexture.set(U.TEXTURE1);var Q=j.colorRampTexture;Q||(Q=j.colorRampTexture=new l.Texture(K,j.colorRamp,U.RGBA)),Q.bind(U.LINEAR,U.CLAMP_TO_EDGE),Z.useProgram("heatmapTexture").draw(K,U.TRIANGLES,O.disabled,q.disabled,Z.colorModeForRenderPass(),ee.disabled,function(ie,ce,le,he){var ge=l.create();l.ortho(ge,0,ie.width,ie.height,0,0,1);var Te=ie.context.gl;return{u_matrix:ge,u_world:[Te.drawingBufferWidth,Te.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:ce.paint.get("heatmap-opacity")}}(Z,j),j.id,Z.viewportBuffer,Z.quadTriangleIndexBuffer,Z.viewportSegments,j.paint,Z.transform.zoom)}}(i,n))},line:function(i,o,n,s){if(i.renderPass==="translucent"){var p=n.paint.get("line-opacity"),m=n.paint.get("line-width");if(p.constantOr(1)!==0&&m.constantOr(1)!==0)for(var y=i.depthModeForSublayer(0,O.ReadOnly),g=i.colorModeForRenderPass(),w=n.paint.get("line-dasharray"),A=n.paint.get("line-pattern"),B=A.constantOr(1),L=n.paint.get("line-gradient"),R=n.getCrossfadeParameters(),Z=B?"linePattern":w?"lineSDF":L?"lineGradient":"line",j=i.context,K=j.gl,U=!0,X=0,Q=s;X<Q.length;X+=1){var ie=Q[X],ce=o.getTile(ie);if(!B||ce.patternsLoaded()){var le=ce.getBucket(n);if(le){var he=le.programConfigurations.get(n.id),ge=i.context.program.get(),Te=i.useProgram(Z,he),Se=U||Te.program!==ge,Le=A.constantOr(null);if(Le&&ce.imageAtlas){var Ge=ce.imageAtlas,Ke=Ge.patternPositions[Le.to.toString()],He=Ge.patternPositions[Le.from.toString()];Ke&&He&&he.setConstantPatternPositions(Ke,He)}var bt=B?fs(i,ce,n,R):w?Np(i,ce,n,w,R):L?$t(i,ce,n,le.lineClipsArray.length):Ta(i,ce,n);if(B)j.activeTexture.set(K.TEXTURE0),ce.imageAtlasTexture.bind(K.LINEAR,K.CLAMP_TO_EDGE),he.updatePaintBuffers(R);else if(w&&(Se||i.lineAtlas.dirty))j.activeTexture.set(K.TEXTURE0),i.lineAtlas.bind(j);else if(L){var Re=le.gradients[n.id],it=Re.texture;if(n.gradientVersion!==Re.version){var at=256;if(n.stepInterpolant){var rt=o.getSource().maxzoom,tt=ie.canonical.z===rt?Math.ceil(1<<i.transform.maxZoom-ie.canonical.z):1;at=l.clamp(l.nextPowerOfTwo(le.maxLineLength/l.EXTENT*1024*tt),256,j.maxTextureSize)}Re.gradient=l.renderColorRamp({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:at,image:Re.gradient||void 0,clips:le.lineClipsArray}),Re.texture?Re.texture.update(Re.gradient):Re.texture=new l.Texture(j,Re.gradient,K.RGBA),Re.version=n.gradientVersion,it=Re.texture}j.activeTexture.set(K.TEXTURE0),it.bind(n.stepInterpolant?K.NEAREST:K.LINEAR,K.CLAMP_TO_EDGE)}Te.draw(j,K.TRIANGLES,y,i.stencilModeForClipping(ie),g,ee.disabled,bt,n.id,le.layoutVertexBuffer,le.indexBuffer,le.segments,n.paint,i.transform.zoom,he,le.layoutVertexBuffer2),U=!1}}}}},fill:function(i,o,n,s){var p=n.paint.get("fill-color"),m=n.paint.get("fill-opacity");if(m.constantOr(1)!==0){var y=i.colorModeForRenderPass(),g=n.paint.get("fill-pattern"),w=i.opaquePassEnabledForLayer()&&!g.constantOr(1)&&p.constantOr(l.Color.transparent).a===1&&m.constantOr(0)===1?"opaque":"translucent";if(i.renderPass===w){var A=i.depthModeForSublayer(1,i.renderPass==="opaque"?O.ReadWrite:O.ReadOnly);ys(i,o,n,s,A,y,!1)}if(i.renderPass==="translucent"&&n.paint.get("fill-antialias")){var B=i.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,O.ReadOnly);ys(i,o,n,s,B,y,!0)}}},"fill-extrusion":function(i,o,n,s){var p=n.paint.get("fill-extrusion-opacity");if(p!==0&&i.renderPass==="translucent"){var m=new O(i.context.gl.LEQUAL,O.ReadWrite,i.depthRangeFor3D);if(p!==1||n.paint.get("fill-extrusion-pattern").constantOr(1))kl(i,o,n,s,m,q.disabled,Y.disabled),kl(i,o,n,s,m,i.stencilModeFor3D(),i.colorModeForRenderPass());else{var y=i.colorModeForRenderPass();kl(i,o,n,s,m,q.disabled,y)}}},hillshade:function(i,o,n,s){if(i.renderPass==="offscreen"||i.renderPass==="translucent"){for(var p=i.context,m=i.depthModeForSublayer(0,O.ReadOnly),y=i.colorModeForRenderPass(),g=i.renderPass==="translucent"?i.stencilConfigForOverlap(s):[{},s],w=g[0],A=0,B=g[1];A<B.length;A+=1){var L=B[A],R=o.getTile(L);R.needsHillshadePrepare&&i.renderPass==="offscreen"?jp(i,R,n,m,q.disabled,y):i.renderPass==="translucent"&&vs(i,R,n,m,w[L.overscaledZ],y)}p.viewport.set([0,0,i.width,i.height])}},raster:function(i,o,n,s){if(i.renderPass==="translucent"&&n.paint.get("raster-opacity")!==0&&s.length)for(var p=i.context,m=p.gl,y=o.getSource(),g=i.useProgram("raster"),w=i.colorModeForRenderPass(),A=y instanceof Ki?[{},s]:i.stencilConfigForOverlap(s),B=A[0],L=A[1],R=L[L.length-1].overscaledZ,Z=!i.options.moving,j=0,K=L;j<K.length;j+=1){var U=K[j],X=i.depthModeForSublayer(U.overscaledZ-R,n.paint.get("raster-opacity")===1?O.ReadWrite:O.ReadOnly,m.LESS),Q=o.getTile(U),ie=i.transform.calculatePosMatrix(U.toUnwrapped(),Z);Q.registerFadeDuration(n.paint.get("raster-fade-duration"));var ce=o.findLoadedParent(U,0),le=gs(Q,ce,o,n,i.transform),he=void 0,ge=void 0,Te=n.paint.get("raster-resampling")==="nearest"?m.NEAREST:m.LINEAR;p.activeTexture.set(m.TEXTURE0),Q.texture.bind(Te,m.CLAMP_TO_EDGE,m.LINEAR_MIPMAP_NEAREST),p.activeTexture.set(m.TEXTURE1),ce?(ce.texture.bind(Te,m.CLAMP_TO_EDGE,m.LINEAR_MIPMAP_NEAREST),he=Math.pow(2,ce.tileID.overscaledZ-Q.tileID.overscaledZ),ge=[Q.tileID.canonical.x*he%1,Q.tileID.canonical.y*he%1]):Q.texture.bind(Te,m.CLAMP_TO_EDGE,m.LINEAR_MIPMAP_NEAREST);var Se=$p(ie,ge||[0,0],he||1,le,n);y instanceof Ki?g.draw(p,m.TRIANGLES,X,q.disabled,w,ee.disabled,Se,n.id,y.boundsBuffer,i.quadTriangleIndexBuffer,y.boundsSegments):g.draw(p,m.TRIANGLES,X,B[U.overscaledZ],w,ee.disabled,Se,n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments)}},background:function(i,o,n){var s=n.paint.get("background-color"),p=n.paint.get("background-opacity");if(p!==0){var m=i.context,y=m.gl,g=i.transform,w=g.tileSize,A=n.paint.get("background-pattern");if(!i.isPatternMissing(A)){var B=!A&&s.a===1&&p===1&&i.opaquePassEnabledForLayer()?"opaque":"translucent";if(i.renderPass===B){var L=q.disabled,R=i.depthModeForSublayer(0,B==="opaque"?O.ReadWrite:O.ReadOnly),Z=i.colorModeForRenderPass(),j=i.useProgram(A?"backgroundPattern":"background"),K=g.coveringTiles({tileSize:w});A&&(m.activeTexture.set(y.TEXTURE0),i.imageManager.bind(i.context));for(var U=n.getCrossfadeParameters(),X=0,Q=K;X<Q.length;X+=1){var ie=Q[X],ce=i.transform.calculatePosMatrix(ie.toUnwrapped()),le=A?Go(ce,p,i,A,{tileID:ie,tileSize:w},U):Aa(ce,p,s);j.draw(m,y.TRIANGLES,R,L,Z,ee.disabled,le,n.id,i.tileExtentBuffer,i.quadTriangleIndexBuffer,i.tileExtentSegments)}}}}},debug:function(i,o,n){for(var s=0;s<n.length;s++)oc(i,o,n[s])},custom:function(i,o,n){var s=i.context,p=n.implementation;if(i.renderPass==="offscreen"){var m=p.prerender;m&&(i.setCustomLayerDefaults(),s.setColorMode(i.colorModeForRenderPass()),m.call(p,s.gl,i.transform.customLayerMatrix()),s.setDirty(),i.setBaseState())}else if(i.renderPass==="translucent"){i.setCustomLayerDefaults(),s.setColorMode(i.colorModeForRenderPass()),s.setStencilMode(q.disabled);var y=p.renderingMode==="3d"?new O(i.context.gl.LEQUAL,O.ReadWrite,i.depthRangeFor3D):i.depthModeForSublayer(0,O.ReadOnly);s.setDepthMode(y),p.render(s.gl,i.transform.customLayerMatrix()),s.setDirty(),i.setBaseState(),s.bindFramebuffer.set(null)}}},Xt=function(i,o){this.context=new D(i),this.transform=o,this._tileTextures={},this.setup(),this.numSublayers=W.maxUnderzooming+W.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Tn,this.gpuTimers={}};Xt.prototype.resize=function(i,o){if(this.width=i*l.browser.devicePixelRatio,this.height=o*l.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,s=this.style._order;n<s.length;n+=1)this.style._layers[s[n]].resize()},Xt.prototype.setup=function(){var i=this.context,o=new l.StructArrayLayout2i4;o.emplaceBack(0,0),o.emplaceBack(l.EXTENT,0),o.emplaceBack(0,l.EXTENT),o.emplaceBack(l.EXTENT,l.EXTENT),this.tileExtentBuffer=i.createVertexBuffer(o,mr.members),this.tileExtentSegments=l.SegmentVector.simpleSegment(0,0,4,2);var n=new l.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(l.EXTENT,0),n.emplaceBack(0,l.EXTENT),n.emplaceBack(l.EXTENT,l.EXTENT),this.debugBuffer=i.createVertexBuffer(n,mr.members),this.debugSegments=l.SegmentVector.simpleSegment(0,0,4,5);var s=new l.StructArrayLayout4i8;s.emplaceBack(0,0,0,0),s.emplaceBack(l.EXTENT,0,l.EXTENT,0),s.emplaceBack(0,l.EXTENT,0,l.EXTENT),s.emplaceBack(l.EXTENT,l.EXTENT,l.EXTENT,l.EXTENT),this.rasterBoundsBuffer=i.createVertexBuffer(s,Oi.members),this.rasterBoundsSegments=l.SegmentVector.simpleSegment(0,0,4,2);var p=new l.StructArrayLayout2i4;p.emplaceBack(0,0),p.emplaceBack(1,0),p.emplaceBack(0,1),p.emplaceBack(1,1),this.viewportBuffer=i.createVertexBuffer(p,mr.members),this.viewportSegments=l.SegmentVector.simpleSegment(0,0,4,2);var m=new l.StructArrayLayout1ui2;m.emplaceBack(0),m.emplaceBack(1),m.emplaceBack(3),m.emplaceBack(2),m.emplaceBack(0),this.tileBorderIndexBuffer=i.createIndexBuffer(m);var y=new l.StructArrayLayout3ui6;y.emplaceBack(0,1,2),y.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=i.createIndexBuffer(y),this.emptyTexture=new l.Texture(i,{width:1,height:1,data:new Uint8Array([0,0,0,0])},i.gl.RGBA);var g=this.context.gl;this.stencilClearMode=new q({func:g.ALWAYS,mask:0},0,255,g.ZERO,g.ZERO,g.ZERO)},Xt.prototype.clearStencil=function(){var i=this.context,o=i.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var n=l.create();l.ortho(n,0,this.width,this.height,0,0,1),l.scale(n,n,[o.drawingBufferWidth,o.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(i,o.TRIANGLES,O.disabled,this.stencilClearMode,Y.disabled,ee.disabled,co(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},Xt.prototype._renderTileClippingMasks=function(i,o){if(this.currentStencilSource!==i.source&&i.isTileClipped()&&o&&o.length){this.currentStencilSource=i.source;var n=this.context,s=n.gl;this.nextStencilID+o.length>256&&this.clearStencil(),n.setColorMode(Y.disabled),n.setDepthMode(O.disabled);var p=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var m=0,y=o;m<y.length;m+=1){var g=y[m],w=this._tileClippingMaskIDs[g.key]=this.nextStencilID++;p.draw(n,s.TRIANGLES,O.disabled,new q({func:s.ALWAYS,mask:0},w,255,s.KEEP,s.KEEP,s.REPLACE),Y.disabled,ee.disabled,co(g.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},Xt.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var i=this.nextStencilID++,o=this.context.gl;return new q({func:o.NOTEQUAL,mask:255},i,255,o.KEEP,o.KEEP,o.REPLACE)},Xt.prototype.stencilModeForClipping=function(i){var o=this.context.gl;return new q({func:o.EQUAL,mask:255},this._tileClippingMaskIDs[i.key],0,o.KEEP,o.KEEP,o.REPLACE)},Xt.prototype.stencilConfigForOverlap=function(i){var o,n=this.context.gl,s=i.sort(function(w,A){return A.overscaledZ-w.overscaledZ}),p=s[s.length-1].overscaledZ,m=s[0].overscaledZ-p+1;if(m>1){this.currentStencilSource=void 0,this.nextStencilID+m>256&&this.clearStencil();for(var y={},g=0;g<m;g++)y[g+p]=new q({func:n.GEQUAL,mask:255},g+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=m,[y,s]}return[(o={},o[p]=q.disabled,o),s]},Xt.prototype.colorModeForRenderPass=function(){var i=this.context.gl;return this._showOverdrawInspector?new Y([i.CONSTANT_COLOR,i.ONE],new l.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?Y.unblended:Y.alphaBlended},Xt.prototype.depthModeForSublayer=function(i,o,n){if(!this.opaquePassEnabledForLayer())return O.disabled;var s=1-((1+this.currentLayer)*this.numSublayers+i)*this.depthEpsilon;return new O(n||this.context.gl.LEQUAL,o,[s,s])},Xt.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},Xt.prototype.render=function(i,o){var n=this;this.style=i,this.options=o,this.lineAtlas=i.lineAtlas,this.imageManager=i.imageManager,this.glyphManager=i.glyphManager,this.symbolFadeChange=i.placement.symbolFadeChange(l.browser.now()),this.imageManager.beginFrame();var s=this.style._order,p=this.style.sourceCaches;for(var m in p){var y=p[m];y.used&&y.prepare(this.context)}var g,w,A={},B={},L={};for(var R in p){var Z=p[R];A[R]=Z.getVisibleCoordinates(),B[R]=A[R].slice().reverse(),L[R]=Z.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var j=0;j<s.length;j++)if(this.style._layers[s[j]].is3D()){this.opaquePassCutoff=j;break}this.renderPass="offscreen";for(var K=0,U=s;K<U.length;K+=1){var X=this.style._layers[U[K]];if(X.hasOffscreenPass()&&!X.isHidden(this.transform.zoom)){var Q=B[X.source];(X.type==="custom"||Q.length)&&this.renderLayer(this,p[X.source],X,Q)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:o.showOverdrawInspector?l.Color.black:l.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=o.showOverdrawInspector,this.depthRangeFor3D=[0,1-(i._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=s.length-1;this.currentLayer>=0;this.currentLayer--){var ie=this.style._layers[s[this.currentLayer]],ce=p[ie.source],le=A[ie.source];this._renderTileClippingMasks(ie,le),this.renderLayer(this,ce,ie,le)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<s.length;this.currentLayer++){var he=this.style._layers[s[this.currentLayer]],ge=p[he.source],Te=(he.type==="symbol"?L:B)[he.source];this._renderTileClippingMasks(he,A[he.source]),this.renderLayer(this,ge,he,Te)}this.options.showTileBoundaries&&(l.values(this.style._layers).forEach(function(Se){Se.source&&!Se.isHidden(n.transform.zoom)&&(Se.source!==(w&&w.id)&&(w=n.style.sourceCaches[Se.source]),(!g||g.getSource().maxzoom<w.getSource().maxzoom)&&(g=w))}),g&&ho.debug(this,g,g.getVisibleCoordinates())),this.options.showPadding&&function(Se){var Le=Se.transform.padding;Bl(Se,Se.transform.height-(Le.top||0),3,Ml),Bl(Se,Le.bottom||0,3,ic),Dl(Se,Le.left||0,3,nc),Dl(Se,Se.transform.width-(Le.right||0),3,_s);var Ge=Se.transform.centerPoint;(function(Ke,He,bt,Re){Pa(Ke,He-1,bt-10,2,20,Re),Pa(Ke,He-10,bt-1,20,2,Re)})(Se,Ge.x,Se.transform.height-Ge.y,zl)}(this),this.context.setDefault()},Xt.prototype.renderLayer=function(i,o,n,s){n.isHidden(this.transform.zoom)||(n.type==="background"||n.type==="custom"||s.length)&&(this.id=n.id,this.gpuTimingStart(n),ho[n.type](i,o,n,s,this.style.placement.variableOffsets),this.gpuTimingEnd())},Xt.prototype.gpuTimingStart=function(i){if(this.options.gpuTiming){var o=this.context.extTimerQuery,n=this.gpuTimers[i.id];n||(n=this.gpuTimers[i.id]={calls:0,cpuTime:0,query:o.createQueryEXT()}),n.calls++,o.beginQueryEXT(o.TIME_ELAPSED_EXT,n.query)}},Xt.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var i=this.context.extTimerQuery;i.endQueryEXT(i.TIME_ELAPSED_EXT)}},Xt.prototype.collectGpuTimers=function(){var i=this.gpuTimers;return this.gpuTimers={},i},Xt.prototype.queryGpuTimers=function(i){var o={};for(var n in i){var s=i[n],p=this.context.extTimerQuery,m=p.getQueryObjectEXT(s.query,p.QUERY_RESULT_EXT)/1e6;p.deleteQueryEXT(s.query),o[n]=m}return o},Xt.prototype.translatePosMatrix=function(i,o,n,s,p){if(!n[0]&&!n[1])return i;var m=p?s==="map"?this.transform.angle:0:s==="viewport"?-this.transform.angle:0;if(m){var y=Math.sin(m),g=Math.cos(m);n=[n[0]*g-n[1]*y,n[0]*y+n[1]*g]}var w=[p?n[0]:Ht(o,n[0],this.transform.zoom),p?n[1]:Ht(o,n[1],this.transform.zoom),0],A=new Float32Array(16);return l.translate(A,i,w),A},Xt.prototype.saveTileTexture=function(i){var o=this._tileTextures[i.size[0]];o?o.push(i):this._tileTextures[i.size[0]]=[i]},Xt.prototype.getTileTexture=function(i){var o=this._tileTextures[i];return o&&o.length>0?o.pop():null},Xt.prototype.isPatternMissing=function(i){if(!i)return!1;if(!i.from||!i.to)return!0;var o=this.imageManager.getPattern(i.from.toString()),n=this.imageManager.getPattern(i.to.toString());return!o||!n},Xt.prototype.useProgram=function(i,o){this.cache=this.cache||{};var n=""+i+(o?o.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[n]||(this.cache[n]=new qu(this.context,i,Up[i],o,Qu[i],this._showOverdrawInspector)),this.cache[n]},Xt.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Xt.prototype.setBaseState=function(){var i=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(i.FUNC_ADD)},Xt.prototype.initDebugOverlayCanvas=function(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=l.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new l.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},Xt.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var xs=function(i,o){this.points=i,this.planes=o};xs.fromInvProjectionMatrix=function(i,o,n){var s=Math.pow(2,n),p=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(function(y){return l.transformMat4([],y,i)}).map(function(y){return l.scale$1([],y,1/y[3]/o*s)}),m=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(function(y){var g=l.sub([],p[y[0]],p[y[1]]),w=l.sub([],p[y[2]],p[y[1]]),A=l.normalize([],l.cross([],g,w)),B=-l.dot(A,p[y[1]]);return A.concat(B)});return new xs(p,m)};var fo=function(i,o){this.min=i,this.max=o,this.center=l.scale$2([],l.add([],this.min,this.max),.5)};fo.prototype.quadrant=function(i){for(var o=[i%2==0,i<2],n=l.clone$2(this.min),s=l.clone$2(this.max),p=0;p<o.length;p++)n[p]=o[p]?this.min[p]:this.center[p],s[p]=o[p]?this.center[p]:this.max[p];return s[2]=this.max[2],new fo(n,s)},fo.prototype.distanceX=function(i){return Math.max(Math.min(this.max[0],i[0]),this.min[0])-i[0]},fo.prototype.distanceY=function(i){return Math.max(Math.min(this.max[1],i[1]),this.min[1])-i[1]},fo.prototype.intersects=function(i){for(var o=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],n=!0,s=0;s<i.planes.length;s++){for(var p=i.planes[s],m=0,y=0;y<o.length;y++)m+=l.dot$1(p,o[y])>=0;if(m===0)return 0;m!==o.length&&(n=!1)}if(n)return 2;for(var g=0;g<3;g++){for(var w=Number.MAX_VALUE,A=-Number.MAX_VALUE,B=0;B<i.points.length;B++){var L=i.points[B][g]-this.min[g];w=Math.min(w,L),A=Math.max(A,L)}if(A<0||w>this.max[g]-this.min[g])return 0}return 1};var zn=function(i,o,n,s){if(i===void 0&&(i=0),o===void 0&&(o=0),n===void 0&&(n=0),s===void 0&&(s=0),isNaN(i)||i<0||isNaN(o)||o<0||isNaN(n)||n<0||isNaN(s)||s<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=i,this.bottom=o,this.left=n,this.right=s};zn.prototype.interpolate=function(i,o,n){return o.top!=null&&i.top!=null&&(this.top=l.number(i.top,o.top,n)),o.bottom!=null&&i.bottom!=null&&(this.bottom=l.number(i.bottom,o.bottom,n)),o.left!=null&&i.left!=null&&(this.left=l.number(i.left,o.left,n)),o.right!=null&&i.right!=null&&(this.right=l.number(i.right,o.right,n)),this},zn.prototype.getCenter=function(i,o){var n=l.clamp((this.left+i-this.right)/2,0,i),s=l.clamp((this.top+o-this.bottom)/2,0,o);return new l.Point(n,s)},zn.prototype.equals=function(i){return this.top===i.top&&this.bottom===i.bottom&&this.left===i.left&&this.right===i.right},zn.prototype.clone=function(){return new zn(this.top,this.bottom,this.left,this.right)},zn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var gt=function(i,o,n,s,p){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=p===void 0||p,this._minZoom=i||0,this._maxZoom=o||22,this._minPitch=n??0,this._maxPitch=s??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new l.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new zn,this._posMatrixCache={},this._alignedPosMatrixCache={}},jt={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};gt.prototype.clone=function(){var i=new gt(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return i.tileSize=this.tileSize,i.latRange=this.latRange,i.width=this.width,i.height=this.height,i._center=this._center,i.zoom=this.zoom,i.angle=this.angle,i._fov=this._fov,i._pitch=this._pitch,i._unmodified=this._unmodified,i._edgeInsets=this._edgeInsets.clone(),i._calcMatrices(),i},jt.minZoom.get=function(){return this._minZoom},jt.minZoom.set=function(i){this._minZoom!==i&&(this._minZoom=i,this.zoom=Math.max(this.zoom,i))},jt.maxZoom.get=function(){return this._maxZoom},jt.maxZoom.set=function(i){this._maxZoom!==i&&(this._maxZoom=i,this.zoom=Math.min(this.zoom,i))},jt.minPitch.get=function(){return this._minPitch},jt.minPitch.set=function(i){this._minPitch!==i&&(this._minPitch=i,this.pitch=Math.max(this.pitch,i))},jt.maxPitch.get=function(){return this._maxPitch},jt.maxPitch.set=function(i){this._maxPitch!==i&&(this._maxPitch=i,this.pitch=Math.min(this.pitch,i))},jt.renderWorldCopies.get=function(){return this._renderWorldCopies},jt.renderWorldCopies.set=function(i){i===void 0?i=!0:i===null&&(i=!1),this._renderWorldCopies=i},jt.worldSize.get=function(){return this.tileSize*this.scale},jt.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},jt.size.get=function(){return new l.Point(this.width,this.height)},jt.bearing.get=function(){return-this.angle/Math.PI*180},jt.bearing.set=function(i){var o=-l.wrap(i,-180,180)*Math.PI/180;this.angle!==o&&(this._unmodified=!1,this.angle=o,this._calcMatrices(),this.rotationMatrix=l.create$2(),l.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},jt.pitch.get=function(){return this._pitch/Math.PI*180},jt.pitch.set=function(i){var o=l.clamp(i,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==o&&(this._unmodified=!1,this._pitch=o,this._calcMatrices())},jt.fov.get=function(){return this._fov/Math.PI*180},jt.fov.set=function(i){i=Math.max(.01,Math.min(60,i)),this._fov!==i&&(this._unmodified=!1,this._fov=i/180*Math.PI,this._calcMatrices())},jt.zoom.get=function(){return this._zoom},jt.zoom.set=function(i){var o=Math.min(Math.max(i,this.minZoom),this.maxZoom);this._zoom!==o&&(this._unmodified=!1,this._zoom=o,this.scale=this.zoomScale(o),this.tileZoom=Math.floor(o),this.zoomFraction=o-this.tileZoom,this._constrain(),this._calcMatrices())},jt.center.get=function(){return this._center},jt.center.set=function(i){i.lat===this._center.lat&&i.lng===this._center.lng||(this._unmodified=!1,this._center=i,this._constrain(),this._calcMatrices())},jt.padding.get=function(){return this._edgeInsets.toJSON()},jt.padding.set=function(i){this._edgeInsets.equals(i)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,i,1),this._calcMatrices())},jt.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},gt.prototype.isPaddingEqual=function(i){return this._edgeInsets.equals(i)},gt.prototype.interpolatePadding=function(i,o,n){this._unmodified=!1,this._edgeInsets.interpolate(i,o,n),this._constrain(),this._calcMatrices()},gt.prototype.coveringZoomLevel=function(i){var o=(i.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/i.tileSize));return Math.max(0,o)},gt.prototype.getVisibleUnwrappedCoordinates=function(i){var o=[new l.UnwrappedTileID(0,i)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new l.Point(0,0)),s=this.pointCoordinate(new l.Point(this.width,0)),p=this.pointCoordinate(new l.Point(this.width,this.height)),m=this.pointCoordinate(new l.Point(0,this.height)),y=Math.floor(Math.min(n.x,s.x,p.x,m.x)),g=Math.floor(Math.max(n.x,s.x,p.x,m.x)),w=y-1;w<=g+1;w++)w!==0&&o.push(new l.UnwrappedTileID(w,i));return o},gt.prototype.coveringTiles=function(i){var o=this.coveringZoomLevel(i),n=o;if(i.minzoom!==void 0&&o<i.minzoom)return[];i.maxzoom!==void 0&&o>i.maxzoom&&(o=i.maxzoom);var s=l.MercatorCoordinate.fromLngLat(this.center),p=Math.pow(2,o),m=[p*s.x,p*s.y,0],y=xs.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,o),g=i.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(g=o);var w=function(Se){return{aabb:new fo([Se*p,0,0],[(Se+1)*p,p,0]),zoom:0,x:0,y:0,wrap:Se,fullyVisible:!1}},A=[],B=[],L=o,R=i.reparseOverscaled?n:o;if(this._renderWorldCopies)for(var Z=1;Z<=3;Z++)A.push(w(-Z)),A.push(w(Z));for(A.push(w(0));A.length>0;){var j=A.pop(),K=j.x,U=j.y,X=j.fullyVisible;if(!X){var Q=j.aabb.intersects(y);if(Q===0)continue;X=Q===2}var ie=j.aabb.distanceX(m),ce=j.aabb.distanceY(m),le=Math.max(Math.abs(ie),Math.abs(ce));if(j.zoom===L||le>3+(1<<L-j.zoom)-2&&j.zoom>=g)B.push({tileID:new l.OverscaledTileID(j.zoom===L?R:j.zoom,j.wrap,j.zoom,K,U),distanceSq:l.sqrLen([m[0]-.5-K,m[1]-.5-U])});else for(var he=0;he<4;he++){var ge=(K<<1)+he%2,Te=(U<<1)+(he>>1);A.push({aabb:j.aabb.quadrant(he),zoom:j.zoom+1,x:ge,y:Te,wrap:j.wrap,fullyVisible:X})}}return B.sort(function(Se,Le){return Se.distanceSq-Le.distanceSq}).map(function(Se){return Se.tileID})},gt.prototype.resize=function(i,o){this.width=i,this.height=o,this.pixelsToGLUnits=[2/i,-2/o],this._constrain(),this._calcMatrices()},jt.unmodified.get=function(){return this._unmodified},gt.prototype.zoomScale=function(i){return Math.pow(2,i)},gt.prototype.scaleZoom=function(i){return Math.log(i)/Math.LN2},gt.prototype.project=function(i){var o=l.clamp(i.lat,-this.maxValidLatitude,this.maxValidLatitude);return new l.Point(l.mercatorXfromLng(i.lng)*this.worldSize,l.mercatorYfromLat(o)*this.worldSize)},gt.prototype.unproject=function(i){return new l.MercatorCoordinate(i.x/this.worldSize,i.y/this.worldSize).toLngLat()},jt.point.get=function(){return this.project(this.center)},gt.prototype.setLocationAtPoint=function(i,o){var n=this.pointCoordinate(o),s=this.pointCoordinate(this.centerPoint),p=this.locationCoordinate(i),m=new l.MercatorCoordinate(p.x-(n.x-s.x),p.y-(n.y-s.y));this.center=this.coordinateLocation(m),this._renderWorldCopies&&(this.center=this.center.wrap())},gt.prototype.locationPoint=function(i){return this.coordinatePoint(this.locationCoordinate(i))},gt.prototype.pointLocation=function(i){return this.coordinateLocation(this.pointCoordinate(i))},gt.prototype.locationCoordinate=function(i){return l.MercatorCoordinate.fromLngLat(i)},gt.prototype.coordinateLocation=function(i){return i.toLngLat()},gt.prototype.pointCoordinate=function(i){var o=[i.x,i.y,0,1],n=[i.x,i.y,1,1];l.transformMat4(o,o,this.pixelMatrixInverse),l.transformMat4(n,n,this.pixelMatrixInverse);var s=o[3],p=n[3],m=o[1]/s,y=n[1]/p,g=o[2]/s,w=n[2]/p,A=g===w?0:(0-g)/(w-g);return new l.MercatorCoordinate(l.number(o[0]/s,n[0]/p,A)/this.worldSize,l.number(m,y,A)/this.worldSize)},gt.prototype.coordinatePoint=function(i){var o=[i.x*this.worldSize,i.y*this.worldSize,0,1];return l.transformMat4(o,o,this.pixelMatrix),new l.Point(o[0]/o[3],o[1]/o[3])},gt.prototype.getBounds=function(){return new l.LngLatBounds().extend(this.pointLocation(new l.Point(0,0))).extend(this.pointLocation(new l.Point(this.width,0))).extend(this.pointLocation(new l.Point(this.width,this.height))).extend(this.pointLocation(new l.Point(0,this.height)))},gt.prototype.getMaxBounds=function(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new l.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},gt.prototype.setMaxBounds=function(i){i?(this.lngRange=[i.getWest(),i.getEast()],this.latRange=[i.getSouth(),i.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},gt.prototype.calculatePosMatrix=function(i,o){o===void 0&&(o=!1);var n=i.key,s=o?this._alignedPosMatrixCache:this._posMatrixCache;if(s[n])return s[n];var p=i.canonical,m=this.worldSize/this.zoomScale(p.z),y=p.x+Math.pow(2,p.z)*i.wrap,g=l.identity(new Float64Array(16));return l.translate(g,g,[y*m,p.y*m,0]),l.scale(g,g,[m/l.EXTENT,m/l.EXTENT,1]),l.multiply(g,o?this.alignedProjMatrix:this.projMatrix,g),s[n]=new Float32Array(g),s[n]},gt.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},gt.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var i,o,n,s,p=-90,m=90,y=-180,g=180,w=this.size,A=this._unmodified;if(this.latRange){var B=this.latRange;p=l.mercatorYfromLat(B[1])*this.worldSize,i=(m=l.mercatorYfromLat(B[0])*this.worldSize)-p<w.y?w.y/(m-p):0}if(this.lngRange){var L=this.lngRange;y=l.mercatorXfromLng(L[0])*this.worldSize,o=(g=l.mercatorXfromLng(L[1])*this.worldSize)-y<w.x?w.x/(g-y):0}var R=this.point,Z=Math.max(o||0,i||0);if(Z)return this.center=this.unproject(new l.Point(o?(g+y)/2:R.x,i?(m+p)/2:R.y)),this.zoom+=this.scaleZoom(Z),this._unmodified=A,void(this._constraining=!1);if(this.latRange){var j=R.y,K=w.y/2;j-K<p&&(s=p+K),j+K>m&&(s=m-K)}if(this.lngRange){var U=R.x,X=w.x/2;U-X<y&&(n=y+X),U+X>g&&(n=g-X)}n===void 0&&s===void 0||(this.center=this.unproject(new l.Point(n!==void 0?n:R.x,s!==void 0?s:R.y))),this._unmodified=A,this._constraining=!1}},gt.prototype._calcMatrices=function(){if(this.height){var i=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var o=Math.PI/2+this._pitch,n=this._fov*(.5+i.y/this.height),s=Math.sin(n)*this.cameraToCenterDistance/Math.sin(l.clamp(Math.PI-o-n,.01,Math.PI-.01)),p=this.point,m=p.x,y=p.y,g=1.01*(Math.cos(Math.PI/2-this._pitch)*s+this.cameraToCenterDistance),w=this.height/50,A=new Float64Array(16);l.perspective(A,this._fov,this.width/this.height,w,g),A[8]=2*-i.x/this.width,A[9]=2*i.y/this.height,l.scale(A,A,[1,-1,1]),l.translate(A,A,[0,0,-this.cameraToCenterDistance]),l.rotateX(A,A,this._pitch),l.rotateZ(A,A,this.angle),l.translate(A,A,[-m,-y,0]),this.mercatorMatrix=l.scale([],A,[this.worldSize,this.worldSize,this.worldSize]),l.scale(A,A,[1,1,l.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=A,this.invProjMatrix=l.invert([],this.projMatrix);var B=this.width%2/2,L=this.height%2/2,R=Math.cos(this.angle),Z=Math.sin(this.angle),j=m-Math.round(m)+R*B+Z*L,K=y-Math.round(y)+R*L+Z*B,U=new Float64Array(A);if(l.translate(U,U,[j>.5?j-1:j,K>.5?K-1:K,0]),this.alignedProjMatrix=U,A=l.create(),l.scale(A,A,[this.width/2,-this.height/2,1]),l.translate(A,A,[1,-1,0]),this.labelPlaneMatrix=A,A=l.create(),l.scale(A,A,[1,-1,1]),l.translate(A,A,[-1,-1,0]),l.scale(A,A,[2/this.width,2/this.height,1]),this.glCoordMatrix=A,this.pixelMatrix=l.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(A=l.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=A,this._posMatrixCache={},this._alignedPosMatrixCache={}}},gt.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var i=this.pointCoordinate(new l.Point(0,0)),o=[i.x*this.worldSize,i.y*this.worldSize,0,1];return l.transformMat4(o,o,this.pixelMatrix)[3]/this.cameraToCenterDistance},gt.prototype.getCameraPoint=function(){var i=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new l.Point(0,i))},gt.prototype.getCameraQueryGeometry=function(i){var o=this.getCameraPoint();if(i.length===1)return[i[0],o];for(var n=o.x,s=o.y,p=o.x,m=o.y,y=0,g=i;y<g.length;y+=1){var w=g[y];n=Math.min(n,w.x),s=Math.min(s,w.y),p=Math.max(p,w.x),m=Math.max(m,w.y)}return[new l.Point(n,s),new l.Point(p,s),new l.Point(p,m),new l.Point(n,m),new l.Point(n,s)]},Object.defineProperties(gt.prototype,jt);var gi=function(i){var o,n,s,p;this._hashName=i&&encodeURIComponent(i),l.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(o=this._updateHashUnthrottled.bind(this),n=!1,s=null,p=function(){s=null,n&&(o(),s=setTimeout(p,300),n=!1)},function(){return n=!0,s||p(),s})};gi.prototype.addTo=function(i){return this._map=i,l.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},gi.prototype.remove=function(){return l.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},gi.prototype.getHashString=function(i){var o=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,s=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),p=Math.pow(10,s),m=Math.round(o.lng*p)/p,y=Math.round(o.lat*p)/p,g=this._map.getBearing(),w=this._map.getPitch(),A="";if(A+=i?"/"+m+"/"+y+"/"+n:n+"/"+y+"/"+m,(g||w)&&(A+="/"+Math.round(10*g)/10),w&&(A+="/"+Math.round(w)),this._hashName){var B=this._hashName,L=!1,R=l.window.location.hash.slice(1).split("&").map(function(Z){var j=Z.split("=")[0];return j===B?(L=!0,j+"="+A):Z}).filter(function(Z){return Z});return L||R.push(B+"="+A),"#"+R.join("&")}return"#"+A},gi.prototype._getCurrentHash=function(){var i,o=this,n=l.window.location.hash.replace("#","");return this._hashName?(n.split("&").map(function(s){return s.split("=")}).forEach(function(s){s[0]===o._hashName&&(i=s)}),(i&&i[1]||"").split("/")):n.split("/")},gi.prototype._onHashChange=function(){var i=this._getCurrentHash();if(i.length>=3&&!i.some(function(n){return isNaN(n)})){var o=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(i[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+i[2],+i[1]],zoom:+i[0],bearing:o,pitch:+(i[4]||0)}),!0}return!1},gi.prototype._updateHashUnthrottled=function(){var i=l.window.location.href.replace(/(#.+)?$/,this.getHashString());try{l.window.history.replaceState(l.window.history.state,null,i)}catch{}};var Ca={linearity:.3,easing:l.bezier(0,0,.3,1)},Wo=l.extend({deceleration:2500,maxSpeed:1400},Ca),ka=l.extend({deceleration:20,maxSpeed:1400},Ca),qp=l.extend({deceleration:1e3,maxSpeed:360},Ca),Gp=l.extend({deceleration:1e3,maxSpeed:90},Ca),Ma=function(i){this._map=i,this.clear()};function za(i,o){(!i.duration||i.duration<o.duration)&&(i.duration=o.duration,i.easing=o.easing)}function hn(i,o,n){var s=n.maxSpeed,p=n.linearity,m=n.deceleration,y=l.clamp(i*p/(o/1e3),-s,s),g=Math.abs(y)/(m*p);return{easing:n.easing,duration:1e3*g,amount:y*(g/2)}}Ma.prototype.clear=function(){this._inertiaBuffer=[]},Ma.prototype.record=function(i){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:l.browser.now(),settings:i})},Ma.prototype._drainInertiaBuffer=function(){for(var i=this._inertiaBuffer,o=l.browser.now();i.length>0&&o-i[0].time>160;)i.shift()},Ma.prototype._onMoveEnd=function(i){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var o={zoom:0,bearing:0,pitch:0,pan:new l.Point(0,0),pinchAround:void 0,around:void 0},n=0,s=this._inertiaBuffer;n<s.length;n+=1){var p=s[n].settings;o.zoom+=p.zoomDelta||0,o.bearing+=p.bearingDelta||0,o.pitch+=p.pitchDelta||0,p.panDelta&&o.pan._add(p.panDelta),p.around&&(o.around=p.around),p.pinchAround&&(o.pinchAround=p.pinchAround)}var m=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,y={};if(o.pan.mag()){var g=hn(o.pan.mag(),m,l.extend({},Wo,i||{}));y.offset=o.pan.mult(g.amount/o.pan.mag()),y.center=this._map.transform.center,za(y,g)}if(o.zoom){var w=hn(o.zoom,m,ka);y.zoom=this._map.transform.zoom+w.amount,za(y,w)}if(o.bearing){var A=hn(o.bearing,m,qp);y.bearing=this._map.transform.bearing+l.clamp(A.amount,-179,179),za(y,A)}if(o.pitch){var B=hn(o.pitch,m,Gp);y.pitch=this._map.transform.pitch+B.amount,za(y,B)}if(y.zoom||y.bearing){var L=o.pinchAround===void 0?o.around:o.pinchAround;y.around=L?this._map.unproject(L):this._map.getCenter()}return this.clear(),l.extend(y,{noMoveStart:!0})}};var gr=function(i){function o(s,p,m,y){y===void 0&&(y={});var g=G.mousePos(p.getCanvasContainer(),m),w=p.unproject(g);i.call(this,s,l.extend({point:g,lngLat:w,originalEvent:m},y)),this._defaultPrevented=!1,this.target=p}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={defaultPrevented:{configurable:!0}};return o.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(o.prototype,n),o}(l.Event),Ba=function(i){function o(s,p,m){var y=s==="touchend"?m.changedTouches:m.touches,g=G.touchPos(p.getCanvasContainer(),y),w=g.map(function(L){return p.unproject(L)}),A=g.reduce(function(L,R,Z,j){return L.add(R.div(j.length))},new l.Point(0,0)),B=p.unproject(A);i.call(this,s,{points:g,point:A,lngLats:w,lngLat:B,originalEvent:m}),this._defaultPrevented=!1}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={defaultPrevented:{configurable:!0}};return o.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(o.prototype,n),o}(l.Event),ac=function(i){function o(s,p,m){i.call(this,s,{originalEvent:m}),this._defaultPrevented=!1}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={defaultPrevented:{configurable:!0}};return o.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(o.prototype,n),o}(l.Event),yr=function(i,o){this._map=i,this._clickTolerance=o.clickTolerance};yr.prototype.reset=function(){delete this._mousedownPos},yr.prototype.wheel=function(i){return this._firePreventable(new ac(i.type,this._map,i))},yr.prototype.mousedown=function(i,o){return this._mousedownPos=o,this._firePreventable(new gr(i.type,this._map,i))},yr.prototype.mouseup=function(i){this._map.fire(new gr(i.type,this._map,i))},yr.prototype.click=function(i,o){this._mousedownPos&&this._mousedownPos.dist(o)>=this._clickTolerance||this._map.fire(new gr(i.type,this._map,i))},yr.prototype.dblclick=function(i){return this._firePreventable(new gr(i.type,this._map,i))},yr.prototype.mouseover=function(i){this._map.fire(new gr(i.type,this._map,i))},yr.prototype.mouseout=function(i){this._map.fire(new gr(i.type,this._map,i))},yr.prototype.touchstart=function(i){return this._firePreventable(new Ba(i.type,this._map,i))},yr.prototype.touchmove=function(i){this._map.fire(new Ba(i.type,this._map,i))},yr.prototype.touchend=function(i){this._map.fire(new Ba(i.type,this._map,i))},yr.prototype.touchcancel=function(i){this._map.fire(new Ba(i.type,this._map,i))},yr.prototype._firePreventable=function(i){if(this._map.fire(i),i.defaultPrevented)return{}},yr.prototype.isEnabled=function(){return!0},yr.prototype.isActive=function(){return!1},yr.prototype.enable=function(){},yr.prototype.disable=function(){};var Oe=function(i){this._map=i};Oe.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Oe.prototype.mousemove=function(i){this._map.fire(new gr(i.type,this._map,i))},Oe.prototype.mousedown=function(){this._delayContextMenu=!0},Oe.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new gr("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Oe.prototype.contextmenu=function(i){this._delayContextMenu?this._contextMenuEvent=i:this._map.fire(new gr(i.type,this._map,i)),this._map.listens("contextmenu")&&i.preventDefault()},Oe.prototype.isEnabled=function(){return!0},Oe.prototype.isActive=function(){return!1},Oe.prototype.enable=function(){},Oe.prototype.disable=function(){};var ci=function(i,o){this._map=i,this._el=i.getCanvasContainer(),this._container=i.getContainer(),this._clickTolerance=o.clickTolerance||1};function bs(i,o){for(var n={},s=0;s<i.length;s++)n[i[s].identifier]=o[s];return n}ci.prototype.isEnabled=function(){return!!this._enabled},ci.prototype.isActive=function(){return!!this._active},ci.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},ci.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ci.prototype.mousedown=function(i,o){this.isEnabled()&&i.shiftKey&&i.button===0&&(G.disableDrag(),this._startPos=this._lastPos=o,this._active=!0)},ci.prototype.mousemoveWindow=function(i,o){if(this._active){var n=o;if(!(this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)){var s=this._startPos;this._lastPos=n,this._box||(this._box=G.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",i));var p=Math.min(s.x,n.x),m=Math.max(s.x,n.x),y=Math.min(s.y,n.y),g=Math.max(s.y,n.y);G.setTransform(this._box,"translate("+p+"px,"+y+"px)"),this._box.style.width=m-p+"px",this._box.style.height=g-y+"px"}}},ci.prototype.mouseupWindow=function(i,o){var n=this;if(this._active&&i.button===0){var s=this._startPos,p=o;if(this.reset(),G.suppressClick(),s.x!==p.x||s.y!==p.y)return this._map.fire(new l.Event("boxzoomend",{originalEvent:i})),{cameraAnimation:function(m){return m.fitScreenCoordinates(s,p,n._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",i)}},ci.prototype.keydown=function(i){this._active&&i.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",i))},ci.prototype.blur=function(){this.reset()},ci.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(G.remove(this._box),this._box=null),G.enableDrag(),delete this._startPos,delete this._lastPos},ci.prototype._fireEvent=function(i,o){return this._map.fire(new l.Event(i,{originalEvent:o}))};var Ho=function(i){this.reset(),this.numTouches=i.numTouches};Ho.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Ho.prototype.touchstart=function(i,o,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=i.timeStamp),n.length===this.numTouches&&(this.centroid=function(s){for(var p=new l.Point(0,0),m=0,y=s;m<y.length;m+=1)p._add(y[m]);return p.div(s.length)}(o),this.touches=bs(n,o)))},Ho.prototype.touchmove=function(i,o,n){if(!this.aborted&&this.centroid){var s=bs(n,o);for(var p in this.touches){var m=s[p];(!m||m.dist(this.touches[p])>30)&&(this.aborted=!0)}}},Ho.prototype.touchend=function(i,o,n){if((!this.centroid||i.timeStamp-this.startTime>500)&&(this.aborted=!0),n.length===0){var s=!this.aborted&&this.centroid;if(this.reset(),s)return s}};var qi=function(i){this.singleTap=new Ho(i),this.numTaps=i.numTaps,this.reset()};qi.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},qi.prototype.touchstart=function(i,o,n){this.singleTap.touchstart(i,o,n)},qi.prototype.touchmove=function(i,o,n){this.singleTap.touchmove(i,o,n)},qi.prototype.touchend=function(i,o,n){var s=this.singleTap.touchend(i,o,n);if(s){var p=i.timeStamp-this.lastTime<500,m=!this.lastTap||this.lastTap.dist(s)<30;if(p&&m||this.reset(),this.count++,this.lastTime=i.timeStamp,this.lastTap=s,this.count===this.numTaps)return this.reset(),s}};var pi=function(){this._zoomIn=new qi({numTouches:1,numTaps:2}),this._zoomOut=new qi({numTouches:2,numTaps:1}),this.reset()};pi.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},pi.prototype.touchstart=function(i,o,n){this._zoomIn.touchstart(i,o,n),this._zoomOut.touchstart(i,o,n)},pi.prototype.touchmove=function(i,o,n){this._zoomIn.touchmove(i,o,n),this._zoomOut.touchmove(i,o,n)},pi.prototype.touchend=function(i,o,n){var s=this,p=this._zoomIn.touchend(i,o,n),m=this._zoomOut.touchend(i,o,n);return p?(this._active=!0,i.preventDefault(),setTimeout(function(){return s.reset()},0),{cameraAnimation:function(y){return y.easeTo({duration:300,zoom:y.getZoom()+1,around:y.unproject(p)},{originalEvent:i})}}):m?(this._active=!0,i.preventDefault(),setTimeout(function(){return s.reset()},0),{cameraAnimation:function(y){return y.easeTo({duration:300,zoom:y.getZoom()-1,around:y.unproject(m)},{originalEvent:i})}}):void 0},pi.prototype.touchcancel=function(){this.reset()},pi.prototype.enable=function(){this._enabled=!0},pi.prototype.disable=function(){this._enabled=!1,this.reset()},pi.prototype.isEnabled=function(){return this._enabled},pi.prototype.isActive=function(){return this._active};var Ll={0:1,2:2},Ee=function(i){this.reset(),this._clickTolerance=i.clickTolerance||1};Ee.prototype.blur=function(){this.reset()},Ee.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Ee.prototype._correctButton=function(i,o){return!1},Ee.prototype._move=function(i,o){return{}},Ee.prototype.mousedown=function(i,o){if(!this._lastPoint){var n=G.mouseButton(i);this._correctButton(i,n)&&(this._lastPoint=o,this._eventButton=n)}},Ee.prototype.mousemoveWindow=function(i,o){var n=this._lastPoint;if(n){if(i.preventDefault(),function(s,p){var m=Ll[p];return s.buttons===void 0||(s.buttons&m)!==m}(i,this._eventButton))this.reset();else if(this._moved||!(o.dist(n)<this._clickTolerance))return this._moved=!0,this._lastPoint=o,this._move(n,o)}},Ee.prototype.mouseupWindow=function(i){this._lastPoint&&G.mouseButton(i)===this._eventButton&&(this._moved&&G.suppressClick(),this.reset())},Ee.prototype.enable=function(){this._enabled=!0},Ee.prototype.disable=function(){this._enabled=!1,this.reset()},Ee.prototype.isEnabled=function(){return this._enabled},Ee.prototype.isActive=function(){return this._active};var Rl=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.mousedown=function(n,s){i.prototype.mousedown.call(this,n,s),this._lastPoint&&(this._active=!0)},o.prototype._correctButton=function(n,s){return s===0&&!n.ctrlKey},o.prototype._move=function(n,s){return{around:s,panDelta:s.sub(n)}},o}(Ee),ws=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype._correctButton=function(n,s){return s===0&&n.ctrlKey||s===2},o.prototype._move=function(n,s){var p=.8*(s.x-n.x);if(p)return this._active=!0,{bearingDelta:p}},o.prototype.contextmenu=function(n){n.preventDefault()},o}(Ee),Fl=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype._correctButton=function(n,s){return s===0&&n.ctrlKey||s===2},o.prototype._move=function(n,s){var p=-.5*(s.y-n.y);if(p)return this._active=!0,{pitchDelta:p}},o.prototype.contextmenu=function(n){n.preventDefault()},o}(Ee),Mi=function(i){this._minTouches=1,this._clickTolerance=i.clickTolerance||1,this.reset()};Mi.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new l.Point(0,0)},Mi.prototype.touchstart=function(i,o,n){return this._calculateTransform(i,o,n)},Mi.prototype.touchmove=function(i,o,n){if(this._active&&!(n.length<this._minTouches))return i.preventDefault(),this._calculateTransform(i,o,n)},Mi.prototype.touchend=function(i,o,n){this._calculateTransform(i,o,n),this._active&&n.length<this._minTouches&&this.reset()},Mi.prototype.touchcancel=function(){this.reset()},Mi.prototype._calculateTransform=function(i,o,n){n.length>0&&(this._active=!0);var s=bs(n,o),p=new l.Point(0,0),m=new l.Point(0,0),y=0;for(var g in s){var w=s[g],A=this._touches[g];A&&(p._add(w),m._add(w.sub(A)),y++,s[g]=w)}if(this._touches=s,!(y<this._minTouches)&&m.mag()){var B=m.div(y);if(this._sum._add(B),!(this._sum.mag()<this._clickTolerance))return{around:p.div(y),panDelta:B}}},Mi.prototype.enable=function(){this._enabled=!0},Mi.prototype.disable=function(){this._enabled=!1,this.reset()},Mi.prototype.isEnabled=function(){return this._enabled},Mi.prototype.isActive=function(){return this._active};var hi=function(){this.reset()};function Ss(i,o,n){for(var s=0;s<i.length;s++)if(i[s].identifier===n)return o[s]}function Ts(i,o){return Math.log(i/o)/Math.LN2}hi.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},hi.prototype._start=function(i){},hi.prototype._move=function(i,o,n){return{}},hi.prototype.touchstart=function(i,o,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([o[0],o[1]]))},hi.prototype.touchmove=function(i,o,n){if(this._firstTwoTouches){i.preventDefault();var s=this._firstTwoTouches,p=s[1],m=Ss(n,o,s[0]),y=Ss(n,o,p);if(m&&y){var g=this._aroundCenter?null:m.add(y).div(2);return this._move([m,y],g,i)}}},hi.prototype.touchend=function(i,o,n){if(this._firstTwoTouches){var s=this._firstTwoTouches,p=s[1],m=Ss(n,o,s[0]),y=Ss(n,o,p);m&&y||(this._active&&G.suppressClick(),this.reset())}},hi.prototype.touchcancel=function(){this.reset()},hi.prototype.enable=function(i){this._enabled=!0,this._aroundCenter=!!i&&i.around==="center"},hi.prototype.disable=function(){this._enabled=!1,this.reset()},hi.prototype.isEnabled=function(){return this._enabled},hi.prototype.isActive=function(){return this._active};var fi=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.reset=function(){i.prototype.reset.call(this),delete this._distance,delete this._startDistance},o.prototype._start=function(n){this._startDistance=this._distance=n[0].dist(n[1])},o.prototype._move=function(n,s){var p=this._distance;if(this._distance=n[0].dist(n[1]),this._active||!(Math.abs(Ts(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Ts(this._distance,p),pinchAround:s}},o}(hi);function fn(i,o){return 180*i.angleWith(o)/Math.PI}var sc=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.reset=function(){i.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},o.prototype._start=function(n){this._startVector=this._vector=n[0].sub(n[1]),this._minDiameter=n[0].dist(n[1])},o.prototype._move=function(n,s){var p=this._vector;if(this._vector=n[0].sub(n[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:fn(this._vector,p),pinchAround:s}},o.prototype._isBelowThreshold=function(n){this._minDiameter=Math.min(this._minDiameter,n.mag());var s=25/(Math.PI*this._minDiameter)*360,p=fn(n,this._startVector);return Math.abs(p)<s},o}(hi);function Da(i){return Math.abs(i.y)>Math.abs(i.x)}var Ol=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.reset=function(){i.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},o.prototype._start=function(n){this._lastPoints=n,Da(n[0].sub(n[1]))&&(this._valid=!1)},o.prototype._move=function(n,s,p){var m=n[0].sub(this._lastPoints[0]),y=n[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(m,y,p.timeStamp),this._valid)return this._lastPoints=n,this._active=!0,{pitchDelta:(m.y+y.y)/2*-.5}},o.prototype.gestureBeginsVertically=function(n,s,p){if(this._valid!==void 0)return this._valid;var m=n.mag()>=2,y=s.mag()>=2;if(m||y){if(!m||!y)return this._firstMove===void 0&&(this._firstMove=p),p-this._firstMove<100&&void 0;var g=n.y>0==s.y>0;return Da(n)&&Da(s)&&g}},o}(hi),Vl={panStep:100,bearingStep:15,pitchStep:10},Gi=function(){var i=Vl;this._panStep=i.panStep,this._bearingStep=i.bearingStep,this._pitchStep=i.pitchStep,this._rotationDisabled=!1};function _i(i){return i*(2-i)}Gi.prototype.blur=function(){this.reset()},Gi.prototype.reset=function(){this._active=!1},Gi.prototype.keydown=function(i){var o=this;if(!(i.altKey||i.ctrlKey||i.metaKey)){var n=0,s=0,p=0,m=0,y=0;switch(i.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:i.shiftKey?s=-1:(i.preventDefault(),m=-1);break;case 39:i.shiftKey?s=1:(i.preventDefault(),m=1);break;case 38:i.shiftKey?p=1:(i.preventDefault(),y=-1);break;case 40:i.shiftKey?p=-1:(i.preventDefault(),y=1);break;default:return}return this._rotationDisabled&&(s=0,p=0),{cameraAnimation:function(g){var w=g.getZoom();g.easeTo({duration:300,easeId:"keyboardHandler",easing:_i,zoom:n?Math.round(w)+n*(i.shiftKey?2:1):w,bearing:g.getBearing()+s*o._bearingStep,pitch:g.getPitch()+p*o._pitchStep,offset:[-m*o._panStep,-y*o._panStep],center:g.getCenter()},{originalEvent:i})}}}},Gi.prototype.enable=function(){this._enabled=!0},Gi.prototype.disable=function(){this._enabled=!1,this.reset()},Gi.prototype.isEnabled=function(){return this._enabled},Gi.prototype.isActive=function(){return this._active},Gi.prototype.disableRotation=function(){this._rotationDisabled=!0},Gi.prototype.enableRotation=function(){this._rotationDisabled=!1};var ht=function(i,o){this._map=i,this._el=i.getCanvasContainer(),this._handler=o,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,l.bindAll(["_onTimeout"],this)};ht.prototype.setZoomRate=function(i){this._defaultZoomRate=i},ht.prototype.setWheelZoomRate=function(i){this._wheelZoomRate=i},ht.prototype.isEnabled=function(){return!!this._enabled},ht.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},ht.prototype.isZooming=function(){return!!this._zooming},ht.prototype.enable=function(i){this.isEnabled()||(this._enabled=!0,this._aroundCenter=i&&i.around==="center")},ht.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ht.prototype.wheel=function(i){if(this.isEnabled()){var o=i.deltaMode===l.window.WheelEvent.DOM_DELTA_LINE?40*i.deltaY:i.deltaY,n=l.browser.now(),s=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,o!==0&&o%4.000244140625==0?this._type="wheel":o!==0&&Math.abs(o)<4?this._type="trackpad":s>400?(this._type=null,this._lastValue=o,this._timeout=setTimeout(this._onTimeout,40,i)):this._type||(this._type=Math.abs(s*o)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,o+=this._lastValue)),i.shiftKey&&o&&(o/=4),this._type&&(this._lastWheelEvent=i,this._delta-=o,this._active||this._start(i)),i.preventDefault()}},ht.prototype._onTimeout=function(i){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(i)},ht.prototype._start=function(i){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var o=G.mousePos(this._el,i);this._around=l.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(o)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},ht.prototype.renderFrame=function(){var i=this;if(this._frameId&&(this._frameId=null,this.isActive())){var o=this._map.transform;if(this._delta!==0){var n=this._type==="wheel"&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,s=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&s!==0&&(s=1/s);var p=typeof this._targetZoom=="number"?o.zoomScale(this._targetZoom):o.scale;this._targetZoom=Math.min(o.maxZoom,Math.max(o.minZoom,o.scaleZoom(p*s))),this._type==="wheel"&&(this._startZoom=o.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var m,y=typeof this._targetZoom=="number"?this._targetZoom:o.zoom,g=this._startZoom,w=this._easing,A=!1;if(this._type==="wheel"&&g&&w){var B=Math.min((l.browser.now()-this._lastWheelEventTime)/200,1),L=w(B);m=l.number(g,y,L),B<1?this._frameId||(this._frameId=!0):A=!0}else m=y,A=!0;return this._active=!0,A&&(this._active=!1,this._finishTimeout=setTimeout(function(){i._zooming=!1,i._handler._triggerRenderFrame(),delete i._targetZoom,delete i._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!A,zoomDelta:m-o.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},ht.prototype._smoothOutEasing=function(i){var o=l.ease;if(this._prevEase){var n=this._prevEase,s=(l.browser.now()-n.start)/n.duration,p=n.easing(s+.01)-n.easing(s),m=.27/Math.sqrt(p*p+1e-4)*.01,y=Math.sqrt(.0729-m*m);o=l.bezier(m,y,.25,1)}return this._prevEase={start:l.browser.now(),duration:i,easing:o},o},ht.prototype.blur=function(){this.reset()},ht.prototype.reset=function(){this._active=!1};var Qi=function(i,o){this._clickZoom=i,this._tapZoom=o};Qi.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Qi.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Qi.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Qi.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var zi=function(){this.reset()};zi.prototype.reset=function(){this._active=!1},zi.prototype.blur=function(){this.reset()},zi.prototype.dblclick=function(i,o){return i.preventDefault(),{cameraAnimation:function(n){n.easeTo({duration:300,zoom:n.getZoom()+(i.shiftKey?-1:1),around:n.unproject(o)},{originalEvent:i})}}},zi.prototype.enable=function(){this._enabled=!0},zi.prototype.disable=function(){this._enabled=!1,this.reset()},zi.prototype.isEnabled=function(){return this._enabled},zi.prototype.isActive=function(){return this._active};var Or=function(){this._tap=new qi({numTouches:1,numTaps:1}),this.reset()};Or.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},Or.prototype.touchstart=function(i,o,n){this._swipePoint||(this._tapTime&&i.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?n.length>0&&(this._swipePoint=o[0],this._swipeTouch=n[0].identifier):this._tap.touchstart(i,o,n))},Or.prototype.touchmove=function(i,o,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;var s=o[0],p=s.y-this._swipePoint.y;return this._swipePoint=s,i.preventDefault(),this._active=!0,{zoomDelta:p/128}}}else this._tap.touchmove(i,o,n)},Or.prototype.touchend=function(i,o,n){this._tapTime?this._swipePoint&&n.length===0&&this.reset():this._tap.touchend(i,o,n)&&(this._tapTime=i.timeStamp)},Or.prototype.touchcancel=function(){this.reset()},Or.prototype.enable=function(){this._enabled=!0},Or.prototype.disable=function(){this._enabled=!1,this.reset()},Or.prototype.isEnabled=function(){return this._enabled},Or.prototype.isActive=function(){return this._active};var mo=function(i,o,n){this._el=i,this._mousePan=o,this._touchPan=n};mo.prototype.enable=function(i){this._inertiaOptions=i||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},mo.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},mo.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},mo.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var Bn=function(i,o,n){this._pitchWithRotate=i.pitchWithRotate,this._mouseRotate=o,this._mousePitch=n};Bn.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},Bn.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},Bn.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},Bn.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var Zi=function(i,o,n,s){this._el=i,this._touchZoom=o,this._touchRotate=n,this._tapDragZoom=s,this._rotationDisabled=!1,this._enabled=!0};Zi.prototype.enable=function(i){this._touchZoom.enable(i),this._rotationDisabled||this._touchRotate.enable(i),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},Zi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},Zi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},Zi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},Zi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},Zi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Wr=function(i){return i.zoom||i.drag||i.pitch||i.rotate},La=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o}(l.Event);function qe(i){return i.panDelta&&i.panDelta.mag()||i.zoomDelta||i.bearingDelta||i.pitchDelta}var Ue=function(i,o){this._map=i,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ma(i),this._bearingSnap=o.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(o),l.bindAll(["handleEvent","handleWindowEvent"],this);var n=this._el;this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[l.window.document,"mousemove",{capture:!0}],[l.window.document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[l.window,"blur",void 0]];for(var s=0,p=this._listeners;s<p.length;s+=1){var m=p[s],y=m[0];G.addEventListener(y,m[1],y===l.window.document?this.handleWindowEvent:this.handleEvent,m[2])}};Ue.prototype.destroy=function(){for(var i=0,o=this._listeners;i<o.length;i+=1){var n=o[i],s=n[0];G.removeEventListener(s,n[1],s===l.window.document?this.handleWindowEvent:this.handleEvent,n[2])}},Ue.prototype._addDefaultHandlers=function(i){var o=this._map,n=o.getCanvasContainer();this._add("mapEvent",new yr(o,i));var s=o.boxZoom=new ci(o,i);this._add("boxZoom",s);var p=new pi,m=new zi;o.doubleClickZoom=new Qi(m,p),this._add("tapZoom",p),this._add("clickZoom",m);var y=new Or;this._add("tapDragZoom",y);var g=o.touchPitch=new Ol;this._add("touchPitch",g);var w=new ws(i),A=new Fl(i);o.dragRotate=new Bn(i,w,A),this._add("mouseRotate",w,["mousePitch"]),this._add("mousePitch",A,["mouseRotate"]);var B=new Rl(i),L=new Mi(i);o.dragPan=new mo(n,B,L),this._add("mousePan",B),this._add("touchPan",L,["touchZoom","touchRotate"]);var R=new sc,Z=new fi;o.touchZoomRotate=new Zi(n,Z,R,y),this._add("touchRotate",R,["touchPan","touchZoom"]),this._add("touchZoom",Z,["touchPan","touchRotate"]);var j=o.scrollZoom=new ht(o,this);this._add("scrollZoom",j,["mousePan"]);var K=o.keyboard=new Gi;this._add("keyboard",K),this._add("blockableMapEvent",new Oe(o));for(var U=0,X=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];U<X.length;U+=1){var Q=X[U];i.interactive&&i[Q]&&o[Q].enable(i[Q])}},Ue.prototype._add=function(i,o,n){this._handlers.push({handlerName:i,handler:o,allowed:n}),this._handlersById[i]=o},Ue.prototype.stop=function(i){if(!this._updatingCamera){for(var o=0,n=this._handlers;o<n.length;o+=1)n[o].handler.reset();this._inertia.clear(),this._fireEvents({},{},i),this._changes=[]}},Ue.prototype.isActive=function(){for(var i=0,o=this._handlers;i<o.length;i+=1)if(o[i].handler.isActive())return!0;return!1},Ue.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},Ue.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},Ue.prototype.isMoving=function(){return!!Wr(this._eventsInProgress)||this.isZooming()},Ue.prototype._blockedByActive=function(i,o,n){for(var s in i)if(s!==n&&(!o||o.indexOf(s)<0))return!0;return!1},Ue.prototype.handleWindowEvent=function(i){this.handleEvent(i,i.type+"Window")},Ue.prototype._getMapTouches=function(i){for(var o=[],n=0,s=i;n<s.length;n+=1){var p=s[n];this._el.contains(p.target)&&o.push(p)}return o},Ue.prototype.handleEvent=function(i,o){this._updatingCamera=!0;for(var n=i.type==="renderFrame"?void 0:i,s={needsRenderFrame:!1},p={},m={},y=i.touches?this._getMapTouches(i.touches):void 0,g=y?G.touchPos(this._el,y):G.mousePos(this._el,i),w=0,A=this._handlers;w<A.length;w+=1){var B=A[w],L=B.handlerName,R=B.handler,Z=B.allowed;if(R.isEnabled()){var j=void 0;this._blockedByActive(m,Z,L)?R.reset():R[o||i.type]&&(j=R[o||i.type](i,g,y),this.mergeHandlerResult(s,p,j,L,n),j&&j.needsRenderFrame&&this._triggerRenderFrame()),(j||R.isActive())&&(m[L]=R)}}var K={};for(var U in this._previousActiveHandlers)m[U]||(K[U]=n);this._previousActiveHandlers=m,(Object.keys(K).length||qe(s))&&(this._changes.push([s,p,K]),this._triggerRenderFrame()),(Object.keys(m).length||qe(s))&&this._map._stop(!0),this._updatingCamera=!1;var X=s.cameraAnimation;X&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],X(this._map))},Ue.prototype.mergeHandlerResult=function(i,o,n,s,p){if(n){l.extend(i,n);var m={handlerName:s,originalEvent:n.originalEvent||p};n.zoomDelta!==void 0&&(o.zoom=m),n.panDelta!==void 0&&(o.drag=m),n.pitchDelta!==void 0&&(o.pitch=m),n.bearingDelta!==void 0&&(o.rotate=m)}},Ue.prototype._applyChanges=function(){for(var i={},o={},n={},s=0,p=this._changes;s<p.length;s+=1){var m=p[s],y=m[0],g=m[1],w=m[2];y.panDelta&&(i.panDelta=(i.panDelta||new l.Point(0,0))._add(y.panDelta)),y.zoomDelta&&(i.zoomDelta=(i.zoomDelta||0)+y.zoomDelta),y.bearingDelta&&(i.bearingDelta=(i.bearingDelta||0)+y.bearingDelta),y.pitchDelta&&(i.pitchDelta=(i.pitchDelta||0)+y.pitchDelta),y.around!==void 0&&(i.around=y.around),y.pinchAround!==void 0&&(i.pinchAround=y.pinchAround),y.noInertia&&(i.noInertia=y.noInertia),l.extend(o,g),l.extend(n,w)}this._updateMapTransform(i,o,n),this._changes=[]},Ue.prototype._updateMapTransform=function(i,o,n){var s=this._map,p=s.transform;if(!qe(i))return this._fireEvents(o,n,!0);var m=i.panDelta,y=i.zoomDelta,g=i.bearingDelta,w=i.pitchDelta,A=i.around,B=i.pinchAround;B!==void 0&&(A=B),s._stop(!0),A=A||s.transform.centerPoint;var L=p.pointLocation(m?A.sub(m):A);g&&(p.bearing+=g),w&&(p.pitch+=w),y&&(p.zoom+=y),p.setLocationAtPoint(L,A),this._map._update(),i.noInertia||this._inertia.record(i),this._fireEvents(o,n,!0)},Ue.prototype._fireEvents=function(i,o,n){var s=this,p=Wr(this._eventsInProgress),m=Wr(i),y={};for(var g in i)this._eventsInProgress[g]||(y[g+"start"]=i[g].originalEvent),this._eventsInProgress[g]=i[g];for(var w in!p&&m&&this._fireEvent("movestart",m.originalEvent),y)this._fireEvent(w,y[w]);for(var A in m&&this._fireEvent("move",m.originalEvent),i)this._fireEvent(A,i[A].originalEvent);var B,L={};for(var R in this._eventsInProgress){var Z=this._eventsInProgress[R],j=Z.handlerName,K=Z.originalEvent;this._handlersById[j].isActive()||(delete this._eventsInProgress[R],L[R+"end"]=B=o[j]||K)}for(var U in L)this._fireEvent(U,L[U]);var X=Wr(this._eventsInProgress);if(n&&(p||m)&&!X){this._updatingCamera=!0;var Q=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),ie=function(ce){return ce!==0&&-s._bearingSnap<ce&&ce<s._bearingSnap};Q?(ie(Q.bearing||this._map.getBearing())&&(Q.bearing=0),this._map.easeTo(Q,{originalEvent:B})):(this._map.fire(new l.Event("moveend",{originalEvent:B})),ie(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},Ue.prototype._fireEvent=function(i,o){this._map.fire(new l.Event(i,o?{originalEvent:o}:{}))},Ue.prototype._requestFrame=function(){var i=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add(function(o){delete i._frameId,i.handleEvent(new La("renderFrame",{timeStamp:o})),i._applyChanges()})},Ue.prototype._triggerRenderFrame=function(){this._frameId===void 0&&(this._frameId=this._requestFrame())};var Is=function(i){function o(n,s){i.call(this),this._moving=!1,this._zooming=!1,this.transform=n,this._bearingSnap=s.bearingSnap,l.bindAll(["_renderFrameCallback"],this)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getCenter=function(){return new l.LngLat(this.transform.center.lng,this.transform.center.lat)},o.prototype.setCenter=function(n,s){return this.jumpTo({center:n},s)},o.prototype.panBy=function(n,s,p){return n=l.Point.convert(n).mult(-1),this.panTo(this.transform.center,l.extend({offset:n},s),p)},o.prototype.panTo=function(n,s,p){return this.easeTo(l.extend({center:n},s),p)},o.prototype.getZoom=function(){return this.transform.zoom},o.prototype.setZoom=function(n,s){return this.jumpTo({zoom:n},s),this},o.prototype.zoomTo=function(n,s,p){return this.easeTo(l.extend({zoom:n},s),p)},o.prototype.zoomIn=function(n,s){return this.zoomTo(this.getZoom()+1,n,s),this},o.prototype.zoomOut=function(n,s){return this.zoomTo(this.getZoom()-1,n,s),this},o.prototype.getBearing=function(){return this.transform.bearing},o.prototype.setBearing=function(n,s){return this.jumpTo({bearing:n},s),this},o.prototype.getPadding=function(){return this.transform.padding},o.prototype.setPadding=function(n,s){return this.jumpTo({padding:n},s),this},o.prototype.rotateTo=function(n,s,p){return this.easeTo(l.extend({bearing:n},s),p)},o.prototype.resetNorth=function(n,s){return this.rotateTo(0,l.extend({duration:1e3},n),s),this},o.prototype.resetNorthPitch=function(n,s){return this.easeTo(l.extend({bearing:0,pitch:0,duration:1e3},n),s),this},o.prototype.snapToNorth=function(n,s){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(n,s):this},o.prototype.getPitch=function(){return this.transform.pitch},o.prototype.setPitch=function(n,s){return this.jumpTo({pitch:n},s),this},o.prototype.cameraForBounds=function(n,s){n=l.LngLatBounds.convert(n);var p=s&&s.bearing||0;return this._cameraForBoxAndBearing(n.getNorthWest(),n.getSouthEast(),p,s)},o.prototype._cameraForBoxAndBearing=function(n,s,p,m){var y={top:0,bottom:0,right:0,left:0};if(typeof(m=l.extend({padding:y,offset:[0,0],maxZoom:this.transform.maxZoom},m)).padding=="number"){var g=m.padding;m.padding={top:g,bottom:g,right:g,left:g}}m.padding=l.extend(y,m.padding);var w=this.transform,A=w.padding,B=w.project(l.LngLat.convert(n)),L=w.project(l.LngLat.convert(s)),R=B.rotate(-p*Math.PI/180),Z=L.rotate(-p*Math.PI/180),j=new l.Point(Math.max(R.x,Z.x),Math.max(R.y,Z.y)),K=new l.Point(Math.min(R.x,Z.x),Math.min(R.y,Z.y)),U=j.sub(K),X=(w.width-(A.left+A.right+m.padding.left+m.padding.right))/U.x,Q=(w.height-(A.top+A.bottom+m.padding.top+m.padding.bottom))/U.y;if(!(Q<0||X<0)){var ie=Math.min(w.scaleZoom(w.scale*Math.min(X,Q)),m.maxZoom),ce=typeof m.offset.x=="number"?new l.Point(m.offset.x,m.offset.y):l.Point.convert(m.offset),le=new l.Point((m.padding.left-m.padding.right)/2,(m.padding.top-m.padding.bottom)/2).rotate(p*Math.PI/180),he=ce.add(le).mult(w.scale/w.zoomScale(ie));return{center:w.unproject(B.add(L).div(2).sub(he)),zoom:ie,bearing:p}}l.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},o.prototype.fitBounds=function(n,s,p){return this._fitInternal(this.cameraForBounds(n,s),s,p)},o.prototype.fitScreenCoordinates=function(n,s,p,m,y){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(l.Point.convert(n)),this.transform.pointLocation(l.Point.convert(s)),p,m),m,y)},o.prototype._fitInternal=function(n,s,p){return n?(delete(s=l.extend(n,s)).padding,s.linear?this.easeTo(s,p):this.flyTo(s,p)):this},o.prototype.jumpTo=function(n,s){this.stop();var p=this.transform,m=!1,y=!1,g=!1;return"zoom"in n&&p.zoom!==+n.zoom&&(m=!0,p.zoom=+n.zoom),n.center!==void 0&&(p.center=l.LngLat.convert(n.center)),"bearing"in n&&p.bearing!==+n.bearing&&(y=!0,p.bearing=+n.bearing),"pitch"in n&&p.pitch!==+n.pitch&&(g=!0,p.pitch=+n.pitch),n.padding==null||p.isPaddingEqual(n.padding)||(p.padding=n.padding),this.fire(new l.Event("movestart",s)).fire(new l.Event("move",s)),m&&this.fire(new l.Event("zoomstart",s)).fire(new l.Event("zoom",s)).fire(new l.Event("zoomend",s)),y&&this.fire(new l.Event("rotatestart",s)).fire(new l.Event("rotate",s)).fire(new l.Event("rotateend",s)),g&&this.fire(new l.Event("pitchstart",s)).fire(new l.Event("pitch",s)).fire(new l.Event("pitchend",s)),this.fire(new l.Event("moveend",s))},o.prototype.easeTo=function(n,s){var p=this;this._stop(!1,n.easeId),((n=l.extend({offset:[0,0],duration:500,easing:l.ease},n)).animate===!1||!n.essential&&l.browser.prefersReducedMotion)&&(n.duration=0);var m=this.transform,y=this.getZoom(),g=this.getBearing(),w=this.getPitch(),A=this.getPadding(),B="zoom"in n?+n.zoom:y,L="bearing"in n?this._normalizeBearing(n.bearing,g):g,R="pitch"in n?+n.pitch:w,Z="padding"in n?n.padding:m.padding,j=l.Point.convert(n.offset),K=m.centerPoint.add(j),U=m.pointLocation(K),X=l.LngLat.convert(n.center||U);this._normalizeCenter(X);var Q,ie,ce=m.project(U),le=m.project(X).sub(ce),he=m.zoomScale(B-y);n.around&&(Q=l.LngLat.convert(n.around),ie=m.locationPoint(Q));var ge={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||B!==y,this._rotating=this._rotating||g!==L,this._pitching=this._pitching||R!==w,this._padding=!m.isPaddingEqual(Z),this._easeId=n.easeId,this._prepareEase(s,n.noMoveStart,ge),this._ease(function(Te){if(p._zooming&&(m.zoom=l.number(y,B,Te)),p._rotating&&(m.bearing=l.number(g,L,Te)),p._pitching&&(m.pitch=l.number(w,R,Te)),p._padding&&(m.interpolatePadding(A,Z,Te),K=m.centerPoint.add(j)),Q)m.setLocationAtPoint(Q,ie);else{var Se=m.zoomScale(m.zoom-y),Le=B>y?Math.min(2,he):Math.max(.5,he),Ge=Math.pow(Le,1-Te),Ke=m.unproject(ce.add(le.mult(Te*Ge)).mult(Se));m.setLocationAtPoint(m.renderWorldCopies?Ke.wrap():Ke,K)}p._fireMoveEvents(s)},function(Te){p._afterEase(s,Te)},n),this},o.prototype._prepareEase=function(n,s,p){p===void 0&&(p={}),this._moving=!0,s||p.moving||this.fire(new l.Event("movestart",n)),this._zooming&&!p.zooming&&this.fire(new l.Event("zoomstart",n)),this._rotating&&!p.rotating&&this.fire(new l.Event("rotatestart",n)),this._pitching&&!p.pitching&&this.fire(new l.Event("pitchstart",n))},o.prototype._fireMoveEvents=function(n){this.fire(new l.Event("move",n)),this._zooming&&this.fire(new l.Event("zoom",n)),this._rotating&&this.fire(new l.Event("rotate",n)),this._pitching&&this.fire(new l.Event("pitch",n))},o.prototype._afterEase=function(n,s){if(!this._easeId||!s||this._easeId!==s){delete this._easeId;var p=this._zooming,m=this._rotating,y=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,p&&this.fire(new l.Event("zoomend",n)),m&&this.fire(new l.Event("rotateend",n)),y&&this.fire(new l.Event("pitchend",n)),this.fire(new l.Event("moveend",n))}},o.prototype.flyTo=function(n,s){var p=this;if(!n.essential&&l.browser.prefersReducedMotion){var m=l.pick(n,["center","zoom","bearing","pitch","around"]);return this.jumpTo(m,s)}this.stop(),n=l.extend({offset:[0,0],speed:1.2,curve:1.42,easing:l.ease},n);var y=this.transform,g=this.getZoom(),w=this.getBearing(),A=this.getPitch(),B=this.getPadding(),L="zoom"in n?l.clamp(+n.zoom,y.minZoom,y.maxZoom):g,R="bearing"in n?this._normalizeBearing(n.bearing,w):w,Z="pitch"in n?+n.pitch:A,j="padding"in n?n.padding:y.padding,K=y.zoomScale(L-g),U=l.Point.convert(n.offset),X=y.centerPoint.add(U),Q=y.pointLocation(X),ie=l.LngLat.convert(n.center||Q);this._normalizeCenter(ie);var ce=y.project(Q),le=y.project(ie).sub(ce),he=n.curve,ge=Math.max(y.width,y.height),Te=ge/K,Se=le.mag();if("minZoom"in n){var Le=l.clamp(Math.min(n.minZoom,g,L),y.minZoom,y.maxZoom),Ge=ge/y.zoomScale(Le-g);he=Math.sqrt(Ge/Se*2)}var Ke=he*he;function He(Qe){var Je=(Te*Te-ge*ge+(Qe?-1:1)*Ke*Ke*Se*Se)/(2*(Qe?Te:ge)*Ke*Se);return Math.log(Math.sqrt(Je*Je+1)-Je)}function bt(Qe){return(Math.exp(Qe)-Math.exp(-Qe))/2}function Re(Qe){return(Math.exp(Qe)+Math.exp(-Qe))/2}var it=He(0),at=function(Qe){return Re(it)/Re(it+he*Qe)},rt=function(Qe){return ge*((Re(it)*(bt(Je=it+he*Qe)/Re(Je))-bt(it))/Ke)/Se;var Je},tt=(He(1)-it)/he;if(Math.abs(Se)<1e-6||!isFinite(tt)){if(Math.abs(ge-Te)<1e-6)return this.easeTo(n,s);var ot=Te<ge?-1:1;tt=Math.abs(Math.log(Te/ge))/he,rt=function(){return 0},at=function(Qe){return Math.exp(ot*he*Qe)}}return n.duration="duration"in n?+n.duration:1e3*tt/("screenSpeed"in n?+n.screenSpeed/he:+n.speed),n.maxDuration&&n.duration>n.maxDuration&&(n.duration=0),this._zooming=!0,this._rotating=w!==R,this._pitching=Z!==A,this._padding=!y.isPaddingEqual(j),this._prepareEase(s,!1),this._ease(function(Qe){var Je=Qe*tt,Sr=1/at(Je);y.zoom=Qe===1?L:g+y.scaleZoom(Sr),p._rotating&&(y.bearing=l.number(w,R,Qe)),p._pitching&&(y.pitch=l.number(A,Z,Qe)),p._padding&&(y.interpolatePadding(B,j,Qe),X=y.centerPoint.add(U));var rr=Qe===1?ie:y.unproject(ce.add(le.mult(rt(Je))).mult(Sr));y.setLocationAtPoint(y.renderWorldCopies?rr.wrap():rr,X),p._fireMoveEvents(s)},function(){return p._afterEase(s)},n),this},o.prototype.isEasing=function(){return!!this._easeFrameId},o.prototype.stop=function(){return this._stop()},o.prototype._stop=function(n,s){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var p=this._onEaseEnd;delete this._onEaseEnd,p.call(this,s)}if(!n){var m=this.handlers;m&&m.stop(!1)}return this},o.prototype._ease=function(n,s,p){p.animate===!1||p.duration===0?(n(1),s()):(this._easeStart=l.browser.now(),this._easeOptions=p,this._onEaseFrame=n,this._onEaseEnd=s,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},o.prototype._renderFrameCallback=function(){var n=Math.min((l.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(n)),n<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},o.prototype._normalizeBearing=function(n,s){n=l.wrap(n,-180,180);var p=Math.abs(n-s);return Math.abs(n-360-s)<p&&(n-=360),Math.abs(n+360-s)<p&&(n+=360),n},o.prototype._normalizeCenter=function(n){var s=this.transform;if(s.renderWorldCopies&&!s.lngRange){var p=n.lng-s.center.lng;n.lng+=p>180?-360:p<-180?360:0}},o}(l.Evented),Hr=function(i){i===void 0&&(i={}),this.options=i,l.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Hr.prototype.getDefaultPosition=function(){return"bottom-right"},Hr.prototype.onAdd=function(i){var o=this.options&&this.options.compact;return this._map=i,this._container=G.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=G.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=G.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),o&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),o===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Hr.prototype.onRemove=function(){G.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Hr.prototype._setElementTitle=function(i,o){var n=this._map._getUIString("AttributionControl."+o);i.title=n,i.setAttribute("aria-label",n)},Hr.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Hr.prototype._updateEditLink=function(){var i=this._editLink;i||(i=this._editLink=this._container.querySelector(".mapbox-improve-map"));var o=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||l.config.ACCESS_TOKEN}];if(i){var n=o.reduce(function(s,p,m){return p.value&&(s+=p.key+"="+p.value+(m<o.length-1?"&":"")),s},"?");i.href=l.config.FEEDBACK_URL+"/"+n+(this._map._hash?this._map._hash.getHashString(!0):""),i.rel="noopener nofollow",this._setElementTitle(i,"MapFeedback")}},Hr.prototype._updateData=function(i){!i||i.sourceDataType!=="metadata"&&i.sourceDataType!=="visibility"&&i.dataType!=="style"||(this._updateAttributions(),this._updateEditLink())},Hr.prototype._updateAttributions=function(){if(this._map.style){var i=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?i=i.concat(this.options.customAttribution.map(function(g){return typeof g!="string"?"":g})):typeof this.options.customAttribution=="string"&&i.push(this.options.customAttribution)),this._map.style.stylesheet){var o=this._map.style.stylesheet;this.styleOwner=o.owner,this.styleId=o.id}var n=this._map.style.sourceCaches;for(var s in n){var p=n[s];if(p.used){var m=p.getSource();m.attribution&&i.indexOf(m.attribution)<0&&i.push(m.attribution)}}i.sort(function(g,w){return g.length-w.length});var y=(i=i.filter(function(g,w){for(var A=w+1;A<i.length;A++)if(i[A].indexOf(g)>=0)return!1;return!0})).join(" | ");y!==this._attribHTML&&(this._attribHTML=y,i.length?(this._innerContainer.innerHTML=y,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Hr.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Wi=function(){l.bindAll(["_updateLogo"],this),l.bindAll(["_updateCompact"],this)};Wi.prototype.onAdd=function(i){this._map=i,this._container=G.create("div","mapboxgl-ctrl");var o=G.create("a","mapboxgl-ctrl-logo");return o.target="_blank",o.rel="noopener nofollow",o.href="https://www.mapbox.com/",o.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),o.setAttribute("rel","noopener nofollow"),this._container.appendChild(o),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Wi.prototype.onRemove=function(){G.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Wi.prototype.getDefaultPosition=function(){return"bottom-left"},Wi.prototype._updateLogo=function(i){i&&i.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")},Wi.prototype._logoRequired=function(){if(this._map.style){var i=this._map.style.sourceCaches;for(var o in i)if(i[o].getSource().mapbox_logo)return!0;return!1}},Wi.prototype._updateCompact=function(){var i=this._container.children;if(i.length){var o=i[0];this._map.getCanvasContainer().offsetWidth<250?o.classList.add("mapboxgl-compact"):o.classList.remove("mapboxgl-compact")}};var Vr=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Vr.prototype.add=function(i){var o=++this._id;return this._queue.push({callback:i,id:o,cancelled:!1}),o},Vr.prototype.remove=function(i){for(var o=this._currentlyRunning,n=0,s=o?this._queue.concat(o):this._queue;n<s.length;n+=1){var p=s[n];if(p.id===i)return void(p.cancelled=!0)}},Vr.prototype.run=function(i){i===void 0&&(i=0);var o=this._currentlyRunning=this._queue;this._queue=[];for(var n=0,s=o;n<s.length;n+=1){var p=s[n];if(!p.cancelled&&(p.callback(i),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Vr.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var en={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},Ul=l.window.HTMLImageElement,As=l.window.HTMLElement,zt=l.window.ImageBitmap,Mr={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},lc=function(i){function o(s){var p=this;if((s=l.extend({},Mr,s)).minZoom!=null&&s.maxZoom!=null&&s.minZoom>s.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(s.minPitch!=null&&s.maxPitch!=null&&s.minPitch>s.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(s.minPitch!=null&&s.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(s.maxPitch!=null&&s.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var m=new gt(s.minZoom,s.maxZoom,s.minPitch,s.maxPitch,s.renderWorldCopies);if(i.call(this,m,s),this._interactive=s.interactive,this._maxTileCacheSize=s.maxTileCacheSize,this._failIfMajorPerformanceCaveat=s.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=s.preserveDrawingBuffer,this._antialias=s.antialias,this._trackResize=s.trackResize,this._bearingSnap=s.bearingSnap,this._refreshExpiredTiles=s.refreshExpiredTiles,this._fadeDuration=s.fadeDuration,this._crossSourceCollisions=s.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=s.collectResourceTiming,this._renderTaskQueue=new Vr,this._controls=[],this._mapId=l.uniqueId(),this._locale=l.extend({},en,s.locale),this._clickTolerance=s.clickTolerance,this._requestManager=new l.RequestManager(s.transformRequest,s.accessToken),typeof s.container=="string"){if(this._container=l.window.document.getElementById(s.container),!this._container)throw new Error("Container '"+s.container+"' not found.")}else{if(!(s.container instanceof As))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=s.container}if(s.maxBounds&&this.setMaxBounds(s.maxBounds),l.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return p._update(!1)}),this.on("moveend",function(){return p._update(!1)}),this.on("zoom",function(){return p._update(!0)}),l.window!==void 0&&(l.window.addEventListener("online",this._onWindowOnline,!1),l.window.addEventListener("resize",this._onWindowResize,!1),l.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Ue(this,s),this._hash=s.hash&&new gi(typeof s.hash=="string"&&s.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:s.center,zoom:s.zoom,bearing:s.bearing,pitch:s.pitch}),s.bounds&&(this.resize(),this.fitBounds(s.bounds,l.extend({},s.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=s.localIdeographFontFamily,s.style&&this.setStyle(s.style,{localIdeographFontFamily:s.localIdeographFontFamily}),s.attributionControl&&this.addControl(new Hr({customAttribution:s.customAttribution})),this.addControl(new Wi,s.logoPosition),this.on("style.load",function(){p.transform.unmodified&&p.jumpTo(p.style.stylesheet)}),this.on("data",function(y){p._update(y.dataType==="style"),p.fire(new l.Event(y.dataType+"data",y))}),this.on("dataloading",function(y){p.fire(new l.Event(y.dataType+"dataloading",y))})}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return o.prototype._getMapId=function(){return this._mapId},o.prototype.addControl=function(s,p){if(p===void 0&&(p=s.getDefaultPosition?s.getDefaultPosition():"top-right"),!s||!s.onAdd)return this.fire(new l.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var m=s.onAdd(this);this._controls.push(s);var y=this._controlPositions[p];return p.indexOf("bottom")!==-1?y.insertBefore(m,y.firstChild):y.appendChild(m),this},o.prototype.removeControl=function(s){if(!s||!s.onRemove)return this.fire(new l.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var p=this._controls.indexOf(s);return p>-1&&this._controls.splice(p,1),s.onRemove(this),this},o.prototype.hasControl=function(s){return this._controls.indexOf(s)>-1},o.prototype.resize=function(s){var p=this._containerDimensions(),m=p[0],y=p[1];if(m===this.transform.width&&y===this.transform.height)return this;this._resizeCanvas(m,y),this.transform.resize(m,y),this.painter.resize(m,y);var g=!this._moving;return g&&this.fire(new l.Event("movestart",s)).fire(new l.Event("move",s)),this.fire(new l.Event("resize",s)),g&&this.fire(new l.Event("moveend",s)),this},o.prototype.getBounds=function(){return this.transform.getBounds()},o.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},o.prototype.setMaxBounds=function(s){return this.transform.setMaxBounds(l.LngLatBounds.convert(s)),this._update()},o.prototype.setMinZoom=function(s){if((s=s??-2)>=-2&&s<=this.transform.maxZoom)return this.transform.minZoom=s,this._update(),this.getZoom()<s&&this.setZoom(s),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},o.prototype.getMinZoom=function(){return this.transform.minZoom},o.prototype.setMaxZoom=function(s){if((s=s??22)>=this.transform.minZoom)return this.transform.maxZoom=s,this._update(),this.getZoom()>s&&this.setZoom(s),this;throw new Error("maxZoom must be greater than the current minZoom")},o.prototype.getMaxZoom=function(){return this.transform.maxZoom},o.prototype.setMinPitch=function(s){if((s=s??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(s>=0&&s<=this.transform.maxPitch)return this.transform.minPitch=s,this._update(),this.getPitch()<s&&this.setPitch(s),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},o.prototype.getMinPitch=function(){return this.transform.minPitch},o.prototype.setMaxPitch=function(s){if((s=s??60)>60)throw new Error("maxPitch must be less than or equal to 60");if(s>=this.transform.minPitch)return this.transform.maxPitch=s,this._update(),this.getPitch()>s&&this.setPitch(s),this;throw new Error("maxPitch must be greater than the current minPitch")},o.prototype.getMaxPitch=function(){return this.transform.maxPitch},o.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},o.prototype.setRenderWorldCopies=function(s){return this.transform.renderWorldCopies=s,this._update()},o.prototype.project=function(s){return this.transform.locationPoint(l.LngLat.convert(s))},o.prototype.unproject=function(s){return this.transform.pointLocation(l.Point.convert(s))},o.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},o.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},o.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},o.prototype._createDelegatedListener=function(s,p,m){var y,g=this;if(s==="mouseenter"||s==="mouseover"){var w=!1;return{layer:p,listener:m,delegates:{mousemove:function(B){var L=g.getLayer(p)?g.queryRenderedFeatures(B.point,{layers:[p]}):[];L.length?w||(w=!0,m.call(g,new gr(s,g,B.originalEvent,{features:L}))):w=!1},mouseout:function(){w=!1}}}}if(s==="mouseleave"||s==="mouseout"){var A=!1;return{layer:p,listener:m,delegates:{mousemove:function(B){(g.getLayer(p)?g.queryRenderedFeatures(B.point,{layers:[p]}):[]).length?A=!0:A&&(A=!1,m.call(g,new gr(s,g,B.originalEvent)))},mouseout:function(B){A&&(A=!1,m.call(g,new gr(s,g,B.originalEvent)))}}}}return{layer:p,listener:m,delegates:(y={},y[s]=function(B){var L=g.getLayer(p)?g.queryRenderedFeatures(B.point,{layers:[p]}):[];L.length&&(B.features=L,m.call(g,B),delete B.features)},y)}},o.prototype.on=function(s,p,m){if(m===void 0)return i.prototype.on.call(this,s,p);var y=this._createDelegatedListener(s,p,m);for(var g in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[s]=this._delegatedListeners[s]||[],this._delegatedListeners[s].push(y),y.delegates)this.on(g,y.delegates[g]);return this},o.prototype.once=function(s,p,m){if(m===void 0)return i.prototype.once.call(this,s,p);var y=this._createDelegatedListener(s,p,m);for(var g in y.delegates)this.once(g,y.delegates[g]);return this},o.prototype.off=function(s,p,m){var y=this;return m===void 0?i.prototype.off.call(this,s,p):(this._delegatedListeners&&this._delegatedListeners[s]&&function(g){for(var w=g[s],A=0;A<w.length;A++){var B=w[A];if(B.layer===p&&B.listener===m){for(var L in B.delegates)y.off(L,B.delegates[L]);return w.splice(A,1),y}}}(this._delegatedListeners),this)},o.prototype.queryRenderedFeatures=function(s,p){if(!this.style)return[];var m;if(p!==void 0||s===void 0||s instanceof l.Point||Array.isArray(s)||(p=s,s=void 0),p=p||{},(s=s||[[0,0],[this.transform.width,this.transform.height]])instanceof l.Point||typeof s[0]=="number")m=[l.Point.convert(s)];else{var y=l.Point.convert(s[0]),g=l.Point.convert(s[1]);m=[y,new l.Point(g.x,y.y),g,new l.Point(y.x,g.y),y]}return this.style.queryRenderedFeatures(m,p,this.transform)},o.prototype.querySourceFeatures=function(s,p){return this.style.querySourceFeatures(s,p)},o.prototype.setStyle=function(s,p){return(p=l.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},p)).diff!==!1&&p.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&s?(this._diffStyle(s,p),this):(this._localIdeographFontFamily=p.localIdeographFontFamily,this._updateStyle(s,p))},o.prototype._getUIString=function(s){var p=this._locale[s];if(p==null)throw new Error("Missing UI string '"+s+"'");return p},o.prototype._updateStyle=function(s,p){return this.style&&(this.style.setEventedParent(null),this.style._remove()),s?(this.style=new ui(this,p||{}),this.style.setEventedParent(this,{style:this.style}),typeof s=="string"?this.style.loadURL(s):this.style.loadJSON(s),this):(delete this.style,this)},o.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new ui(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},o.prototype._diffStyle=function(s,p){var m=this;if(typeof s=="string"){var y=this._requestManager.normalizeStyleURL(s),g=this._requestManager.transformRequest(y,l.ResourceType.Style);l.getJSON(g,function(w,A){w?m.fire(new l.ErrorEvent(w)):A&&m._updateDiff(A,p)})}else typeof s=="object"&&this._updateDiff(s,p)},o.prototype._updateDiff=function(s,p){try{this.style.setState(s)&&this._update(!0)}catch(m){l.warnOnce("Unable to perform style diff: "+(m.message||m.error||m)+". Rebuilding the style from scratch."),this._updateStyle(s,p)}},o.prototype.getStyle=function(){if(this.style)return this.style.serialize()},o.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():l.warnOnce("There is no style added to the map.")},o.prototype.addSource=function(s,p){return this._lazyInitEmptyStyle(),this.style.addSource(s,p),this._update(!0)},o.prototype.isSourceLoaded=function(s){var p=this.style&&this.style.sourceCaches[s];if(p!==void 0)return p.loaded();this.fire(new l.ErrorEvent(new Error("There is no source with ID '"+s+"'")))},o.prototype.areTilesLoaded=function(){var s=this.style&&this.style.sourceCaches;for(var p in s){var m=s[p]._tiles;for(var y in m){var g=m[y];if(g.state!=="loaded"&&g.state!=="errored")return!1}}return!0},o.prototype.addSourceType=function(s,p,m){return this._lazyInitEmptyStyle(),this.style.addSourceType(s,p,m)},o.prototype.removeSource=function(s){return this.style.removeSource(s),this._update(!0)},o.prototype.getSource=function(s){return this.style.getSource(s)},o.prototype.addImage=function(s,p,m){m===void 0&&(m={});var y=m.pixelRatio;y===void 0&&(y=1);var g=m.sdf;g===void 0&&(g=!1);var w=m.stretchX,A=m.stretchY,B=m.content;if(this._lazyInitEmptyStyle(),p instanceof Ul||zt&&p instanceof zt){var L=l.browser.getImageData(p);this.style.addImage(s,{data:new l.RGBAImage({width:L.width,height:L.height},L.data),pixelRatio:y,stretchX:w,stretchY:A,content:B,sdf:g,version:0})}else{if(p.width===void 0||p.height===void 0)return this.fire(new l.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var R=p;this.style.addImage(s,{data:new l.RGBAImage({width:p.width,height:p.height},new Uint8Array(p.data)),pixelRatio:y,stretchX:w,stretchY:A,content:B,sdf:g,version:0,userImage:R}),R.onAdd&&R.onAdd(this,s)}},o.prototype.updateImage=function(s,p){var m=this.style.getImage(s);if(!m)return this.fire(new l.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var y=p instanceof Ul||zt&&p instanceof zt?l.browser.getImageData(p):p,g=y.width,w=y.height,A=y.data;return g===void 0||w===void 0?this.fire(new l.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):g!==m.data.width||w!==m.data.height?this.fire(new l.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(m.data.replace(A,!(p instanceof Ul||zt&&p instanceof zt)),void this.style.updateImage(s,m))},o.prototype.hasImage=function(s){return s?!!this.style.getImage(s):(this.fire(new l.ErrorEvent(new Error("Missing required image id"))),!1)},o.prototype.removeImage=function(s){this.style.removeImage(s)},o.prototype.loadImage=function(s,p){l.getImage(this._requestManager.transformRequest(s,l.ResourceType.Image),p)},o.prototype.listImages=function(){return this.style.listImages()},o.prototype.addLayer=function(s,p){return this._lazyInitEmptyStyle(),this.style.addLayer(s,p),this._update(!0)},o.prototype.moveLayer=function(s,p){return this.style.moveLayer(s,p),this._update(!0)},o.prototype.removeLayer=function(s){return this.style.removeLayer(s),this._update(!0)},o.prototype.getLayer=function(s){return this.style.getLayer(s)},o.prototype.setLayerZoomRange=function(s,p,m){return this.style.setLayerZoomRange(s,p,m),this._update(!0)},o.prototype.setFilter=function(s,p,m){return m===void 0&&(m={}),this.style.setFilter(s,p,m),this._update(!0)},o.prototype.getFilter=function(s){return this.style.getFilter(s)},o.prototype.setPaintProperty=function(s,p,m,y){return y===void 0&&(y={}),this.style.setPaintProperty(s,p,m,y),this._update(!0)},o.prototype.getPaintProperty=function(s,p){return this.style.getPaintProperty(s,p)},o.prototype.setLayoutProperty=function(s,p,m,y){return y===void 0&&(y={}),this.style.setLayoutProperty(s,p,m,y),this._update(!0)},o.prototype.getLayoutProperty=function(s,p){return this.style.getLayoutProperty(s,p)},o.prototype.setLight=function(s,p){return p===void 0&&(p={}),this._lazyInitEmptyStyle(),this.style.setLight(s,p),this._update(!0)},o.prototype.getLight=function(){return this.style.getLight()},o.prototype.setFeatureState=function(s,p){return this.style.setFeatureState(s,p),this._update()},o.prototype.removeFeatureState=function(s,p){return this.style.removeFeatureState(s,p),this._update()},o.prototype.getFeatureState=function(s){return this.style.getFeatureState(s)},o.prototype.getContainer=function(){return this._container},o.prototype.getCanvasContainer=function(){return this._canvasContainer},o.prototype.getCanvas=function(){return this._canvas},o.prototype._containerDimensions=function(){var s=0,p=0;return this._container&&(s=this._container.clientWidth||400,p=this._container.clientHeight||300),[s,p]},o.prototype._detectMissingCSS=function(){l.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&l.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},o.prototype._setupContainer=function(){var s=this._container;s.classList.add("mapboxgl-map"),(this._missingCSSCanary=G.create("div","mapboxgl-canary",s)).style.visibility="hidden",this._detectMissingCSS();var p=this._canvasContainer=G.create("div","mapboxgl-canvas-container",s);this._interactive&&p.classList.add("mapboxgl-interactive"),this._canvas=G.create("canvas","mapboxgl-canvas",p),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");var m=this._containerDimensions();this._resizeCanvas(m[0],m[1]);var y=this._controlContainer=G.create("div","mapboxgl-control-container",s),g=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(w){g[w]=G.create("div","mapboxgl-ctrl-"+w,y)}),this._container.addEventListener("scroll",this._onMapScroll,!1)},o.prototype._resizeCanvas=function(s,p){var m=l.browser.devicePixelRatio||1;this._canvas.width=m*s,this._canvas.height=m*p,this._canvas.style.width=s+"px",this._canvas.style.height=p+"px"},o.prototype._setupPainter=function(){var s=l.extend({},re.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),p=this._canvas.getContext("webgl",s)||this._canvas.getContext("experimental-webgl",s);p?(this.painter=new Xt(p,this.transform),l.webpSupported.testSupport(p)):this.fire(new l.ErrorEvent(new Error("Failed to initialize WebGL")))},o.prototype._contextLost=function(s){s.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new l.Event("webglcontextlost",{originalEvent:s}))},o.prototype._contextRestored=function(s){this._setupPainter(),this.resize(),this._update(),this.fire(new l.Event("webglcontextrestored",{originalEvent:s}))},o.prototype._onMapScroll=function(s){if(s.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},o.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},o.prototype._update=function(s){return this.style?(this._styleDirty=this._styleDirty||s,this._sourcesDirty=!0,this.triggerRepaint(),this):this},o.prototype._requestRenderFrame=function(s){return this._update(),this._renderTaskQueue.add(s)},o.prototype._cancelRenderFrame=function(s){this._renderTaskQueue.remove(s)},o.prototype._render=function(s){var p,m=this,y=0,g=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(p=g.createQueryEXT(),g.beginQueryEXT(g.TIME_ELAPSED_EXT,p),y=l.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(s),!this._removed){var w=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var A=this.transform.zoom,B=l.browser.now();this.style.zoomHistory.update(A,B);var L=new l.EvaluationParameters(A,{now:B,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),R=L.crossFadingFactor();R===1&&R===this._crossFadingFactor||(w=!0,this._crossFadingFactor=R),this.style.update(L)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new l.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new l.Event("load"))),this.style&&(this.style.hasTransitions()||w)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var Z=l.browser.now()-y;g.endQueryEXT(g.TIME_ELAPSED_EXT,p),setTimeout(function(){var U=g.getQueryObjectEXT(p,g.QUERY_RESULT_EXT)/1e6;g.deleteQueryEXT(p),m.fire(new l.Event("gpu-timing-frame",{cpuTime:Z,gpuTime:U}))},50)}if(this.listens("gpu-timing-layer")){var j=this.painter.collectGpuTimers();setTimeout(function(){var U=m.painter.queryGpuTimers(j);m.fire(new l.Event("gpu-timing-layer",{layerTimes:U}))},50)}var K=this._sourcesDirty||this._styleDirty||this._placementDirty;return K||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new l.Event("idle")),!this._loaded||this._fullyLoaded||K||(this._fullyLoaded=!0),this}},o.prototype.remove=function(){this._hash&&this._hash.remove();for(var s=0,p=this._controls;s<p.length;s+=1)p[s].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),l.window!==void 0&&(l.window.removeEventListener("resize",this._onWindowResize,!1),l.window.removeEventListener("orientationchange",this._onWindowResize,!1),l.window.removeEventListener("online",this._onWindowOnline,!1));var m=this.painter.context.gl.getExtension("WEBGL_lose_context");m&&m.loseContext(),yo(this._canvasContainer),yo(this._controlContainer),yo(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new l.Event("remove"))},o.prototype.triggerRepaint=function(){var s=this;this.style&&!this._frame&&(this._frame=l.browser.frame(function(p){s._frame=null,s._render(p)}))},o.prototype._onWindowOnline=function(){this._update()},o.prototype._onWindowResize=function(s){this._trackResize&&this.resize({originalEvent:s})._update()},n.showTileBoundaries.get=function(){return!!this._showTileBoundaries},n.showTileBoundaries.set=function(s){this._showTileBoundaries!==s&&(this._showTileBoundaries=s,this._update())},n.showPadding.get=function(){return!!this._showPadding},n.showPadding.set=function(s){this._showPadding!==s&&(this._showPadding=s,this._update())},n.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},n.showCollisionBoxes.set=function(s){this._showCollisionBoxes!==s&&(this._showCollisionBoxes=s,s?this.style._generateCollisionBoxes():this._update())},n.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},n.showOverdrawInspector.set=function(s){this._showOverdrawInspector!==s&&(this._showOverdrawInspector=s,this._update())},n.repaint.get=function(){return!!this._repaint},n.repaint.set=function(s){this._repaint!==s&&(this._repaint=s,this.triggerRepaint())},n.vertices.get=function(){return!!this._vertices},n.vertices.set=function(s){this._vertices=s,this._update()},o.prototype._setCacheLimits=function(s,p){l.setCacheLimits(s,p)},n.version.get=function(){return l.version},Object.defineProperties(o.prototype,n),o}(Is);function yo(i){i.parentNode&&i.parentNode.removeChild(i)}var Nl={showCompass:!0,showZoom:!0,visualizePitch:!1},dn=function(i){var o=this;this.options=l.extend({},Nl,i),this._container=G.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(n){return n.preventDefault()}),this.options.showZoom&&(l.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",function(n){return o._map.zoomIn({},{originalEvent:n})}),G.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",function(n){return o._map.zoomOut({},{originalEvent:n})}),G.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(l.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",function(n){o.options.visualizePitch?o._map.resetNorthPitch({},{originalEvent:n}):o._map.resetNorth({},{originalEvent:n})}),this._compassIcon=G.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};dn.prototype._updateZoomButtons=function(){var i=this._map.getZoom(),o=i===this._map.getMaxZoom(),n=i===this._map.getMinZoom();this._zoomInButton.disabled=o,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",o.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())},dn.prototype._rotateCompassArrow=function(){var i=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=i},dn.prototype.onAdd=function(i){return this._map=i,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new di(this._map,this._compass,this.options.visualizePitch)),this._container},dn.prototype.onRemove=function(){G.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},dn.prototype._createButton=function(i,o){var n=G.create("button",i,this._container);return n.type="button",n.addEventListener("click",o),n},dn.prototype._setButtonTitle=function(i,o){var n=this._map._getUIString("NavigationControl."+o);i.title=n,i.setAttribute("aria-label",n)};var di=function(i,o,n){n===void 0&&(n=!1),this._clickTolerance=10,this.element=o,this.mouseRotate=new ws({clickTolerance:i.dragRotate._mouseRotate._clickTolerance}),this.map=i,n&&(this.mousePitch=new Fl({clickTolerance:i.dragRotate._mousePitch._clickTolerance})),l.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),G.addEventListener(o,"mousedown",this.mousedown),G.addEventListener(o,"touchstart",this.touchstart,{passive:!1}),G.addEventListener(o,"touchmove",this.touchmove),G.addEventListener(o,"touchend",this.touchend),G.addEventListener(o,"touchcancel",this.reset)};function Xo(i,o,n){if(i=new l.LngLat(i.lng,i.lat),o){var s=new l.LngLat(i.lng-360,i.lat),p=new l.LngLat(i.lng+360,i.lat),m=n.locationPoint(i).distSqr(o);n.locationPoint(s).distSqr(o)<m?i=s:n.locationPoint(p).distSqr(o)<m&&(i=p)}for(;Math.abs(i.lng-n.center.lng)>180;){var y=n.locationPoint(i);if(y.x>=0&&y.y>=0&&y.x<=n.width&&y.y<=n.height)break;i.lng>n.center.lng?i.lng-=360:i.lng+=360}return i}di.prototype.down=function(i,o){this.mouseRotate.mousedown(i,o),this.mousePitch&&this.mousePitch.mousedown(i,o),G.disableDrag()},di.prototype.move=function(i,o){var n=this.map,s=this.mouseRotate.mousemoveWindow(i,o);if(s&&s.bearingDelta&&n.setBearing(n.getBearing()+s.bearingDelta),this.mousePitch){var p=this.mousePitch.mousemoveWindow(i,o);p&&p.pitchDelta&&n.setPitch(n.getPitch()+p.pitchDelta)}},di.prototype.off=function(){var i=this.element;G.removeEventListener(i,"mousedown",this.mousedown),G.removeEventListener(i,"touchstart",this.touchstart,{passive:!1}),G.removeEventListener(i,"touchmove",this.touchmove),G.removeEventListener(i,"touchend",this.touchend),G.removeEventListener(i,"touchcancel",this.reset),this.offTemp()},di.prototype.offTemp=function(){G.enableDrag(),G.removeEventListener(l.window,"mousemove",this.mousemove),G.removeEventListener(l.window,"mouseup",this.mouseup)},di.prototype.mousedown=function(i){this.down(l.extend({},i,{ctrlKey:!0,preventDefault:function(){return i.preventDefault()}}),G.mousePos(this.element,i)),G.addEventListener(l.window,"mousemove",this.mousemove),G.addEventListener(l.window,"mouseup",this.mouseup)},di.prototype.mousemove=function(i){this.move(i,G.mousePos(this.element,i))},di.prototype.mouseup=function(i){this.mouseRotate.mouseupWindow(i),this.mousePitch&&this.mousePitch.mouseupWindow(i),this.offTemp()},di.prototype.touchstart=function(i){i.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=G.touchPos(this.element,i.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return i.preventDefault()}},this._startPos))},di.prototype.touchmove=function(i){i.targetTouches.length!==1?this.reset():(this._lastPos=G.touchPos(this.element,i.targetTouches)[0],this.move({preventDefault:function(){return i.preventDefault()}},this._lastPos))},di.prototype.touchend=function(i){i.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},di.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var tn={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Es(i,o,n){var s=i.classList;for(var p in tn)s.remove("mapboxgl-"+n+"-anchor-"+p);s.add("mapboxgl-"+n+"-anchor-"+o)}var Ko,Ra=function(i){function o(n,s){if(i.call(this),(n instanceof l.window.HTMLElement||s)&&(n=l.extend({element:n},s)),l.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._scale=n&&n.scale||1,this._draggable=n&&n.draggable||!1,this._clickTolerance=n&&n.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=n&&n.rotation||0,this._rotationAlignment=n&&n.rotationAlignment||"auto",this._pitchAlignment=n&&n.pitchAlignment&&n.pitchAlignment!=="auto"?n.pitchAlignment:this._rotationAlignment,n&&n.element)this._element=n.element,this._offset=l.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=G.create("div"),this._element.setAttribute("aria-label","Map marker");var p=G.createNS("http://www.w3.org/2000/svg","svg");p.setAttributeNS(null,"display","block"),p.setAttributeNS(null,"height","41px"),p.setAttributeNS(null,"width","27px"),p.setAttributeNS(null,"viewBox","0 0 27 41");var m=G.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"stroke","none"),m.setAttributeNS(null,"stroke-width","1"),m.setAttributeNS(null,"fill","none"),m.setAttributeNS(null,"fill-rule","evenodd");var y=G.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"fill-rule","nonzero");var g=G.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(3.0, 29.0)"),g.setAttributeNS(null,"fill","#000000");for(var w=0,A=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];w<A.length;w+=1){var B=A[w],L=G.createNS("http://www.w3.org/2000/svg","ellipse");L.setAttributeNS(null,"opacity","0.04"),L.setAttributeNS(null,"cx","10.5"),L.setAttributeNS(null,"cy","5.80029008"),L.setAttributeNS(null,"rx",B.rx),L.setAttributeNS(null,"ry",B.ry),g.appendChild(L)}var R=G.createNS("http://www.w3.org/2000/svg","g");R.setAttributeNS(null,"fill",this._color);var Z=G.createNS("http://www.w3.org/2000/svg","path");Z.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),R.appendChild(Z);var j=G.createNS("http://www.w3.org/2000/svg","g");j.setAttributeNS(null,"opacity","0.25"),j.setAttributeNS(null,"fill","#000000");var K=G.createNS("http://www.w3.org/2000/svg","path");K.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),j.appendChild(K);var U=G.createNS("http://www.w3.org/2000/svg","g");U.setAttributeNS(null,"transform","translate(6.0, 7.0)"),U.setAttributeNS(null,"fill","#FFFFFF");var X=G.createNS("http://www.w3.org/2000/svg","g");X.setAttributeNS(null,"transform","translate(8.0, 8.0)");var Q=G.createNS("http://www.w3.org/2000/svg","circle");Q.setAttributeNS(null,"fill","#000000"),Q.setAttributeNS(null,"opacity","0.25"),Q.setAttributeNS(null,"cx","5.5"),Q.setAttributeNS(null,"cy","5.5"),Q.setAttributeNS(null,"r","5.4999962");var ie=G.createNS("http://www.w3.org/2000/svg","circle");ie.setAttributeNS(null,"fill","#FFFFFF"),ie.setAttributeNS(null,"cx","5.5"),ie.setAttributeNS(null,"cy","5.5"),ie.setAttributeNS(null,"r","5.4999962"),X.appendChild(Q),X.appendChild(ie),y.appendChild(g),y.appendChild(R),y.appendChild(j),y.appendChild(U),y.appendChild(X),p.appendChild(y),p.setAttributeNS(null,"height",41*this._scale+"px"),p.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(p),this._offset=l.Point.convert(n&&n.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",function(ce){ce.preventDefault()}),this._element.addEventListener("mousedown",function(ce){ce.preventDefault()}),Es(this._element,this._anchor,"marker"),this._popup=null}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.addTo=function(n){return this.remove(),this._map=n,n.getCanvasContainer().appendChild(this._element),n.on("move",this._update),n.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},o.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),G.remove(this._element),this._popup&&this._popup.remove(),this},o.prototype.getLngLat=function(){return this._lngLat},o.prototype.setLngLat=function(n){return this._lngLat=l.LngLat.convert(n),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},o.prototype.getElement=function(){return this._element},o.prototype.setPopup=function(n){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),n){if(!("offset"in n.options)){var s=Math.sqrt(Math.pow(13.5,2)/2);n.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[s,-1*(24.6+s)],"bottom-right":[-s,-1*(24.6+s)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=n,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},o.prototype._onKeyPress=function(n){var s=n.code,p=n.charCode||n.keyCode;s!=="Space"&&s!=="Enter"&&p!==32&&p!==13||this.togglePopup()},o.prototype._onMapClick=function(n){var s=n.originalEvent.target,p=this._element;this._popup&&(s===p||p.contains(s))&&this.togglePopup()},o.prototype.getPopup=function(){return this._popup},o.prototype.togglePopup=function(){var n=this._popup;return n?(n.isOpen()?n.remove():n.addTo(this._map),this):this},o.prototype._update=function(n){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Xo(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var s="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?s="rotateZ("+this._rotation+"deg)":this._rotationAlignment==="map"&&(s="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var p="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?p="rotateX(0deg)":this._pitchAlignment==="map"&&(p="rotateX("+this._map.getPitch()+"deg)"),n&&n.type!=="moveend"||(this._pos=this._pos.round()),G.setTransform(this._element,tn[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+p+" "+s)}},o.prototype.getOffset=function(){return this._offset},o.prototype.setOffset=function(n){return this._offset=l.Point.convert(n),this._update(),this},o.prototype._onMove=function(n){if(!this._isDragging){var s=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=s}this._isDragging&&(this._pos=n.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new l.Event("dragstart"))),this.fire(new l.Event("drag")))},o.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new l.Event("dragend")),this._state="inactive"},o.prototype._addDragHandler=function(n){this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},o.prototype.setDraggable=function(n){return this._draggable=!!n,this._map&&(n?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},o.prototype.isDraggable=function(){return this._draggable},o.prototype.setRotation=function(n){return this._rotation=n||0,this._update(),this},o.prototype.getRotation=function(){return this._rotation},o.prototype.setRotationAlignment=function(n){return this._rotationAlignment=n||"auto",this._update(),this},o.prototype.getRotationAlignment=function(){return this._rotationAlignment},o.prototype.setPitchAlignment=function(n){return this._pitchAlignment=n&&n!=="auto"?n:this._rotationAlignment,this._update(),this},o.prototype.getPitchAlignment=function(){return this._pitchAlignment},o}(l.Evented),$l={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Jo=0,vo=!1,jl=function(i){function o(n){i.call(this),this.options=l.extend({},$l,n),l.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.onAdd=function(n){var s;return this._map=n,this._container=G.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),s=this._setupUI,Ko!==void 0?s(Ko):l.window.navigator.permissions!==void 0?l.window.navigator.permissions.query({name:"geolocation"}).then(function(p){s(Ko=p.state!=="denied")}):s(Ko=!!l.window.navigator.geolocation),this._container},o.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(l.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),G.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Jo=0,vo=!1},o.prototype._isOutOfMapMaxBounds=function(n){var s=this._map.getMaxBounds(),p=n.coords;return s&&(p.longitude<s.getWest()||p.longitude>s.getEast()||p.latitude<s.getSouth()||p.latitude>s.getNorth())},o.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},o.prototype._onSuccess=function(n){if(this._map){if(this._isOutOfMapMaxBounds(n))return this._setErrorState(),this.fire(new l.Event("outofmaxbounds",n)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=n,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(n),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(n),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new l.Event("geolocate",n)),this._finish()}},o.prototype._updateCamera=function(n){var s=new l.LngLat(n.coords.longitude,n.coords.latitude),p=n.coords.accuracy,m=this._map.getBearing(),y=l.extend({bearing:m},this.options.fitBoundsOptions);this._map.fitBounds(s.toBounds(p),y,{geolocateSource:!0})},o.prototype._updateMarker=function(n){if(n){var s=new l.LngLat(n.coords.longitude,n.coords.latitude);this._accuracyCircleMarker.setLngLat(s).addTo(this._map),this._userLocationDotMarker.setLngLat(s).addTo(this._map),this._accuracy=n.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},o.prototype._updateCircleRadius=function(){var n=this._map._container.clientHeight/2,s=this._map.unproject([0,n]),p=this._map.unproject([1,n]),m=s.distanceTo(p),y=Math.ceil(2*this._accuracy/m);this._circleElement.style.width=y+"px",this._circleElement.style.height=y+"px"},o.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},o.prototype._onError=function(n){if(this._map){if(this.options.trackUserLocation)if(n.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(n.code===3&&vo)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new l.Event("error",n)),this._finish()}},o.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},o.prototype._setupUI=function(n){var s=this;if(this._container.addEventListener("contextmenu",function(y){return y.preventDefault()}),this._geolocateButton=G.create("button","mapboxgl-ctrl-geolocate",this._container),G.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",n===!1){l.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var p=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=p,this._geolocateButton.setAttribute("aria-label",p)}else{var m=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=m,this._geolocateButton.setAttribute("aria-label",m)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=G.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Ra(this._dotElement),this._circleElement=G.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ra({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function(y){y.geolocateSource||s._watchState!=="ACTIVE_LOCK"||y.originalEvent&&y.originalEvent.type==="resize"||(s._watchState="BACKGROUND",s._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),s._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),s.fire(new l.Event("trackuserlocationend")))})},o.prototype.trigger=function(){if(!this._setup)return l.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new l.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Jo--,vo=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new l.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new l.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){var n;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Jo>1?(n={maximumAge:6e5,timeout:0},vo=!0):(n=this.options.positionOptions,vo=!1),this._geolocationWatchID=l.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,n)}}else l.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},o.prototype._clearWatch=function(){l.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},o}(l.Evented),Dn={maxWidth:100,unit:"metric"},Ln=function(i){this.options=l.extend({},Dn,i),l.bindAll(["_onMove","setUnit"],this)};function Ps(i,o,n){var s=n&&n.maxWidth||100,p=i._container.clientHeight/2,m=i.unproject([0,p]),y=i.unproject([s,p]),g=m.distanceTo(y);if(n&&n.unit==="imperial"){var w=3.2808*g;w>5280?Rn(o,s,w/5280,i._getUIString("ScaleControl.Miles")):Rn(o,s,w,i._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?Rn(o,s,g/1852,i._getUIString("ScaleControl.NauticalMiles")):g>=1e3?Rn(o,s,g/1e3,i._getUIString("ScaleControl.Kilometers")):Rn(o,s,g,i._getUIString("ScaleControl.Meters"))}function Rn(i,o,n,s){var p,m,y,g=(p=n,(m=Math.pow(10,(""+Math.floor(p)).length-1))*(y=(y=p/m)>=10?10:y>=5?5:y>=3?3:y>=2?2:y>=1?1:function(w){var A=Math.pow(10,Math.ceil(-Math.log(w)/Math.LN10));return Math.round(w*A)/A}(y)));i.style.width=o*(g/n)+"px",i.innerHTML=g+" "+s}Ln.prototype.getDefaultPosition=function(){return"bottom-left"},Ln.prototype._onMove=function(){Ps(this._map,this._container,this.options)},Ln.prototype.onAdd=function(i){return this._map=i,this._container=G.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",i.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Ln.prototype.onRemove=function(){G.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Ln.prototype.setUnit=function(i){this.options.unit=i,Ps(this._map,this._container,this.options)};var Bi=function(i){this._fullscreen=!1,i&&i.container&&(i.container instanceof l.window.HTMLElement?this._container=i.container:l.warnOnce("Full screen control 'container' must be a DOM element.")),l.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in l.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in l.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in l.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in l.window.document&&(this._fullscreenchange="MSFullscreenChange")};Bi.prototype.onAdd=function(i){return this._map=i,this._container||(this._container=this._map.getContainer()),this._controlContainer=G.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",l.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Bi.prototype.onRemove=function(){G.remove(this._controlContainer),this._map=null,l.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Bi.prototype._checkFullscreenSupport=function(){return!!(l.window.document.fullscreenEnabled||l.window.document.mozFullScreenEnabled||l.window.document.msFullscreenEnabled||l.window.document.webkitFullscreenEnabled)},Bi.prototype._setupUI=function(){var i=this._fullscreenButton=G.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);G.create("span","mapboxgl-ctrl-icon",i).setAttribute("aria-hidden",!0),i.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),l.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Bi.prototype._updateTitle=function(){var i=this._getTitle();this._fullscreenButton.setAttribute("aria-label",i),this._fullscreenButton.title=i},Bi.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Bi.prototype._isFullscreen=function(){return this._fullscreen},Bi.prototype._changeIcon=function(){(l.window.document.fullscreenElement||l.window.document.mozFullScreenElement||l.window.document.webkitFullscreenElement||l.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Bi.prototype._onClickFullscreen=function(){this._isFullscreen()?l.window.document.exitFullscreen?l.window.document.exitFullscreen():l.window.document.mozCancelFullScreen?l.window.document.mozCancelFullScreen():l.window.document.msExitFullscreen?l.window.document.msExitFullscreen():l.window.document.webkitCancelFullScreen&&l.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var ql={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Fa=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Gl=function(i){function o(n){i.call(this),this.options=l.extend(Object.create(ql),n),l.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.addTo=function(n){return this._map&&this.remove(),this._map=n,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new l.Event("open")),this},o.prototype.isOpen=function(){return!!this._map},o.prototype.remove=function(){return this._content&&G.remove(this._content),this._container&&(G.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new l.Event("close")),this},o.prototype.getLngLat=function(){return this._lngLat},o.prototype.setLngLat=function(n){return this._lngLat=l.LngLat.convert(n),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},o.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},o.prototype.getElement=function(){return this._container},o.prototype.setText=function(n){return this.setDOMContent(l.window.document.createTextNode(n))},o.prototype.setHTML=function(n){var s,p=l.window.document.createDocumentFragment(),m=l.window.document.createElement("body");for(m.innerHTML=n;s=m.firstChild;)p.appendChild(s);return this.setDOMContent(p)},o.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},o.prototype.setMaxWidth=function(n){return this.options.maxWidth=n,this._update(),this},o.prototype.setDOMContent=function(n){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=G.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(n),this._createCloseButton(),this._update(),this._focusFirstElement(),this},o.prototype.addClassName=function(n){this._container&&this._container.classList.add(n)},o.prototype.removeClassName=function(n){this._container&&this._container.classList.remove(n)},o.prototype.setOffset=function(n){return this.options.offset=n,this._update(),this},o.prototype.toggleClassName=function(n){if(this._container)return this._container.classList.toggle(n)},o.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=G.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},o.prototype._onMouseUp=function(n){this._update(n.point)},o.prototype._onMouseMove=function(n){this._update(n.point)},o.prototype._onDrag=function(n){this._update(n.point)},o.prototype._update=function(n){var s=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=G.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=G.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(L){return s._container.classList.add(L)}),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Xo(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||n)){var p=this._pos=this._trackPointer&&n?n:this._map.project(this._lngLat),m=this.options.anchor,y=function L(R){if(R){if(typeof R=="number"){var Z=Math.round(Math.sqrt(.5*Math.pow(R,2)));return{center:new l.Point(0,0),top:new l.Point(0,R),"top-left":new l.Point(Z,Z),"top-right":new l.Point(-Z,Z),bottom:new l.Point(0,-R),"bottom-left":new l.Point(Z,-Z),"bottom-right":new l.Point(-Z,-Z),left:new l.Point(R,0),right:new l.Point(-R,0)}}if(R instanceof l.Point||Array.isArray(R)){var j=l.Point.convert(R);return{center:j,top:j,"top-left":j,"top-right":j,bottom:j,"bottom-left":j,"bottom-right":j,left:j,right:j}}return{center:l.Point.convert(R.center||[0,0]),top:l.Point.convert(R.top||[0,0]),"top-left":l.Point.convert(R["top-left"]||[0,0]),"top-right":l.Point.convert(R["top-right"]||[0,0]),bottom:l.Point.convert(R.bottom||[0,0]),"bottom-left":l.Point.convert(R["bottom-left"]||[0,0]),"bottom-right":l.Point.convert(R["bottom-right"]||[0,0]),left:l.Point.convert(R.left||[0,0]),right:l.Point.convert(R.right||[0,0])}}return L(new l.Point(0,0))}(this.options.offset);if(!m){var g,w=this._container.offsetWidth,A=this._container.offsetHeight;g=p.y+y.bottom.y<A?["top"]:p.y>this._map.transform.height-A?["bottom"]:[],p.x<w/2?g.push("left"):p.x>this._map.transform.width-w/2&&g.push("right"),m=g.length===0?"bottom":g.join("-")}var B=p.add(y[m]).round();G.setTransform(this._container,tn[m]+" translate("+B.x+"px,"+B.y+"px)"),Es(this._container,m,"popup")}},o.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var n=this._container.querySelector(Fa);n&&n.focus()}},o.prototype._onClose=function(){this.remove()},o}(l.Evented),Cs={version:l.version,supported:re,setRTLTextPlugin:l.setRTLTextPlugin,getRTLTextPluginStatus:l.getRTLTextPluginStatus,Map:lc,NavigationControl:dn,GeolocateControl:jl,AttributionControl:Hr,ScaleControl:Ln,FullscreenControl:Bi,Popup:Gl,Marker:Ra,Style:ui,LngLat:l.LngLat,LngLatBounds:l.LngLatBounds,Point:l.Point,MercatorCoordinate:l.MercatorCoordinate,Evented:l.Evented,config:l.config,prewarm:function(){de().acquire(fe)},clearPrewarmedResources:function(){var i=Ve;i&&(i.isPreloaded()&&i.numActive()===1?(i.release(fe),Ve=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return l.config.ACCESS_TOKEN},set accessToken(i){l.config.ACCESS_TOKEN=i},get baseApiUrl(){return l.config.API_URL},set baseApiUrl(i){l.config.API_URL=i},get workerCount(){return xe.workerCount},set workerCount(i){xe.workerCount=i},get maxParallelImageRequests(){return l.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(i){l.config.MAX_PARALLEL_IMAGE_REQUESTS=i},clearStorage:function(i){l.clearTileCache(i)},workerUrl:""};return Cs}),k})})(Xg);var u0=Xg.exports;const Zn=st.getDefaultExportFromCjs(u0);var xp={exports:{}},c0=h0,p0={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"};function h0(d){if(!d||!d.type)return null;var h=p0[d.type];if(!h)return null;if(h==="geometry")return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:d}]};if(h==="feature")return{type:"FeatureCollection",features:[d]};if(h==="featurecollection")return d}function ep(d){switch(d&&d.type||null){case"FeatureCollection":return d.features=d.features.reduce(function(h,_){return h.concat(ep(_))},[]),d;case"Feature":return d.geometry?ep(d.geometry).map(function(h){var _={type:"Feature",properties:JSON.parse(JSON.stringify(d.properties)),geometry:h};return d.id!==void 0&&(_.id=d.id),_}):[d];case"MultiPoint":return d.coordinates.map(function(h){return{type:"Point",coordinates:h}});case"MultiPolygon":return d.coordinates.map(function(h){return{type:"Polygon",coordinates:h}});case"MultiLineString":return d.coordinates.map(function(h){return{type:"LineString",coordinates:h}});case"GeometryCollection":return d.geometries.map(ep).reduce(function(h,_){return h.concat(_)},[]);case"Point":case"Polygon":case"LineString":return[d]}}const f0=Object.freeze(Object.defineProperty({__proto__:null,default:ep},Symbol.toStringTag,{value:"Module"})),d0=st.getAugmentedNamespace(f0);var m0=function(h){return _(h);function _(E){return Array.isArray(E)&&E.length&&typeof E[0]=="number"?[E]:E.reduce(function(k,V){return Array.isArray(V)&&Array.isArray(V[0])?k.concat(_(V)):(k.push(V),k)},[])}},y0=c0,tp=d0,v0=m0;tp instanceof Function||(tp=tp.default);var g0=function(d){if(!d)return[];var h=tp(y0(d)),_=[];return h.features.forEach(function(E){E.geometry&&(_=_.concat(v0(E.geometry.coordinates)))}),_},Kg=Function.prototype.toString,ll=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,nd,rp;if(typeof ll=="function"&&typeof Object.defineProperty=="function")try{nd=Object.defineProperty({},"length",{get:function(){throw rp}}),rp={},ll(function(){throw 42},null,nd)}catch(d){d!==rp&&(ll=null)}else ll=null;var _0=/^\s*class\b/,od=function(h){try{var _=Kg.call(h);return _0.test(_)}catch{return!1}},Th=function(h){try{return od(h)?!1:(Kg.call(h),!0)}catch{return!1}},ip=Object.prototype.toString,x0="[object Object]",b0="[object Function]",w0="[object GeneratorFunction]",S0="[object HTMLAllCollection]",T0="[object HTML document.all class]",I0="[object HTMLCollection]",A0=typeof Symbol=="function"&&!!Symbol.toStringTag,E0=!(0 in[,]),ad=function(){return!1};if(typeof document=="object"){var P0=document.all;ip.call(P0)===ip.call(document.all)&&(ad=function(h){if((E0||!h)&&(typeof h>"u"||typeof h=="object"))try{var _=ip.call(h);return(_===S0||_===T0||_===I0||_===x0)&&h("")==null}catch{}return!1})}var bp=ll?function(h){if(ad(h))return!0;if(!h||typeof h!="function"&&typeof h!="object")return!1;try{ll(h,null,nd)}catch(_){if(_!==rp)return!1}return!od(h)&&Th(h)}:function(h){if(ad(h))return!0;if(!h||typeof h!="function"&&typeof h!="object")return!1;if(A0)return Th(h);if(od(h))return!1;var _=ip.call(h);return _!==b0&&_!==w0&&!/^\[object HTML/.test(_)?!1:Th(h)},C0=bp,k0=Object.prototype.toString,Jg=Object.prototype.hasOwnProperty,M0=function(h,_,E){for(var k=0,V=h.length;k<V;k++)Jg.call(h,k)&&(E==null?_(h[k],k,h):_.call(E,h[k],k,h))},z0=function(h,_,E){for(var k=0,V=h.length;k<V;k++)E==null?_(h.charAt(k),k,h):_.call(E,h.charAt(k),k,h)},B0=function(h,_,E){for(var k in h)Jg.call(h,k)&&(E==null?_(h[k],k,h):_.call(E,h[k],k,h))};function D0(d){return k0.call(d)==="[object Array]"}var wd=function(h,_,E){if(!C0(_))throw new TypeError("iterator must be a function");var k;arguments.length>=3&&(k=E),D0(h)?M0(h,_,k):typeof h=="string"?z0(h,_,k):B0(h,_,k)},Yg=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],Ih=Yg,L0=typeof globalThis>"u"?st.commonjsGlobal:globalThis,Tu=function(){for(var h=[],_=0;_<Ih.length;_++)typeof L0[Ih[_]]=="function"&&(h[h.length]=Ih[_]);return h},Qg={exports:{}},Sd=Object,R0=Error,F0=EvalError,Td=RangeError,O0=ReferenceError,_n=SyntaxError,St=TypeError,V0=URIError,wp=Math.abs,Ya=Math.floor,Id=Math.max,Ad=Math.min,Qa=Math.pow,U0=Math.round,es=Number.isNaN||function(h){return h!==h},N0=es,$0=function(h){return N0(h)||h===0?h:h<0?-1:1},j0=Object.getOwnPropertyDescriptor,np=j0;if(np)try{np([],"length")}catch{np=null}var Co=np,op=Object.defineProperty||!1;if(op)try{op({},"a",{value:1})}catch{op=!1}var Iu=op,Ah,my;function Ed(){return my||(my=1,Ah=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var h={},_=Symbol("test"),E=Object(_);if(typeof _=="string"||Object.prototype.toString.call(_)!=="[object Symbol]"||Object.prototype.toString.call(E)!=="[object Symbol]")return!1;var k=42;h[_]=k;for(var V in h)return!1;if(typeof Object.keys=="function"&&Object.keys(h).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(h).length!==0)return!1;var l=Object.getOwnPropertySymbols(h);if(l.length!==1||l[0]!==_||!Object.prototype.propertyIsEnumerable.call(h,_))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var re=Object.getOwnPropertyDescriptor(h,_);if(re.value!==k||re.enumerable!==!0)return!1}return!0}),Ah}var Eh,yy;function e_(){if(yy)return Eh;yy=1;var d=typeof Symbol<"u"&&Symbol,h=Ed();return Eh=function(){return typeof d!="function"||typeof Symbol!="function"||typeof d("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:h()},Eh}var t_=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,q0=Sd,r_=q0.getPrototypeOf||null,G0="Function.prototype.bind called on incompatible ",Z0=Object.prototype.toString,W0=Math.max,H0="[object Function]",vy=function(h,_){for(var E=[],k=0;k<h.length;k+=1)E[k]=h[k];for(var V=0;V<_.length;V+=1)E[V+h.length]=_[V];return E},X0=function(h,_){for(var E=[],k=_,V=0;k<h.length;k+=1,V+=1)E[V]=h[k];return E},K0=function(d,h){for(var _="",E=0;E<d.length;E+=1)_+=d[E],E+1<d.length&&(_+=h);return _},J0=function(h){var _=this;if(typeof _!="function"||Z0.apply(_)!==H0)throw new TypeError(G0+_);for(var E=X0(arguments,1),k,V=function(){if(this instanceof k){var pe=_.apply(this,vy(E,arguments));return Object(pe)===pe?pe:this}return _.apply(h,vy(E,arguments))},l=W0(0,_.length-E.length),re=[],G=0;G<l;G++)re[G]="$"+G;if(k=Function("binder","return function ("+K0(re,",")+"){ return binder.apply(this,arguments); }")(V),_.prototype){var me=function(){};me.prototype=_.prototype,k.prototype=new me,me.prototype=null}return k},Y0=J0,Au=Function.prototype.bind||Y0,Pd=Function.prototype.call,Cd=Function.prototype.apply,Q0=typeof Reflect<"u"&&Reflect&&Reflect.apply,e1=Au,t1=Cd,r1=Pd,i1=Q0,i_=i1||e1.call(r1,t1),n1=Au,o1=St,a1=Pd,s1=i_,kd=function(h){if(h.length<1||typeof h[0]!="function")throw new o1("a function is required");return s1(n1,a1,h)},l1=kd,gy=Co,n_;try{n_=[].__proto__===Array.prototype}catch(d){if(!d||typeof d!="object"||!("code"in d)||d.code!=="ERR_PROTO_ACCESS")throw d}var Ph=!!n_&&gy&&gy(Object.prototype,"__proto__"),o_=Object,_y=o_.getPrototypeOf,u1=Ph&&typeof Ph.get=="function"?l1([Ph.get]):typeof _y=="function"?function(h){return _y(h==null?h:o_(h))}:!1,xy=t_,by=r_,wy=u1,ts=xy?function(h){return xy(h)}:by?function(h){if(!h||typeof h!="object"&&typeof h!="function")throw new TypeError("getProto: not an object");return by(h)}:wy?function(h){return wy(h)}:null,Ch,Sy;function ko(){if(Sy)return Ch;Sy=1;var d=Function.prototype.call,h=Object.prototype.hasOwnProperty,_=Au;return Ch=_.call(d,h),Ch}var kt,c1=Sd,p1=R0,h1=F0,f1=Td,d1=O0,cl=_n,ul=St,m1=V0,y1=wp,v1=Ya,g1=Id,_1=Ad,x1=Qa,b1=U0,w1=$0,a_=Function,kh=function(d){try{return a_('"use strict"; return ('+d+").constructor;")()}catch{}},wu=Co,S1=Iu,Mh=function(){throw new ul},T1=wu?function(){try{return arguments.callee,Mh}catch{try{return wu(arguments,"callee").get}catch{return Mh}}}():Mh,nl=e_()(),Qr=ts,I1=r_,A1=t_,s_=Cd,Eu=Pd,sl={},E1=typeof Uint8Array>"u"||!Qr?kt:Qr(Uint8Array),Ja={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?kt:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?kt:ArrayBuffer,"%ArrayIteratorPrototype%":nl&&Qr?Qr([][Symbol.iterator]()):kt,"%AsyncFromSyncIteratorPrototype%":kt,"%AsyncFunction%":sl,"%AsyncGenerator%":sl,"%AsyncGeneratorFunction%":sl,"%AsyncIteratorPrototype%":sl,"%Atomics%":typeof Atomics>"u"?kt:Atomics,"%BigInt%":typeof BigInt>"u"?kt:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?kt:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?kt:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?kt:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":p1,"%eval%":eval,"%EvalError%":h1,"%Float16Array%":typeof Float16Array>"u"?kt:Float16Array,"%Float32Array%":typeof Float32Array>"u"?kt:Float32Array,"%Float64Array%":typeof Float64Array>"u"?kt:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?kt:FinalizationRegistry,"%Function%":a_,"%GeneratorFunction%":sl,"%Int8Array%":typeof Int8Array>"u"?kt:Int8Array,"%Int16Array%":typeof Int16Array>"u"?kt:Int16Array,"%Int32Array%":typeof Int32Array>"u"?kt:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":nl&&Qr?Qr(Qr([][Symbol.iterator]())):kt,"%JSON%":typeof JSON=="object"?JSON:kt,"%Map%":typeof Map>"u"?kt:Map,"%MapIteratorPrototype%":typeof Map>"u"||!nl||!Qr?kt:Qr(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":c1,"%Object.getOwnPropertyDescriptor%":wu,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?kt:Promise,"%Proxy%":typeof Proxy>"u"?kt:Proxy,"%RangeError%":f1,"%ReferenceError%":d1,"%Reflect%":typeof Reflect>"u"?kt:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?kt:Set,"%SetIteratorPrototype%":typeof Set>"u"||!nl||!Qr?kt:Qr(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?kt:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":nl&&Qr?Qr(""[Symbol.iterator]()):kt,"%Symbol%":nl?Symbol:kt,"%SyntaxError%":cl,"%ThrowTypeError%":T1,"%TypedArray%":E1,"%TypeError%":ul,"%Uint8Array%":typeof Uint8Array>"u"?kt:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?kt:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?kt:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?kt:Uint32Array,"%URIError%":m1,"%WeakMap%":typeof WeakMap>"u"?kt:WeakMap,"%WeakRef%":typeof WeakRef>"u"?kt:WeakRef,"%WeakSet%":typeof WeakSet>"u"?kt:WeakSet,"%Function.prototype.call%":Eu,"%Function.prototype.apply%":s_,"%Object.defineProperty%":S1,"%Object.getPrototypeOf%":I1,"%Math.abs%":y1,"%Math.floor%":v1,"%Math.max%":g1,"%Math.min%":_1,"%Math.pow%":x1,"%Math.round%":b1,"%Math.sign%":w1,"%Reflect.getPrototypeOf%":A1};if(Qr)try{null.error}catch(d){var P1=Qr(Qr(d));Ja["%Error.prototype%"]=P1}var C1=function d(h){var _;if(h==="%AsyncFunction%")_=kh("async function () {}");else if(h==="%GeneratorFunction%")_=kh("function* () {}");else if(h==="%AsyncGeneratorFunction%")_=kh("async function* () {}");else if(h==="%AsyncGenerator%"){var E=d("%AsyncGeneratorFunction%");E&&(_=E.prototype)}else if(h==="%AsyncIteratorPrototype%"){var k=d("%AsyncGenerator%");k&&Qr&&(_=Qr(k.prototype))}return Ja[h]=_,_},Ty={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Pu=Au,up=ko(),k1=Pu.call(Eu,Array.prototype.concat),M1=Pu.call(s_,Array.prototype.splice),Iy=Pu.call(Eu,String.prototype.replace),cp=Pu.call(Eu,String.prototype.slice),z1=Pu.call(Eu,RegExp.prototype.exec),B1=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,D1=/\\(\\)?/g,L1=function(h){var _=cp(h,0,1),E=cp(h,-1);if(_==="%"&&E!=="%")throw new cl("invalid intrinsic syntax, expected closing `%`");if(E==="%"&&_!=="%")throw new cl("invalid intrinsic syntax, expected opening `%`");var k=[];return Iy(h,B1,function(V,l,re,G){k[k.length]=re?Iy(G,D1,"$1"):l||V}),k},R1=function(h,_){var E=h,k;if(up(Ty,E)&&(k=Ty[E],E="%"+k[0]+"%"),up(Ja,E)){var V=Ja[E];if(V===sl&&(V=C1(E)),typeof V>"u"&&!_)throw new ul("intrinsic "+h+" exists, but is not available. Please file an issue!");return{alias:k,name:E,value:V}}throw new cl("intrinsic "+h+" does not exist!")},hr=function(h,_){if(typeof h!="string"||h.length===0)throw new ul("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof _!="boolean")throw new ul('"allowMissing" argument must be a boolean');if(z1(/^%?[^%]*%?$/,h)===null)throw new cl("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var E=L1(h),k=E.length>0?E[0]:"",V=R1("%"+k+"%",_),l=V.name,re=V.value,G=!1,me=V.alias;me&&(k=me[0],M1(E,k1([0,1],me)));for(var pe=1,Ce=!0;pe<E.length;pe+=1){var ae=E[pe],ve=cp(ae,0,1),ke=cp(ae,-1);if((ve==='"'||ve==="'"||ve==="`"||ke==='"'||ke==="'"||ke==="`")&&ve!==ke)throw new cl("property names with quotes must have matching quotes");if((ae==="constructor"||!Ce)&&(G=!0),k+="."+ae,l="%"+k+"%",up(Ja,l))re=Ja[l];else if(re!=null){if(!(ae in re)){if(!_)throw new ul("base intrinsic for "+h+" exists, but the property is not available.");return}if(wu&&pe+1>=E.length){var Xe=wu(re,ae);Ce=!!Xe,Ce&&"get"in Xe&&!("originalValue"in Xe.get)?re=Xe.get:re=re[ae]}else Ce=up(re,ae),re=re[ae];Ce&&!G&&(Ja[l]=re)}}return re},Ay=Iu,F1=_n,ol=St,Ey=Co,Md=function(h,_,E){if(!h||typeof h!="object"&&typeof h!="function")throw new ol("`obj` must be an object or a function`");if(typeof _!="string"&&typeof _!="symbol")throw new ol("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new ol("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new ol("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new ol("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new ol("`loose`, if provided, must be a boolean");var k=arguments.length>3?arguments[3]:null,V=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,re=arguments.length>6?arguments[6]:!1,G=!!Ey&&Ey(h,_);if(Ay)Ay(h,_,{configurable:l===null&&G?G.configurable:!l,enumerable:k===null&&G?G.enumerable:!k,value:E,writable:V===null&&G?G.writable:!V});else if(re||!k&&!V&&!l)h[_]=E;else throw new F1("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},sd=Iu,l_=function(){return!!sd};l_.hasArrayLengthDefineBug=function(){if(!sd)return null;try{return sd([],"length",{value:1}).length!==1}catch{return!0}};var Sp=l_,O1=hr,Py=Md,V1=Sp(),Cy=Co,ky=St,U1=O1("%Math.floor%"),N1=function(h,_){if(typeof h!="function")throw new ky("`fn` is not a function");if(typeof _!="number"||_<0||_>4294967295||U1(_)!==_)throw new ky("`length` must be a positive 32-bit integer");var E=arguments.length>2&&!!arguments[2],k=!0,V=!0;if("length"in h&&Cy){var l=Cy(h,"length");l&&!l.configurable&&(k=!1),l&&!l.writable&&(V=!1)}return(k||V||!E)&&(V1?Py(h,"length",_,!0,!0):Py(h,"length",_)),h},$1=Au,j1=Cd,q1=i_,G1=function(){return q1($1,j1,arguments)};(function(d){var h=N1,_=Iu,E=kd,k=G1;d.exports=function(l){var re=E(arguments),G=l.length-(arguments.length-1);return h(re,1+(G>0?G:0),!0)},_?_(d.exports,"apply",{value:k}):d.exports.apply=k})(Qg);var sa=Qg.exports,u_=hr,c_=kd,Z1=c_([u_("%String.prototype.indexOf%")]),Wt=function(h,_){var E=u_(h,!!_);return typeof E=="function"&&Z1(h,".prototype.")>-1?c_([E]):E},zh,My;function Mo(){if(My)return zh;My=1;var d=Ed();return zh=function(){return d()&&!!Symbol.toStringTag},zh}var pp=wd,W1=Tu,zy=sa,zd=Wt,ap=Co,$c=ts,H1=zd("Object.prototype.toString"),p_=Mo()(),By=typeof globalThis>"u"?st.commonjsGlobal:globalThis,ld=W1(),Bd=zd("String.prototype.slice"),X1=zd("Array.prototype.indexOf",!0)||function(h,_){for(var E=0;E<h.length;E+=1)if(h[E]===_)return E;return-1},hp={__proto__:null};p_&&ap&&$c?pp(ld,function(d){var h=new By[d];if(Symbol.toStringTag in h&&$c){var _=$c(h),E=ap(_,Symbol.toStringTag);if(!E&&_){var k=$c(_);E=ap(k,Symbol.toStringTag)}hp["$"+d]=zy(E.get)}}):pp(ld,function(d){var h=new By[d],_=h.slice||h.set;_&&(hp["$"+d]=zy(_))});var K1=function(h){var _=!1;return pp(hp,function(E,k){if(!_)try{"$"+E(h)===k&&(_=Bd(k,1))}catch{}}),_},J1=function(h){var _=!1;return pp(hp,function(E,k){if(!_)try{E(h),_=Bd(k,1)}catch{}}),_},hl=function(h){if(!h||typeof h!="object")return!1;if(!p_){var _=Bd(H1(h),8,-1);return X1(ld,_)>-1?_:_!=="Object"?!1:J1(h)}return ap?K1(h):null},Dy=Object.prototype.toString,h_=function(h){var _=Dy.call(h),E=_==="[object Arguments]";return E||(E=_!=="[object Array]"&&h!==null&&typeof h=="object"&&typeof h.length=="number"&&h.length>=0&&Dy.call(h.callee)==="[object Function]"),E},Bh,Ly;function Y1(){if(Ly)return Bh;Ly=1;var d;if(!Object.keys){var h=Object.prototype.hasOwnProperty,_=Object.prototype.toString,E=h_,k=Object.prototype.propertyIsEnumerable,V=!k.call({toString:null},"toString"),l=k.call(function(){},"prototype"),re=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],G=function(ae){var ve=ae.constructor;return ve&&ve.prototype===ae},me={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},pe=function(){if(typeof window>"u")return!1;for(var ae in window)try{if(!me["$"+ae]&&h.call(window,ae)&&window[ae]!==null&&typeof window[ae]=="object")try{G(window[ae])}catch{return!0}}catch{return!0}return!1}(),Ce=function(ae){if(typeof window>"u"||!pe)return G(ae);try{return G(ae)}catch{return!1}};d=function(ve){var ke=ve!==null&&typeof ve=="object",Xe=_.call(ve)==="[object Function]",$e=E(ve),At=ke&&_.call(ve)==="[object String]",et=[];if(!ke&&!Xe&&!$e)throw new TypeError("Object.keys called on a non-object");var dt=l&&Xe;if(At&&ve.length>0&&!h.call(ve,0))for(var Rt=0;Rt<ve.length;++Rt)et.push(String(Rt));if($e&&ve.length>0)for(var Gt=0;Gt<ve.length;++Gt)et.push(String(Gt));else for(var Qt in ve)!(dt&&Qt==="prototype")&&h.call(ve,Qt)&&et.push(String(Qt));if(V)for(var fr=Ce(ve),Er=0;Er<re.length;++Er)!(fr&&re[Er]==="constructor")&&h.call(ve,re[Er])&&et.push(re[Er]);return et}}return Bh=d,Bh}var Q1=Array.prototype.slice,ew=h_,Ry=Object.keys,sp=Ry?function(h){return Ry(h)}:Y1(),Fy=Object.keys;sp.shim=function(){if(Object.keys){var h=function(){var _=Object.keys(arguments);return _&&_.length===arguments.length}(1,2);h||(Object.keys=function(E){return ew(E)?Fy(Q1.call(E)):Fy(E)})}else Object.keys=sp;return Object.keys||sp};var tw=sp,rw=tw,iw=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",nw=Object.prototype.toString,ow=Array.prototype.concat,Oy=Md,aw=function(d){return typeof d=="function"&&nw.call(d)==="[object Function]"},f_=Sp(),sw=function(d,h,_,E){if(h in d){if(E===!0){if(d[h]===_)return}else if(!aw(E)||!E())return}f_?Oy(d,h,_,!0):Oy(d,h,_)},d_=function(d,h){var _=arguments.length>2?arguments[2]:{},E=rw(h);iw&&(E=ow.call(E,Object.getOwnPropertySymbols(h)));for(var k=0;k<E.length;k+=1)sw(d,E[k],h[E[k]],_[E[k]])};d_.supportsDescriptors=!!f_;var Cu=d_;const lw={},uw=Object.freeze(Object.defineProperty({__proto__:null,default:lw},Symbol.toStringTag,{value:"Module"})),cw=st.getAugmentedNamespace(uw);var Dd=typeof Map=="function"&&Map.prototype,Dh=Object.getOwnPropertyDescriptor&&Dd?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,fp=Dd&&Dh&&typeof Dh.get=="function"?Dh.get:null,Vy=Dd&&Map.prototype.forEach,Ld=typeof Set=="function"&&Set.prototype,Lh=Object.getOwnPropertyDescriptor&&Ld?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,dp=Ld&&Lh&&typeof Lh.get=="function"?Lh.get:null,Uy=Ld&&Set.prototype.forEach,pw=typeof WeakMap=="function"&&WeakMap.prototype,gu=pw?WeakMap.prototype.has:null,hw=typeof WeakSet=="function"&&WeakSet.prototype,_u=hw?WeakSet.prototype.has:null,fw=typeof WeakRef=="function"&&WeakRef.prototype,Ny=fw?WeakRef.prototype.deref:null,dw=Boolean.prototype.valueOf,mw=Object.prototype.toString,yw=Function.prototype.toString,vw=String.prototype.match,Rd=String.prototype.slice,oa=String.prototype.replace,gw=String.prototype.toUpperCase,$y=String.prototype.toLowerCase,m_=RegExp.prototype.test,jy=Array.prototype.concat,Wn=Array.prototype.join,_w=Array.prototype.slice,qy=Math.floor,ud=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Rh=Object.getOwnPropertySymbols,cd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,pl=typeof Symbol=="function"&&typeof Symbol.iterator=="object",xu=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===pl||!0)?Symbol.toStringTag:null,y_=Object.prototype.propertyIsEnumerable,Gy=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(d){return d.__proto__}:null);function Zy(d,h){if(d===1/0||d===-1/0||d!==d||d&&d>-1e3&&d<1e3||m_.call(/e/,h))return h;var _=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof d=="number"){var E=d<0?-qy(-d):qy(d);if(E!==d){var k=String(E),V=Rd.call(h,k.length+1);return oa.call(k,_,"$&_")+"."+oa.call(oa.call(V,/([0-9]{3})/g,"$&_"),/_$/,"")}}return oa.call(h,_,"$&_")}var pd=cw,Wy=pd.custom,Hy=__(Wy)?Wy:null,v_={__proto__:null,double:'"',single:"'"},xw={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},bw=function d(h,_,E,k){var V=_||{};if(Po(V,"quoteStyle")&&!Po(v_,V.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Po(V,"maxStringLength")&&(typeof V.maxStringLength=="number"?V.maxStringLength<0&&V.maxStringLength!==1/0:V.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=Po(V,"customInspect")?V.customInspect:!0;if(typeof l!="boolean"&&l!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Po(V,"indent")&&V.indent!==null&&V.indent!==" "&&!(parseInt(V.indent,10)===V.indent&&V.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Po(V,"numericSeparator")&&typeof V.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var re=V.numericSeparator;if(typeof h>"u")return"undefined";if(h===null)return"null";if(typeof h=="boolean")return h?"true":"false";if(typeof h=="string")return b_(h,V);if(typeof h=="number"){if(h===0)return 1/0/h>0?"0":"-0";var G=String(h);return re?Zy(h,G):G}if(typeof h=="bigint"){var me=String(h)+"n";return re?Zy(h,me):me}var pe=typeof V.depth>"u"?5:V.depth;if(typeof E>"u"&&(E=0),E>=pe&&pe>0&&typeof h=="object")return hd(h)?"[Array]":"[Object]";var Ce=Vw(V,E);if(typeof k>"u")k=[];else if(x_(k,h)>=0)return"[Circular]";function ae(Ft,Pr,Bo){if(Pr&&(k=_w.call(k),k.push(Pr)),Bo){var li={depth:V.depth};return Po(V,"quoteStyle")&&(li.quoteStyle=V.quoteStyle),d(Ft,li,E+1,k)}return d(Ft,V,E+1,k)}if(typeof h=="function"&&!Xy(h)){var ve=kw(h),ke=jc(h,ae);return"[Function"+(ve?": "+ve:" (anonymous)")+"]"+(ke.length>0?" { "+Wn.call(ke,", ")+" }":"")}if(__(h)){var Xe=pl?oa.call(String(h),/^(Symbol\(.*\))_[^)]*$/,"$1"):cd.call(h);return typeof h=="object"&&!pl?vu(Xe):Xe}if(Rw(h)){for(var $e="<"+$y.call(String(h.nodeName)),At=h.attributes||[],et=0;et<At.length;et++)$e+=" "+At[et].name+"="+g_(ww(At[et].value),"double",V);return $e+=">",h.childNodes&&h.childNodes.length&&($e+="..."),$e+="</"+$y.call(String(h.nodeName))+">",$e}if(hd(h)){if(h.length===0)return"[]";var dt=jc(h,ae);return Ce&&!Ow(dt)?"["+fd(dt,Ce)+"]":"[ "+Wn.call(dt,", ")+" ]"}if(Tw(h)){var Rt=jc(h,ae);return!("cause"in Error.prototype)&&"cause"in h&&!y_.call(h,"cause")?"{ ["+String(h)+"] "+Wn.call(jy.call("[cause]: "+ae(h.cause),Rt),", ")+" }":Rt.length===0?"["+String(h)+"]":"{ ["+String(h)+"] "+Wn.call(Rt,", ")+" }"}if(typeof h=="object"&&l){if(Hy&&typeof h[Hy]=="function"&&pd)return pd(h,{depth:pe-E});if(l!=="symbol"&&typeof h.inspect=="function")return h.inspect()}if(Mw(h)){var Gt=[];return Vy&&Vy.call(h,function(Ft,Pr){Gt.push(ae(Pr,h,!0)+" => "+ae(Ft,h))}),Ky("Map",fp.call(h),Gt,Ce)}if(Dw(h)){var Qt=[];return Uy&&Uy.call(h,function(Ft){Qt.push(ae(Ft,h))}),Ky("Set",dp.call(h),Qt,Ce)}if(zw(h))return Fh("WeakMap");if(Lw(h))return Fh("WeakSet");if(Bw(h))return Fh("WeakRef");if(Aw(h))return vu(ae(Number(h)));if(Pw(h))return vu(ae(ud.call(h)));if(Ew(h))return vu(dw.call(h));if(Iw(h))return vu(ae(String(h)));if(typeof window<"u"&&h===window)return"{ [object Window] }";if(typeof globalThis<"u"&&h===globalThis||typeof st.commonjsGlobal<"u"&&h===st.commonjsGlobal)return"{ [object globalThis] }";if(!Sw(h)&&!Xy(h)){var fr=jc(h,ae),Er=Gy?Gy(h)===Object.prototype:h instanceof Object||h.constructor===Object,dr=h instanceof Object?"":"null prototype",ei=!Er&&xu&&Object(h)===h&&xu in h?Rd.call(la(h),8,-1):dr?"Object":"",wr=Er||typeof h.constructor!="function"?"":h.constructor.name?h.constructor.name+" ":"",Si=wr+(ei||dr?"["+Wn.call(jy.call([],ei||[],dr||[]),": ")+"] ":"");return fr.length===0?Si+"{}":Ce?Si+"{"+fd(fr,Ce)+"}":Si+"{ "+Wn.call(fr,", ")+" }"}return String(h)};function g_(d,h,_){var E=_.quoteStyle||h,k=v_[E];return k+d+k}function ww(d){return oa.call(String(d),/"/g,""")}function rs(d){return!xu||!(typeof d=="object"&&(xu in d||typeof d[xu]<"u"))}function hd(d){return la(d)==="[object Array]"&&rs(d)}function Sw(d){return la(d)==="[object Date]"&&rs(d)}function Xy(d){return la(d)==="[object RegExp]"&&rs(d)}function Tw(d){return la(d)==="[object Error]"&&rs(d)}function Iw(d){return la(d)==="[object String]"&&rs(d)}function Aw(d){return la(d)==="[object Number]"&&rs(d)}function Ew(d){return la(d)==="[object Boolean]"&&rs(d)}function __(d){if(pl)return d&&typeof d=="object"&&d instanceof Symbol;if(typeof d=="symbol")return!0;if(!d||typeof d!="object"||!cd)return!1;try{return cd.call(d),!0}catch{}return!1}function Pw(d){if(!d||typeof d!="object"||!ud)return!1;try{return ud.call(d),!0}catch{}return!1}var Cw=Object.prototype.hasOwnProperty||function(d){return d in this};function Po(d,h){return Cw.call(d,h)}function la(d){return mw.call(d)}function kw(d){if(d.name)return d.name;var h=vw.call(yw.call(d),/^function\s*([\w$]+)/);return h?h[1]:null}function x_(d,h){if(d.indexOf)return d.indexOf(h);for(var _=0,E=d.length;_<E;_++)if(d[_]===h)return _;return-1}function Mw(d){if(!fp||!d||typeof d!="object")return!1;try{fp.call(d);try{dp.call(d)}catch{return!0}return d instanceof Map}catch{}return!1}function zw(d){if(!gu||!d||typeof d!="object")return!1;try{gu.call(d,gu);try{_u.call(d,_u)}catch{return!0}return d instanceof WeakMap}catch{}return!1}function Bw(d){if(!Ny||!d||typeof d!="object")return!1;try{return Ny.call(d),!0}catch{}return!1}function Dw(d){if(!dp||!d||typeof d!="object")return!1;try{dp.call(d);try{fp.call(d)}catch{return!0}return d instanceof Set}catch{}return!1}function Lw(d){if(!_u||!d||typeof d!="object")return!1;try{_u.call(d,_u);try{gu.call(d,gu)}catch{return!0}return d instanceof WeakSet}catch{}return!1}function Rw(d){return!d||typeof d!="object"?!1:typeof HTMLElement<"u"&&d instanceof HTMLElement?!0:typeof d.nodeName=="string"&&typeof d.getAttribute=="function"}function b_(d,h){if(d.length>h.maxStringLength){var _=d.length-h.maxStringLength,E="... "+_+" more character"+(_>1?"s":"");return b_(Rd.call(d,0,h.maxStringLength),h)+E}var k=xw[h.quoteStyle||"single"];k.lastIndex=0;var V=oa.call(oa.call(d,k,"\\$1"),/[\x00-\x1f]/g,Fw);return g_(V,"single",h)}function Fw(d){var h=d.charCodeAt(0),_={8:"b",9:"t",10:"n",12:"f",13:"r"}[h];return _?"\\"+_:"\\x"+(h<16?"0":"")+gw.call(h.toString(16))}function vu(d){return"Object("+d+")"}function Fh(d){return d+" { ? }"}function Ky(d,h,_,E){var k=E?fd(_,E):Wn.call(_,", ");return d+" ("+h+") {"+k+"}"}function Ow(d){for(var h=0;h<d.length;h++)if(x_(d[h],`
|
|
498
|
-
`)>=0)return!1;return!0}function
|
|
497
|
+
`),ie=y.createShader(y.FRAGMENT_SHADER);if(y.isContextLost())this.failedToCreate=!0;else{y.shaderSource(ie,X),y.compileShader(ie),y.attachShader(this.program,ie);var ce=y.createShader(y.VERTEX_SHADER);if(y.isContextLost())this.failedToCreate=!0;else{y.shaderSource(ce,Q),y.compileShader(ce),y.attachShader(this.program,ce),this.attributes={};var le={};this.numAttributes=A.length;for(var he=0;he<this.numAttributes;he++)A[he]&&(y.bindAttribLocation(this.program,he,A[he]),this.attributes[A[he]]=he);y.linkProgram(this.program),y.deleteShader(ce),y.deleteShader(ie);for(var ge=0;ge<R.length;ge++){var Te=R[ge];if(Te&&!le[Te]){var Se=y.getUniformLocation(this.program,Te);Se&&(le[Te]=Se)}}this.fixedUniforms=p(i,le),this.binderUniforms=s?s.getUniforms(i,le):[]}}};function Gu(i,o,n){var s=1/Ht(n,1,o.transform.tileZoom),p=Math.pow(2,n.tileID.overscaledZ),m=n.tileSize*Math.pow(2,o.transform.tileZoom)/p,y=m*(n.tileID.canonical.x+n.tileID.wrap*p),g=m*n.tileID.canonical.y;return{u_image:0,u_texsize:n.imageAtlasTexture.size,u_scale:[s,i.fromScale,i.toScale],u_fade:i.t,u_pixel_coord_upper:[y>>16,g>>16],u_pixel_coord_lower:[65535&y,65535&g]}}ju.prototype.draw=function(i,o,n,s,p,m,y,g,w,A,B,L,R,Z,j,K){var U,X=i.gl;if(!this.failedToCreate){for(var Q in i.program.set(this.program),i.setDepthMode(n),i.setStencilMode(s),i.setColorMode(p),i.setCullFace(m),this.fixedUniforms)this.fixedUniforms[Q].set(y[Q]);Z&&Z.setUniforms(i,this.binderUniforms,L,{zoom:R});for(var ie=(U={},U[X.LINES]=2,U[X.TRIANGLES]=3,U[X.LINE_STRIP]=1,U)[o],ce=0,le=B.get();ce<le.length;ce+=1){var he=le[ce],ge=he.vaos||(he.vaos={});(ge[g]||(ge[g]=new hs)).bind(i,this,w,Z?Z.getPaintVertexBuffers():[],A,he.vertexOffset,j,K),X.drawElements(o,he.primitiveLength*ie,X.UNSIGNED_SHORT,he.primitiveOffset*ie*2)}}};var Zu=function(i,o,n,s){var p=o.style.light,m=p.properties.get("position"),y=[m.x,m.y,m.z],g=l.create$1();p.properties.get("anchor")==="viewport"&&l.fromRotation(g,-o.transform.angle),l.transformMat3(y,y,g);var w=p.properties.get("color");return{u_matrix:i,u_lightpos:y,u_lightintensity:p.properties.get("intensity"),u_lightcolor:[w.r,w.g,w.b],u_vertical_gradient:+n,u_opacity:s}},so=function(i,o,n,s,p,m,y){return l.extend(Zu(i,o,n,s),Gu(m,o,y),{u_height_factor:-Math.pow(2,p.overscaledZ)/y.tileSize/8})},Mn=function(i){return{u_matrix:i}},lo=function(i,o,n,s){return l.extend(Mn(i),Gu(n,o,s))},Wu=function(i,o){return{u_matrix:i,u_world:o}},Hu=function(i,o,n,s,p){return l.extend(lo(i,o,n,s),{u_world:p})},Cl=function(i,o,n,s){var p,m,y=i.transform;if(s.paint.get("circle-pitch-alignment")==="map"){var g=Ht(n,1,y.zoom);p=!0,m=[g,g]}else p=!1,m=y.pixelsToGLUnits;return{u_camera_to_center_distance:y.cameraToCenterDistance,u_scale_with_map:+(s.paint.get("circle-pitch-scale")==="map"),u_matrix:i.translatePosMatrix(o.posMatrix,n,s.paint.get("circle-translate"),s.paint.get("circle-translate-anchor")),u_pitch_with_map:+p,u_device_pixel_ratio:l.browser.devicePixelRatio,u_extrude_scale:m}},uo=function(i,o,n){var s=Ht(n,1,o.zoom),p=Math.pow(2,o.zoom-n.tileID.overscaledZ),m=n.tileID.overscaleFactor();return{u_matrix:i,u_camera_to_center_distance:o.cameraToCenterDistance,u_pixels_to_tile_units:s,u_extrude_scale:[o.pixelsToGLUnits[0]/(s*p),o.pixelsToGLUnits[1]/(s*p)],u_overscale_factor:m}},Xu=function(i,o,n){return{u_matrix:i,u_inv_matrix:o,u_camera_to_center_distance:n.cameraToCenterDistance,u_viewport_size:[n.width,n.height]}},co=function(i,o,n){return n===void 0&&(n=1),{u_matrix:i,u_color:o,u_overlay:0,u_overlay_scale:n}},po=function(i){return{u_matrix:i}},Ku=function(i,o,n,s){return{u_matrix:i,u_extrude_scale:Ht(o,1,n),u_intensity:s}},Ta=function(i,o,n){var s=i.transform;return{u_matrix:Ju(i,o,n),u_ratio:1/Ht(o,1,s.zoom),u_device_pixel_ratio:l.browser.devicePixelRatio,u_units_to_pixels:[1/s.pixelsToGLUnits[0],1/s.pixelsToGLUnits[1]]}},qt=function(i,o,n,s){return l.extend(Ta(i,o,n),{u_image:0,u_image_height:s})},fs=function(i,o,n,s){var p=i.transform,m=qo(o,p);return{u_matrix:Ju(i,o,n),u_texsize:o.imageAtlasTexture.size,u_ratio:1/Ht(o,1,p.zoom),u_device_pixel_ratio:l.browser.devicePixelRatio,u_image:0,u_scale:[m,s.fromScale,s.toScale],u_fade:s.t,u_units_to_pixels:[1/p.pixelsToGLUnits[0],1/p.pixelsToGLUnits[1]]}},Np=function(i,o,n,s,p){var m=i.lineAtlas,y=qo(o,i.transform),g=n.layout.get("line-cap")==="round",w=m.getDash(s.from,g),A=m.getDash(s.to,g),B=w.width*p.fromScale,L=A.width*p.toScale;return l.extend(Ta(i,o,n),{u_patternscale_a:[y/B,-w.height/2],u_patternscale_b:[y/L,-A.height/2],u_sdfgamma:m.width/(256*Math.min(B,L)*l.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:w.y,u_tex_y_b:A.y,u_mix:p.t})};function qo(i,o){return 1/Ht(i,1,o.tileZoom)}function Ju(i,o,n){return i.translatePosMatrix(o.tileID.posMatrix,o,n.paint.get("line-translate"),n.paint.get("line-translate-anchor"))}var $p=function(i,o,n,s,p){return{u_matrix:i,u_tl_parent:o,u_scale_parent:n,u_buffer_scale:1,u_fade_t:s.mix,u_opacity:s.opacity*p.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:p.paint.get("raster-brightness-min"),u_brightness_high:p.paint.get("raster-brightness-max"),u_saturation_factor:(y=p.paint.get("raster-saturation"),y>0?1-1/(1.001-y):-y),u_contrast_factor:(m=p.paint.get("raster-contrast"),m>0?1/(1-m):1+m),u_spin_weights:Yu(p.paint.get("raster-hue-rotate"))};var m,y};function Yu(i){i*=Math.PI/180;var o=Math.sin(i),n=Math.cos(i);return[(2*n+1)/3,(-Math.sqrt(3)*o-n+1)/3,(Math.sqrt(3)*o-n+1)/3]}var ds,jo=function(i,o,n,s,p,m,y,g,w,A){var B=p.transform;return{u_is_size_zoom_constant:+(i==="constant"||i==="source"),u_is_size_feature_constant:+(i==="constant"||i==="camera"),u_size_t:o?o.uSizeT:0,u_size:o?o.uSize:0,u_camera_to_center_distance:B.cameraToCenterDistance,u_pitch:B.pitch/360*2*Math.PI,u_rotate_symbol:+n,u_aspect_ratio:B.width/B.height,u_fade_change:p.options.fadeDuration?p.symbolFadeChange:1,u_matrix:m,u_label_plane_matrix:y,u_coord_matrix:g,u_is_text:+w,u_pitch_with_map:+s,u_texsize:A,u_texture:0}},Ia=function(i,o,n,s,p,m,y,g,w,A,B){var L=p.transform;return l.extend(jo(i,o,n,s,p,m,y,g,w,A),{u_gamma_scale:s?Math.cos(L._pitch)*L.cameraToCenterDistance:1,u_device_pixel_ratio:l.browser.devicePixelRatio,u_is_halo:1})},ms=function(i,o,n,s,p,m,y,g,w,A){return l.extend(Ia(i,o,n,s,p,m,y,g,!0,w),{u_texsize_icon:A,u_texture_icon:1})},Aa=function(i,o,n){return{u_matrix:i,u_opacity:o,u_color:n}},Go=function(i,o,n,s,p,m){return l.extend(function(y,g,w,A){var B=w.imageManager.getPattern(y.from.toString()),L=w.imageManager.getPattern(y.to.toString()),R=w.imageManager.getPixelSize(),Z=R.width,j=R.height,K=Math.pow(2,A.tileID.overscaledZ),U=A.tileSize*Math.pow(2,w.transform.tileZoom)/K,X=U*(A.tileID.canonical.x+A.tileID.wrap*K),Q=U*A.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:B.tl,u_pattern_br_a:B.br,u_pattern_tl_b:L.tl,u_pattern_br_b:L.br,u_texsize:[Z,j],u_mix:g.t,u_pattern_size_a:B.displaySize,u_pattern_size_b:L.displaySize,u_scale_a:g.fromScale,u_scale_b:g.toScale,u_tile_units_to_pixels:1/Ht(A,1,w.transform.tileZoom),u_pixel_coord_upper:[X>>16,Q>>16],u_pixel_coord_lower:[65535&X,65535&Q]}}(s,m,n,p),{u_matrix:i,u_opacity:o})},Qu={fillExtrusion:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_lightpos:new l.Uniform3f(i,o.u_lightpos),u_lightintensity:new l.Uniform1f(i,o.u_lightintensity),u_lightcolor:new l.Uniform3f(i,o.u_lightcolor),u_vertical_gradient:new l.Uniform1f(i,o.u_vertical_gradient),u_opacity:new l.Uniform1f(i,o.u_opacity)}},fillExtrusionPattern:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_lightpos:new l.Uniform3f(i,o.u_lightpos),u_lightintensity:new l.Uniform1f(i,o.u_lightintensity),u_lightcolor:new l.Uniform3f(i,o.u_lightcolor),u_vertical_gradient:new l.Uniform1f(i,o.u_vertical_gradient),u_height_factor:new l.Uniform1f(i,o.u_height_factor),u_image:new l.Uniform1i(i,o.u_image),u_texsize:new l.Uniform2f(i,o.u_texsize),u_pixel_coord_upper:new l.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new l.Uniform2f(i,o.u_pixel_coord_lower),u_scale:new l.Uniform3f(i,o.u_scale),u_fade:new l.Uniform1f(i,o.u_fade),u_opacity:new l.Uniform1f(i,o.u_opacity)}},fill:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix)}},fillPattern:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_image:new l.Uniform1i(i,o.u_image),u_texsize:new l.Uniform2f(i,o.u_texsize),u_pixel_coord_upper:new l.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new l.Uniform2f(i,o.u_pixel_coord_lower),u_scale:new l.Uniform3f(i,o.u_scale),u_fade:new l.Uniform1f(i,o.u_fade)}},fillOutline:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_world:new l.Uniform2f(i,o.u_world)}},fillOutlinePattern:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_world:new l.Uniform2f(i,o.u_world),u_image:new l.Uniform1i(i,o.u_image),u_texsize:new l.Uniform2f(i,o.u_texsize),u_pixel_coord_upper:new l.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new l.Uniform2f(i,o.u_pixel_coord_lower),u_scale:new l.Uniform3f(i,o.u_scale),u_fade:new l.Uniform1f(i,o.u_fade)}},circle:function(i,o){return{u_camera_to_center_distance:new l.Uniform1f(i,o.u_camera_to_center_distance),u_scale_with_map:new l.Uniform1i(i,o.u_scale_with_map),u_pitch_with_map:new l.Uniform1i(i,o.u_pitch_with_map),u_extrude_scale:new l.Uniform2f(i,o.u_extrude_scale),u_device_pixel_ratio:new l.Uniform1f(i,o.u_device_pixel_ratio),u_matrix:new l.UniformMatrix4f(i,o.u_matrix)}},collisionBox:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_camera_to_center_distance:new l.Uniform1f(i,o.u_camera_to_center_distance),u_pixels_to_tile_units:new l.Uniform1f(i,o.u_pixels_to_tile_units),u_extrude_scale:new l.Uniform2f(i,o.u_extrude_scale),u_overscale_factor:new l.Uniform1f(i,o.u_overscale_factor)}},collisionCircle:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_inv_matrix:new l.UniformMatrix4f(i,o.u_inv_matrix),u_camera_to_center_distance:new l.Uniform1f(i,o.u_camera_to_center_distance),u_viewport_size:new l.Uniform2f(i,o.u_viewport_size)}},debug:function(i,o){return{u_color:new l.UniformColor(i,o.u_color),u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_overlay:new l.Uniform1i(i,o.u_overlay),u_overlay_scale:new l.Uniform1f(i,o.u_overlay_scale)}},clippingMask:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix)}},heatmap:function(i,o){return{u_extrude_scale:new l.Uniform1f(i,o.u_extrude_scale),u_intensity:new l.Uniform1f(i,o.u_intensity),u_matrix:new l.UniformMatrix4f(i,o.u_matrix)}},heatmapTexture:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_world:new l.Uniform2f(i,o.u_world),u_image:new l.Uniform1i(i,o.u_image),u_color_ramp:new l.Uniform1i(i,o.u_color_ramp),u_opacity:new l.Uniform1f(i,o.u_opacity)}},hillshade:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_image:new l.Uniform1i(i,o.u_image),u_latrange:new l.Uniform2f(i,o.u_latrange),u_light:new l.Uniform2f(i,o.u_light),u_shadow:new l.UniformColor(i,o.u_shadow),u_highlight:new l.UniformColor(i,o.u_highlight),u_accent:new l.UniformColor(i,o.u_accent)}},hillshadePrepare:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_image:new l.Uniform1i(i,o.u_image),u_dimension:new l.Uniform2f(i,o.u_dimension),u_zoom:new l.Uniform1f(i,o.u_zoom),u_unpack:new l.Uniform4f(i,o.u_unpack)}},line:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_ratio:new l.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new l.Uniform1f(i,o.u_device_pixel_ratio),u_units_to_pixels:new l.Uniform2f(i,o.u_units_to_pixels)}},lineGradient:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_ratio:new l.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new l.Uniform1f(i,o.u_device_pixel_ratio),u_units_to_pixels:new l.Uniform2f(i,o.u_units_to_pixels),u_image:new l.Uniform1i(i,o.u_image),u_image_height:new l.Uniform1f(i,o.u_image_height)}},linePattern:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_texsize:new l.Uniform2f(i,o.u_texsize),u_ratio:new l.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new l.Uniform1f(i,o.u_device_pixel_ratio),u_image:new l.Uniform1i(i,o.u_image),u_units_to_pixels:new l.Uniform2f(i,o.u_units_to_pixels),u_scale:new l.Uniform3f(i,o.u_scale),u_fade:new l.Uniform1f(i,o.u_fade)}},lineSDF:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_ratio:new l.Uniform1f(i,o.u_ratio),u_device_pixel_ratio:new l.Uniform1f(i,o.u_device_pixel_ratio),u_units_to_pixels:new l.Uniform2f(i,o.u_units_to_pixels),u_patternscale_a:new l.Uniform2f(i,o.u_patternscale_a),u_patternscale_b:new l.Uniform2f(i,o.u_patternscale_b),u_sdfgamma:new l.Uniform1f(i,o.u_sdfgamma),u_image:new l.Uniform1i(i,o.u_image),u_tex_y_a:new l.Uniform1f(i,o.u_tex_y_a),u_tex_y_b:new l.Uniform1f(i,o.u_tex_y_b),u_mix:new l.Uniform1f(i,o.u_mix)}},raster:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_tl_parent:new l.Uniform2f(i,o.u_tl_parent),u_scale_parent:new l.Uniform1f(i,o.u_scale_parent),u_buffer_scale:new l.Uniform1f(i,o.u_buffer_scale),u_fade_t:new l.Uniform1f(i,o.u_fade_t),u_opacity:new l.Uniform1f(i,o.u_opacity),u_image0:new l.Uniform1i(i,o.u_image0),u_image1:new l.Uniform1i(i,o.u_image1),u_brightness_low:new l.Uniform1f(i,o.u_brightness_low),u_brightness_high:new l.Uniform1f(i,o.u_brightness_high),u_saturation_factor:new l.Uniform1f(i,o.u_saturation_factor),u_contrast_factor:new l.Uniform1f(i,o.u_contrast_factor),u_spin_weights:new l.Uniform3f(i,o.u_spin_weights)}},symbolIcon:function(i,o){return{u_is_size_zoom_constant:new l.Uniform1i(i,o.u_is_size_zoom_constant),u_is_size_feature_constant:new l.Uniform1i(i,o.u_is_size_feature_constant),u_size_t:new l.Uniform1f(i,o.u_size_t),u_size:new l.Uniform1f(i,o.u_size),u_camera_to_center_distance:new l.Uniform1f(i,o.u_camera_to_center_distance),u_pitch:new l.Uniform1f(i,o.u_pitch),u_rotate_symbol:new l.Uniform1i(i,o.u_rotate_symbol),u_aspect_ratio:new l.Uniform1f(i,o.u_aspect_ratio),u_fade_change:new l.Uniform1f(i,o.u_fade_change),u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_label_plane_matrix:new l.UniformMatrix4f(i,o.u_label_plane_matrix),u_coord_matrix:new l.UniformMatrix4f(i,o.u_coord_matrix),u_is_text:new l.Uniform1i(i,o.u_is_text),u_pitch_with_map:new l.Uniform1i(i,o.u_pitch_with_map),u_texsize:new l.Uniform2f(i,o.u_texsize),u_texture:new l.Uniform1i(i,o.u_texture)}},symbolSDF:function(i,o){return{u_is_size_zoom_constant:new l.Uniform1i(i,o.u_is_size_zoom_constant),u_is_size_feature_constant:new l.Uniform1i(i,o.u_is_size_feature_constant),u_size_t:new l.Uniform1f(i,o.u_size_t),u_size:new l.Uniform1f(i,o.u_size),u_camera_to_center_distance:new l.Uniform1f(i,o.u_camera_to_center_distance),u_pitch:new l.Uniform1f(i,o.u_pitch),u_rotate_symbol:new l.Uniform1i(i,o.u_rotate_symbol),u_aspect_ratio:new l.Uniform1f(i,o.u_aspect_ratio),u_fade_change:new l.Uniform1f(i,o.u_fade_change),u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_label_plane_matrix:new l.UniformMatrix4f(i,o.u_label_plane_matrix),u_coord_matrix:new l.UniformMatrix4f(i,o.u_coord_matrix),u_is_text:new l.Uniform1i(i,o.u_is_text),u_pitch_with_map:new l.Uniform1i(i,o.u_pitch_with_map),u_texsize:new l.Uniform2f(i,o.u_texsize),u_texture:new l.Uniform1i(i,o.u_texture),u_gamma_scale:new l.Uniform1f(i,o.u_gamma_scale),u_device_pixel_ratio:new l.Uniform1f(i,o.u_device_pixel_ratio),u_is_halo:new l.Uniform1i(i,o.u_is_halo)}},symbolTextAndIcon:function(i,o){return{u_is_size_zoom_constant:new l.Uniform1i(i,o.u_is_size_zoom_constant),u_is_size_feature_constant:new l.Uniform1i(i,o.u_is_size_feature_constant),u_size_t:new l.Uniform1f(i,o.u_size_t),u_size:new l.Uniform1f(i,o.u_size),u_camera_to_center_distance:new l.Uniform1f(i,o.u_camera_to_center_distance),u_pitch:new l.Uniform1f(i,o.u_pitch),u_rotate_symbol:new l.Uniform1i(i,o.u_rotate_symbol),u_aspect_ratio:new l.Uniform1f(i,o.u_aspect_ratio),u_fade_change:new l.Uniform1f(i,o.u_fade_change),u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_label_plane_matrix:new l.UniformMatrix4f(i,o.u_label_plane_matrix),u_coord_matrix:new l.UniformMatrix4f(i,o.u_coord_matrix),u_is_text:new l.Uniform1i(i,o.u_is_text),u_pitch_with_map:new l.Uniform1i(i,o.u_pitch_with_map),u_texsize:new l.Uniform2f(i,o.u_texsize),u_texsize_icon:new l.Uniform2f(i,o.u_texsize_icon),u_texture:new l.Uniform1i(i,o.u_texture),u_texture_icon:new l.Uniform1i(i,o.u_texture_icon),u_gamma_scale:new l.Uniform1f(i,o.u_gamma_scale),u_device_pixel_ratio:new l.Uniform1f(i,o.u_device_pixel_ratio),u_is_halo:new l.Uniform1i(i,o.u_is_halo)}},background:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_opacity:new l.Uniform1f(i,o.u_opacity),u_color:new l.UniformColor(i,o.u_color)}},backgroundPattern:function(i,o){return{u_matrix:new l.UniformMatrix4f(i,o.u_matrix),u_opacity:new l.Uniform1f(i,o.u_opacity),u_image:new l.Uniform1i(i,o.u_image),u_pattern_tl_a:new l.Uniform2f(i,o.u_pattern_tl_a),u_pattern_br_a:new l.Uniform2f(i,o.u_pattern_br_a),u_pattern_tl_b:new l.Uniform2f(i,o.u_pattern_tl_b),u_pattern_br_b:new l.Uniform2f(i,o.u_pattern_br_b),u_texsize:new l.Uniform2f(i,o.u_texsize),u_mix:new l.Uniform1f(i,o.u_mix),u_pattern_size_a:new l.Uniform2f(i,o.u_pattern_size_a),u_pattern_size_b:new l.Uniform2f(i,o.u_pattern_size_b),u_scale_a:new l.Uniform1f(i,o.u_scale_a),u_scale_b:new l.Uniform1f(i,o.u_scale_b),u_pixel_coord_upper:new l.Uniform2f(i,o.u_pixel_coord_upper),u_pixel_coord_lower:new l.Uniform2f(i,o.u_pixel_coord_lower),u_tile_units_to_pixels:new l.Uniform1f(i,o.u_tile_units_to_pixels)}}};function Zo(i,o,n,s,p,m,y){for(var g=i.context,w=g.gl,A=i.useProgram("collisionBox"),B=[],L=0,R=0,Z=0;Z<s.length;Z++){var j=s[Z],K=o.getTile(j),U=K.getBucket(n);if(U){var X=j.posMatrix;p[0]===0&&p[1]===0||(X=i.translatePosMatrix(j.posMatrix,K,p,m));var Q=y?U.textCollisionBox:U.iconCollisionBox,ie=U.collisionCircleArray;if(ie.length>0){var ce=l.create(),le=X;l.mul(ce,U.placementInvProjMatrix,i.transform.glCoordMatrix),l.mul(ce,ce,U.placementViewportMatrix),B.push({circleArray:ie,circleOffset:R,transform:le,invTransform:ce}),R=L+=ie.length/4}Q&&A.draw(g,w.LINES,O.disabled,G.disabled,i.colorModeForRenderPass(),ee.disabled,uo(X,i.transform,K),n.id,Q.layoutVertexBuffer,Q.indexBuffer,Q.segments,null,i.transform.zoom,null,null,Q.collisionVertexBuffer)}}if(y&&B.length){var he=i.useProgram("collisionCircle"),ge=new l.StructArrayLayout2f1f2i16;ge.resize(4*L),ge._trim();for(var Te=0,Se=0,Le=B;Se<Le.length;Se+=1)for(var Ge=Le[Se],Xe=0;Xe<Ge.circleArray.length/4;Xe++){var He=4*Xe,wt=Ge.circleArray[He+0],Re=Ge.circleArray[He+1],rt=Ge.circleArray[He+2],at=Ge.circleArray[He+3];ge.emplace(Te++,wt,Re,rt,at,0),ge.emplace(Te++,wt,Re,rt,at,1),ge.emplace(Te++,wt,Re,rt,at,2),ge.emplace(Te++,wt,Re,rt,at,3)}(!ds||ds.length<2*L)&&(ds=function(ir){var Vr=2*ir,Mr=new l.StructArrayLayout3ui6;Mr.resize(Vr),Mr._trim();for(var tr=0;tr<Vr;tr++){var ur=6*tr;Mr.uint16[ur+0]=4*tr+0,Mr.uint16[ur+1]=4*tr+1,Mr.uint16[ur+2]=4*tr+2,Mr.uint16[ur+3]=4*tr+2,Mr.uint16[ur+4]=4*tr+3,Mr.uint16[ur+5]=4*tr+0}return Mr}(L));for(var tt=g.createIndexBuffer(ds,!0),et=g.createVertexBuffer(ge,l.collisionCircleLayout.members,!0),nt=0,Qe=B;nt<Qe.length;nt+=1){var Ke=Qe[nt],Sr=Xu(Ke.transform,Ke.invTransform,i.transform);he.draw(g,w.TRIANGLES,O.disabled,G.disabled,i.colorModeForRenderPass(),ee.disabled,Sr,n.id,et,tt,l.SegmentVector.simpleSegment(0,2*Ke.circleOffset,Ke.circleArray.length,Ke.circleArray.length/2),null,i.transform.zoom,null,null,null)}et.destroy(),tt.destroy()}}var qi=l.identity(new Float32Array(16));function ec(i,o,n,s,p,m){var y=l.getAnchorAlignment(i),g=-(y.horizontalAlign-.5)*o,w=-(y.verticalAlign-.5)*n,A=l.evaluateVariableOffset(i,s);return new l.Point((g/p+A[0])*m,(w/p+A[1])*m)}function tc(i,o,n,s,p,m,y,g,w,A,B){var L=i.text.placedSymbolArray,R=i.text.dynamicLayoutVertexArray,Z=i.icon.dynamicLayoutVertexArray,j={};R.clear();for(var K=0;K<L.length;K++){var U=L.get(K),X=U.hidden||!U.crossTileID||i.allowVerticalPlacement&&!U.placedOrientation?null:s[U.crossTileID];if(X){var Q=new l.Point(U.anchorX,U.anchorY),ie=mt(Q,n?g:y),ce=Mt(m.cameraToCenterDistance,ie.signedDistanceFromCamera),le=p.evaluateSizeForFeature(i.textSizeData,A,U)*ce/l.ONE_EM;n&&(le*=i.tilePixelRatio/w);for(var he=ec(X.anchor,X.width,X.height,X.textOffset,X.textBoxScale,le),ge=n?mt(Q.add(he),y).point:ie.point.add(o?he.rotate(-m.angle):he),Te=i.allowVerticalPlacement&&U.placedOrientation===l.WritingMode.vertical?Math.PI/2:0,Se=0;Se<U.numGlyphs;Se++)l.addDynamicAttributes(R,ge,Te);B&&U.associatedIconIndex>=0&&(j[U.associatedIconIndex]={shiftedAnchor:ge,angle:Te})}else jr(U.numGlyphs,R)}if(B){Z.clear();for(var Le=i.icon.placedSymbolArray,Ge=0;Ge<Le.length;Ge++){var Xe=Le.get(Ge);if(Xe.hidden)jr(Xe.numGlyphs,Z);else{var He=j[Ge];if(He)for(var wt=0;wt<Xe.numGlyphs;wt++)l.addDynamicAttributes(Z,He.shiftedAnchor,He.angle);else jr(Xe.numGlyphs,Z)}}i.icon.dynamicLayoutVertexBuffer.updateData(Z)}i.text.dynamicLayoutVertexBuffer.updateData(R)}function rc(i,o,n){return n.iconsInText&&o?"symbolTextAndIcon":i?"symbolSDF":"symbolIcon"}function ho(i,o,n,s,p,m,y,g,w,A,B,L){for(var R=i.context,Z=R.gl,j=i.transform,K=g==="map",U=w==="map",X=K&&n.layout.get("symbol-placement")!=="point",Q=K&&!U&&!X,ie=n.layout.get("symbol-sort-key").constantOr(1)!==void 0,ce=!1,le=i.depthModeForSublayer(0,O.ReadOnly),he=n.layout.get("text-variable-anchor"),ge=[],Te=0,Se=s;Te<Se.length;Te+=1){var Le=Se[Te],Ge=o.getTile(Le),Xe=Ge.getBucket(n);if(Xe){var He=p?Xe.text:Xe.icon;if(He&&He.segments.get().length){var wt=He.programConfigurations.get(n.id),Re=p||Xe.sdfIcons,rt=p?Xe.textSizeData:Xe.iconSizeData,at=U||j.pitch!==0,tt=i.useProgram(rc(Re,p,Xe),wt),et=l.evaluateSizeForZoom(rt,j.zoom),nt=void 0,Qe=[0,0],Ke=void 0,Sr=void 0,ir=null,Vr=void 0;if(p)Ke=Ge.glyphAtlasTexture,Sr=Z.LINEAR,nt=Ge.glyphAtlasTexture.size,Xe.iconsInText&&(Qe=Ge.imageAtlasTexture.size,ir=Ge.imageAtlasTexture,Vr=at||i.options.rotating||i.options.zooming||rt.kind==="composite"||rt.kind==="camera"?Z.LINEAR:Z.NEAREST);else{var Mr=n.layout.get("icon-size").constantOr(0)!==1||Xe.iconsNeedLinear;Ke=Ge.imageAtlasTexture,Sr=Re||i.options.rotating||i.options.zooming||Mr||at?Z.LINEAR:Z.NEAREST,nt=Ge.imageAtlasTexture.size}var tr=Ht(Ge,1,i.transform.zoom),ur=sr(Le.posMatrix,U,K,i.transform,tr),mi=Ft(Le.posMatrix,U,K,i.transform,tr),Hr=he&&Xe.hasTextData(),Fn=n.layout.get("icon-text-fit")!=="none"&&Hr&&Xe.hasIconData();X&&ga(Xe,Le.posMatrix,i,p,ur,mi,U,A);var ni=i.translatePosMatrix(Le.posMatrix,Ge,m,y),Hi=X||p&&he||Fn?qi:ur,Di=i.translatePosMatrix(mi,Ge,m,y,!0),Oa=Re&&n.paint.get(p?"text-halo-width":"icon-halo-width").constantOr(1)!==0,Yo={program:tt,buffers:He,uniformValues:Re?Xe.iconsInText?ms(rt.kind,et,Q,U,i,ni,Hi,Di,nt,Qe):Ia(rt.kind,et,Q,U,i,ni,Hi,Di,p,nt):jo(rt.kind,et,Q,U,i,ni,Hi,Di,p,nt),atlasTexture:Ke,atlasTextureIcon:ir,atlasInterpolation:Sr,atlasInterpolationIcon:Vr,isSDF:Re,hasHalo:Oa};if(ie&&Xe.canOverlap){ce=!0;for(var On=0,Qo=He.segments.get();On<Qo.length;On+=1){var Va=Qo[On];ge.push({segments:new l.SegmentVector([Va]),sortKey:Va.sortKey,state:Yo})}}else ge.push({segments:He.segments,sortKey:0,state:Yo})}}}ce&&ge.sort(function(Vn,_o){return Vn.sortKey-_o.sortKey});for(var rn=0,Ua=ge;rn<Ua.length;rn+=1){var nn=Ua[rn],Tr=nn.state;if(R.activeTexture.set(Z.TEXTURE0),Tr.atlasTexture.bind(Tr.atlasInterpolation,Z.CLAMP_TO_EDGE),Tr.atlasTextureIcon&&(R.activeTexture.set(Z.TEXTURE1),Tr.atlasTextureIcon&&Tr.atlasTextureIcon.bind(Tr.atlasInterpolationIcon,Z.CLAMP_TO_EDGE)),Tr.isSDF){var mn=Tr.uniformValues;Tr.hasHalo&&(mn.u_is_halo=1,Ea(Tr.buffers,nn.segments,n,i,Tr.program,le,B,L,mn)),mn.u_is_halo=0}Ea(Tr.buffers,nn.segments,n,i,Tr.program,le,B,L,Tr.uniformValues)}}function Ea(i,o,n,s,p,m,y,g,w){var A=s.context;p.draw(A,A.gl.TRIANGLES,m,y,g,ee.disabled,w,n.id,i.layoutVertexBuffer,i.indexBuffer,o,n.paint,s.transform.zoom,i.programConfigurations.get(n.id),i.dynamicLayoutVertexBuffer,i.opacityVertexBuffer)}function ys(i,o,n,s,p,m,y){var g,w,A,B,L,R=i.context.gl,Z=n.paint.get("fill-pattern"),j=Z&&Z.constantOr(1),K=n.getCrossfadeParameters();y?(w=j&&!n.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",g=R.LINES):(w=j?"fillPattern":"fill",g=R.TRIANGLES);for(var U=0,X=s;U<X.length;U+=1){var Q=X[U],ie=o.getTile(Q);if(!j||ie.patternsLoaded()){var ce=ie.getBucket(n);if(ce){var le=ce.programConfigurations.get(n.id),he=i.useProgram(w,le);j&&(i.context.activeTexture.set(R.TEXTURE0),ie.imageAtlasTexture.bind(R.LINEAR,R.CLAMP_TO_EDGE),le.updatePaintBuffers(K));var ge=Z.constantOr(null);if(ge&&ie.imageAtlas){var Te=ie.imageAtlas,Se=Te.patternPositions[ge.to.toString()],Le=Te.patternPositions[ge.from.toString()];Se&&Le&&le.setConstantPatternPositions(Se,Le)}var Ge=i.translatePosMatrix(Q.posMatrix,ie,n.paint.get("fill-translate"),n.paint.get("fill-translate-anchor"));if(y){B=ce.indexBuffer2,L=ce.segments2;var Xe=[R.drawingBufferWidth,R.drawingBufferHeight];A=w==="fillOutlinePattern"&&j?Hu(Ge,i,K,ie,Xe):Wu(Ge,Xe)}else B=ce.indexBuffer,L=ce.segments,A=j?lo(Ge,i,K,ie):Mn(Ge);he.draw(i.context,g,p,i.stencilModeForClipping(Q),m,ee.disabled,A,n.id,ce.layoutVertexBuffer,B,L,n.paint,i.transform.zoom,le)}}}}function kl(i,o,n,s,p,m,y){for(var g=i.context,w=g.gl,A=n.paint.get("fill-extrusion-pattern"),B=A.constantOr(1),L=n.getCrossfadeParameters(),R=n.paint.get("fill-extrusion-opacity"),Z=0,j=s;Z<j.length;Z+=1){var K=j[Z],U=o.getTile(K),X=U.getBucket(n);if(X){var Q=X.programConfigurations.get(n.id),ie=i.useProgram(B?"fillExtrusionPattern":"fillExtrusion",Q);B&&(i.context.activeTexture.set(w.TEXTURE0),U.imageAtlasTexture.bind(w.LINEAR,w.CLAMP_TO_EDGE),Q.updatePaintBuffers(L));var ce=A.constantOr(null);if(ce&&U.imageAtlas){var le=U.imageAtlas,he=le.patternPositions[ce.to.toString()],ge=le.patternPositions[ce.from.toString()];he&&ge&&Q.setConstantPatternPositions(he,ge)}var Te=i.translatePosMatrix(K.posMatrix,U,n.paint.get("fill-extrusion-translate"),n.paint.get("fill-extrusion-translate-anchor")),Se=n.paint.get("fill-extrusion-vertical-gradient"),Le=B?so(Te,i,Se,R,K,L,U):Zu(Te,i,Se,R);ie.draw(g,g.gl.TRIANGLES,p,m,y,ee.backCCW,Le,n.id,X.layoutVertexBuffer,X.indexBuffer,X.segments,n.paint,i.transform.zoom,Q)}}}function vs(i,o,n,s,p,m){var y=i.context,g=y.gl,w=o.fbo;if(w){var A=i.useProgram("hillshade");y.activeTexture.set(g.TEXTURE0),g.bindTexture(g.TEXTURE_2D,w.colorAttachment.get());var B=function(L,R,Z){var j=Z.paint.get("hillshade-shadow-color"),K=Z.paint.get("hillshade-highlight-color"),U=Z.paint.get("hillshade-accent-color"),X=Z.paint.get("hillshade-illumination-direction")*(Math.PI/180);Z.paint.get("hillshade-illumination-anchor")==="viewport"&&(X-=L.transform.angle);var Q,ie,ce,le=!L.options.moving;return{u_matrix:L.transform.calculatePosMatrix(R.tileID.toUnwrapped(),le),u_image:0,u_latrange:(Q=R.tileID,ie=Math.pow(2,Q.canonical.z),ce=Q.canonical.y,[new l.MercatorCoordinate(0,ce/ie).toLngLat().lat,new l.MercatorCoordinate(0,(ce+1)/ie).toLngLat().lat]),u_light:[Z.paint.get("hillshade-exaggeration"),X],u_shadow:j,u_highlight:K,u_accent:U}}(i,o,n);A.draw(y,g.TRIANGLES,s,p,m,ee.disabled,B,n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments)}}function qp(i,o,n,s,p,m){var y=i.context,g=y.gl,w=o.dem;if(w&&w.data){var A=w.dim,B=w.stride,L=w.getPixels();if(y.activeTexture.set(g.TEXTURE1),y.pixelStoreUnpackPremultiplyAlpha.set(!1),o.demTexture=o.demTexture||i.getTileTexture(B),o.demTexture){var R=o.demTexture;R.update(L,{premultiply:!1}),R.bind(g.NEAREST,g.CLAMP_TO_EDGE)}else o.demTexture=new l.Texture(y,L,g.RGBA,{premultiply:!1}),o.demTexture.bind(g.NEAREST,g.CLAMP_TO_EDGE);y.activeTexture.set(g.TEXTURE0);var Z=o.fbo;if(!Z){var j=new l.Texture(y,{width:A,height:A,data:null},g.RGBA);j.bind(g.LINEAR,g.CLAMP_TO_EDGE),(Z=o.fbo=y.createFramebuffer(A,A,!0)).colorAttachment.set(j.texture)}y.bindFramebuffer.set(Z.framebuffer),y.viewport.set([0,0,A,A]),i.useProgram("hillshadePrepare").draw(y,g.TRIANGLES,s,p,m,ee.disabled,function(K,U){var X=U.stride,Q=l.create();return l.ortho(Q,0,l.EXTENT,-l.EXTENT,0,0,1),l.translate(Q,Q,[0,-l.EXTENT,0]),{u_matrix:Q,u_image:1,u_dimension:[X,X],u_zoom:K.overscaledZ,u_unpack:U.getUnpackVector()}}(o.tileID,w),n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments),o.needsHillshadePrepare=!1}}function gs(i,o,n,s,p){var m=s.paint.get("raster-fade-duration");if(m>0){var y=l.browser.now(),g=(y-i.timeAdded)/m,w=o?(y-o.timeAdded)/m:-1,A=n.getSource(),B=p.coveringZoomLevel({tileSize:A.tileSize,roundZoom:A.roundZoom}),L=!o||Math.abs(o.tileID.overscaledZ-B)>Math.abs(i.tileID.overscaledZ-B),R=L&&i.refreshedUponExpiration?1:l.clamp(L?g:1-w,0,1);return i.refreshedUponExpiration&&g>=1&&(i.refreshedUponExpiration=!1),o?{opacity:1,mix:1-R}:{opacity:R,mix:0}}return{opacity:1,mix:0}}var Ml=new l.Color(1,0,0,1),ic=new l.Color(0,1,0,1),nc=new l.Color(0,0,1,1),_s=new l.Color(1,0,1,1),zl=new l.Color(0,1,1,1);function Bl(i,o,n,s){Pa(i,0,o+n/2,i.transform.width,n,s)}function Dl(i,o,n,s){Pa(i,o-n/2,0,n,i.transform.height,s)}function Pa(i,o,n,s,p,m){var y=i.context,g=y.gl;g.enable(g.SCISSOR_TEST),g.scissor(o*l.browser.devicePixelRatio,n*l.browser.devicePixelRatio,s*l.browser.devicePixelRatio,p*l.browser.devicePixelRatio),y.clear({color:m}),g.disable(g.SCISSOR_TEST)}function oc(i,o,n){var s=i.context,p=s.gl,m=n.posMatrix,y=i.useProgram("debug"),g=O.disabled,w=G.disabled,A=i.colorModeForRenderPass();s.activeTexture.set(p.TEXTURE0),i.emptyTexture.bind(p.LINEAR,p.CLAMP_TO_EDGE),y.draw(s,p.LINE_STRIP,g,w,A,ee.disabled,co(m,l.Color.red),"$debug",i.debugBuffer,i.tileBorderIndexBuffer,i.debugSegments);var B=o.getTileByID(n.key).latestRawTileData,L=Math.floor((B&&B.byteLength||0)/1024),R=o.getTile(n).tileSize,Z=512/Math.min(R,512)*(n.overscaledZ/i.transform.zoom)*.5,j=n.canonical.toString();n.overscaledZ!==n.canonical.z&&(j+=" => "+n.overscaledZ),function(K,U){K.initDebugOverlayCanvas();var X=K.debugOverlayCanvas,Q=K.context.gl,ie=K.debugOverlayCanvas.getContext("2d");ie.clearRect(0,0,X.width,X.height),ie.shadowColor="white",ie.shadowBlur=2,ie.lineWidth=1.5,ie.strokeStyle="white",ie.textBaseline="top",ie.font="bold 36px Open Sans, sans-serif",ie.fillText(U,5,5),ie.strokeText(U,5,5),K.debugOverlayTexture.update(X),K.debugOverlayTexture.bind(Q.LINEAR,Q.CLAMP_TO_EDGE)}(i,j+" "+L+"kb"),y.draw(s,p.TRIANGLES,g,w,Y.alphaBlended,ee.disabled,co(m,l.Color.transparent,Z),"$debug",i.debugBuffer,i.quadTriangleIndexBuffer,i.debugSegments)}var fo={symbol:function(i,o,n,s,p){if(i.renderPass==="translucent"){var m=G.disabled,y=i.colorModeForRenderPass();n.layout.get("text-variable-anchor")&&function(g,w,A,B,L,R,Z){for(var j=w.transform,K=L==="map",U=R==="map",X=0,Q=g;X<Q.length;X+=1){var ie=Q[X],ce=B.getTile(ie),le=ce.getBucket(A);if(le&&le.text&&le.text.segments.get().length){var he=l.evaluateSizeForZoom(le.textSizeData,j.zoom),ge=Ht(ce,1,w.transform.zoom),Te=sr(ie.posMatrix,U,K,w.transform,ge),Se=A.layout.get("icon-text-fit")!=="none"&&le.hasIconData();if(he){var Le=Math.pow(2,j.zoom-ce.tileID.overscaledZ);tc(le,K,U,Z,l.symbolSize,j,Te,ie.posMatrix,Le,he,Se)}}}}(s,i,n,o,n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),p),n.paint.get("icon-opacity").constantOr(1)!==0&&ho(i,o,n,s,!1,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),n.layout.get("icon-rotation-alignment"),n.layout.get("icon-pitch-alignment"),n.layout.get("icon-keep-upright"),m,y),n.paint.get("text-opacity").constantOr(1)!==0&&ho(i,o,n,s,!0,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),n.layout.get("text-rotation-alignment"),n.layout.get("text-pitch-alignment"),n.layout.get("text-keep-upright"),m,y),o.map.showCollisionBoxes&&(Zo(i,o,n,s,n.paint.get("text-translate"),n.paint.get("text-translate-anchor"),!0),Zo(i,o,n,s,n.paint.get("icon-translate"),n.paint.get("icon-translate-anchor"),!1))}},circle:function(i,o,n,s){if(i.renderPass==="translucent"){var p=n.paint.get("circle-opacity"),m=n.paint.get("circle-stroke-width"),y=n.paint.get("circle-stroke-opacity"),g=n.layout.get("circle-sort-key").constantOr(1)!==void 0;if(p.constantOr(1)!==0||m.constantOr(1)!==0&&y.constantOr(1)!==0){for(var w=i.context,A=w.gl,B=i.depthModeForSublayer(0,O.ReadOnly),L=G.disabled,R=i.colorModeForRenderPass(),Z=[],j=0;j<s.length;j++){var K=s[j],U=o.getTile(K),X=U.getBucket(n);if(X){var Q=X.programConfigurations.get(n.id),ie={programConfiguration:Q,program:i.useProgram("circle",Q),layoutVertexBuffer:X.layoutVertexBuffer,indexBuffer:X.indexBuffer,uniformValues:Cl(i,K,U,n)};if(g)for(var ce=0,le=X.segments.get();ce<le.length;ce+=1){var he=le[ce];Z.push({segments:new l.SegmentVector([he]),sortKey:he.sortKey,state:ie})}else Z.push({segments:X.segments,sortKey:0,state:ie})}}g&&Z.sort(function(Ge,Xe){return Ge.sortKey-Xe.sortKey});for(var ge=0,Te=Z;ge<Te.length;ge+=1){var Se=Te[ge],Le=Se.state;Le.program.draw(w,A.TRIANGLES,B,L,R,ee.disabled,Le.uniformValues,n.id,Le.layoutVertexBuffer,Le.indexBuffer,Se.segments,n.paint,i.transform.zoom,Le.programConfiguration)}}}},heatmap:function(i,o,n,s){if(n.paint.get("heatmap-opacity")!==0)if(i.renderPass==="offscreen"){var p=i.context,m=p.gl,y=G.disabled,g=new Y([m.ONE,m.ONE],l.Color.transparent,[!0,!0,!0,!0]);(function(Z,j,K){var U=Z.gl;Z.activeTexture.set(U.TEXTURE1),Z.viewport.set([0,0,j.width/4,j.height/4]);var X=K.heatmapFbo;if(X)U.bindTexture(U.TEXTURE_2D,X.colorAttachment.get()),Z.bindFramebuffer.set(X.framebuffer);else{var Q=U.createTexture();U.bindTexture(U.TEXTURE_2D,Q),U.texParameteri(U.TEXTURE_2D,U.TEXTURE_WRAP_S,U.CLAMP_TO_EDGE),U.texParameteri(U.TEXTURE_2D,U.TEXTURE_WRAP_T,U.CLAMP_TO_EDGE),U.texParameteri(U.TEXTURE_2D,U.TEXTURE_MIN_FILTER,U.LINEAR),U.texParameteri(U.TEXTURE_2D,U.TEXTURE_MAG_FILTER,U.LINEAR),X=K.heatmapFbo=Z.createFramebuffer(j.width/4,j.height/4,!1),function(ie,ce,le,he){var ge=ie.gl;ge.texImage2D(ge.TEXTURE_2D,0,ge.RGBA,ce.width/4,ce.height/4,0,ge.RGBA,ie.extRenderToTextureHalfFloat?ie.extTextureHalfFloat.HALF_FLOAT_OES:ge.UNSIGNED_BYTE,null),he.colorAttachment.set(le)}(Z,j,Q,X)}})(p,i,n),p.clear({color:l.Color.transparent});for(var w=0;w<s.length;w++){var A=s[w];if(!o.hasRenderableParent(A)){var B=o.getTile(A),L=B.getBucket(n);if(L){var R=L.programConfigurations.get(n.id);i.useProgram("heatmap",R).draw(p,m.TRIANGLES,O.disabled,y,g,ee.disabled,Ku(A.posMatrix,B,i.transform.zoom,n.paint.get("heatmap-intensity")),n.id,L.layoutVertexBuffer,L.indexBuffer,L.segments,n.paint,i.transform.zoom,R)}}}p.viewport.set([0,0,i.width,i.height])}else i.renderPass==="translucent"&&(i.context.setColorMode(i.colorModeForRenderPass()),function(Z,j){var K=Z.context,U=K.gl,X=j.heatmapFbo;if(X){K.activeTexture.set(U.TEXTURE0),U.bindTexture(U.TEXTURE_2D,X.colorAttachment.get()),K.activeTexture.set(U.TEXTURE1);var Q=j.colorRampTexture;Q||(Q=j.colorRampTexture=new l.Texture(K,j.colorRamp,U.RGBA)),Q.bind(U.LINEAR,U.CLAMP_TO_EDGE),Z.useProgram("heatmapTexture").draw(K,U.TRIANGLES,O.disabled,G.disabled,Z.colorModeForRenderPass(),ee.disabled,function(ie,ce,le,he){var ge=l.create();l.ortho(ge,0,ie.width,ie.height,0,0,1);var Te=ie.context.gl;return{u_matrix:ge,u_world:[Te.drawingBufferWidth,Te.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:ce.paint.get("heatmap-opacity")}}(Z,j),j.id,Z.viewportBuffer,Z.quadTriangleIndexBuffer,Z.viewportSegments,j.paint,Z.transform.zoom)}}(i,n))},line:function(i,o,n,s){if(i.renderPass==="translucent"){var p=n.paint.get("line-opacity"),m=n.paint.get("line-width");if(p.constantOr(1)!==0&&m.constantOr(1)!==0)for(var y=i.depthModeForSublayer(0,O.ReadOnly),g=i.colorModeForRenderPass(),w=n.paint.get("line-dasharray"),A=n.paint.get("line-pattern"),B=A.constantOr(1),L=n.paint.get("line-gradient"),R=n.getCrossfadeParameters(),Z=B?"linePattern":w?"lineSDF":L?"lineGradient":"line",j=i.context,K=j.gl,U=!0,X=0,Q=s;X<Q.length;X+=1){var ie=Q[X],ce=o.getTile(ie);if(!B||ce.patternsLoaded()){var le=ce.getBucket(n);if(le){var he=le.programConfigurations.get(n.id),ge=i.context.program.get(),Te=i.useProgram(Z,he),Se=U||Te.program!==ge,Le=A.constantOr(null);if(Le&&ce.imageAtlas){var Ge=ce.imageAtlas,Xe=Ge.patternPositions[Le.to.toString()],He=Ge.patternPositions[Le.from.toString()];Xe&&He&&he.setConstantPatternPositions(Xe,He)}var wt=B?fs(i,ce,n,R):w?Np(i,ce,n,w,R):L?qt(i,ce,n,le.lineClipsArray.length):Ta(i,ce,n);if(B)j.activeTexture.set(K.TEXTURE0),ce.imageAtlasTexture.bind(K.LINEAR,K.CLAMP_TO_EDGE),he.updatePaintBuffers(R);else if(w&&(Se||i.lineAtlas.dirty))j.activeTexture.set(K.TEXTURE0),i.lineAtlas.bind(j);else if(L){var Re=le.gradients[n.id],rt=Re.texture;if(n.gradientVersion!==Re.version){var at=256;if(n.stepInterpolant){var tt=o.getSource().maxzoom,et=ie.canonical.z===tt?Math.ceil(1<<i.transform.maxZoom-ie.canonical.z):1;at=l.clamp(l.nextPowerOfTwo(le.maxLineLength/l.EXTENT*1024*et),256,j.maxTextureSize)}Re.gradient=l.renderColorRamp({expression:n.gradientExpression(),evaluationKey:"lineProgress",resolution:at,image:Re.gradient||void 0,clips:le.lineClipsArray}),Re.texture?Re.texture.update(Re.gradient):Re.texture=new l.Texture(j,Re.gradient,K.RGBA),Re.version=n.gradientVersion,rt=Re.texture}j.activeTexture.set(K.TEXTURE0),rt.bind(n.stepInterpolant?K.NEAREST:K.LINEAR,K.CLAMP_TO_EDGE)}Te.draw(j,K.TRIANGLES,y,i.stencilModeForClipping(ie),g,ee.disabled,wt,n.id,le.layoutVertexBuffer,le.indexBuffer,le.segments,n.paint,i.transform.zoom,he,le.layoutVertexBuffer2),U=!1}}}}},fill:function(i,o,n,s){var p=n.paint.get("fill-color"),m=n.paint.get("fill-opacity");if(m.constantOr(1)!==0){var y=i.colorModeForRenderPass(),g=n.paint.get("fill-pattern"),w=i.opaquePassEnabledForLayer()&&!g.constantOr(1)&&p.constantOr(l.Color.transparent).a===1&&m.constantOr(0)===1?"opaque":"translucent";if(i.renderPass===w){var A=i.depthModeForSublayer(1,i.renderPass==="opaque"?O.ReadWrite:O.ReadOnly);ys(i,o,n,s,A,y,!1)}if(i.renderPass==="translucent"&&n.paint.get("fill-antialias")){var B=i.depthModeForSublayer(n.getPaintProperty("fill-outline-color")?2:0,O.ReadOnly);ys(i,o,n,s,B,y,!0)}}},"fill-extrusion":function(i,o,n,s){var p=n.paint.get("fill-extrusion-opacity");if(p!==0&&i.renderPass==="translucent"){var m=new O(i.context.gl.LEQUAL,O.ReadWrite,i.depthRangeFor3D);if(p!==1||n.paint.get("fill-extrusion-pattern").constantOr(1))kl(i,o,n,s,m,G.disabled,Y.disabled),kl(i,o,n,s,m,i.stencilModeFor3D(),i.colorModeForRenderPass());else{var y=i.colorModeForRenderPass();kl(i,o,n,s,m,G.disabled,y)}}},hillshade:function(i,o,n,s){if(i.renderPass==="offscreen"||i.renderPass==="translucent"){for(var p=i.context,m=i.depthModeForSublayer(0,O.ReadOnly),y=i.colorModeForRenderPass(),g=i.renderPass==="translucent"?i.stencilConfigForOverlap(s):[{},s],w=g[0],A=0,B=g[1];A<B.length;A+=1){var L=B[A],R=o.getTile(L);R.needsHillshadePrepare&&i.renderPass==="offscreen"?qp(i,R,n,m,G.disabled,y):i.renderPass==="translucent"&&vs(i,R,n,m,w[L.overscaledZ],y)}p.viewport.set([0,0,i.width,i.height])}},raster:function(i,o,n,s){if(i.renderPass==="translucent"&&n.paint.get("raster-opacity")!==0&&s.length)for(var p=i.context,m=p.gl,y=o.getSource(),g=i.useProgram("raster"),w=i.colorModeForRenderPass(),A=y instanceof Ki?[{},s]:i.stencilConfigForOverlap(s),B=A[0],L=A[1],R=L[L.length-1].overscaledZ,Z=!i.options.moving,j=0,K=L;j<K.length;j+=1){var U=K[j],X=i.depthModeForSublayer(U.overscaledZ-R,n.paint.get("raster-opacity")===1?O.ReadWrite:O.ReadOnly,m.LESS),Q=o.getTile(U),ie=i.transform.calculatePosMatrix(U.toUnwrapped(),Z);Q.registerFadeDuration(n.paint.get("raster-fade-duration"));var ce=o.findLoadedParent(U,0),le=gs(Q,ce,o,n,i.transform),he=void 0,ge=void 0,Te=n.paint.get("raster-resampling")==="nearest"?m.NEAREST:m.LINEAR;p.activeTexture.set(m.TEXTURE0),Q.texture.bind(Te,m.CLAMP_TO_EDGE,m.LINEAR_MIPMAP_NEAREST),p.activeTexture.set(m.TEXTURE1),ce?(ce.texture.bind(Te,m.CLAMP_TO_EDGE,m.LINEAR_MIPMAP_NEAREST),he=Math.pow(2,ce.tileID.overscaledZ-Q.tileID.overscaledZ),ge=[Q.tileID.canonical.x*he%1,Q.tileID.canonical.y*he%1]):Q.texture.bind(Te,m.CLAMP_TO_EDGE,m.LINEAR_MIPMAP_NEAREST);var Se=$p(ie,ge||[0,0],he||1,le,n);y instanceof Ki?g.draw(p,m.TRIANGLES,X,G.disabled,w,ee.disabled,Se,n.id,y.boundsBuffer,i.quadTriangleIndexBuffer,y.boundsSegments):g.draw(p,m.TRIANGLES,X,B[U.overscaledZ],w,ee.disabled,Se,n.id,i.rasterBoundsBuffer,i.quadTriangleIndexBuffer,i.rasterBoundsSegments)}},background:function(i,o,n){var s=n.paint.get("background-color"),p=n.paint.get("background-opacity");if(p!==0){var m=i.context,y=m.gl,g=i.transform,w=g.tileSize,A=n.paint.get("background-pattern");if(!i.isPatternMissing(A)){var B=!A&&s.a===1&&p===1&&i.opaquePassEnabledForLayer()?"opaque":"translucent";if(i.renderPass===B){var L=G.disabled,R=i.depthModeForSublayer(0,B==="opaque"?O.ReadWrite:O.ReadOnly),Z=i.colorModeForRenderPass(),j=i.useProgram(A?"backgroundPattern":"background"),K=g.coveringTiles({tileSize:w});A&&(m.activeTexture.set(y.TEXTURE0),i.imageManager.bind(i.context));for(var U=n.getCrossfadeParameters(),X=0,Q=K;X<Q.length;X+=1){var ie=Q[X],ce=i.transform.calculatePosMatrix(ie.toUnwrapped()),le=A?Go(ce,p,i,A,{tileID:ie,tileSize:w},U):Aa(ce,p,s);j.draw(m,y.TRIANGLES,R,L,Z,ee.disabled,le,n.id,i.tileExtentBuffer,i.quadTriangleIndexBuffer,i.tileExtentSegments)}}}}},debug:function(i,o,n){for(var s=0;s<n.length;s++)oc(i,o,n[s])},custom:function(i,o,n){var s=i.context,p=n.implementation;if(i.renderPass==="offscreen"){var m=p.prerender;m&&(i.setCustomLayerDefaults(),s.setColorMode(i.colorModeForRenderPass()),m.call(p,s.gl,i.transform.customLayerMatrix()),s.setDirty(),i.setBaseState())}else if(i.renderPass==="translucent"){i.setCustomLayerDefaults(),s.setColorMode(i.colorModeForRenderPass()),s.setStencilMode(G.disabled);var y=p.renderingMode==="3d"?new O(i.context.gl.LEQUAL,O.ReadWrite,i.depthRangeFor3D):i.depthModeForSublayer(0,O.ReadOnly);s.setDepthMode(y),p.render(s.gl,i.transform.customLayerMatrix()),s.setDirty(),i.setBaseState(),s.bindFramebuffer.set(null)}}},Xt=function(i,o){this.context=new D(i),this.transform=o,this._tileTextures={},this.setup(),this.numSublayers=W.maxUnderzooming+W.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new Tn,this.gpuTimers={}};Xt.prototype.resize=function(i,o){if(this.width=i*l.browser.devicePixelRatio,this.height=o*l.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var n=0,s=this.style._order;n<s.length;n+=1)this.style._layers[s[n]].resize()},Xt.prototype.setup=function(){var i=this.context,o=new l.StructArrayLayout2i4;o.emplaceBack(0,0),o.emplaceBack(l.EXTENT,0),o.emplaceBack(0,l.EXTENT),o.emplaceBack(l.EXTENT,l.EXTENT),this.tileExtentBuffer=i.createVertexBuffer(o,dr.members),this.tileExtentSegments=l.SegmentVector.simpleSegment(0,0,4,2);var n=new l.StructArrayLayout2i4;n.emplaceBack(0,0),n.emplaceBack(l.EXTENT,0),n.emplaceBack(0,l.EXTENT),n.emplaceBack(l.EXTENT,l.EXTENT),this.debugBuffer=i.createVertexBuffer(n,dr.members),this.debugSegments=l.SegmentVector.simpleSegment(0,0,4,5);var s=new l.StructArrayLayout4i8;s.emplaceBack(0,0,0,0),s.emplaceBack(l.EXTENT,0,l.EXTENT,0),s.emplaceBack(0,l.EXTENT,0,l.EXTENT),s.emplaceBack(l.EXTENT,l.EXTENT,l.EXTENT,l.EXTENT),this.rasterBoundsBuffer=i.createVertexBuffer(s,Oi.members),this.rasterBoundsSegments=l.SegmentVector.simpleSegment(0,0,4,2);var p=new l.StructArrayLayout2i4;p.emplaceBack(0,0),p.emplaceBack(1,0),p.emplaceBack(0,1),p.emplaceBack(1,1),this.viewportBuffer=i.createVertexBuffer(p,dr.members),this.viewportSegments=l.SegmentVector.simpleSegment(0,0,4,2);var m=new l.StructArrayLayout1ui2;m.emplaceBack(0),m.emplaceBack(1),m.emplaceBack(3),m.emplaceBack(2),m.emplaceBack(0),this.tileBorderIndexBuffer=i.createIndexBuffer(m);var y=new l.StructArrayLayout3ui6;y.emplaceBack(0,1,2),y.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=i.createIndexBuffer(y),this.emptyTexture=new l.Texture(i,{width:1,height:1,data:new Uint8Array([0,0,0,0])},i.gl.RGBA);var g=this.context.gl;this.stencilClearMode=new G({func:g.ALWAYS,mask:0},0,255,g.ZERO,g.ZERO,g.ZERO)},Xt.prototype.clearStencil=function(){var i=this.context,o=i.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var n=l.create();l.ortho(n,0,this.width,this.height,0,0,1),l.scale(n,n,[o.drawingBufferWidth,o.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(i,o.TRIANGLES,O.disabled,this.stencilClearMode,Y.disabled,ee.disabled,po(n),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},Xt.prototype._renderTileClippingMasks=function(i,o){if(this.currentStencilSource!==i.source&&i.isTileClipped()&&o&&o.length){this.currentStencilSource=i.source;var n=this.context,s=n.gl;this.nextStencilID+o.length>256&&this.clearStencil(),n.setColorMode(Y.disabled),n.setDepthMode(O.disabled);var p=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var m=0,y=o;m<y.length;m+=1){var g=y[m],w=this._tileClippingMaskIDs[g.key]=this.nextStencilID++;p.draw(n,s.TRIANGLES,O.disabled,new G({func:s.ALWAYS,mask:0},w,255,s.KEEP,s.KEEP,s.REPLACE),Y.disabled,ee.disabled,po(g.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},Xt.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();var i=this.nextStencilID++,o=this.context.gl;return new G({func:o.NOTEQUAL,mask:255},i,255,o.KEEP,o.KEEP,o.REPLACE)},Xt.prototype.stencilModeForClipping=function(i){var o=this.context.gl;return new G({func:o.EQUAL,mask:255},this._tileClippingMaskIDs[i.key],0,o.KEEP,o.KEEP,o.REPLACE)},Xt.prototype.stencilConfigForOverlap=function(i){var o,n=this.context.gl,s=i.sort(function(w,A){return A.overscaledZ-w.overscaledZ}),p=s[s.length-1].overscaledZ,m=s[0].overscaledZ-p+1;if(m>1){this.currentStencilSource=void 0,this.nextStencilID+m>256&&this.clearStencil();for(var y={},g=0;g<m;g++)y[g+p]=new G({func:n.GEQUAL,mask:255},g+this.nextStencilID,255,n.KEEP,n.KEEP,n.REPLACE);return this.nextStencilID+=m,[y,s]}return[(o={},o[p]=G.disabled,o),s]},Xt.prototype.colorModeForRenderPass=function(){var i=this.context.gl;return this._showOverdrawInspector?new Y([i.CONSTANT_COLOR,i.ONE],new l.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):this.renderPass==="opaque"?Y.unblended:Y.alphaBlended},Xt.prototype.depthModeForSublayer=function(i,o,n){if(!this.opaquePassEnabledForLayer())return O.disabled;var s=1-((1+this.currentLayer)*this.numSublayers+i)*this.depthEpsilon;return new O(n||this.context.gl.LEQUAL,o,[s,s])},Xt.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},Xt.prototype.render=function(i,o){var n=this;this.style=i,this.options=o,this.lineAtlas=i.lineAtlas,this.imageManager=i.imageManager,this.glyphManager=i.glyphManager,this.symbolFadeChange=i.placement.symbolFadeChange(l.browser.now()),this.imageManager.beginFrame();var s=this.style._order,p=this.style.sourceCaches;for(var m in p){var y=p[m];y.used&&y.prepare(this.context)}var g,w,A={},B={},L={};for(var R in p){var Z=p[R];A[R]=Z.getVisibleCoordinates(),B[R]=A[R].slice().reverse(),L[R]=Z.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var j=0;j<s.length;j++)if(this.style._layers[s[j]].is3D()){this.opaquePassCutoff=j;break}this.renderPass="offscreen";for(var K=0,U=s;K<U.length;K+=1){var X=this.style._layers[U[K]];if(X.hasOffscreenPass()&&!X.isHidden(this.transform.zoom)){var Q=B[X.source];(X.type==="custom"||Q.length)&&this.renderLayer(this,p[X.source],X,Q)}}for(this.context.bindFramebuffer.set(null),this.context.clear({color:o.showOverdrawInspector?l.Color.black:l.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=o.showOverdrawInspector,this.depthRangeFor3D=[0,1-(i._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=s.length-1;this.currentLayer>=0;this.currentLayer--){var ie=this.style._layers[s[this.currentLayer]],ce=p[ie.source],le=A[ie.source];this._renderTileClippingMasks(ie,le),this.renderLayer(this,ce,ie,le)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<s.length;this.currentLayer++){var he=this.style._layers[s[this.currentLayer]],ge=p[he.source],Te=(he.type==="symbol"?L:B)[he.source];this._renderTileClippingMasks(he,A[he.source]),this.renderLayer(this,ge,he,Te)}this.options.showTileBoundaries&&(l.values(this.style._layers).forEach(function(Se){Se.source&&!Se.isHidden(n.transform.zoom)&&(Se.source!==(w&&w.id)&&(w=n.style.sourceCaches[Se.source]),(!g||g.getSource().maxzoom<w.getSource().maxzoom)&&(g=w))}),g&&fo.debug(this,g,g.getVisibleCoordinates())),this.options.showPadding&&function(Se){var Le=Se.transform.padding;Bl(Se,Se.transform.height-(Le.top||0),3,Ml),Bl(Se,Le.bottom||0,3,ic),Dl(Se,Le.left||0,3,nc),Dl(Se,Se.transform.width-(Le.right||0),3,_s);var Ge=Se.transform.centerPoint;(function(Xe,He,wt,Re){Pa(Xe,He-1,wt-10,2,20,Re),Pa(Xe,He-10,wt-1,20,2,Re)})(Se,Ge.x,Se.transform.height-Ge.y,zl)}(this),this.context.setDefault()},Xt.prototype.renderLayer=function(i,o,n,s){n.isHidden(this.transform.zoom)||(n.type==="background"||n.type==="custom"||s.length)&&(this.id=n.id,this.gpuTimingStart(n),fo[n.type](i,o,n,s,this.style.placement.variableOffsets),this.gpuTimingEnd())},Xt.prototype.gpuTimingStart=function(i){if(this.options.gpuTiming){var o=this.context.extTimerQuery,n=this.gpuTimers[i.id];n||(n=this.gpuTimers[i.id]={calls:0,cpuTime:0,query:o.createQueryEXT()}),n.calls++,o.beginQueryEXT(o.TIME_ELAPSED_EXT,n.query)}},Xt.prototype.gpuTimingEnd=function(){if(this.options.gpuTiming){var i=this.context.extTimerQuery;i.endQueryEXT(i.TIME_ELAPSED_EXT)}},Xt.prototype.collectGpuTimers=function(){var i=this.gpuTimers;return this.gpuTimers={},i},Xt.prototype.queryGpuTimers=function(i){var o={};for(var n in i){var s=i[n],p=this.context.extTimerQuery,m=p.getQueryObjectEXT(s.query,p.QUERY_RESULT_EXT)/1e6;p.deleteQueryEXT(s.query),o[n]=m}return o},Xt.prototype.translatePosMatrix=function(i,o,n,s,p){if(!n[0]&&!n[1])return i;var m=p?s==="map"?this.transform.angle:0:s==="viewport"?-this.transform.angle:0;if(m){var y=Math.sin(m),g=Math.cos(m);n=[n[0]*g-n[1]*y,n[0]*y+n[1]*g]}var w=[p?n[0]:Ht(o,n[0],this.transform.zoom),p?n[1]:Ht(o,n[1],this.transform.zoom),0],A=new Float32Array(16);return l.translate(A,i,w),A},Xt.prototype.saveTileTexture=function(i){var o=this._tileTextures[i.size[0]];o?o.push(i):this._tileTextures[i.size[0]]=[i]},Xt.prototype.getTileTexture=function(i){var o=this._tileTextures[i];return o&&o.length>0?o.pop():null},Xt.prototype.isPatternMissing=function(i){if(!i)return!1;if(!i.from||!i.to)return!0;var o=this.imageManager.getPattern(i.from.toString()),n=this.imageManager.getPattern(i.to.toString());return!o||!n},Xt.prototype.useProgram=function(i,o){this.cache=this.cache||{};var n=""+i+(o?o.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[n]||(this.cache[n]=new ju(this.context,i,Up[i],o,Qu[i],this._showOverdrawInspector)),this.cache[n]},Xt.prototype.setCustomLayerDefaults=function(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()},Xt.prototype.setBaseState=function(){var i=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(i.FUNC_ADD)},Xt.prototype.initDebugOverlayCanvas=function(){this.debugOverlayCanvas==null&&(this.debugOverlayCanvas=l.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new l.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},Xt.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()};var xs=function(i,o){this.points=i,this.planes=o};xs.fromInvProjectionMatrix=function(i,o,n){var s=Math.pow(2,n),p=[[-1,1,-1,1],[1,1,-1,1],[1,-1,-1,1],[-1,-1,-1,1],[-1,1,1,1],[1,1,1,1],[1,-1,1,1],[-1,-1,1,1]].map(function(y){return l.transformMat4([],y,i)}).map(function(y){return l.scale$1([],y,1/y[3]/o*s)}),m=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map(function(y){var g=l.sub([],p[y[0]],p[y[1]]),w=l.sub([],p[y[2]],p[y[1]]),A=l.normalize([],l.cross([],g,w)),B=-l.dot(A,p[y[1]]);return A.concat(B)});return new xs(p,m)};var mo=function(i,o){this.min=i,this.max=o,this.center=l.scale$2([],l.add([],this.min,this.max),.5)};mo.prototype.quadrant=function(i){for(var o=[i%2==0,i<2],n=l.clone$2(this.min),s=l.clone$2(this.max),p=0;p<o.length;p++)n[p]=o[p]?this.min[p]:this.center[p],s[p]=o[p]?this.center[p]:this.max[p];return s[2]=this.max[2],new mo(n,s)},mo.prototype.distanceX=function(i){return Math.max(Math.min(this.max[0],i[0]),this.min[0])-i[0]},mo.prototype.distanceY=function(i){return Math.max(Math.min(this.max[1],i[1]),this.min[1])-i[1]},mo.prototype.intersects=function(i){for(var o=[[this.min[0],this.min[1],0,1],[this.max[0],this.min[1],0,1],[this.max[0],this.max[1],0,1],[this.min[0],this.max[1],0,1]],n=!0,s=0;s<i.planes.length;s++){for(var p=i.planes[s],m=0,y=0;y<o.length;y++)m+=l.dot$1(p,o[y])>=0;if(m===0)return 0;m!==o.length&&(n=!1)}if(n)return 2;for(var g=0;g<3;g++){for(var w=Number.MAX_VALUE,A=-Number.MAX_VALUE,B=0;B<i.points.length;B++){var L=i.points[B][g]-this.min[g];w=Math.min(w,L),A=Math.max(A,L)}if(A<0||w>this.max[g]-this.min[g])return 0}return 1};var zn=function(i,o,n,s){if(i===void 0&&(i=0),o===void 0&&(o=0),n===void 0&&(n=0),s===void 0&&(s=0),isNaN(i)||i<0||isNaN(o)||o<0||isNaN(n)||n<0||isNaN(s)||s<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=i,this.bottom=o,this.left=n,this.right=s};zn.prototype.interpolate=function(i,o,n){return o.top!=null&&i.top!=null&&(this.top=l.number(i.top,o.top,n)),o.bottom!=null&&i.bottom!=null&&(this.bottom=l.number(i.bottom,o.bottom,n)),o.left!=null&&i.left!=null&&(this.left=l.number(i.left,o.left,n)),o.right!=null&&i.right!=null&&(this.right=l.number(i.right,o.right,n)),this},zn.prototype.getCenter=function(i,o){var n=l.clamp((this.left+i-this.right)/2,0,i),s=l.clamp((this.top+o-this.bottom)/2,0,o);return new l.Point(n,s)},zn.prototype.equals=function(i){return this.top===i.top&&this.bottom===i.bottom&&this.left===i.left&&this.right===i.right},zn.prototype.clone=function(){return new zn(this.top,this.bottom,this.left,this.right)},zn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}};var gt=function(i,o,n,s,p){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=p===void 0||p,this._minZoom=i||0,this._maxZoom=o||22,this._minPitch=n??0,this._maxPitch=s??60,this.setMaxBounds(),this.width=0,this.height=0,this._center=new l.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new zn,this._posMatrixCache={},this._alignedPosMatrixCache={}},jt={minZoom:{configurable:!0},maxZoom:{configurable:!0},minPitch:{configurable:!0},maxPitch:{configurable:!0},renderWorldCopies:{configurable:!0},worldSize:{configurable:!0},centerOffset:{configurable:!0},size:{configurable:!0},bearing:{configurable:!0},pitch:{configurable:!0},fov:{configurable:!0},zoom:{configurable:!0},center:{configurable:!0},padding:{configurable:!0},centerPoint:{configurable:!0},unmodified:{configurable:!0},point:{configurable:!0}};gt.prototype.clone=function(){var i=new gt(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return i.tileSize=this.tileSize,i.latRange=this.latRange,i.width=this.width,i.height=this.height,i._center=this._center,i.zoom=this.zoom,i.angle=this.angle,i._fov=this._fov,i._pitch=this._pitch,i._unmodified=this._unmodified,i._edgeInsets=this._edgeInsets.clone(),i._calcMatrices(),i},jt.minZoom.get=function(){return this._minZoom},jt.minZoom.set=function(i){this._minZoom!==i&&(this._minZoom=i,this.zoom=Math.max(this.zoom,i))},jt.maxZoom.get=function(){return this._maxZoom},jt.maxZoom.set=function(i){this._maxZoom!==i&&(this._maxZoom=i,this.zoom=Math.min(this.zoom,i))},jt.minPitch.get=function(){return this._minPitch},jt.minPitch.set=function(i){this._minPitch!==i&&(this._minPitch=i,this.pitch=Math.max(this.pitch,i))},jt.maxPitch.get=function(){return this._maxPitch},jt.maxPitch.set=function(i){this._maxPitch!==i&&(this._maxPitch=i,this.pitch=Math.min(this.pitch,i))},jt.renderWorldCopies.get=function(){return this._renderWorldCopies},jt.renderWorldCopies.set=function(i){i===void 0?i=!0:i===null&&(i=!1),this._renderWorldCopies=i},jt.worldSize.get=function(){return this.tileSize*this.scale},jt.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},jt.size.get=function(){return new l.Point(this.width,this.height)},jt.bearing.get=function(){return-this.angle/Math.PI*180},jt.bearing.set=function(i){var o=-l.wrap(i,-180,180)*Math.PI/180;this.angle!==o&&(this._unmodified=!1,this.angle=o,this._calcMatrices(),this.rotationMatrix=l.create$2(),l.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},jt.pitch.get=function(){return this._pitch/Math.PI*180},jt.pitch.set=function(i){var o=l.clamp(i,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==o&&(this._unmodified=!1,this._pitch=o,this._calcMatrices())},jt.fov.get=function(){return this._fov/Math.PI*180},jt.fov.set=function(i){i=Math.max(.01,Math.min(60,i)),this._fov!==i&&(this._unmodified=!1,this._fov=i/180*Math.PI,this._calcMatrices())},jt.zoom.get=function(){return this._zoom},jt.zoom.set=function(i){var o=Math.min(Math.max(i,this.minZoom),this.maxZoom);this._zoom!==o&&(this._unmodified=!1,this._zoom=o,this.scale=this.zoomScale(o),this.tileZoom=Math.floor(o),this.zoomFraction=o-this.tileZoom,this._constrain(),this._calcMatrices())},jt.center.get=function(){return this._center},jt.center.set=function(i){i.lat===this._center.lat&&i.lng===this._center.lng||(this._unmodified=!1,this._center=i,this._constrain(),this._calcMatrices())},jt.padding.get=function(){return this._edgeInsets.toJSON()},jt.padding.set=function(i){this._edgeInsets.equals(i)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,i,1),this._calcMatrices())},jt.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},gt.prototype.isPaddingEqual=function(i){return this._edgeInsets.equals(i)},gt.prototype.interpolatePadding=function(i,o,n){this._unmodified=!1,this._edgeInsets.interpolate(i,o,n),this._constrain(),this._calcMatrices()},gt.prototype.coveringZoomLevel=function(i){var o=(i.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/i.tileSize));return Math.max(0,o)},gt.prototype.getVisibleUnwrappedCoordinates=function(i){var o=[new l.UnwrappedTileID(0,i)];if(this._renderWorldCopies)for(var n=this.pointCoordinate(new l.Point(0,0)),s=this.pointCoordinate(new l.Point(this.width,0)),p=this.pointCoordinate(new l.Point(this.width,this.height)),m=this.pointCoordinate(new l.Point(0,this.height)),y=Math.floor(Math.min(n.x,s.x,p.x,m.x)),g=Math.floor(Math.max(n.x,s.x,p.x,m.x)),w=y-1;w<=g+1;w++)w!==0&&o.push(new l.UnwrappedTileID(w,i));return o},gt.prototype.coveringTiles=function(i){var o=this.coveringZoomLevel(i),n=o;if(i.minzoom!==void 0&&o<i.minzoom)return[];i.maxzoom!==void 0&&o>i.maxzoom&&(o=i.maxzoom);var s=l.MercatorCoordinate.fromLngLat(this.center),p=Math.pow(2,o),m=[p*s.x,p*s.y,0],y=xs.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,o),g=i.minzoom||0;this.pitch<=60&&this._edgeInsets.top<.1&&(g=o);var w=function(Se){return{aabb:new mo([Se*p,0,0],[(Se+1)*p,p,0]),zoom:0,x:0,y:0,wrap:Se,fullyVisible:!1}},A=[],B=[],L=o,R=i.reparseOverscaled?n:o;if(this._renderWorldCopies)for(var Z=1;Z<=3;Z++)A.push(w(-Z)),A.push(w(Z));for(A.push(w(0));A.length>0;){var j=A.pop(),K=j.x,U=j.y,X=j.fullyVisible;if(!X){var Q=j.aabb.intersects(y);if(Q===0)continue;X=Q===2}var ie=j.aabb.distanceX(m),ce=j.aabb.distanceY(m),le=Math.max(Math.abs(ie),Math.abs(ce));if(j.zoom===L||le>3+(1<<L-j.zoom)-2&&j.zoom>=g)B.push({tileID:new l.OverscaledTileID(j.zoom===L?R:j.zoom,j.wrap,j.zoom,K,U),distanceSq:l.sqrLen([m[0]-.5-K,m[1]-.5-U])});else for(var he=0;he<4;he++){var ge=(K<<1)+he%2,Te=(U<<1)+(he>>1);A.push({aabb:j.aabb.quadrant(he),zoom:j.zoom+1,x:ge,y:Te,wrap:j.wrap,fullyVisible:X})}}return B.sort(function(Se,Le){return Se.distanceSq-Le.distanceSq}).map(function(Se){return Se.tileID})},gt.prototype.resize=function(i,o){this.width=i,this.height=o,this.pixelsToGLUnits=[2/i,-2/o],this._constrain(),this._calcMatrices()},jt.unmodified.get=function(){return this._unmodified},gt.prototype.zoomScale=function(i){return Math.pow(2,i)},gt.prototype.scaleZoom=function(i){return Math.log(i)/Math.LN2},gt.prototype.project=function(i){var o=l.clamp(i.lat,-this.maxValidLatitude,this.maxValidLatitude);return new l.Point(l.mercatorXfromLng(i.lng)*this.worldSize,l.mercatorYfromLat(o)*this.worldSize)},gt.prototype.unproject=function(i){return new l.MercatorCoordinate(i.x/this.worldSize,i.y/this.worldSize).toLngLat()},jt.point.get=function(){return this.project(this.center)},gt.prototype.setLocationAtPoint=function(i,o){var n=this.pointCoordinate(o),s=this.pointCoordinate(this.centerPoint),p=this.locationCoordinate(i),m=new l.MercatorCoordinate(p.x-(n.x-s.x),p.y-(n.y-s.y));this.center=this.coordinateLocation(m),this._renderWorldCopies&&(this.center=this.center.wrap())},gt.prototype.locationPoint=function(i){return this.coordinatePoint(this.locationCoordinate(i))},gt.prototype.pointLocation=function(i){return this.coordinateLocation(this.pointCoordinate(i))},gt.prototype.locationCoordinate=function(i){return l.MercatorCoordinate.fromLngLat(i)},gt.prototype.coordinateLocation=function(i){return i.toLngLat()},gt.prototype.pointCoordinate=function(i){var o=[i.x,i.y,0,1],n=[i.x,i.y,1,1];l.transformMat4(o,o,this.pixelMatrixInverse),l.transformMat4(n,n,this.pixelMatrixInverse);var s=o[3],p=n[3],m=o[1]/s,y=n[1]/p,g=o[2]/s,w=n[2]/p,A=g===w?0:(0-g)/(w-g);return new l.MercatorCoordinate(l.number(o[0]/s,n[0]/p,A)/this.worldSize,l.number(m,y,A)/this.worldSize)},gt.prototype.coordinatePoint=function(i){var o=[i.x*this.worldSize,i.y*this.worldSize,0,1];return l.transformMat4(o,o,this.pixelMatrix),new l.Point(o[0]/o[3],o[1]/o[3])},gt.prototype.getBounds=function(){return new l.LngLatBounds().extend(this.pointLocation(new l.Point(0,0))).extend(this.pointLocation(new l.Point(this.width,0))).extend(this.pointLocation(new l.Point(this.width,this.height))).extend(this.pointLocation(new l.Point(0,this.height)))},gt.prototype.getMaxBounds=function(){return this.latRange&&this.latRange.length===2&&this.lngRange&&this.lngRange.length===2?new l.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},gt.prototype.setMaxBounds=function(i){i?(this.lngRange=[i.getWest(),i.getEast()],this.latRange=[i.getSouth(),i.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},gt.prototype.calculatePosMatrix=function(i,o){o===void 0&&(o=!1);var n=i.key,s=o?this._alignedPosMatrixCache:this._posMatrixCache;if(s[n])return s[n];var p=i.canonical,m=this.worldSize/this.zoomScale(p.z),y=p.x+Math.pow(2,p.z)*i.wrap,g=l.identity(new Float64Array(16));return l.translate(g,g,[y*m,p.y*m,0]),l.scale(g,g,[m/l.EXTENT,m/l.EXTENT,1]),l.multiply(g,o?this.alignedProjMatrix:this.projMatrix,g),s[n]=new Float32Array(g),s[n]},gt.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},gt.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var i,o,n,s,p=-90,m=90,y=-180,g=180,w=this.size,A=this._unmodified;if(this.latRange){var B=this.latRange;p=l.mercatorYfromLat(B[1])*this.worldSize,i=(m=l.mercatorYfromLat(B[0])*this.worldSize)-p<w.y?w.y/(m-p):0}if(this.lngRange){var L=this.lngRange;y=l.mercatorXfromLng(L[0])*this.worldSize,o=(g=l.mercatorXfromLng(L[1])*this.worldSize)-y<w.x?w.x/(g-y):0}var R=this.point,Z=Math.max(o||0,i||0);if(Z)return this.center=this.unproject(new l.Point(o?(g+y)/2:R.x,i?(m+p)/2:R.y)),this.zoom+=this.scaleZoom(Z),this._unmodified=A,void(this._constraining=!1);if(this.latRange){var j=R.y,K=w.y/2;j-K<p&&(s=p+K),j+K>m&&(s=m-K)}if(this.lngRange){var U=R.x,X=w.x/2;U-X<y&&(n=y+X),U+X>g&&(n=g-X)}n===void 0&&s===void 0||(this.center=this.unproject(new l.Point(n!==void 0?n:R.x,s!==void 0?s:R.y))),this._unmodified=A,this._constraining=!1}},gt.prototype._calcMatrices=function(){if(this.height){var i=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var o=Math.PI/2+this._pitch,n=this._fov*(.5+i.y/this.height),s=Math.sin(n)*this.cameraToCenterDistance/Math.sin(l.clamp(Math.PI-o-n,.01,Math.PI-.01)),p=this.point,m=p.x,y=p.y,g=1.01*(Math.cos(Math.PI/2-this._pitch)*s+this.cameraToCenterDistance),w=this.height/50,A=new Float64Array(16);l.perspective(A,this._fov,this.width/this.height,w,g),A[8]=2*-i.x/this.width,A[9]=2*i.y/this.height,l.scale(A,A,[1,-1,1]),l.translate(A,A,[0,0,-this.cameraToCenterDistance]),l.rotateX(A,A,this._pitch),l.rotateZ(A,A,this.angle),l.translate(A,A,[-m,-y,0]),this.mercatorMatrix=l.scale([],A,[this.worldSize,this.worldSize,this.worldSize]),l.scale(A,A,[1,1,l.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=A,this.invProjMatrix=l.invert([],this.projMatrix);var B=this.width%2/2,L=this.height%2/2,R=Math.cos(this.angle),Z=Math.sin(this.angle),j=m-Math.round(m)+R*B+Z*L,K=y-Math.round(y)+R*L+Z*B,U=new Float64Array(A);if(l.translate(U,U,[j>.5?j-1:j,K>.5?K-1:K,0]),this.alignedProjMatrix=U,A=l.create(),l.scale(A,A,[this.width/2,-this.height/2,1]),l.translate(A,A,[1,-1,0]),this.labelPlaneMatrix=A,A=l.create(),l.scale(A,A,[1,-1,1]),l.translate(A,A,[-1,-1,0]),l.scale(A,A,[2/this.width,2/this.height,1]),this.glCoordMatrix=A,this.pixelMatrix=l.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(A=l.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=A,this._posMatrixCache={},this._alignedPosMatrixCache={}}},gt.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var i=this.pointCoordinate(new l.Point(0,0)),o=[i.x*this.worldSize,i.y*this.worldSize,0,1];return l.transformMat4(o,o,this.pixelMatrix)[3]/this.cameraToCenterDistance},gt.prototype.getCameraPoint=function(){var i=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new l.Point(0,i))},gt.prototype.getCameraQueryGeometry=function(i){var o=this.getCameraPoint();if(i.length===1)return[i[0],o];for(var n=o.x,s=o.y,p=o.x,m=o.y,y=0,g=i;y<g.length;y+=1){var w=g[y];n=Math.min(n,w.x),s=Math.min(s,w.y),p=Math.max(p,w.x),m=Math.max(m,w.y)}return[new l.Point(n,s),new l.Point(p,s),new l.Point(p,m),new l.Point(n,m),new l.Point(n,s)]},Object.defineProperties(gt.prototype,jt);var _i=function(i){var o,n,s,p;this._hashName=i&&encodeURIComponent(i),l.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(o=this._updateHashUnthrottled.bind(this),n=!1,s=null,p=function(){s=null,n&&(o(),s=setTimeout(p,300),n=!1)},function(){return n=!0,s||p(),s})};_i.prototype.addTo=function(i){return this._map=i,l.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},_i.prototype.remove=function(){return l.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},_i.prototype.getHashString=function(i){var o=this._map.getCenter(),n=Math.round(100*this._map.getZoom())/100,s=Math.ceil((n*Math.LN2+Math.log(512/360/.5))/Math.LN10),p=Math.pow(10,s),m=Math.round(o.lng*p)/p,y=Math.round(o.lat*p)/p,g=this._map.getBearing(),w=this._map.getPitch(),A="";if(A+=i?"/"+m+"/"+y+"/"+n:n+"/"+y+"/"+m,(g||w)&&(A+="/"+Math.round(10*g)/10),w&&(A+="/"+Math.round(w)),this._hashName){var B=this._hashName,L=!1,R=l.window.location.hash.slice(1).split("&").map(function(Z){var j=Z.split("=")[0];return j===B?(L=!0,j+"="+A):Z}).filter(function(Z){return Z});return L||R.push(B+"="+A),"#"+R.join("&")}return"#"+A},_i.prototype._getCurrentHash=function(){var i,o=this,n=l.window.location.hash.replace("#","");return this._hashName?(n.split("&").map(function(s){return s.split("=")}).forEach(function(s){s[0]===o._hashName&&(i=s)}),(i&&i[1]||"").split("/")):n.split("/")},_i.prototype._onHashChange=function(){var i=this._getCurrentHash();if(i.length>=3&&!i.some(function(n){return isNaN(n)})){var o=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(i[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+i[2],+i[1]],zoom:+i[0],bearing:o,pitch:+(i[4]||0)}),!0}return!1},_i.prototype._updateHashUnthrottled=function(){var i=l.window.location.href.replace(/(#.+)?$/,this.getHashString());try{l.window.history.replaceState(l.window.history.state,null,i)}catch{}};var Ca={linearity:.3,easing:l.bezier(0,0,.3,1)},Wo=l.extend({deceleration:2500,maxSpeed:1400},Ca),ka=l.extend({deceleration:20,maxSpeed:1400},Ca),jp=l.extend({deceleration:1e3,maxSpeed:360},Ca),Gp=l.extend({deceleration:1e3,maxSpeed:90},Ca),Ma=function(i){this._map=i,this.clear()};function za(i,o){(!i.duration||i.duration<o.duration)&&(i.duration=o.duration,i.easing=o.easing)}function hn(i,o,n){var s=n.maxSpeed,p=n.linearity,m=n.deceleration,y=l.clamp(i*p/(o/1e3),-s,s),g=Math.abs(y)/(m*p);return{easing:n.easing,duration:1e3*g,amount:y*(g/2)}}Ma.prototype.clear=function(){this._inertiaBuffer=[]},Ma.prototype.record=function(i){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:l.browser.now(),settings:i})},Ma.prototype._drainInertiaBuffer=function(){for(var i=this._inertiaBuffer,o=l.browser.now();i.length>0&&o-i[0].time>160;)i.shift()},Ma.prototype._onMoveEnd=function(i){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var o={zoom:0,bearing:0,pitch:0,pan:new l.Point(0,0),pinchAround:void 0,around:void 0},n=0,s=this._inertiaBuffer;n<s.length;n+=1){var p=s[n].settings;o.zoom+=p.zoomDelta||0,o.bearing+=p.bearingDelta||0,o.pitch+=p.pitchDelta||0,p.panDelta&&o.pan._add(p.panDelta),p.around&&(o.around=p.around),p.pinchAround&&(o.pinchAround=p.pinchAround)}var m=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,y={};if(o.pan.mag()){var g=hn(o.pan.mag(),m,l.extend({},Wo,i||{}));y.offset=o.pan.mult(g.amount/o.pan.mag()),y.center=this._map.transform.center,za(y,g)}if(o.zoom){var w=hn(o.zoom,m,ka);y.zoom=this._map.transform.zoom+w.amount,za(y,w)}if(o.bearing){var A=hn(o.bearing,m,jp);y.bearing=this._map.transform.bearing+l.clamp(A.amount,-179,179),za(y,A)}if(o.pitch){var B=hn(o.pitch,m,Gp);y.pitch=this._map.transform.pitch+B.amount,za(y,B)}if(y.zoom||y.bearing){var L=o.pinchAround===void 0?o.around:o.pinchAround;y.around=L?this._map.unproject(L):this._map.getCenter()}return this.clear(),l.extend(y,{noMoveStart:!0})}};var _r=function(i){function o(s,p,m,y){y===void 0&&(y={});var g=q.mousePos(p.getCanvasContainer(),m),w=p.unproject(g);i.call(this,s,l.extend({point:g,lngLat:w,originalEvent:m},y)),this._defaultPrevented=!1,this.target=p}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={defaultPrevented:{configurable:!0}};return o.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(o.prototype,n),o}(l.Event),Ba=function(i){function o(s,p,m){var y=s==="touchend"?m.changedTouches:m.touches,g=q.touchPos(p.getCanvasContainer(),y),w=g.map(function(L){return p.unproject(L)}),A=g.reduce(function(L,R,Z,j){return L.add(R.div(j.length))},new l.Point(0,0)),B=p.unproject(A);i.call(this,s,{points:g,point:A,lngLats:w,lngLat:B,originalEvent:m}),this._defaultPrevented=!1}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={defaultPrevented:{configurable:!0}};return o.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(o.prototype,n),o}(l.Event),ac=function(i){function o(s,p,m){i.call(this,s,{originalEvent:m}),this._defaultPrevented=!1}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={defaultPrevented:{configurable:!0}};return o.prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(o.prototype,n),o}(l.Event),mr=function(i,o){this._map=i,this._clickTolerance=o.clickTolerance};mr.prototype.reset=function(){delete this._mousedownPos},mr.prototype.wheel=function(i){return this._firePreventable(new ac(i.type,this._map,i))},mr.prototype.mousedown=function(i,o){return this._mousedownPos=o,this._firePreventable(new _r(i.type,this._map,i))},mr.prototype.mouseup=function(i){this._map.fire(new _r(i.type,this._map,i))},mr.prototype.click=function(i,o){this._mousedownPos&&this._mousedownPos.dist(o)>=this._clickTolerance||this._map.fire(new _r(i.type,this._map,i))},mr.prototype.dblclick=function(i){return this._firePreventable(new _r(i.type,this._map,i))},mr.prototype.mouseover=function(i){this._map.fire(new _r(i.type,this._map,i))},mr.prototype.mouseout=function(i){this._map.fire(new _r(i.type,this._map,i))},mr.prototype.touchstart=function(i){return this._firePreventable(new Ba(i.type,this._map,i))},mr.prototype.touchmove=function(i){this._map.fire(new Ba(i.type,this._map,i))},mr.prototype.touchend=function(i){this._map.fire(new Ba(i.type,this._map,i))},mr.prototype.touchcancel=function(i){this._map.fire(new Ba(i.type,this._map,i))},mr.prototype._firePreventable=function(i){if(this._map.fire(i),i.defaultPrevented)return{}},mr.prototype.isEnabled=function(){return!0},mr.prototype.isActive=function(){return!1},mr.prototype.enable=function(){},mr.prototype.disable=function(){};var Oe=function(i){this._map=i};Oe.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Oe.prototype.mousemove=function(i){this._map.fire(new _r(i.type,this._map,i))},Oe.prototype.mousedown=function(){this._delayContextMenu=!0},Oe.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new _r("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Oe.prototype.contextmenu=function(i){this._delayContextMenu?this._contextMenuEvent=i:this._map.fire(new _r(i.type,this._map,i)),this._map.listens("contextmenu")&&i.preventDefault()},Oe.prototype.isEnabled=function(){return!0},Oe.prototype.isActive=function(){return!1},Oe.prototype.enable=function(){},Oe.prototype.disable=function(){};var ci=function(i,o){this._map=i,this._el=i.getCanvasContainer(),this._container=i.getContainer(),this._clickTolerance=o.clickTolerance||1};function bs(i,o){for(var n={},s=0;s<i.length;s++)n[i[s].identifier]=o[s];return n}ci.prototype.isEnabled=function(){return!!this._enabled},ci.prototype.isActive=function(){return!!this._active},ci.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},ci.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ci.prototype.mousedown=function(i,o){this.isEnabled()&&i.shiftKey&&i.button===0&&(q.disableDrag(),this._startPos=this._lastPos=o,this._active=!0)},ci.prototype.mousemoveWindow=function(i,o){if(this._active){var n=o;if(!(this._lastPos.equals(n)||!this._box&&n.dist(this._startPos)<this._clickTolerance)){var s=this._startPos;this._lastPos=n,this._box||(this._box=q.create("div","mapboxgl-boxzoom",this._container),this._container.classList.add("mapboxgl-crosshair"),this._fireEvent("boxzoomstart",i));var p=Math.min(s.x,n.x),m=Math.max(s.x,n.x),y=Math.min(s.y,n.y),g=Math.max(s.y,n.y);q.setTransform(this._box,"translate("+p+"px,"+y+"px)"),this._box.style.width=m-p+"px",this._box.style.height=g-y+"px"}}},ci.prototype.mouseupWindow=function(i,o){var n=this;if(this._active&&i.button===0){var s=this._startPos,p=o;if(this.reset(),q.suppressClick(),s.x!==p.x||s.y!==p.y)return this._map.fire(new l.Event("boxzoomend",{originalEvent:i})),{cameraAnimation:function(m){return m.fitScreenCoordinates(s,p,n._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",i)}},ci.prototype.keydown=function(i){this._active&&i.keyCode===27&&(this.reset(),this._fireEvent("boxzoomcancel",i))},ci.prototype.blur=function(){this.reset()},ci.prototype.reset=function(){this._active=!1,this._container.classList.remove("mapboxgl-crosshair"),this._box&&(q.remove(this._box),this._box=null),q.enableDrag(),delete this._startPos,delete this._lastPos},ci.prototype._fireEvent=function(i,o){return this._map.fire(new l.Event(i,{originalEvent:o}))};var Ho=function(i){this.reset(),this.numTouches=i.numTouches};Ho.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},Ho.prototype.touchstart=function(i,o,n){(this.centroid||n.length>this.numTouches)&&(this.aborted=!0),this.aborted||(this.startTime===void 0&&(this.startTime=i.timeStamp),n.length===this.numTouches&&(this.centroid=function(s){for(var p=new l.Point(0,0),m=0,y=s;m<y.length;m+=1)p._add(y[m]);return p.div(s.length)}(o),this.touches=bs(n,o)))},Ho.prototype.touchmove=function(i,o,n){if(!this.aborted&&this.centroid){var s=bs(n,o);for(var p in this.touches){var m=s[p];(!m||m.dist(this.touches[p])>30)&&(this.aborted=!0)}}},Ho.prototype.touchend=function(i,o,n){if((!this.centroid||i.timeStamp-this.startTime>500)&&(this.aborted=!0),n.length===0){var s=!this.aborted&&this.centroid;if(this.reset(),s)return s}};var ji=function(i){this.singleTap=new Ho(i),this.numTaps=i.numTaps,this.reset()};ji.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},ji.prototype.touchstart=function(i,o,n){this.singleTap.touchstart(i,o,n)},ji.prototype.touchmove=function(i,o,n){this.singleTap.touchmove(i,o,n)},ji.prototype.touchend=function(i,o,n){var s=this.singleTap.touchend(i,o,n);if(s){var p=i.timeStamp-this.lastTime<500,m=!this.lastTap||this.lastTap.dist(s)<30;if(p&&m||this.reset(),this.count++,this.lastTime=i.timeStamp,this.lastTap=s,this.count===this.numTaps)return this.reset(),s}};var pi=function(){this._zoomIn=new ji({numTouches:1,numTaps:2}),this._zoomOut=new ji({numTouches:2,numTaps:1}),this.reset()};pi.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},pi.prototype.touchstart=function(i,o,n){this._zoomIn.touchstart(i,o,n),this._zoomOut.touchstart(i,o,n)},pi.prototype.touchmove=function(i,o,n){this._zoomIn.touchmove(i,o,n),this._zoomOut.touchmove(i,o,n)},pi.prototype.touchend=function(i,o,n){var s=this,p=this._zoomIn.touchend(i,o,n),m=this._zoomOut.touchend(i,o,n);return p?(this._active=!0,i.preventDefault(),setTimeout(function(){return s.reset()},0),{cameraAnimation:function(y){return y.easeTo({duration:300,zoom:y.getZoom()+1,around:y.unproject(p)},{originalEvent:i})}}):m?(this._active=!0,i.preventDefault(),setTimeout(function(){return s.reset()},0),{cameraAnimation:function(y){return y.easeTo({duration:300,zoom:y.getZoom()-1,around:y.unproject(m)},{originalEvent:i})}}):void 0},pi.prototype.touchcancel=function(){this.reset()},pi.prototype.enable=function(){this._enabled=!0},pi.prototype.disable=function(){this._enabled=!1,this.reset()},pi.prototype.isEnabled=function(){return this._enabled},pi.prototype.isActive=function(){return this._active};var Ll={0:1,2:2},Pe=function(i){this.reset(),this._clickTolerance=i.clickTolerance||1};Pe.prototype.blur=function(){this.reset()},Pe.prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},Pe.prototype._correctButton=function(i,o){return!1},Pe.prototype._move=function(i,o){return{}},Pe.prototype.mousedown=function(i,o){if(!this._lastPoint){var n=q.mouseButton(i);this._correctButton(i,n)&&(this._lastPoint=o,this._eventButton=n)}},Pe.prototype.mousemoveWindow=function(i,o){var n=this._lastPoint;if(n){if(i.preventDefault(),function(s,p){var m=Ll[p];return s.buttons===void 0||(s.buttons&m)!==m}(i,this._eventButton))this.reset();else if(this._moved||!(o.dist(n)<this._clickTolerance))return this._moved=!0,this._lastPoint=o,this._move(n,o)}},Pe.prototype.mouseupWindow=function(i){this._lastPoint&&q.mouseButton(i)===this._eventButton&&(this._moved&&q.suppressClick(),this.reset())},Pe.prototype.enable=function(){this._enabled=!0},Pe.prototype.disable=function(){this._enabled=!1,this.reset()},Pe.prototype.isEnabled=function(){return this._enabled},Pe.prototype.isActive=function(){return this._active};var Rl=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.mousedown=function(n,s){i.prototype.mousedown.call(this,n,s),this._lastPoint&&(this._active=!0)},o.prototype._correctButton=function(n,s){return s===0&&!n.ctrlKey},o.prototype._move=function(n,s){return{around:s,panDelta:s.sub(n)}},o}(Pe),ws=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype._correctButton=function(n,s){return s===0&&n.ctrlKey||s===2},o.prototype._move=function(n,s){var p=.8*(s.x-n.x);if(p)return this._active=!0,{bearingDelta:p}},o.prototype.contextmenu=function(n){n.preventDefault()},o}(Pe),Fl=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype._correctButton=function(n,s){return s===0&&n.ctrlKey||s===2},o.prototype._move=function(n,s){var p=-.5*(s.y-n.y);if(p)return this._active=!0,{pitchDelta:p}},o.prototype.contextmenu=function(n){n.preventDefault()},o}(Pe),Mi=function(i){this._minTouches=1,this._clickTolerance=i.clickTolerance||1,this.reset()};Mi.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new l.Point(0,0)},Mi.prototype.touchstart=function(i,o,n){return this._calculateTransform(i,o,n)},Mi.prototype.touchmove=function(i,o,n){if(this._active&&!(n.length<this._minTouches))return i.preventDefault(),this._calculateTransform(i,o,n)},Mi.prototype.touchend=function(i,o,n){this._calculateTransform(i,o,n),this._active&&n.length<this._minTouches&&this.reset()},Mi.prototype.touchcancel=function(){this.reset()},Mi.prototype._calculateTransform=function(i,o,n){n.length>0&&(this._active=!0);var s=bs(n,o),p=new l.Point(0,0),m=new l.Point(0,0),y=0;for(var g in s){var w=s[g],A=this._touches[g];A&&(p._add(w),m._add(w.sub(A)),y++,s[g]=w)}if(this._touches=s,!(y<this._minTouches)&&m.mag()){var B=m.div(y);if(this._sum._add(B),!(this._sum.mag()<this._clickTolerance))return{around:p.div(y),panDelta:B}}},Mi.prototype.enable=function(){this._enabled=!0},Mi.prototype.disable=function(){this._enabled=!1,this.reset()},Mi.prototype.isEnabled=function(){return this._enabled},Mi.prototype.isActive=function(){return this._active};var hi=function(){this.reset()};function Ss(i,o,n){for(var s=0;s<i.length;s++)if(i[s].identifier===n)return o[s]}function Ts(i,o){return Math.log(i/o)/Math.LN2}hi.prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},hi.prototype._start=function(i){},hi.prototype._move=function(i,o,n){return{}},hi.prototype.touchstart=function(i,o,n){this._firstTwoTouches||n.length<2||(this._firstTwoTouches=[n[0].identifier,n[1].identifier],this._start([o[0],o[1]]))},hi.prototype.touchmove=function(i,o,n){if(this._firstTwoTouches){i.preventDefault();var s=this._firstTwoTouches,p=s[1],m=Ss(n,o,s[0]),y=Ss(n,o,p);if(m&&y){var g=this._aroundCenter?null:m.add(y).div(2);return this._move([m,y],g,i)}}},hi.prototype.touchend=function(i,o,n){if(this._firstTwoTouches){var s=this._firstTwoTouches,p=s[1],m=Ss(n,o,s[0]),y=Ss(n,o,p);m&&y||(this._active&&q.suppressClick(),this.reset())}},hi.prototype.touchcancel=function(){this.reset()},hi.prototype.enable=function(i){this._enabled=!0,this._aroundCenter=!!i&&i.around==="center"},hi.prototype.disable=function(){this._enabled=!1,this.reset()},hi.prototype.isEnabled=function(){return this._enabled},hi.prototype.isActive=function(){return this._active};var fi=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.reset=function(){i.prototype.reset.call(this),delete this._distance,delete this._startDistance},o.prototype._start=function(n){this._startDistance=this._distance=n[0].dist(n[1])},o.prototype._move=function(n,s){var p=this._distance;if(this._distance=n[0].dist(n[1]),this._active||!(Math.abs(Ts(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Ts(this._distance,p),pinchAround:s}},o}(hi);function fn(i,o){return 180*i.angleWith(o)/Math.PI}var sc=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.reset=function(){i.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},o.prototype._start=function(n){this._startVector=this._vector=n[0].sub(n[1]),this._minDiameter=n[0].dist(n[1])},o.prototype._move=function(n,s){var p=this._vector;if(this._vector=n[0].sub(n[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:fn(this._vector,p),pinchAround:s}},o.prototype._isBelowThreshold=function(n){this._minDiameter=Math.min(this._minDiameter,n.mag());var s=25/(Math.PI*this._minDiameter)*360,p=fn(n,this._startVector);return Math.abs(p)<s},o}(hi);function Da(i){return Math.abs(i.y)>Math.abs(i.x)}var Ol=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.reset=function(){i.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},o.prototype._start=function(n){this._lastPoints=n,Da(n[0].sub(n[1]))&&(this._valid=!1)},o.prototype._move=function(n,s,p){var m=n[0].sub(this._lastPoints[0]),y=n[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(m,y,p.timeStamp),this._valid)return this._lastPoints=n,this._active=!0,{pitchDelta:(m.y+y.y)/2*-.5}},o.prototype.gestureBeginsVertically=function(n,s,p){if(this._valid!==void 0)return this._valid;var m=n.mag()>=2,y=s.mag()>=2;if(m||y){if(!m||!y)return this._firstMove===void 0&&(this._firstMove=p),p-this._firstMove<100&&void 0;var g=n.y>0==s.y>0;return Da(n)&&Da(s)&&g}},o}(hi),Vl={panStep:100,bearingStep:15,pitchStep:10},Gi=function(){var i=Vl;this._panStep=i.panStep,this._bearingStep=i.bearingStep,this._pitchStep=i.pitchStep,this._rotationDisabled=!1};function xi(i){return i*(2-i)}Gi.prototype.blur=function(){this.reset()},Gi.prototype.reset=function(){this._active=!1},Gi.prototype.keydown=function(i){var o=this;if(!(i.altKey||i.ctrlKey||i.metaKey)){var n=0,s=0,p=0,m=0,y=0;switch(i.keyCode){case 61:case 107:case 171:case 187:n=1;break;case 189:case 109:case 173:n=-1;break;case 37:i.shiftKey?s=-1:(i.preventDefault(),m=-1);break;case 39:i.shiftKey?s=1:(i.preventDefault(),m=1);break;case 38:i.shiftKey?p=1:(i.preventDefault(),y=-1);break;case 40:i.shiftKey?p=-1:(i.preventDefault(),y=1);break;default:return}return this._rotationDisabled&&(s=0,p=0),{cameraAnimation:function(g){var w=g.getZoom();g.easeTo({duration:300,easeId:"keyboardHandler",easing:xi,zoom:n?Math.round(w)+n*(i.shiftKey?2:1):w,bearing:g.getBearing()+s*o._bearingStep,pitch:g.getPitch()+p*o._pitchStep,offset:[-m*o._panStep,-y*o._panStep],center:g.getCenter()},{originalEvent:i})}}}},Gi.prototype.enable=function(){this._enabled=!0},Gi.prototype.disable=function(){this._enabled=!1,this.reset()},Gi.prototype.isEnabled=function(){return this._enabled},Gi.prototype.isActive=function(){return this._active},Gi.prototype.disableRotation=function(){this._rotationDisabled=!0},Gi.prototype.enableRotation=function(){this._rotationDisabled=!1};var ft=function(i,o){this._map=i,this._el=i.getCanvasContainer(),this._handler=o,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,l.bindAll(["_onTimeout"],this)};ft.prototype.setZoomRate=function(i){this._defaultZoomRate=i},ft.prototype.setWheelZoomRate=function(i){this._wheelZoomRate=i},ft.prototype.isEnabled=function(){return!!this._enabled},ft.prototype.isActive=function(){return!!this._active||this._finishTimeout!==void 0},ft.prototype.isZooming=function(){return!!this._zooming},ft.prototype.enable=function(i){this.isEnabled()||(this._enabled=!0,this._aroundCenter=i&&i.around==="center")},ft.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},ft.prototype.wheel=function(i){if(this.isEnabled()){var o=i.deltaMode===l.window.WheelEvent.DOM_DELTA_LINE?40*i.deltaY:i.deltaY,n=l.browser.now(),s=n-(this._lastWheelEventTime||0);this._lastWheelEventTime=n,o!==0&&o%4.000244140625==0?this._type="wheel":o!==0&&Math.abs(o)<4?this._type="trackpad":s>400?(this._type=null,this._lastValue=o,this._timeout=setTimeout(this._onTimeout,40,i)):this._type||(this._type=Math.abs(s*o)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,o+=this._lastValue)),i.shiftKey&&o&&(o/=4),this._type&&(this._lastWheelEvent=i,this._delta-=o,this._active||this._start(i)),i.preventDefault()}},ft.prototype._onTimeout=function(i){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(i)},ft.prototype._start=function(i){if(this._delta){this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);var o=q.mousePos(this._el,i);this._around=l.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(o)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}},ft.prototype.renderFrame=function(){var i=this;if(this._frameId&&(this._frameId=null,this.isActive())){var o=this._map.transform;if(this._delta!==0){var n=this._type==="wheel"&&Math.abs(this._delta)>4.000244140625?this._wheelZoomRate:this._defaultZoomRate,s=2/(1+Math.exp(-Math.abs(this._delta*n)));this._delta<0&&s!==0&&(s=1/s);var p=typeof this._targetZoom=="number"?o.zoomScale(this._targetZoom):o.scale;this._targetZoom=Math.min(o.maxZoom,Math.max(o.minZoom,o.scaleZoom(p*s))),this._type==="wheel"&&(this._startZoom=o.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}var m,y=typeof this._targetZoom=="number"?this._targetZoom:o.zoom,g=this._startZoom,w=this._easing,A=!1;if(this._type==="wheel"&&g&&w){var B=Math.min((l.browser.now()-this._lastWheelEventTime)/200,1),L=w(B);m=l.number(g,y,L),B<1?this._frameId||(this._frameId=!0):A=!0}else m=y,A=!0;return this._active=!0,A&&(this._active=!1,this._finishTimeout=setTimeout(function(){i._zooming=!1,i._handler._triggerRenderFrame(),delete i._targetZoom,delete i._finishTimeout},200)),{noInertia:!0,needsRenderFrame:!A,zoomDelta:m-o.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},ft.prototype._smoothOutEasing=function(i){var o=l.ease;if(this._prevEase){var n=this._prevEase,s=(l.browser.now()-n.start)/n.duration,p=n.easing(s+.01)-n.easing(s),m=.27/Math.sqrt(p*p+1e-4)*.01,y=Math.sqrt(.0729-m*m);o=l.bezier(m,y,.25,1)}return this._prevEase={start:l.browser.now(),duration:i,easing:o},o},ft.prototype.blur=function(){this.reset()},ft.prototype.reset=function(){this._active=!1};var Qi=function(i,o){this._clickZoom=i,this._tapZoom=o};Qi.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},Qi.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},Qi.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},Qi.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()};var zi=function(){this.reset()};zi.prototype.reset=function(){this._active=!1},zi.prototype.blur=function(){this.reset()},zi.prototype.dblclick=function(i,o){return i.preventDefault(),{cameraAnimation:function(n){n.easeTo({duration:300,zoom:n.getZoom()+(i.shiftKey?-1:1),around:n.unproject(o)},{originalEvent:i})}}},zi.prototype.enable=function(){this._enabled=!0},zi.prototype.disable=function(){this._enabled=!1,this.reset()},zi.prototype.isEnabled=function(){return this._enabled},zi.prototype.isActive=function(){return this._active};var Fr=function(){this._tap=new ji({numTouches:1,numTaps:1}),this.reset()};Fr.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},Fr.prototype.touchstart=function(i,o,n){this._swipePoint||(this._tapTime&&i.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?n.length>0&&(this._swipePoint=o[0],this._swipeTouch=n[0].identifier):this._tap.touchstart(i,o,n))},Fr.prototype.touchmove=function(i,o,n){if(this._tapTime){if(this._swipePoint){if(n[0].identifier!==this._swipeTouch)return;var s=o[0],p=s.y-this._swipePoint.y;return this._swipePoint=s,i.preventDefault(),this._active=!0,{zoomDelta:p/128}}}else this._tap.touchmove(i,o,n)},Fr.prototype.touchend=function(i,o,n){this._tapTime?this._swipePoint&&n.length===0&&this.reset():this._tap.touchend(i,o,n)&&(this._tapTime=i.timeStamp)},Fr.prototype.touchcancel=function(){this.reset()},Fr.prototype.enable=function(){this._enabled=!0},Fr.prototype.disable=function(){this._enabled=!1,this.reset()},Fr.prototype.isEnabled=function(){return this._enabled},Fr.prototype.isActive=function(){return this._active};var yo=function(i,o,n){this._el=i,this._mousePan=o,this._touchPan=n};yo.prototype.enable=function(i){this._inertiaOptions=i||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("mapboxgl-touch-drag-pan")},yo.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("mapboxgl-touch-drag-pan")},yo.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},yo.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()};var Bn=function(i,o,n){this._pitchWithRotate=i.pitchWithRotate,this._mouseRotate=o,this._mousePitch=n};Bn.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},Bn.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},Bn.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},Bn.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()};var Zi=function(i,o,n,s){this._el=i,this._touchZoom=o,this._touchRotate=n,this._tapDragZoom=s,this._rotationDisabled=!1,this._enabled=!0};Zi.prototype.enable=function(i){this._touchZoom.enable(i),this._rotationDisabled||this._touchRotate.enable(i),this._tapDragZoom.enable(),this._el.classList.add("mapboxgl-touch-zoom-rotate")},Zi.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("mapboxgl-touch-zoom-rotate")},Zi.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},Zi.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},Zi.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},Zi.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var Zr=function(i){return i.zoom||i.drag||i.pitch||i.rotate},La=function(i){function o(){i.apply(this,arguments)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o}(l.Event);function je(i){return i.panDelta&&i.panDelta.mag()||i.zoomDelta||i.bearingDelta||i.pitchDelta}var Ue=function(i,o){this._map=i,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Ma(i),this._bearingSnap=o.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(o),l.bindAll(["handleEvent","handleWindowEvent"],this);var n=this._el;this._listeners=[[n,"touchstart",{passive:!0}],[n,"touchmove",{passive:!1}],[n,"touchend",void 0],[n,"touchcancel",void 0],[n,"mousedown",void 0],[n,"mousemove",void 0],[n,"mouseup",void 0],[l.window.document,"mousemove",{capture:!0}],[l.window.document,"mouseup",void 0],[n,"mouseover",void 0],[n,"mouseout",void 0],[n,"dblclick",void 0],[n,"click",void 0],[n,"keydown",{capture:!1}],[n,"keyup",void 0],[n,"wheel",{passive:!1}],[n,"contextmenu",void 0],[l.window,"blur",void 0]];for(var s=0,p=this._listeners;s<p.length;s+=1){var m=p[s],y=m[0];q.addEventListener(y,m[1],y===l.window.document?this.handleWindowEvent:this.handleEvent,m[2])}};Ue.prototype.destroy=function(){for(var i=0,o=this._listeners;i<o.length;i+=1){var n=o[i],s=n[0];q.removeEventListener(s,n[1],s===l.window.document?this.handleWindowEvent:this.handleEvent,n[2])}},Ue.prototype._addDefaultHandlers=function(i){var o=this._map,n=o.getCanvasContainer();this._add("mapEvent",new mr(o,i));var s=o.boxZoom=new ci(o,i);this._add("boxZoom",s);var p=new pi,m=new zi;o.doubleClickZoom=new Qi(m,p),this._add("tapZoom",p),this._add("clickZoom",m);var y=new Fr;this._add("tapDragZoom",y);var g=o.touchPitch=new Ol;this._add("touchPitch",g);var w=new ws(i),A=new Fl(i);o.dragRotate=new Bn(i,w,A),this._add("mouseRotate",w,["mousePitch"]),this._add("mousePitch",A,["mouseRotate"]);var B=new Rl(i),L=new Mi(i);o.dragPan=new yo(n,B,L),this._add("mousePan",B),this._add("touchPan",L,["touchZoom","touchRotate"]);var R=new sc,Z=new fi;o.touchZoomRotate=new Zi(n,Z,R,y),this._add("touchRotate",R,["touchPan","touchZoom"]),this._add("touchZoom",Z,["touchPan","touchRotate"]);var j=o.scrollZoom=new ft(o,this);this._add("scrollZoom",j,["mousePan"]);var K=o.keyboard=new Gi;this._add("keyboard",K),this._add("blockableMapEvent",new Oe(o));for(var U=0,X=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];U<X.length;U+=1){var Q=X[U];i.interactive&&i[Q]&&o[Q].enable(i[Q])}},Ue.prototype._add=function(i,o,n){this._handlers.push({handlerName:i,handler:o,allowed:n}),this._handlersById[i]=o},Ue.prototype.stop=function(i){if(!this._updatingCamera){for(var o=0,n=this._handlers;o<n.length;o+=1)n[o].handler.reset();this._inertia.clear(),this._fireEvents({},{},i),this._changes=[]}},Ue.prototype.isActive=function(){for(var i=0,o=this._handlers;i<o.length;i+=1)if(o[i].handler.isActive())return!0;return!1},Ue.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},Ue.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},Ue.prototype.isMoving=function(){return!!Zr(this._eventsInProgress)||this.isZooming()},Ue.prototype._blockedByActive=function(i,o,n){for(var s in i)if(s!==n&&(!o||o.indexOf(s)<0))return!0;return!1},Ue.prototype.handleWindowEvent=function(i){this.handleEvent(i,i.type+"Window")},Ue.prototype._getMapTouches=function(i){for(var o=[],n=0,s=i;n<s.length;n+=1){var p=s[n];this._el.contains(p.target)&&o.push(p)}return o},Ue.prototype.handleEvent=function(i,o){this._updatingCamera=!0;for(var n=i.type==="renderFrame"?void 0:i,s={needsRenderFrame:!1},p={},m={},y=i.touches?this._getMapTouches(i.touches):void 0,g=y?q.touchPos(this._el,y):q.mousePos(this._el,i),w=0,A=this._handlers;w<A.length;w+=1){var B=A[w],L=B.handlerName,R=B.handler,Z=B.allowed;if(R.isEnabled()){var j=void 0;this._blockedByActive(m,Z,L)?R.reset():R[o||i.type]&&(j=R[o||i.type](i,g,y),this.mergeHandlerResult(s,p,j,L,n),j&&j.needsRenderFrame&&this._triggerRenderFrame()),(j||R.isActive())&&(m[L]=R)}}var K={};for(var U in this._previousActiveHandlers)m[U]||(K[U]=n);this._previousActiveHandlers=m,(Object.keys(K).length||je(s))&&(this._changes.push([s,p,K]),this._triggerRenderFrame()),(Object.keys(m).length||je(s))&&this._map._stop(!0),this._updatingCamera=!1;var X=s.cameraAnimation;X&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],X(this._map))},Ue.prototype.mergeHandlerResult=function(i,o,n,s,p){if(n){l.extend(i,n);var m={handlerName:s,originalEvent:n.originalEvent||p};n.zoomDelta!==void 0&&(o.zoom=m),n.panDelta!==void 0&&(o.drag=m),n.pitchDelta!==void 0&&(o.pitch=m),n.bearingDelta!==void 0&&(o.rotate=m)}},Ue.prototype._applyChanges=function(){for(var i={},o={},n={},s=0,p=this._changes;s<p.length;s+=1){var m=p[s],y=m[0],g=m[1],w=m[2];y.panDelta&&(i.panDelta=(i.panDelta||new l.Point(0,0))._add(y.panDelta)),y.zoomDelta&&(i.zoomDelta=(i.zoomDelta||0)+y.zoomDelta),y.bearingDelta&&(i.bearingDelta=(i.bearingDelta||0)+y.bearingDelta),y.pitchDelta&&(i.pitchDelta=(i.pitchDelta||0)+y.pitchDelta),y.around!==void 0&&(i.around=y.around),y.pinchAround!==void 0&&(i.pinchAround=y.pinchAround),y.noInertia&&(i.noInertia=y.noInertia),l.extend(o,g),l.extend(n,w)}this._updateMapTransform(i,o,n),this._changes=[]},Ue.prototype._updateMapTransform=function(i,o,n){var s=this._map,p=s.transform;if(!je(i))return this._fireEvents(o,n,!0);var m=i.panDelta,y=i.zoomDelta,g=i.bearingDelta,w=i.pitchDelta,A=i.around,B=i.pinchAround;B!==void 0&&(A=B),s._stop(!0),A=A||s.transform.centerPoint;var L=p.pointLocation(m?A.sub(m):A);g&&(p.bearing+=g),w&&(p.pitch+=w),y&&(p.zoom+=y),p.setLocationAtPoint(L,A),this._map._update(),i.noInertia||this._inertia.record(i),this._fireEvents(o,n,!0)},Ue.prototype._fireEvents=function(i,o,n){var s=this,p=Zr(this._eventsInProgress),m=Zr(i),y={};for(var g in i)this._eventsInProgress[g]||(y[g+"start"]=i[g].originalEvent),this._eventsInProgress[g]=i[g];for(var w in!p&&m&&this._fireEvent("movestart",m.originalEvent),y)this._fireEvent(w,y[w]);for(var A in m&&this._fireEvent("move",m.originalEvent),i)this._fireEvent(A,i[A].originalEvent);var B,L={};for(var R in this._eventsInProgress){var Z=this._eventsInProgress[R],j=Z.handlerName,K=Z.originalEvent;this._handlersById[j].isActive()||(delete this._eventsInProgress[R],L[R+"end"]=B=o[j]||K)}for(var U in L)this._fireEvent(U,L[U]);var X=Zr(this._eventsInProgress);if(n&&(p||m)&&!X){this._updatingCamera=!0;var Q=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),ie=function(ce){return ce!==0&&-s._bearingSnap<ce&&ce<s._bearingSnap};Q?(ie(Q.bearing||this._map.getBearing())&&(Q.bearing=0),this._map.easeTo(Q,{originalEvent:B})):(this._map.fire(new l.Event("moveend",{originalEvent:B})),ie(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}},Ue.prototype._fireEvent=function(i,o){this._map.fire(new l.Event(i,o?{originalEvent:o}:{}))},Ue.prototype._requestFrame=function(){var i=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add(function(o){delete i._frameId,i.handleEvent(new La("renderFrame",{timeStamp:o})),i._applyChanges()})},Ue.prototype._triggerRenderFrame=function(){this._frameId===void 0&&(this._frameId=this._requestFrame())};var Is=function(i){function o(n,s){i.call(this),this._moving=!1,this._zooming=!1,this.transform=n,this._bearingSnap=s.bearingSnap,l.bindAll(["_renderFrameCallback"],this)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.getCenter=function(){return new l.LngLat(this.transform.center.lng,this.transform.center.lat)},o.prototype.setCenter=function(n,s){return this.jumpTo({center:n},s)},o.prototype.panBy=function(n,s,p){return n=l.Point.convert(n).mult(-1),this.panTo(this.transform.center,l.extend({offset:n},s),p)},o.prototype.panTo=function(n,s,p){return this.easeTo(l.extend({center:n},s),p)},o.prototype.getZoom=function(){return this.transform.zoom},o.prototype.setZoom=function(n,s){return this.jumpTo({zoom:n},s),this},o.prototype.zoomTo=function(n,s,p){return this.easeTo(l.extend({zoom:n},s),p)},o.prototype.zoomIn=function(n,s){return this.zoomTo(this.getZoom()+1,n,s),this},o.prototype.zoomOut=function(n,s){return this.zoomTo(this.getZoom()-1,n,s),this},o.prototype.getBearing=function(){return this.transform.bearing},o.prototype.setBearing=function(n,s){return this.jumpTo({bearing:n},s),this},o.prototype.getPadding=function(){return this.transform.padding},o.prototype.setPadding=function(n,s){return this.jumpTo({padding:n},s),this},o.prototype.rotateTo=function(n,s,p){return this.easeTo(l.extend({bearing:n},s),p)},o.prototype.resetNorth=function(n,s){return this.rotateTo(0,l.extend({duration:1e3},n),s),this},o.prototype.resetNorthPitch=function(n,s){return this.easeTo(l.extend({bearing:0,pitch:0,duration:1e3},n),s),this},o.prototype.snapToNorth=function(n,s){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(n,s):this},o.prototype.getPitch=function(){return this.transform.pitch},o.prototype.setPitch=function(n,s){return this.jumpTo({pitch:n},s),this},o.prototype.cameraForBounds=function(n,s){n=l.LngLatBounds.convert(n);var p=s&&s.bearing||0;return this._cameraForBoxAndBearing(n.getNorthWest(),n.getSouthEast(),p,s)},o.prototype._cameraForBoxAndBearing=function(n,s,p,m){var y={top:0,bottom:0,right:0,left:0};if(typeof(m=l.extend({padding:y,offset:[0,0],maxZoom:this.transform.maxZoom},m)).padding=="number"){var g=m.padding;m.padding={top:g,bottom:g,right:g,left:g}}m.padding=l.extend(y,m.padding);var w=this.transform,A=w.padding,B=w.project(l.LngLat.convert(n)),L=w.project(l.LngLat.convert(s)),R=B.rotate(-p*Math.PI/180),Z=L.rotate(-p*Math.PI/180),j=new l.Point(Math.max(R.x,Z.x),Math.max(R.y,Z.y)),K=new l.Point(Math.min(R.x,Z.x),Math.min(R.y,Z.y)),U=j.sub(K),X=(w.width-(A.left+A.right+m.padding.left+m.padding.right))/U.x,Q=(w.height-(A.top+A.bottom+m.padding.top+m.padding.bottom))/U.y;if(!(Q<0||X<0)){var ie=Math.min(w.scaleZoom(w.scale*Math.min(X,Q)),m.maxZoom),ce=typeof m.offset.x=="number"?new l.Point(m.offset.x,m.offset.y):l.Point.convert(m.offset),le=new l.Point((m.padding.left-m.padding.right)/2,(m.padding.top-m.padding.bottom)/2).rotate(p*Math.PI/180),he=ce.add(le).mult(w.scale/w.zoomScale(ie));return{center:w.unproject(B.add(L).div(2).sub(he)),zoom:ie,bearing:p}}l.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},o.prototype.fitBounds=function(n,s,p){return this._fitInternal(this.cameraForBounds(n,s),s,p)},o.prototype.fitScreenCoordinates=function(n,s,p,m,y){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(l.Point.convert(n)),this.transform.pointLocation(l.Point.convert(s)),p,m),m,y)},o.prototype._fitInternal=function(n,s,p){return n?(delete(s=l.extend(n,s)).padding,s.linear?this.easeTo(s,p):this.flyTo(s,p)):this},o.prototype.jumpTo=function(n,s){this.stop();var p=this.transform,m=!1,y=!1,g=!1;return"zoom"in n&&p.zoom!==+n.zoom&&(m=!0,p.zoom=+n.zoom),n.center!==void 0&&(p.center=l.LngLat.convert(n.center)),"bearing"in n&&p.bearing!==+n.bearing&&(y=!0,p.bearing=+n.bearing),"pitch"in n&&p.pitch!==+n.pitch&&(g=!0,p.pitch=+n.pitch),n.padding==null||p.isPaddingEqual(n.padding)||(p.padding=n.padding),this.fire(new l.Event("movestart",s)).fire(new l.Event("move",s)),m&&this.fire(new l.Event("zoomstart",s)).fire(new l.Event("zoom",s)).fire(new l.Event("zoomend",s)),y&&this.fire(new l.Event("rotatestart",s)).fire(new l.Event("rotate",s)).fire(new l.Event("rotateend",s)),g&&this.fire(new l.Event("pitchstart",s)).fire(new l.Event("pitch",s)).fire(new l.Event("pitchend",s)),this.fire(new l.Event("moveend",s))},o.prototype.easeTo=function(n,s){var p=this;this._stop(!1,n.easeId),((n=l.extend({offset:[0,0],duration:500,easing:l.ease},n)).animate===!1||!n.essential&&l.browser.prefersReducedMotion)&&(n.duration=0);var m=this.transform,y=this.getZoom(),g=this.getBearing(),w=this.getPitch(),A=this.getPadding(),B="zoom"in n?+n.zoom:y,L="bearing"in n?this._normalizeBearing(n.bearing,g):g,R="pitch"in n?+n.pitch:w,Z="padding"in n?n.padding:m.padding,j=l.Point.convert(n.offset),K=m.centerPoint.add(j),U=m.pointLocation(K),X=l.LngLat.convert(n.center||U);this._normalizeCenter(X);var Q,ie,ce=m.project(U),le=m.project(X).sub(ce),he=m.zoomScale(B-y);n.around&&(Q=l.LngLat.convert(n.around),ie=m.locationPoint(Q));var ge={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||B!==y,this._rotating=this._rotating||g!==L,this._pitching=this._pitching||R!==w,this._padding=!m.isPaddingEqual(Z),this._easeId=n.easeId,this._prepareEase(s,n.noMoveStart,ge),this._ease(function(Te){if(p._zooming&&(m.zoom=l.number(y,B,Te)),p._rotating&&(m.bearing=l.number(g,L,Te)),p._pitching&&(m.pitch=l.number(w,R,Te)),p._padding&&(m.interpolatePadding(A,Z,Te),K=m.centerPoint.add(j)),Q)m.setLocationAtPoint(Q,ie);else{var Se=m.zoomScale(m.zoom-y),Le=B>y?Math.min(2,he):Math.max(.5,he),Ge=Math.pow(Le,1-Te),Xe=m.unproject(ce.add(le.mult(Te*Ge)).mult(Se));m.setLocationAtPoint(m.renderWorldCopies?Xe.wrap():Xe,K)}p._fireMoveEvents(s)},function(Te){p._afterEase(s,Te)},n),this},o.prototype._prepareEase=function(n,s,p){p===void 0&&(p={}),this._moving=!0,s||p.moving||this.fire(new l.Event("movestart",n)),this._zooming&&!p.zooming&&this.fire(new l.Event("zoomstart",n)),this._rotating&&!p.rotating&&this.fire(new l.Event("rotatestart",n)),this._pitching&&!p.pitching&&this.fire(new l.Event("pitchstart",n))},o.prototype._fireMoveEvents=function(n){this.fire(new l.Event("move",n)),this._zooming&&this.fire(new l.Event("zoom",n)),this._rotating&&this.fire(new l.Event("rotate",n)),this._pitching&&this.fire(new l.Event("pitch",n))},o.prototype._afterEase=function(n,s){if(!this._easeId||!s||this._easeId!==s){delete this._easeId;var p=this._zooming,m=this._rotating,y=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,p&&this.fire(new l.Event("zoomend",n)),m&&this.fire(new l.Event("rotateend",n)),y&&this.fire(new l.Event("pitchend",n)),this.fire(new l.Event("moveend",n))}},o.prototype.flyTo=function(n,s){var p=this;if(!n.essential&&l.browser.prefersReducedMotion){var m=l.pick(n,["center","zoom","bearing","pitch","around"]);return this.jumpTo(m,s)}this.stop(),n=l.extend({offset:[0,0],speed:1.2,curve:1.42,easing:l.ease},n);var y=this.transform,g=this.getZoom(),w=this.getBearing(),A=this.getPitch(),B=this.getPadding(),L="zoom"in n?l.clamp(+n.zoom,y.minZoom,y.maxZoom):g,R="bearing"in n?this._normalizeBearing(n.bearing,w):w,Z="pitch"in n?+n.pitch:A,j="padding"in n?n.padding:y.padding,K=y.zoomScale(L-g),U=l.Point.convert(n.offset),X=y.centerPoint.add(U),Q=y.pointLocation(X),ie=l.LngLat.convert(n.center||Q);this._normalizeCenter(ie);var ce=y.project(Q),le=y.project(ie).sub(ce),he=n.curve,ge=Math.max(y.width,y.height),Te=ge/K,Se=le.mag();if("minZoom"in n){var Le=l.clamp(Math.min(n.minZoom,g,L),y.minZoom,y.maxZoom),Ge=ge/y.zoomScale(Le-g);he=Math.sqrt(Ge/Se*2)}var Xe=he*he;function He(Qe){var Ke=(Te*Te-ge*ge+(Qe?-1:1)*Xe*Xe*Se*Se)/(2*(Qe?Te:ge)*Xe*Se);return Math.log(Math.sqrt(Ke*Ke+1)-Ke)}function wt(Qe){return(Math.exp(Qe)-Math.exp(-Qe))/2}function Re(Qe){return(Math.exp(Qe)+Math.exp(-Qe))/2}var rt=He(0),at=function(Qe){return Re(rt)/Re(rt+he*Qe)},tt=function(Qe){return ge*((Re(rt)*(wt(Ke=rt+he*Qe)/Re(Ke))-wt(rt))/Xe)/Se;var Ke},et=(He(1)-rt)/he;if(Math.abs(Se)<1e-6||!isFinite(et)){if(Math.abs(ge-Te)<1e-6)return this.easeTo(n,s);var nt=Te<ge?-1:1;et=Math.abs(Math.log(Te/ge))/he,tt=function(){return 0},at=function(Qe){return Math.exp(nt*he*Qe)}}return n.duration="duration"in n?+n.duration:1e3*et/("screenSpeed"in n?+n.screenSpeed/he:+n.speed),n.maxDuration&&n.duration>n.maxDuration&&(n.duration=0),this._zooming=!0,this._rotating=w!==R,this._pitching=Z!==A,this._padding=!y.isPaddingEqual(j),this._prepareEase(s,!1),this._ease(function(Qe){var Ke=Qe*et,Sr=1/at(Ke);y.zoom=Qe===1?L:g+y.scaleZoom(Sr),p._rotating&&(y.bearing=l.number(w,R,Qe)),p._pitching&&(y.pitch=l.number(A,Z,Qe)),p._padding&&(y.interpolatePadding(B,j,Qe),X=y.centerPoint.add(U));var ir=Qe===1?ie:y.unproject(ce.add(le.mult(tt(Ke))).mult(Sr));y.setLocationAtPoint(y.renderWorldCopies?ir.wrap():ir,X),p._fireMoveEvents(s)},function(){return p._afterEase(s)},n),this},o.prototype.isEasing=function(){return!!this._easeFrameId},o.prototype.stop=function(){return this._stop()},o.prototype._stop=function(n,s){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){var p=this._onEaseEnd;delete this._onEaseEnd,p.call(this,s)}if(!n){var m=this.handlers;m&&m.stop(!1)}return this},o.prototype._ease=function(n,s,p){p.animate===!1||p.duration===0?(n(1),s()):(this._easeStart=l.browser.now(),this._easeOptions=p,this._onEaseFrame=n,this._onEaseEnd=s,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},o.prototype._renderFrameCallback=function(){var n=Math.min((l.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(n)),n<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},o.prototype._normalizeBearing=function(n,s){n=l.wrap(n,-180,180);var p=Math.abs(n-s);return Math.abs(n-360-s)<p&&(n-=360),Math.abs(n+360-s)<p&&(n+=360),n},o.prototype._normalizeCenter=function(n){var s=this.transform;if(s.renderWorldCopies&&!s.lngRange){var p=n.lng-s.center.lng;n.lng+=p>180?-360:p<-180?360:0}},o}(l.Evented),Wr=function(i){i===void 0&&(i={}),this.options=i,l.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)};Wr.prototype.getDefaultPosition=function(){return"bottom-right"},Wr.prototype.onAdd=function(i){var o=this.options&&this.options.compact;return this._map=i,this._container=q.create("div","mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=q.create("button","mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=q.create("div","mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),o&&this._container.classList.add("mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),o===void 0&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Wr.prototype.onRemove=function(){q.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("moveend",this._updateEditLink),this._map.off("resize",this._updateCompact),this._map=void 0,this._attribHTML=void 0},Wr.prototype._setElementTitle=function(i,o){var n=this._map._getUIString("AttributionControl."+o);i.title=n,i.setAttribute("aria-label",n)},Wr.prototype._toggleAttribution=function(){this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Wr.prototype._updateEditLink=function(){var i=this._editLink;i||(i=this._editLink=this._container.querySelector(".mapbox-improve-map"));var o=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||l.config.ACCESS_TOKEN}];if(i){var n=o.reduce(function(s,p,m){return p.value&&(s+=p.key+"="+p.value+(m<o.length-1?"&":"")),s},"?");i.href=l.config.FEEDBACK_URL+"/"+n+(this._map._hash?this._map._hash.getHashString(!0):""),i.rel="noopener nofollow",this._setElementTitle(i,"MapFeedback")}},Wr.prototype._updateData=function(i){!i||i.sourceDataType!=="metadata"&&i.sourceDataType!=="visibility"&&i.dataType!=="style"||(this._updateAttributions(),this._updateEditLink())},Wr.prototype._updateAttributions=function(){if(this._map.style){var i=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?i=i.concat(this.options.customAttribution.map(function(g){return typeof g!="string"?"":g})):typeof this.options.customAttribution=="string"&&i.push(this.options.customAttribution)),this._map.style.stylesheet){var o=this._map.style.stylesheet;this.styleOwner=o.owner,this.styleId=o.id}var n=this._map.style.sourceCaches;for(var s in n){var p=n[s];if(p.used){var m=p.getSource();m.attribution&&i.indexOf(m.attribution)<0&&i.push(m.attribution)}}i.sort(function(g,w){return g.length-w.length});var y=(i=i.filter(function(g,w){for(var A=w+1;A<i.length;A++)if(i[A].indexOf(g)>=0)return!1;return!0})).join(" | ");y!==this._attribHTML&&(this._attribHTML=y,i.length?(this._innerContainer.innerHTML=y,this._container.classList.remove("mapboxgl-attrib-empty")):this._container.classList.add("mapboxgl-attrib-empty"),this._editLink=null)}},Wr.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("mapboxgl-compact"):this._container.classList.remove("mapboxgl-compact","mapboxgl-compact-show")};var Wi=function(){l.bindAll(["_updateLogo"],this),l.bindAll(["_updateCompact"],this)};Wi.prototype.onAdd=function(i){this._map=i,this._container=q.create("div","mapboxgl-ctrl");var o=q.create("a","mapboxgl-ctrl-logo");return o.target="_blank",o.rel="noopener nofollow",o.href="https://www.mapbox.com/",o.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),o.setAttribute("rel","noopener nofollow"),this._container.appendChild(o),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Wi.prototype.onRemove=function(){q.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Wi.prototype.getDefaultPosition=function(){return"bottom-left"},Wi.prototype._updateLogo=function(i){i&&i.sourceDataType!=="metadata"||(this._container.style.display=this._logoRequired()?"block":"none")},Wi.prototype._logoRequired=function(){if(this._map.style){var i=this._map.style.sourceCaches;for(var o in i)if(i[o].getSource().mapbox_logo)return!0;return!1}},Wi.prototype._updateCompact=function(){var i=this._container.children;if(i.length){var o=i[0];this._map.getCanvasContainer().offsetWidth<250?o.classList.add("mapboxgl-compact"):o.classList.remove("mapboxgl-compact")}};var Or=function(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1};Or.prototype.add=function(i){var o=++this._id;return this._queue.push({callback:i,id:o,cancelled:!1}),o},Or.prototype.remove=function(i){for(var o=this._currentlyRunning,n=0,s=o?this._queue.concat(o):this._queue;n<s.length;n+=1){var p=s[n];if(p.id===i)return void(p.cancelled=!0)}},Or.prototype.run=function(i){i===void 0&&(i=0);var o=this._currentlyRunning=this._queue;this._queue=[];for(var n=0,s=o;n<s.length;n+=1){var p=s[n];if(!p.cancelled&&(p.callback(i),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},Or.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var en={"AttributionControl.ToggleAttribution":"Toggle attribution","AttributionControl.MapFeedback":"Map feedback","FullscreenControl.Enter":"Enter fullscreen","FullscreenControl.Exit":"Exit fullscreen","GeolocateControl.FindMyLocation":"Find my location","GeolocateControl.LocationNotAvailable":"Location not available","LogoControl.Title":"Mapbox logo","NavigationControl.ResetBearing":"Reset bearing to north","NavigationControl.ZoomIn":"Zoom in","NavigationControl.ZoomOut":"Zoom out","ScaleControl.Feet":"ft","ScaleControl.Meters":"m","ScaleControl.Kilometers":"km","ScaleControl.Miles":"mi","ScaleControl.NauticalMiles":"nm"},Ul=l.window.HTMLImageElement,As=l.window.HTMLElement,Dt=l.window.ImageBitmap,kr={center:[0,0],zoom:0,bearing:0,pitch:0,minZoom:-2,maxZoom:22,minPitch:0,maxPitch:60,interactive:!0,scrollZoom:!0,boxZoom:!0,dragRotate:!0,dragPan:!0,keyboard:!0,doubleClickZoom:!0,touchZoomRotate:!0,touchPitch:!0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,accessToken:null,fadeDuration:300,crossSourceCollisions:!0},lc=function(i){function o(s){var p=this;if((s=l.extend({},kr,s)).minZoom!=null&&s.maxZoom!=null&&s.minZoom>s.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(s.minPitch!=null&&s.maxPitch!=null&&s.minPitch>s.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(s.minPitch!=null&&s.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(s.maxPitch!=null&&s.maxPitch>60)throw new Error("maxPitch must be less than or equal to 60");var m=new gt(s.minZoom,s.maxZoom,s.minPitch,s.maxPitch,s.renderWorldCopies);if(i.call(this,m,s),this._interactive=s.interactive,this._maxTileCacheSize=s.maxTileCacheSize,this._failIfMajorPerformanceCaveat=s.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=s.preserveDrawingBuffer,this._antialias=s.antialias,this._trackResize=s.trackResize,this._bearingSnap=s.bearingSnap,this._refreshExpiredTiles=s.refreshExpiredTiles,this._fadeDuration=s.fadeDuration,this._crossSourceCollisions=s.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=s.collectResourceTiming,this._renderTaskQueue=new Or,this._controls=[],this._mapId=l.uniqueId(),this._locale=l.extend({},en,s.locale),this._clickTolerance=s.clickTolerance,this._requestManager=new l.RequestManager(s.transformRequest,s.accessToken),typeof s.container=="string"){if(this._container=l.window.document.getElementById(s.container),!this._container)throw new Error("Container '"+s.container+"' not found.")}else{if(!(s.container instanceof As))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=s.container}if(s.maxBounds&&this.setMaxBounds(s.maxBounds),l.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),this.painter===void 0)throw new Error("Failed to initialize WebGL.");this.on("move",function(){return p._update(!1)}),this.on("moveend",function(){return p._update(!1)}),this.on("zoom",function(){return p._update(!0)}),l.window!==void 0&&(l.window.addEventListener("online",this._onWindowOnline,!1),l.window.addEventListener("resize",this._onWindowResize,!1),l.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Ue(this,s),this._hash=s.hash&&new _i(typeof s.hash=="string"&&s.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:s.center,zoom:s.zoom,bearing:s.bearing,pitch:s.pitch}),s.bounds&&(this.resize(),this.fitBounds(s.bounds,l.extend({},s.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=s.localIdeographFontFamily,s.style&&this.setStyle(s.style,{localIdeographFontFamily:s.localIdeographFontFamily}),s.attributionControl&&this.addControl(new Wr({customAttribution:s.customAttribution})),this.addControl(new Wi,s.logoPosition),this.on("style.load",function(){p.transform.unmodified&&p.jumpTo(p.style.stylesheet)}),this.on("data",function(y){p._update(y.dataType==="style"),p.fire(new l.Event(y.dataType+"data",y))}),this.on("dataloading",function(y){p.fire(new l.Event(y.dataType+"dataloading",y))})}i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o;var n={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return o.prototype._getMapId=function(){return this._mapId},o.prototype.addControl=function(s,p){if(p===void 0&&(p=s.getDefaultPosition?s.getDefaultPosition():"top-right"),!s||!s.onAdd)return this.fire(new l.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var m=s.onAdd(this);this._controls.push(s);var y=this._controlPositions[p];return p.indexOf("bottom")!==-1?y.insertBefore(m,y.firstChild):y.appendChild(m),this},o.prototype.removeControl=function(s){if(!s||!s.onRemove)return this.fire(new l.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var p=this._controls.indexOf(s);return p>-1&&this._controls.splice(p,1),s.onRemove(this),this},o.prototype.hasControl=function(s){return this._controls.indexOf(s)>-1},o.prototype.resize=function(s){var p=this._containerDimensions(),m=p[0],y=p[1];if(m===this.transform.width&&y===this.transform.height)return this;this._resizeCanvas(m,y),this.transform.resize(m,y),this.painter.resize(m,y);var g=!this._moving;return g&&this.fire(new l.Event("movestart",s)).fire(new l.Event("move",s)),this.fire(new l.Event("resize",s)),g&&this.fire(new l.Event("moveend",s)),this},o.prototype.getBounds=function(){return this.transform.getBounds()},o.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},o.prototype.setMaxBounds=function(s){return this.transform.setMaxBounds(l.LngLatBounds.convert(s)),this._update()},o.prototype.setMinZoom=function(s){if((s=s??-2)>=-2&&s<=this.transform.maxZoom)return this.transform.minZoom=s,this._update(),this.getZoom()<s&&this.setZoom(s),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},o.prototype.getMinZoom=function(){return this.transform.minZoom},o.prototype.setMaxZoom=function(s){if((s=s??22)>=this.transform.minZoom)return this.transform.maxZoom=s,this._update(),this.getZoom()>s&&this.setZoom(s),this;throw new Error("maxZoom must be greater than the current minZoom")},o.prototype.getMaxZoom=function(){return this.transform.maxZoom},o.prototype.setMinPitch=function(s){if((s=s??0)<0)throw new Error("minPitch must be greater than or equal to 0");if(s>=0&&s<=this.transform.maxPitch)return this.transform.minPitch=s,this._update(),this.getPitch()<s&&this.setPitch(s),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},o.prototype.getMinPitch=function(){return this.transform.minPitch},o.prototype.setMaxPitch=function(s){if((s=s??60)>60)throw new Error("maxPitch must be less than or equal to 60");if(s>=this.transform.minPitch)return this.transform.maxPitch=s,this._update(),this.getPitch()>s&&this.setPitch(s),this;throw new Error("maxPitch must be greater than the current minPitch")},o.prototype.getMaxPitch=function(){return this.transform.maxPitch},o.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},o.prototype.setRenderWorldCopies=function(s){return this.transform.renderWorldCopies=s,this._update()},o.prototype.project=function(s){return this.transform.locationPoint(l.LngLat.convert(s))},o.prototype.unproject=function(s){return this.transform.pointLocation(l.Point.convert(s))},o.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},o.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},o.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},o.prototype._createDelegatedListener=function(s,p,m){var y,g=this;if(s==="mouseenter"||s==="mouseover"){var w=!1;return{layer:p,listener:m,delegates:{mousemove:function(B){var L=g.getLayer(p)?g.queryRenderedFeatures(B.point,{layers:[p]}):[];L.length?w||(w=!0,m.call(g,new _r(s,g,B.originalEvent,{features:L}))):w=!1},mouseout:function(){w=!1}}}}if(s==="mouseleave"||s==="mouseout"){var A=!1;return{layer:p,listener:m,delegates:{mousemove:function(B){(g.getLayer(p)?g.queryRenderedFeatures(B.point,{layers:[p]}):[]).length?A=!0:A&&(A=!1,m.call(g,new _r(s,g,B.originalEvent)))},mouseout:function(B){A&&(A=!1,m.call(g,new _r(s,g,B.originalEvent)))}}}}return{layer:p,listener:m,delegates:(y={},y[s]=function(B){var L=g.getLayer(p)?g.queryRenderedFeatures(B.point,{layers:[p]}):[];L.length&&(B.features=L,m.call(g,B),delete B.features)},y)}},o.prototype.on=function(s,p,m){if(m===void 0)return i.prototype.on.call(this,s,p);var y=this._createDelegatedListener(s,p,m);for(var g in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[s]=this._delegatedListeners[s]||[],this._delegatedListeners[s].push(y),y.delegates)this.on(g,y.delegates[g]);return this},o.prototype.once=function(s,p,m){if(m===void 0)return i.prototype.once.call(this,s,p);var y=this._createDelegatedListener(s,p,m);for(var g in y.delegates)this.once(g,y.delegates[g]);return this},o.prototype.off=function(s,p,m){var y=this;return m===void 0?i.prototype.off.call(this,s,p):(this._delegatedListeners&&this._delegatedListeners[s]&&function(g){for(var w=g[s],A=0;A<w.length;A++){var B=w[A];if(B.layer===p&&B.listener===m){for(var L in B.delegates)y.off(L,B.delegates[L]);return w.splice(A,1),y}}}(this._delegatedListeners),this)},o.prototype.queryRenderedFeatures=function(s,p){if(!this.style)return[];var m;if(p!==void 0||s===void 0||s instanceof l.Point||Array.isArray(s)||(p=s,s=void 0),p=p||{},(s=s||[[0,0],[this.transform.width,this.transform.height]])instanceof l.Point||typeof s[0]=="number")m=[l.Point.convert(s)];else{var y=l.Point.convert(s[0]),g=l.Point.convert(s[1]);m=[y,new l.Point(g.x,y.y),g,new l.Point(y.x,g.y),y]}return this.style.queryRenderedFeatures(m,p,this.transform)},o.prototype.querySourceFeatures=function(s,p){return this.style.querySourceFeatures(s,p)},o.prototype.setStyle=function(s,p){return(p=l.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},p)).diff!==!1&&p.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&s?(this._diffStyle(s,p),this):(this._localIdeographFontFamily=p.localIdeographFontFamily,this._updateStyle(s,p))},o.prototype._getUIString=function(s){var p=this._locale[s];if(p==null)throw new Error("Missing UI string '"+s+"'");return p},o.prototype._updateStyle=function(s,p){return this.style&&(this.style.setEventedParent(null),this.style._remove()),s?(this.style=new ui(this,p||{}),this.style.setEventedParent(this,{style:this.style}),typeof s=="string"?this.style.loadURL(s):this.style.loadJSON(s),this):(delete this.style,this)},o.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new ui(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},o.prototype._diffStyle=function(s,p){var m=this;if(typeof s=="string"){var y=this._requestManager.normalizeStyleURL(s),g=this._requestManager.transformRequest(y,l.ResourceType.Style);l.getJSON(g,function(w,A){w?m.fire(new l.ErrorEvent(w)):A&&m._updateDiff(A,p)})}else typeof s=="object"&&this._updateDiff(s,p)},o.prototype._updateDiff=function(s,p){try{this.style.setState(s)&&this._update(!0)}catch(m){l.warnOnce("Unable to perform style diff: "+(m.message||m.error||m)+". Rebuilding the style from scratch."),this._updateStyle(s,p)}},o.prototype.getStyle=function(){if(this.style)return this.style.serialize()},o.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():l.warnOnce("There is no style added to the map.")},o.prototype.addSource=function(s,p){return this._lazyInitEmptyStyle(),this.style.addSource(s,p),this._update(!0)},o.prototype.isSourceLoaded=function(s){var p=this.style&&this.style.sourceCaches[s];if(p!==void 0)return p.loaded();this.fire(new l.ErrorEvent(new Error("There is no source with ID '"+s+"'")))},o.prototype.areTilesLoaded=function(){var s=this.style&&this.style.sourceCaches;for(var p in s){var m=s[p]._tiles;for(var y in m){var g=m[y];if(g.state!=="loaded"&&g.state!=="errored")return!1}}return!0},o.prototype.addSourceType=function(s,p,m){return this._lazyInitEmptyStyle(),this.style.addSourceType(s,p,m)},o.prototype.removeSource=function(s){return this.style.removeSource(s),this._update(!0)},o.prototype.getSource=function(s){return this.style.getSource(s)},o.prototype.addImage=function(s,p,m){m===void 0&&(m={});var y=m.pixelRatio;y===void 0&&(y=1);var g=m.sdf;g===void 0&&(g=!1);var w=m.stretchX,A=m.stretchY,B=m.content;if(this._lazyInitEmptyStyle(),p instanceof Ul||Dt&&p instanceof Dt){var L=l.browser.getImageData(p);this.style.addImage(s,{data:new l.RGBAImage({width:L.width,height:L.height},L.data),pixelRatio:y,stretchX:w,stretchY:A,content:B,sdf:g,version:0})}else{if(p.width===void 0||p.height===void 0)return this.fire(new l.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));var R=p;this.style.addImage(s,{data:new l.RGBAImage({width:p.width,height:p.height},new Uint8Array(p.data)),pixelRatio:y,stretchX:w,stretchY:A,content:B,sdf:g,version:0,userImage:R}),R.onAdd&&R.onAdd(this,s)}},o.prototype.updateImage=function(s,p){var m=this.style.getImage(s);if(!m)return this.fire(new l.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var y=p instanceof Ul||Dt&&p instanceof Dt?l.browser.getImageData(p):p,g=y.width,w=y.height,A=y.data;return g===void 0||w===void 0?this.fire(new l.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))):g!==m.data.width||w!==m.data.height?this.fire(new l.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(m.data.replace(A,!(p instanceof Ul||Dt&&p instanceof Dt)),void this.style.updateImage(s,m))},o.prototype.hasImage=function(s){return s?!!this.style.getImage(s):(this.fire(new l.ErrorEvent(new Error("Missing required image id"))),!1)},o.prototype.removeImage=function(s){this.style.removeImage(s)},o.prototype.loadImage=function(s,p){l.getImage(this._requestManager.transformRequest(s,l.ResourceType.Image),p)},o.prototype.listImages=function(){return this.style.listImages()},o.prototype.addLayer=function(s,p){return this._lazyInitEmptyStyle(),this.style.addLayer(s,p),this._update(!0)},o.prototype.moveLayer=function(s,p){return this.style.moveLayer(s,p),this._update(!0)},o.prototype.removeLayer=function(s){return this.style.removeLayer(s),this._update(!0)},o.prototype.getLayer=function(s){return this.style.getLayer(s)},o.prototype.setLayerZoomRange=function(s,p,m){return this.style.setLayerZoomRange(s,p,m),this._update(!0)},o.prototype.setFilter=function(s,p,m){return m===void 0&&(m={}),this.style.setFilter(s,p,m),this._update(!0)},o.prototype.getFilter=function(s){return this.style.getFilter(s)},o.prototype.setPaintProperty=function(s,p,m,y){return y===void 0&&(y={}),this.style.setPaintProperty(s,p,m,y),this._update(!0)},o.prototype.getPaintProperty=function(s,p){return this.style.getPaintProperty(s,p)},o.prototype.setLayoutProperty=function(s,p,m,y){return y===void 0&&(y={}),this.style.setLayoutProperty(s,p,m,y),this._update(!0)},o.prototype.getLayoutProperty=function(s,p){return this.style.getLayoutProperty(s,p)},o.prototype.setLight=function(s,p){return p===void 0&&(p={}),this._lazyInitEmptyStyle(),this.style.setLight(s,p),this._update(!0)},o.prototype.getLight=function(){return this.style.getLight()},o.prototype.setFeatureState=function(s,p){return this.style.setFeatureState(s,p),this._update()},o.prototype.removeFeatureState=function(s,p){return this.style.removeFeatureState(s,p),this._update()},o.prototype.getFeatureState=function(s){return this.style.getFeatureState(s)},o.prototype.getContainer=function(){return this._container},o.prototype.getCanvasContainer=function(){return this._canvasContainer},o.prototype.getCanvas=function(){return this._canvas},o.prototype._containerDimensions=function(){var s=0,p=0;return this._container&&(s=this._container.clientWidth||400,p=this._container.clientHeight||300),[s,p]},o.prototype._detectMissingCSS=function(){l.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color")!=="rgb(250, 128, 114)"&&l.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.")},o.prototype._setupContainer=function(){var s=this._container;s.classList.add("mapboxgl-map"),(this._missingCSSCanary=q.create("div","mapboxgl-canary",s)).style.visibility="hidden",this._detectMissingCSS();var p=this._canvasContainer=q.create("div","mapboxgl-canvas-container",s);this._interactive&&p.classList.add("mapboxgl-interactive"),this._canvas=q.create("canvas","mapboxgl-canvas",p),this._canvas.addEventListener("webglcontextlost",this._contextLost,!1),this._canvas.addEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.setAttribute("tabindex","0"),this._canvas.setAttribute("aria-label","Map"),this._canvas.setAttribute("role","region");var m=this._containerDimensions();this._resizeCanvas(m[0],m[1]);var y=this._controlContainer=q.create("div","mapboxgl-control-container",s),g=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach(function(w){g[w]=q.create("div","mapboxgl-ctrl-"+w,y)}),this._container.addEventListener("scroll",this._onMapScroll,!1)},o.prototype._resizeCanvas=function(s,p){var m=l.browser.devicePixelRatio||1;this._canvas.width=m*s,this._canvas.height=m*p,this._canvas.style.width=s+"px",this._canvas.style.height=p+"px"},o.prototype._setupPainter=function(){var s=l.extend({},re.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),p=this._canvas.getContext("webgl",s)||this._canvas.getContext("experimental-webgl",s);p?(this.painter=new Xt(p,this.transform),l.webpSupported.testSupport(p)):this.fire(new l.ErrorEvent(new Error("Failed to initialize WebGL")))},o.prototype._contextLost=function(s){s.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new l.Event("webglcontextlost",{originalEvent:s}))},o.prototype._contextRestored=function(s){this._setupPainter(),this.resize(),this._update(),this.fire(new l.Event("webglcontextrestored",{originalEvent:s}))},o.prototype._onMapScroll=function(s){if(s.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},o.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},o.prototype._update=function(s){return this.style?(this._styleDirty=this._styleDirty||s,this._sourcesDirty=!0,this.triggerRepaint(),this):this},o.prototype._requestRenderFrame=function(s){return this._update(),this._renderTaskQueue.add(s)},o.prototype._cancelRenderFrame=function(s){this._renderTaskQueue.remove(s)},o.prototype._render=function(s){var p,m=this,y=0,g=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(p=g.createQueryEXT(),g.beginQueryEXT(g.TIME_ELAPSED_EXT,p),y=l.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(s),!this._removed){var w=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;var A=this.transform.zoom,B=l.browser.now();this.style.zoomHistory.update(A,B);var L=new l.EvaluationParameters(A,{now:B,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),R=L.crossFadingFactor();R===1&&R===this._crossFadingFactor||(w=!0,this._crossFadingFactor=R),this.style.update(L)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this._placementDirty=this.style&&this.style._updatePlacement(this.painter.transform,this.showCollisionBoxes,this._fadeDuration,this._crossSourceCollisions),this.painter.render(this.style,{showTileBoundaries:this.showTileBoundaries,showOverdrawInspector:this._showOverdrawInspector,rotating:this.isRotating(),zooming:this.isZooming(),moving:this.isMoving(),fadeDuration:this._fadeDuration,showPadding:this.showPadding,gpuTiming:!!this.listens("gpu-timing-layer")}),this.fire(new l.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new l.Event("load"))),this.style&&(this.style.hasTransitions()||w)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){var Z=l.browser.now()-y;g.endQueryEXT(g.TIME_ELAPSED_EXT,p),setTimeout(function(){var U=g.getQueryObjectEXT(p,g.QUERY_RESULT_EXT)/1e6;g.deleteQueryEXT(p),m.fire(new l.Event("gpu-timing-frame",{cpuTime:Z,gpuTime:U}))},50)}if(this.listens("gpu-timing-layer")){var j=this.painter.collectGpuTimers();setTimeout(function(){var U=m.painter.queryGpuTimers(j);m.fire(new l.Event("gpu-timing-layer",{layerTimes:U}))},50)}var K=this._sourcesDirty||this._styleDirty||this._placementDirty;return K||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new l.Event("idle")),!this._loaded||this._fullyLoaded||K||(this._fullyLoaded=!0),this}},o.prototype.remove=function(){this._hash&&this._hash.remove();for(var s=0,p=this._controls;s<p.length;s+=1)p[s].onRemove(this);this._controls=[],this._frame&&(this._frame.cancel(),this._frame=null),this._renderTaskQueue.clear(),this.painter.destroy(),this.handlers.destroy(),delete this.handlers,this.setStyle(null),l.window!==void 0&&(l.window.removeEventListener("resize",this._onWindowResize,!1),l.window.removeEventListener("orientationchange",this._onWindowResize,!1),l.window.removeEventListener("online",this._onWindowOnline,!1));var m=this.painter.context.gl.getExtension("WEBGL_lose_context");m&&m.loseContext(),vo(this._canvasContainer),vo(this._controlContainer),vo(this._missingCSSCanary),this._container.classList.remove("mapboxgl-map"),this._removed=!0,this.fire(new l.Event("remove"))},o.prototype.triggerRepaint=function(){var s=this;this.style&&!this._frame&&(this._frame=l.browser.frame(function(p){s._frame=null,s._render(p)}))},o.prototype._onWindowOnline=function(){this._update()},o.prototype._onWindowResize=function(s){this._trackResize&&this.resize({originalEvent:s})._update()},n.showTileBoundaries.get=function(){return!!this._showTileBoundaries},n.showTileBoundaries.set=function(s){this._showTileBoundaries!==s&&(this._showTileBoundaries=s,this._update())},n.showPadding.get=function(){return!!this._showPadding},n.showPadding.set=function(s){this._showPadding!==s&&(this._showPadding=s,this._update())},n.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},n.showCollisionBoxes.set=function(s){this._showCollisionBoxes!==s&&(this._showCollisionBoxes=s,s?this.style._generateCollisionBoxes():this._update())},n.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},n.showOverdrawInspector.set=function(s){this._showOverdrawInspector!==s&&(this._showOverdrawInspector=s,this._update())},n.repaint.get=function(){return!!this._repaint},n.repaint.set=function(s){this._repaint!==s&&(this._repaint=s,this.triggerRepaint())},n.vertices.get=function(){return!!this._vertices},n.vertices.set=function(s){this._vertices=s,this._update()},o.prototype._setCacheLimits=function(s,p){l.setCacheLimits(s,p)},n.version.get=function(){return l.version},Object.defineProperties(o.prototype,n),o}(Is);function vo(i){i.parentNode&&i.parentNode.removeChild(i)}var Nl={showCompass:!0,showZoom:!0,visualizePitch:!1},dn=function(i){var o=this;this.options=l.extend({},Nl,i),this._container=q.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",function(n){return n.preventDefault()}),this.options.showZoom&&(l.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("mapboxgl-ctrl-zoom-in",function(n){return o._map.zoomIn({},{originalEvent:n})}),q.create("span","mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("mapboxgl-ctrl-zoom-out",function(n){return o._map.zoomOut({},{originalEvent:n})}),q.create("span","mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(l.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("mapboxgl-ctrl-compass",function(n){o.options.visualizePitch?o._map.resetNorthPitch({},{originalEvent:n}):o._map.resetNorth({},{originalEvent:n})}),this._compassIcon=q.create("span","mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))};dn.prototype._updateZoomButtons=function(){var i=this._map.getZoom(),o=i===this._map.getMaxZoom(),n=i===this._map.getMinZoom();this._zoomInButton.disabled=o,this._zoomOutButton.disabled=n,this._zoomInButton.setAttribute("aria-disabled",o.toString()),this._zoomOutButton.setAttribute("aria-disabled",n.toString())},dn.prototype._rotateCompassArrow=function(){var i=this.options.visualizePitch?"scale("+1/Math.pow(Math.cos(this._map.transform.pitch*(Math.PI/180)),.5)+") rotateX("+this._map.transform.pitch+"deg) rotateZ("+this._map.transform.angle*(180/Math.PI)+"deg)":"rotate("+this._map.transform.angle*(180/Math.PI)+"deg)";this._compassIcon.style.transform=i},dn.prototype.onAdd=function(i){return this._map=i,this.options.showZoom&&(this._setButtonTitle(this._zoomInButton,"ZoomIn"),this._setButtonTitle(this._zoomOutButton,"ZoomOut"),this._map.on("zoom",this._updateZoomButtons),this._updateZoomButtons()),this.options.showCompass&&(this._setButtonTitle(this._compass,"ResetBearing"),this.options.visualizePitch&&this._map.on("pitch",this._rotateCompassArrow),this._map.on("rotate",this._rotateCompassArrow),this._rotateCompassArrow(),this._handler=new di(this._map,this._compass,this.options.visualizePitch)),this._container},dn.prototype.onRemove=function(){q.remove(this._container),this.options.showZoom&&this._map.off("zoom",this._updateZoomButtons),this.options.showCompass&&(this.options.visualizePitch&&this._map.off("pitch",this._rotateCompassArrow),this._map.off("rotate",this._rotateCompassArrow),this._handler.off(),delete this._handler),delete this._map},dn.prototype._createButton=function(i,o){var n=q.create("button",i,this._container);return n.type="button",n.addEventListener("click",o),n},dn.prototype._setButtonTitle=function(i,o){var n=this._map._getUIString("NavigationControl."+o);i.title=n,i.setAttribute("aria-label",n)};var di=function(i,o,n){n===void 0&&(n=!1),this._clickTolerance=10,this.element=o,this.mouseRotate=new ws({clickTolerance:i.dragRotate._mouseRotate._clickTolerance}),this.map=i,n&&(this.mousePitch=new Fl({clickTolerance:i.dragRotate._mousePitch._clickTolerance})),l.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),q.addEventListener(o,"mousedown",this.mousedown),q.addEventListener(o,"touchstart",this.touchstart,{passive:!1}),q.addEventListener(o,"touchmove",this.touchmove),q.addEventListener(o,"touchend",this.touchend),q.addEventListener(o,"touchcancel",this.reset)};function Xo(i,o,n){if(i=new l.LngLat(i.lng,i.lat),o){var s=new l.LngLat(i.lng-360,i.lat),p=new l.LngLat(i.lng+360,i.lat),m=n.locationPoint(i).distSqr(o);n.locationPoint(s).distSqr(o)<m?i=s:n.locationPoint(p).distSqr(o)<m&&(i=p)}for(;Math.abs(i.lng-n.center.lng)>180;){var y=n.locationPoint(i);if(y.x>=0&&y.y>=0&&y.x<=n.width&&y.y<=n.height)break;i.lng>n.center.lng?i.lng-=360:i.lng+=360}return i}di.prototype.down=function(i,o){this.mouseRotate.mousedown(i,o),this.mousePitch&&this.mousePitch.mousedown(i,o),q.disableDrag()},di.prototype.move=function(i,o){var n=this.map,s=this.mouseRotate.mousemoveWindow(i,o);if(s&&s.bearingDelta&&n.setBearing(n.getBearing()+s.bearingDelta),this.mousePitch){var p=this.mousePitch.mousemoveWindow(i,o);p&&p.pitchDelta&&n.setPitch(n.getPitch()+p.pitchDelta)}},di.prototype.off=function(){var i=this.element;q.removeEventListener(i,"mousedown",this.mousedown),q.removeEventListener(i,"touchstart",this.touchstart,{passive:!1}),q.removeEventListener(i,"touchmove",this.touchmove),q.removeEventListener(i,"touchend",this.touchend),q.removeEventListener(i,"touchcancel",this.reset),this.offTemp()},di.prototype.offTemp=function(){q.enableDrag(),q.removeEventListener(l.window,"mousemove",this.mousemove),q.removeEventListener(l.window,"mouseup",this.mouseup)},di.prototype.mousedown=function(i){this.down(l.extend({},i,{ctrlKey:!0,preventDefault:function(){return i.preventDefault()}}),q.mousePos(this.element,i)),q.addEventListener(l.window,"mousemove",this.mousemove),q.addEventListener(l.window,"mouseup",this.mouseup)},di.prototype.mousemove=function(i){this.move(i,q.mousePos(this.element,i))},di.prototype.mouseup=function(i){this.mouseRotate.mouseupWindow(i),this.mousePitch&&this.mousePitch.mouseupWindow(i),this.offTemp()},di.prototype.touchstart=function(i){i.targetTouches.length!==1?this.reset():(this._startPos=this._lastPos=q.touchPos(this.element,i.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return i.preventDefault()}},this._startPos))},di.prototype.touchmove=function(i){i.targetTouches.length!==1?this.reset():(this._lastPos=q.touchPos(this.element,i.targetTouches)[0],this.move({preventDefault:function(){return i.preventDefault()}},this._lastPos))},di.prototype.touchend=function(i){i.targetTouches.length===0&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},di.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var tn={center:"translate(-50%,-50%)",top:"translate(-50%,0)","top-left":"translate(0,0)","top-right":"translate(-100%,0)",bottom:"translate(-50%,-100%)","bottom-left":"translate(0,-100%)","bottom-right":"translate(-100%,-100%)",left:"translate(0,-50%)",right:"translate(-100%,-50%)"};function Es(i,o,n){var s=i.classList;for(var p in tn)s.remove("mapboxgl-"+n+"-anchor-"+p);s.add("mapboxgl-"+n+"-anchor-"+o)}var Ko,Ra=function(i){function o(n,s){if(i.call(this),(n instanceof l.window.HTMLElement||s)&&(n=l.extend({element:n},s)),l.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=n&&n.anchor||"center",this._color=n&&n.color||"#3FB1CE",this._scale=n&&n.scale||1,this._draggable=n&&n.draggable||!1,this._clickTolerance=n&&n.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=n&&n.rotation||0,this._rotationAlignment=n&&n.rotationAlignment||"auto",this._pitchAlignment=n&&n.pitchAlignment&&n.pitchAlignment!=="auto"?n.pitchAlignment:this._rotationAlignment,n&&n.element)this._element=n.element,this._offset=l.Point.convert(n&&n.offset||[0,0]);else{this._defaultMarker=!0,this._element=q.create("div"),this._element.setAttribute("aria-label","Map marker");var p=q.createNS("http://www.w3.org/2000/svg","svg");p.setAttributeNS(null,"display","block"),p.setAttributeNS(null,"height","41px"),p.setAttributeNS(null,"width","27px"),p.setAttributeNS(null,"viewBox","0 0 27 41");var m=q.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"stroke","none"),m.setAttributeNS(null,"stroke-width","1"),m.setAttributeNS(null,"fill","none"),m.setAttributeNS(null,"fill-rule","evenodd");var y=q.createNS("http://www.w3.org/2000/svg","g");y.setAttributeNS(null,"fill-rule","nonzero");var g=q.createNS("http://www.w3.org/2000/svg","g");g.setAttributeNS(null,"transform","translate(3.0, 29.0)"),g.setAttributeNS(null,"fill","#000000");for(var w=0,A=[{rx:"10.5",ry:"5.25002273"},{rx:"10.5",ry:"5.25002273"},{rx:"9.5",ry:"4.77275007"},{rx:"8.5",ry:"4.29549936"},{rx:"7.5",ry:"3.81822308"},{rx:"6.5",ry:"3.34094679"},{rx:"5.5",ry:"2.86367051"},{rx:"4.5",ry:"2.38636864"}];w<A.length;w+=1){var B=A[w],L=q.createNS("http://www.w3.org/2000/svg","ellipse");L.setAttributeNS(null,"opacity","0.04"),L.setAttributeNS(null,"cx","10.5"),L.setAttributeNS(null,"cy","5.80029008"),L.setAttributeNS(null,"rx",B.rx),L.setAttributeNS(null,"ry",B.ry),g.appendChild(L)}var R=q.createNS("http://www.w3.org/2000/svg","g");R.setAttributeNS(null,"fill",this._color);var Z=q.createNS("http://www.w3.org/2000/svg","path");Z.setAttributeNS(null,"d","M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"),R.appendChild(Z);var j=q.createNS("http://www.w3.org/2000/svg","g");j.setAttributeNS(null,"opacity","0.25"),j.setAttributeNS(null,"fill","#000000");var K=q.createNS("http://www.w3.org/2000/svg","path");K.setAttributeNS(null,"d","M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"),j.appendChild(K);var U=q.createNS("http://www.w3.org/2000/svg","g");U.setAttributeNS(null,"transform","translate(6.0, 7.0)"),U.setAttributeNS(null,"fill","#FFFFFF");var X=q.createNS("http://www.w3.org/2000/svg","g");X.setAttributeNS(null,"transform","translate(8.0, 8.0)");var Q=q.createNS("http://www.w3.org/2000/svg","circle");Q.setAttributeNS(null,"fill","#000000"),Q.setAttributeNS(null,"opacity","0.25"),Q.setAttributeNS(null,"cx","5.5"),Q.setAttributeNS(null,"cy","5.5"),Q.setAttributeNS(null,"r","5.4999962");var ie=q.createNS("http://www.w3.org/2000/svg","circle");ie.setAttributeNS(null,"fill","#FFFFFF"),ie.setAttributeNS(null,"cx","5.5"),ie.setAttributeNS(null,"cy","5.5"),ie.setAttributeNS(null,"r","5.4999962"),X.appendChild(Q),X.appendChild(ie),y.appendChild(g),y.appendChild(R),y.appendChild(j),y.appendChild(U),y.appendChild(X),p.appendChild(y),p.setAttributeNS(null,"height",41*this._scale+"px"),p.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(p),this._offset=l.Point.convert(n&&n.offset||[0,-14])}this._element.classList.add("mapboxgl-marker"),this._element.addEventListener("dragstart",function(ce){ce.preventDefault()}),this._element.addEventListener("mousedown",function(ce){ce.preventDefault()}),Es(this._element,this._anchor,"marker"),this._popup=null}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.addTo=function(n){return this.remove(),this._map=n,n.getCanvasContainer().appendChild(this._element),n.on("move",this._update),n.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},o.prototype.remove=function(){return this._map&&(this._map.off("click",this._onMapClick),this._map.off("move",this._update),this._map.off("moveend",this._update),this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler),this._map.off("mouseup",this._onUp),this._map.off("touchend",this._onUp),this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),delete this._map),q.remove(this._element),this._popup&&this._popup.remove(),this},o.prototype.getLngLat=function(){return this._lngLat},o.prototype.setLngLat=function(n){return this._lngLat=l.LngLat.convert(n),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},o.prototype.getElement=function(){return this._element},o.prototype.setPopup=function(n){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),n){if(!("offset"in n.options)){var s=Math.sqrt(Math.pow(13.5,2)/2);n.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[s,-1*(24.6+s)],"bottom-right":[-s,-1*(24.6+s)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset}this._popup=n,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this},o.prototype._onKeyPress=function(n){var s=n.code,p=n.charCode||n.keyCode;s!=="Space"&&s!=="Enter"&&p!==32&&p!==13||this.togglePopup()},o.prototype._onMapClick=function(n){var s=n.originalEvent.target,p=this._element;this._popup&&(s===p||p.contains(s))&&this.togglePopup()},o.prototype.getPopup=function(){return this._popup},o.prototype.togglePopup=function(){var n=this._popup;return n?(n.isOpen()?n.remove():n.addTo(this._map),this):this},o.prototype._update=function(n){if(this._map){this._map.transform.renderWorldCopies&&(this._lngLat=Xo(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);var s="";this._rotationAlignment==="viewport"||this._rotationAlignment==="auto"?s="rotateZ("+this._rotation+"deg)":this._rotationAlignment==="map"&&(s="rotateZ("+(this._rotation-this._map.getBearing())+"deg)");var p="";this._pitchAlignment==="viewport"||this._pitchAlignment==="auto"?p="rotateX(0deg)":this._pitchAlignment==="map"&&(p="rotateX("+this._map.getPitch()+"deg)"),n&&n.type!=="moveend"||(this._pos=this._pos.round()),q.setTransform(this._element,tn[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+p+" "+s)}},o.prototype.getOffset=function(){return this._offset},o.prototype.setOffset=function(n){return this._offset=l.Point.convert(n),this._update(),this},o.prototype._onMove=function(n){if(!this._isDragging){var s=this._clickTolerance||this._map._clickTolerance;this._isDragging=n.point.dist(this._pointerdownPos)>=s}this._isDragging&&(this._pos=n.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none",this._state==="pending"&&(this._state="active",this.fire(new l.Event("dragstart"))),this.fire(new l.Event("drag")))},o.prototype._onUp=function(){this._element.style.pointerEvents="auto",this._positionDelta=null,this._pointerdownPos=null,this._isDragging=!1,this._map.off("mousemove",this._onMove),this._map.off("touchmove",this._onMove),this._state==="active"&&this.fire(new l.Event("dragend")),this._state="inactive"},o.prototype._addDragHandler=function(n){this._element.contains(n.originalEvent.target)&&(n.preventDefault(),this._positionDelta=n.point.sub(this._pos).add(this._offset),this._pointerdownPos=n.point,this._state="pending",this._map.on("mousemove",this._onMove),this._map.on("touchmove",this._onMove),this._map.once("mouseup",this._onUp),this._map.once("touchend",this._onUp))},o.prototype.setDraggable=function(n){return this._draggable=!!n,this._map&&(n?(this._map.on("mousedown",this._addDragHandler),this._map.on("touchstart",this._addDragHandler)):(this._map.off("mousedown",this._addDragHandler),this._map.off("touchstart",this._addDragHandler))),this},o.prototype.isDraggable=function(){return this._draggable},o.prototype.setRotation=function(n){return this._rotation=n||0,this._update(),this},o.prototype.getRotation=function(){return this._rotation},o.prototype.setRotationAlignment=function(n){return this._rotationAlignment=n||"auto",this._update(),this},o.prototype.getRotationAlignment=function(){return this._rotationAlignment},o.prototype.setPitchAlignment=function(n){return this._pitchAlignment=n&&n!=="auto"?n:this._rotationAlignment,this._update(),this},o.prototype.getPitchAlignment=function(){return this._pitchAlignment},o}(l.Evented),$l={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Jo=0,go=!1,ql=function(i){function o(n){i.call(this),this.options=l.extend({},$l,n),l.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.onAdd=function(n){var s;return this._map=n,this._container=q.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),s=this._setupUI,Ko!==void 0?s(Ko):l.window.navigator.permissions!==void 0?l.window.navigator.permissions.query({name:"geolocation"}).then(function(p){s(Ko=p.state!=="denied")}):s(Ko=!!l.window.navigator.geolocation),this._container},o.prototype.onRemove=function(){this._geolocationWatchID!==void 0&&(l.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0),this.options.showUserLocation&&this._userLocationDotMarker&&this._userLocationDotMarker.remove(),this.options.showAccuracyCircle&&this._accuracyCircleMarker&&this._accuracyCircleMarker.remove(),q.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Jo=0,go=!1},o.prototype._isOutOfMapMaxBounds=function(n){var s=this._map.getMaxBounds(),p=n.coords;return s&&(p.longitude<s.getWest()||p.longitude>s.getEast()||p.latitude<s.getSouth()||p.latitude>s.getNorth())},o.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting")}},o.prototype._onSuccess=function(n){if(this._map){if(this._isOutOfMapMaxBounds(n))return this._setErrorState(),this.fire(new l.Event("outofmaxbounds",n)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=n,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&this._watchState!=="OFF"&&this._updateMarker(n),this.options.trackUserLocation&&this._watchState!=="ACTIVE_LOCK"||this._updateCamera(n),this.options.showUserLocation&&this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"),this.fire(new l.Event("geolocate",n)),this._finish()}},o.prototype._updateCamera=function(n){var s=new l.LngLat(n.coords.longitude,n.coords.latitude),p=n.coords.accuracy,m=this._map.getBearing(),y=l.extend({bearing:m},this.options.fitBoundsOptions);this._map.fitBounds(s.toBounds(p),y,{geolocateSource:!0})},o.prototype._updateMarker=function(n){if(n){var s=new l.LngLat(n.coords.longitude,n.coords.latitude);this._accuracyCircleMarker.setLngLat(s).addTo(this._map),this._userLocationDotMarker.setLngLat(s).addTo(this._map),this._accuracy=n.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()},o.prototype._updateCircleRadius=function(){var n=this._map._container.clientHeight/2,s=this._map.unproject([0,n]),p=this._map.unproject([1,n]),m=s.distanceTo(p),y=Math.ceil(2*this._accuracy/m);this._circleElement.style.width=y+"px",this._circleElement.style.height=y+"px"},o.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},o.prototype._onError=function(n){if(this._map){if(this.options.trackUserLocation)if(n.code===1){this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var s=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=s,this._geolocateButton.setAttribute("aria-label",s),this._geolocationWatchID!==void 0&&this._clearWatch()}else{if(n.code===3&&go)return;this._setErrorState()}this._watchState!=="OFF"&&this.options.showUserLocation&&this._dotElement.classList.add("mapboxgl-user-location-dot-stale"),this.fire(new l.Event("error",n)),this._finish()}},o.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},o.prototype._setupUI=function(n){var s=this;if(this._container.addEventListener("contextmenu",function(y){return y.preventDefault()}),this._geolocateButton=q.create("button","mapboxgl-ctrl-geolocate",this._container),q.create("span","mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),this._geolocateButton.type="button",n===!1){l.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");var p=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=p,this._geolocateButton.setAttribute("aria-label",p)}else{var m=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=m,this._geolocateButton.setAttribute("aria-label",m)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=q.create("div","mapboxgl-user-location-dot"),this._userLocationDotMarker=new Ra(this._dotElement),this._circleElement=q.create("div","mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Ra({element:this._circleElement,pitchAlignment:"map"}),this.options.trackUserLocation&&(this._watchState="OFF"),this._map.on("zoom",this._onZoom)),this._geolocateButton.addEventListener("click",this.trigger.bind(this)),this._setup=!0,this.options.trackUserLocation&&this._map.on("movestart",function(y){y.geolocateSource||s._watchState!=="ACTIVE_LOCK"||y.originalEvent&&y.originalEvent.type==="resize"||(s._watchState="BACKGROUND",s._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"),s._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),s.fire(new l.Event("trackuserlocationend")))})},o.prototype.trigger=function(){if(!this._setup)return l.warnOnce("Geolocate control triggered before added to a map"),!1;if(this.options.trackUserLocation){switch(this._watchState){case"OFF":this._watchState="WAITING_ACTIVE",this.fire(new l.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Jo--,go=!1,this._watchState="OFF",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"),this.fire(new l.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new l.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error")}if(this._watchState==="OFF"&&this._geolocationWatchID!==void 0)this._clearWatch();else if(this._geolocationWatchID===void 0){var n;this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),++Jo>1?(n={maximumAge:6e5,timeout:0},go=!0):(n=this.options.positionOptions,go=!1),this._geolocationWatchID=l.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,n)}}else l.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},o.prototype._clearWatch=function(){l.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},o}(l.Evented),Dn={maxWidth:100,unit:"metric"},Ln=function(i){this.options=l.extend({},Dn,i),l.bindAll(["_onMove","setUnit"],this)};function Ps(i,o,n){var s=n&&n.maxWidth||100,p=i._container.clientHeight/2,m=i.unproject([0,p]),y=i.unproject([s,p]),g=m.distanceTo(y);if(n&&n.unit==="imperial"){var w=3.2808*g;w>5280?Rn(o,s,w/5280,i._getUIString("ScaleControl.Miles")):Rn(o,s,w,i._getUIString("ScaleControl.Feet"))}else n&&n.unit==="nautical"?Rn(o,s,g/1852,i._getUIString("ScaleControl.NauticalMiles")):g>=1e3?Rn(o,s,g/1e3,i._getUIString("ScaleControl.Kilometers")):Rn(o,s,g,i._getUIString("ScaleControl.Meters"))}function Rn(i,o,n,s){var p,m,y,g=(p=n,(m=Math.pow(10,(""+Math.floor(p)).length-1))*(y=(y=p/m)>=10?10:y>=5?5:y>=3?3:y>=2?2:y>=1?1:function(w){var A=Math.pow(10,Math.ceil(-Math.log(w)/Math.LN10));return Math.round(w*A)/A}(y)));i.style.width=o*(g/n)+"px",i.innerHTML=g+" "+s}Ln.prototype.getDefaultPosition=function(){return"bottom-left"},Ln.prototype._onMove=function(){Ps(this._map,this._container,this.options)},Ln.prototype.onAdd=function(i){return this._map=i,this._container=q.create("div","mapboxgl-ctrl mapboxgl-ctrl-scale",i.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},Ln.prototype.onRemove=function(){q.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},Ln.prototype.setUnit=function(i){this.options.unit=i,Ps(this._map,this._container,this.options)};var Bi=function(i){this._fullscreen=!1,i&&i.container&&(i.container instanceof l.window.HTMLElement?this._container=i.container:l.warnOnce("Full screen control 'container' must be a DOM element.")),l.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in l.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in l.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in l.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in l.window.document&&(this._fullscreenchange="MSFullscreenChange")};Bi.prototype.onAdd=function(i){return this._map=i,this._container||(this._container=this._map.getContainer()),this._controlContainer=q.create("div","mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",l.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Bi.prototype.onRemove=function(){q.remove(this._controlContainer),this._map=null,l.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Bi.prototype._checkFullscreenSupport=function(){return!!(l.window.document.fullscreenEnabled||l.window.document.mozFullScreenEnabled||l.window.document.msFullscreenEnabled||l.window.document.webkitFullscreenEnabled)},Bi.prototype._setupUI=function(){var i=this._fullscreenButton=q.create("button","mapboxgl-ctrl-fullscreen",this._controlContainer);q.create("span","mapboxgl-ctrl-icon",i).setAttribute("aria-hidden",!0),i.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),l.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Bi.prototype._updateTitle=function(){var i=this._getTitle();this._fullscreenButton.setAttribute("aria-label",i),this._fullscreenButton.title=i},Bi.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Bi.prototype._isFullscreen=function(){return this._fullscreen},Bi.prototype._changeIcon=function(){(l.window.document.fullscreenElement||l.window.document.mozFullScreenElement||l.window.document.webkitFullscreenElement||l.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Bi.prototype._onClickFullscreen=function(){this._isFullscreen()?l.window.document.exitFullscreen?l.window.document.exitFullscreen():l.window.document.mozCancelFullScreen?l.window.document.mozCancelFullScreen():l.window.document.msExitFullscreen?l.window.document.msExitFullscreen():l.window.document.webkitCancelFullScreen&&l.window.document.webkitCancelFullScreen():this._container.requestFullscreen?this._container.requestFullscreen():this._container.mozRequestFullScreen?this._container.mozRequestFullScreen():this._container.msRequestFullscreen?this._container.msRequestFullscreen():this._container.webkitRequestFullscreen&&this._container.webkitRequestFullscreen()};var jl={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},Fa=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),Gl=function(i){function o(n){i.call(this),this.options=l.extend(Object.create(jl),n),l.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return i&&(o.__proto__=i),(o.prototype=Object.create(i&&i.prototype)).constructor=o,o.prototype.addTo=function(n){return this._map&&this.remove(),this._map=n,this.options.closeOnClick&&this._map.on("click",this._onClose),this.options.closeOnMove&&this._map.on("move",this._onClose),this._map.on("remove",this.remove),this._update(),this._focusFirstElement(),this._trackPointer?(this._map.on("mousemove",this._onMouseMove),this._map.on("mouseup",this._onMouseUp),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new l.Event("open")),this},o.prototype.isOpen=function(){return!!this._map},o.prototype.remove=function(){return this._content&&q.remove(this._content),this._container&&(q.remove(this._container),delete this._container),this._map&&(this._map.off("move",this._update),this._map.off("move",this._onClose),this._map.off("click",this._onClose),this._map.off("remove",this.remove),this._map.off("mousemove",this._onMouseMove),this._map.off("mouseup",this._onMouseUp),this._map.off("drag",this._onDrag),delete this._map),this.fire(new l.Event("close")),this},o.prototype.getLngLat=function(){return this._lngLat},o.prototype.setLngLat=function(n){return this._lngLat=l.LngLat.convert(n),this._pos=null,this._trackPointer=!1,this._update(),this._map&&(this._map.on("move",this._update),this._map.off("mousemove",this._onMouseMove),this._container&&this._container.classList.remove("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")),this},o.prototype.trackPointer=function(){return this._trackPointer=!0,this._pos=null,this._update(),this._map&&(this._map.off("move",this._update),this._map.on("mousemove",this._onMouseMove),this._map.on("drag",this._onDrag),this._container&&this._container.classList.add("mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("mapboxgl-track-pointer")),this},o.prototype.getElement=function(){return this._container},o.prototype.setText=function(n){return this.setDOMContent(l.window.document.createTextNode(n))},o.prototype.setHTML=function(n){var s,p=l.window.document.createDocumentFragment(),m=l.window.document.createElement("body");for(m.innerHTML=n;s=m.firstChild;)p.appendChild(s);return this.setDOMContent(p)},o.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},o.prototype.setMaxWidth=function(n){return this.options.maxWidth=n,this._update(),this},o.prototype.setDOMContent=function(n){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=q.create("div","mapboxgl-popup-content",this._container);return this._content.appendChild(n),this._createCloseButton(),this._update(),this._focusFirstElement(),this},o.prototype.addClassName=function(n){this._container&&this._container.classList.add(n)},o.prototype.removeClassName=function(n){this._container&&this._container.classList.remove(n)},o.prototype.setOffset=function(n){return this.options.offset=n,this._update(),this},o.prototype.toggleClassName=function(n){if(this._container)return this._container.classList.toggle(n)},o.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=q.create("button","mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="×",this._closeButton.addEventListener("click",this._onClose))},o.prototype._onMouseUp=function(n){this._update(n.point)},o.prototype._onMouseMove=function(n){this._update(n.point)},o.prototype._onDrag=function(n){this._update(n.point)},o.prototype._update=function(n){var s=this;if(this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=q.create("div","mapboxgl-popup",this._map.getContainer()),this._tip=q.create("div","mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach(function(L){return s._container.classList.add(L)}),this._trackPointer&&this._container.classList.add("mapboxgl-popup-track-pointer")),this.options.maxWidth&&this._container.style.maxWidth!==this.options.maxWidth&&(this._container.style.maxWidth=this.options.maxWidth),this._map.transform.renderWorldCopies&&!this._trackPointer&&(this._lngLat=Xo(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||n)){var p=this._pos=this._trackPointer&&n?n:this._map.project(this._lngLat),m=this.options.anchor,y=function L(R){if(R){if(typeof R=="number"){var Z=Math.round(Math.sqrt(.5*Math.pow(R,2)));return{center:new l.Point(0,0),top:new l.Point(0,R),"top-left":new l.Point(Z,Z),"top-right":new l.Point(-Z,Z),bottom:new l.Point(0,-R),"bottom-left":new l.Point(Z,-Z),"bottom-right":new l.Point(-Z,-Z),left:new l.Point(R,0),right:new l.Point(-R,0)}}if(R instanceof l.Point||Array.isArray(R)){var j=l.Point.convert(R);return{center:j,top:j,"top-left":j,"top-right":j,bottom:j,"bottom-left":j,"bottom-right":j,left:j,right:j}}return{center:l.Point.convert(R.center||[0,0]),top:l.Point.convert(R.top||[0,0]),"top-left":l.Point.convert(R["top-left"]||[0,0]),"top-right":l.Point.convert(R["top-right"]||[0,0]),bottom:l.Point.convert(R.bottom||[0,0]),"bottom-left":l.Point.convert(R["bottom-left"]||[0,0]),"bottom-right":l.Point.convert(R["bottom-right"]||[0,0]),left:l.Point.convert(R.left||[0,0]),right:l.Point.convert(R.right||[0,0])}}return L(new l.Point(0,0))}(this.options.offset);if(!m){var g,w=this._container.offsetWidth,A=this._container.offsetHeight;g=p.y+y.bottom.y<A?["top"]:p.y>this._map.transform.height-A?["bottom"]:[],p.x<w/2?g.push("left"):p.x>this._map.transform.width-w/2&&g.push("right"),m=g.length===0?"bottom":g.join("-")}var B=p.add(y[m]).round();q.setTransform(this._container,tn[m]+" translate("+B.x+"px,"+B.y+"px)"),Es(this._container,m,"popup")}},o.prototype._focusFirstElement=function(){if(this.options.focusAfterOpen&&this._container){var n=this._container.querySelector(Fa);n&&n.focus()}},o.prototype._onClose=function(){this.remove()},o}(l.Evented),Cs={version:l.version,supported:re,setRTLTextPlugin:l.setRTLTextPlugin,getRTLTextPluginStatus:l.getRTLTextPluginStatus,Map:lc,NavigationControl:dn,GeolocateControl:ql,AttributionControl:Wr,ScaleControl:Ln,FullscreenControl:Bi,Popup:Gl,Marker:Ra,Style:ui,LngLat:l.LngLat,LngLatBounds:l.LngLatBounds,Point:l.Point,MercatorCoordinate:l.MercatorCoordinate,Evented:l.Evented,config:l.config,prewarm:function(){de().acquire(fe)},clearPrewarmedResources:function(){var i=Ve;i&&(i.isPreloaded()&&i.numActive()===1?(i.release(fe),Ve=null):console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"))},get accessToken(){return l.config.ACCESS_TOKEN},set accessToken(i){l.config.ACCESS_TOKEN=i},get baseApiUrl(){return l.config.API_URL},set baseApiUrl(i){l.config.API_URL=i},get workerCount(){return xe.workerCount},set workerCount(i){xe.workerCount=i},get maxParallelImageRequests(){return l.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(i){l.config.MAX_PARALLEL_IMAGE_REQUESTS=i},clearStorage:function(i){l.clearTileCache(i)},workerUrl:""};return Cs}),k})})(Qg);var f0=Qg.exports;const Zn=st.getDefaultExportFromCjs(f0);var xp={exports:{}},d0=y0,m0={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"};function y0(d){if(!d||!d.type)return null;var h=m0[d.type];if(!h)return null;if(h==="geometry")return{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:d}]};if(h==="feature")return{type:"FeatureCollection",features:[d]};if(h==="featurecollection")return d}function ep(d){switch(d&&d.type||null){case"FeatureCollection":return d.features=d.features.reduce(function(h,_){return h.concat(ep(_))},[]),d;case"Feature":return d.geometry?ep(d.geometry).map(function(h){var _={type:"Feature",properties:JSON.parse(JSON.stringify(d.properties)),geometry:h};return d.id!==void 0&&(_.id=d.id),_}):[d];case"MultiPoint":return d.coordinates.map(function(h){return{type:"Point",coordinates:h}});case"MultiPolygon":return d.coordinates.map(function(h){return{type:"Polygon",coordinates:h}});case"MultiLineString":return d.coordinates.map(function(h){return{type:"LineString",coordinates:h}});case"GeometryCollection":return d.geometries.map(ep).reduce(function(h,_){return h.concat(_)},[]);case"Point":case"Polygon":case"LineString":return[d]}}const v0=Object.freeze(Object.defineProperty({__proto__:null,default:ep},Symbol.toStringTag,{value:"Module"})),g0=st.getAugmentedNamespace(v0);var _0=function(h){return _(h);function _(E){return Array.isArray(E)&&E.length&&typeof E[0]=="number"?[E]:E.reduce(function(k,V){return Array.isArray(V)&&Array.isArray(V[0])?k.concat(_(V)):(k.push(V),k)},[])}},x0=d0,tp=g0,b0=_0;tp instanceof Function||(tp=tp.default);var w0=function(d){if(!d)return[];var h=tp(x0(d)),_=[];return h.features.forEach(function(E){E.geometry&&(_=_.concat(b0(E.geometry.coordinates)))}),_},e_=Function.prototype.toString,ll=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,nd,rp;if(typeof ll=="function"&&typeof Object.defineProperty=="function")try{nd=Object.defineProperty({},"length",{get:function(){throw rp}}),rp={},ll(function(){throw 42},null,nd)}catch(d){d!==rp&&(ll=null)}else ll=null;var S0=/^\s*class\b/,od=function(h){try{var _=e_.call(h);return S0.test(_)}catch{return!1}},Th=function(h){try{return od(h)?!1:(e_.call(h),!0)}catch{return!1}},ip=Object.prototype.toString,T0="[object Object]",I0="[object Function]",A0="[object GeneratorFunction]",E0="[object HTMLAllCollection]",P0="[object HTML document.all class]",C0="[object HTMLCollection]",k0=typeof Symbol=="function"&&!!Symbol.toStringTag,M0=!(0 in[,]),ad=function(){return!1};if(typeof document=="object"){var z0=document.all;ip.call(z0)===ip.call(document.all)&&(ad=function(h){if((M0||!h)&&(typeof h>"u"||typeof h=="object"))try{var _=ip.call(h);return(_===E0||_===P0||_===C0||_===T0)&&h("")==null}catch{}return!1})}var bp=ll?function(h){if(ad(h))return!0;if(!h||typeof h!="function"&&typeof h!="object")return!1;try{ll(h,null,nd)}catch(_){if(_!==rp)return!1}return!od(h)&&Th(h)}:function(h){if(ad(h))return!0;if(!h||typeof h!="function"&&typeof h!="object")return!1;if(k0)return Th(h);if(od(h))return!1;var _=ip.call(h);return _!==I0&&_!==A0&&!/^\[object HTML/.test(_)?!1:Th(h)},B0=bp,D0=Object.prototype.toString,t_=Object.prototype.hasOwnProperty,L0=function(h,_,E){for(var k=0,V=h.length;k<V;k++)t_.call(h,k)&&(E==null?_(h[k],k,h):_.call(E,h[k],k,h))},R0=function(h,_,E){for(var k=0,V=h.length;k<V;k++)E==null?_(h.charAt(k),k,h):_.call(E,h.charAt(k),k,h)},F0=function(h,_,E){for(var k in h)t_.call(h,k)&&(E==null?_(h[k],k,h):_.call(E,h[k],k,h))};function O0(d){return D0.call(d)==="[object Array]"}var wd=function(h,_,E){if(!B0(_))throw new TypeError("iterator must be a function");var k;arguments.length>=3&&(k=E),O0(h)?L0(h,_,k):typeof h=="string"?R0(h,_,k):F0(h,_,k)},r_=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],Ih=r_,V0=typeof globalThis>"u"?st.commonjsGlobal:globalThis,Tu=function(){for(var h=[],_=0;_<Ih.length;_++)typeof V0[Ih[_]]=="function"&&(h[h.length]=Ih[_]);return h},i_={exports:{}},Sd=Object,U0=Error,N0=EvalError,Td=RangeError,$0=ReferenceError,_n=SyntaxError,Tt=TypeError,q0=URIError,wp=Math.abs,Ya=Math.floor,Id=Math.max,Ad=Math.min,Qa=Math.pow,j0=Math.round,es=Number.isNaN||function(h){return h!==h},G0=es,Z0=function(h){return G0(h)||h===0?h:h<0?-1:1},W0=Object.getOwnPropertyDescriptor,np=W0;if(np)try{np([],"length")}catch{np=null}var ko=np,op=Object.defineProperty||!1;if(op)try{op({},"a",{value:1})}catch{op=!1}var Iu=op,Ah,my;function Ed(){return my||(my=1,Ah=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var h={},_=Symbol("test"),E=Object(_);if(typeof _=="string"||Object.prototype.toString.call(_)!=="[object Symbol]"||Object.prototype.toString.call(E)!=="[object Symbol]")return!1;var k=42;h[_]=k;for(var V in h)return!1;if(typeof Object.keys=="function"&&Object.keys(h).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(h).length!==0)return!1;var l=Object.getOwnPropertySymbols(h);if(l.length!==1||l[0]!==_||!Object.prototype.propertyIsEnumerable.call(h,_))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var re=Object.getOwnPropertyDescriptor(h,_);if(re.value!==k||re.enumerable!==!0)return!1}return!0}),Ah}var Eh,yy;function n_(){if(yy)return Eh;yy=1;var d=typeof Symbol<"u"&&Symbol,h=Ed();return Eh=function(){return typeof d!="function"||typeof Symbol!="function"||typeof d("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:h()},Eh}var o_=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,H0=Sd,a_=H0.getPrototypeOf||null,X0="Function.prototype.bind called on incompatible ",K0=Object.prototype.toString,J0=Math.max,Y0="[object Function]",vy=function(h,_){for(var E=[],k=0;k<h.length;k+=1)E[k]=h[k];for(var V=0;V<_.length;V+=1)E[V+h.length]=_[V];return E},Q0=function(h,_){for(var E=[],k=_,V=0;k<h.length;k+=1,V+=1)E[V]=h[k];return E},e1=function(d,h){for(var _="",E=0;E<d.length;E+=1)_+=d[E],E+1<d.length&&(_+=h);return _},t1=function(h){var _=this;if(typeof _!="function"||K0.apply(_)!==Y0)throw new TypeError(X0+_);for(var E=Q0(arguments,1),k,V=function(){if(this instanceof k){var pe=_.apply(this,vy(E,arguments));return Object(pe)===pe?pe:this}return _.apply(h,vy(E,arguments))},l=J0(0,_.length-E.length),re=[],q=0;q<l;q++)re[q]="$"+q;if(k=Function("binder","return function ("+e1(re,",")+"){ return binder.apply(this,arguments); }")(V),_.prototype){var me=function(){};me.prototype=_.prototype,k.prototype=new me,me.prototype=null}return k},r1=t1,Au=Function.prototype.bind||r1,Pd=Function.prototype.call,Cd=Function.prototype.apply,i1=typeof Reflect<"u"&&Reflect&&Reflect.apply,n1=Au,o1=Cd,a1=Pd,s1=i1,s_=s1||n1.call(a1,o1),l1=Au,u1=Tt,c1=Pd,p1=s_,kd=function(h){if(h.length<1||typeof h[0]!="function")throw new u1("a function is required");return p1(l1,c1,h)},h1=kd,gy=ko,l_;try{l_=[].__proto__===Array.prototype}catch(d){if(!d||typeof d!="object"||!("code"in d)||d.code!=="ERR_PROTO_ACCESS")throw d}var Ph=!!l_&&gy&&gy(Object.prototype,"__proto__"),u_=Object,_y=u_.getPrototypeOf,f1=Ph&&typeof Ph.get=="function"?h1([Ph.get]):typeof _y=="function"?function(h){return _y(h==null?h:u_(h))}:!1,xy=o_,by=a_,wy=f1,ts=xy?function(h){return xy(h)}:by?function(h){if(!h||typeof h!="object"&&typeof h!="function")throw new TypeError("getProto: not an object");return by(h)}:wy?function(h){return wy(h)}:null,Ch,Sy;function c_(){if(Sy)return Ch;Sy=1;const d=(async function(){}).constructor;return Ch=()=>d,Ch}var kh,Ty;function p_(){if(Ty)return kh;Ty=1;const d=(function*(){}).constructor;return kh=()=>d,kh}var Mh,Iy;function d1(){if(Iy)return Mh;Iy=1;const d=(async function*(){}).constructor;return Mh=()=>d,Mh}var zh,Ay;function Mo(){if(Ay)return zh;Ay=1;var d=Function.prototype.call,h=Object.prototype.hasOwnProperty,_=Au;return zh=_.call(d,h),zh}var At,m1=Sd,y1=U0,v1=N0,g1=Td,_1=$0,cl=_n,ul=Tt,x1=q0,b1=wp,w1=Ya,S1=Id,T1=Ad,I1=Qa,A1=j0,E1=Z0,wu=ko,P1=Iu,Bh=function(){throw new ul},C1=wu?function(){try{return arguments.callee,Bh}catch{try{return wu(arguments,"callee").get}catch{return Bh}}}():Bh,nl=n_()(),Yr=ts,k1=a_,M1=o_,h_=Cd,Eu=Pd,sl={},z1=typeof Uint8Array>"u"||!Yr?At:Yr(Uint8Array),Ja={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?At:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?At:ArrayBuffer,"%ArrayIteratorPrototype%":nl&&Yr?Yr([][Symbol.iterator]()):At,"%AsyncFromSyncIteratorPrototype%":At,"%AsyncFunction%":sl,"%AsyncGenerator%":sl,"%AsyncGeneratorFunction%":sl,"%AsyncIteratorPrototype%":sl,"%Atomics%":typeof Atomics>"u"?At:Atomics,"%BigInt%":typeof BigInt>"u"?At:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?At:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?At:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?At:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":y1,"%eval%":eval,"%EvalError%":v1,"%Float16Array%":typeof Float16Array>"u"?At:Float16Array,"%Float32Array%":typeof Float32Array>"u"?At:Float32Array,"%Float64Array%":typeof Float64Array>"u"?At:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?At:FinalizationRegistry,"%Function%":Function,"%GeneratorFunction%":sl,"%Int8Array%":typeof Int8Array>"u"?At:Int8Array,"%Int16Array%":typeof Int16Array>"u"?At:Int16Array,"%Int32Array%":typeof Int32Array>"u"?At:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":nl&&Yr?Yr(Yr([][Symbol.iterator]())):At,"%JSON%":typeof JSON=="object"?JSON:At,"%Map%":typeof Map>"u"?At:Map,"%MapIteratorPrototype%":typeof Map>"u"||!nl||!Yr?At:Yr(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":m1,"%Object.getOwnPropertyDescriptor%":wu,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?At:Promise,"%Proxy%":typeof Proxy>"u"?At:Proxy,"%RangeError%":g1,"%ReferenceError%":_1,"%Reflect%":typeof Reflect>"u"?At:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?At:Set,"%SetIteratorPrototype%":typeof Set>"u"||!nl||!Yr?At:Yr(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?At:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":nl&&Yr?Yr(""[Symbol.iterator]()):At,"%Symbol%":nl?Symbol:At,"%SyntaxError%":cl,"%ThrowTypeError%":C1,"%TypedArray%":z1,"%TypeError%":ul,"%Uint8Array%":typeof Uint8Array>"u"?At:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?At:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?At:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?At:Uint32Array,"%URIError%":x1,"%WeakMap%":typeof WeakMap>"u"?At:WeakMap,"%WeakRef%":typeof WeakRef>"u"?At:WeakRef,"%WeakSet%":typeof WeakSet>"u"?At:WeakSet,"%Function.prototype.call%":Eu,"%Function.prototype.apply%":h_,"%Object.defineProperty%":P1,"%Object.getPrototypeOf%":k1,"%Math.abs%":b1,"%Math.floor%":w1,"%Math.max%":S1,"%Math.min%":T1,"%Math.pow%":I1,"%Math.round%":A1,"%Math.sign%":E1,"%Reflect.getPrototypeOf%":M1};if(Yr)try{null.error}catch(d){var B1=Yr(Yr(d));Ja["%Error.prototype%"]=B1}var D1=c_(),L1=p_(),R1=d1(),F1=function d(h){var _;if(h==="%AsyncFunction%")_=D1()||void 0;else if(h==="%GeneratorFunction%")_=L1()||void 0;else if(h==="%AsyncGeneratorFunction%")_=R1()||void 0;else if(h==="%AsyncGenerator%"){var E=d("%AsyncGeneratorFunction%");E&&(_=E.prototype)}else if(h==="%AsyncIteratorPrototype%"){var k=d("%AsyncGenerator%");k&&Yr&&(_=Yr(k.prototype))}return Ja[h]=_,_},Ey={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Pu=Au,up=Mo(),O1=Pu.call(Eu,Array.prototype.concat),V1=Pu.call(h_,Array.prototype.splice),Py=Pu.call(Eu,String.prototype.replace),cp=Pu.call(Eu,String.prototype.slice),U1=Pu.call(Eu,RegExp.prototype.exec),N1=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,$1=/\\(\\)?/g,q1=function(h){var _=cp(h,0,1),E=cp(h,-1);if(_==="%"&&E!=="%")throw new cl("invalid intrinsic syntax, expected closing `%`");if(E==="%"&&_!=="%")throw new cl("invalid intrinsic syntax, expected opening `%`");var k=[];return Py(h,N1,function(V,l,re,q){k[k.length]=re?Py(q,$1,"$1"):l||V}),k},j1=function(h,_){var E=h,k;if(up(Ey,E)&&(k=Ey[E],E="%"+k[0]+"%"),up(Ja,E)){var V=Ja[E];if(V===sl&&(V=F1(E)),typeof V>"u"&&!_)throw new ul("intrinsic "+h+" exists, but is not available. Please file an issue!");return{alias:k,name:E,value:V}}throw new cl("intrinsic "+h+" does not exist!")},fr=function(h,_){if(typeof h!="string"||h.length===0)throw new ul("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof _!="boolean")throw new ul('"allowMissing" argument must be a boolean');if(U1(/^%?[^%]*%?$/,h)===null)throw new cl("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var E=q1(h),k=E.length>0?E[0]:"",V=j1("%"+k+"%",_),l=V.name,re=V.value,q=!1,me=V.alias;me&&(k=me[0],V1(E,O1([0,1],me)));for(var pe=1,ke=!0;pe<E.length;pe+=1){var ae=E[pe],ve=cp(ae,0,1),Ae=cp(ae,-1);if((ve==='"'||ve==="'"||ve==="`"||Ae==='"'||Ae==="'"||Ae==="`")&&ve!==Ae)throw new cl("property names with quotes must have matching quotes");if((ae==="constructor"||!ke)&&(q=!0),k+="."+ae,l="%"+k+"%",up(Ja,l))re=Ja[l];else if(re!=null){if(!(ae in re)){if(!_)throw new ul("base intrinsic for "+h+" exists, but the property is not available.");return}if(wu&&pe+1>=E.length){var Je=wu(re,ae);ke=!!Je,ke&&"get"in Je&&!("originalValue"in Je.get)?re=Je.get:re=re[ae]}else ke=up(re,ae),re=re[ae];ke&&!q&&(Ja[l]=re)}}return re},Cy=Iu,G1=_n,ol=Tt,ky=ko,Md=function(h,_,E){if(!h||typeof h!="object"&&typeof h!="function")throw new ol("`obj` must be an object or a function`");if(typeof _!="string"&&typeof _!="symbol")throw new ol("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new ol("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new ol("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new ol("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new ol("`loose`, if provided, must be a boolean");var k=arguments.length>3?arguments[3]:null,V=arguments.length>4?arguments[4]:null,l=arguments.length>5?arguments[5]:null,re=arguments.length>6?arguments[6]:!1,q=!!ky&&ky(h,_);if(Cy)Cy(h,_,{configurable:l===null&&q?q.configurable:!l,enumerable:k===null&&q?q.enumerable:!k,value:E,writable:V===null&&q?q.writable:!V});else if(re||!k&&!V&&!l)h[_]=E;else throw new G1("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},sd=Iu,f_=function(){return!!sd};f_.hasArrayLengthDefineBug=function(){if(!sd)return null;try{return sd([],"length",{value:1}).length!==1}catch{return!0}};var Sp=f_,Z1=fr,My=Md,W1=Sp(),zy=ko,By=Tt,H1=Z1("%Math.floor%"),X1=function(h,_){if(typeof h!="function")throw new By("`fn` is not a function");if(typeof _!="number"||_<0||_>4294967295||H1(_)!==_)throw new By("`length` must be a positive 32-bit integer");var E=arguments.length>2&&!!arguments[2],k=!0,V=!0;if("length"in h&&zy){var l=zy(h,"length");l&&!l.configurable&&(k=!1),l&&!l.writable&&(V=!1)}return(k||V||!E)&&(W1?My(h,"length",_,!0,!0):My(h,"length",_)),h},K1=Au,J1=Cd,Y1=s_,Q1=function(){return Y1(K1,J1,arguments)};(function(d){var h=X1,_=Iu,E=kd,k=Q1;d.exports=function(l){var re=E(arguments),q=1+l.length-(arguments.length-1);return h(re,q>0?q:0,!0)},_?_(d.exports,"apply",{value:k}):d.exports.apply=k})(i_);var sa=i_.exports,d_=fr,m_=kd,ew=m_([d_("%String.prototype.indexOf%")]),Wt=function(h,_){var E=d_(h,!!_);return typeof E=="function"&&ew(h,".prototype.")>-1?m_([E]):E},Dh,Dy;function zo(){if(Dy)return Dh;Dy=1;var d=Ed();return Dh=function(){return d()&&!!Symbol.toStringTag},Dh}var pp=wd,tw=Tu,Ly=sa,zd=Wt,ap=ko,$c=ts,rw=zd("Object.prototype.toString"),y_=zo()(),Ry=typeof globalThis>"u"?st.commonjsGlobal:globalThis,ld=tw(),Bd=zd("String.prototype.slice"),iw=zd("Array.prototype.indexOf",!0)||function(h,_){for(var E=0;E<h.length;E+=1)if(h[E]===_)return E;return-1},hp={__proto__:null};y_&&ap&&$c?pp(ld,function(d){var h=new Ry[d];if(Symbol.toStringTag in h&&$c){var _=$c(h),E=ap(_,Symbol.toStringTag);if(!E&&_){var k=$c(_);E=ap(k,Symbol.toStringTag)}if(E&&E.get){var V=Ly(E.get);hp["$"+d]=V}}}):pp(ld,function(d){var h=new Ry[d],_=h.slice||h.set;if(_){var E=Ly(_);hp["$"+d]=E}});var nw=function(h){var _=!1;return pp(hp,function(E,k){if(!_)try{"$"+E(h)===k&&(_=Bd(k,1))}catch{}}),_},ow=function(h){var _=!1;return pp(hp,function(E,k){if(!_)try{E(h),_=Bd(k,1)}catch{}}),_},hl=function(h){if(!h||typeof h!="object")return!1;if(!y_){var _=Bd(rw(h),8,-1);return iw(ld,_)>-1?_:_!=="Object"?!1:ow(h)}return ap?nw(h):null},Fy=Object.prototype.toString,v_=function(h){var _=Fy.call(h),E=_==="[object Arguments]";return E||(E=_!=="[object Array]"&&h!==null&&typeof h=="object"&&typeof h.length=="number"&&h.length>=0&&Fy.call(h.callee)==="[object Function]"),E},Lh,Oy;function aw(){if(Oy)return Lh;Oy=1;var d;if(!Object.keys){var h=Object.prototype.hasOwnProperty,_=Object.prototype.toString,E=v_,k=Object.prototype.propertyIsEnumerable,V=!k.call({toString:null},"toString"),l=k.call(function(){},"prototype"),re=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],q=function(ae){var ve=ae.constructor;return ve&&ve.prototype===ae},me={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},pe=function(){if(typeof window>"u")return!1;for(var ae in window)try{if(!me["$"+ae]&&h.call(window,ae)&&window[ae]!==null&&typeof window[ae]=="object")try{q(window[ae])}catch{return!0}}catch{return!0}return!1}(),ke=function(ae){if(typeof window>"u"||!pe)return q(ae);try{return q(ae)}catch{return!1}};d=function(ve){var Ae=ve!==null&&typeof ve=="object",Je=_.call(ve)==="[object Function]",qe=E(ve),pt=Ae&&_.call(ve)==="[object String]",ot=[];if(!Ae&&!Je&&!qe)throw new TypeError("Object.keys called on a non-object");var Rt=l&&Je;if(pt&&ve.length>0&&!h.call(ve,0))for(var bt=0;bt<ve.length;++bt)ot.push(String(bt));if(qe&&ve.length>0)for(var Ct=0;Ct<ve.length;++Ct)ot.push(String(Ct));else for(var Qt in ve)!(Rt&&Qt==="prototype")&&h.call(ve,Qt)&&ot.push(String(Qt));if(V)for(var vr=ke(ve),Er=0;Er<re.length;++Er)!(vr&&re[Er]==="constructor")&&h.call(ve,re[Er])&&ot.push(re[Er]);return ot}}return Lh=d,Lh}var sw=Array.prototype.slice,lw=v_,Vy=Object.keys,sp=Vy?function(h){return Vy(h)}:aw(),Uy=Object.keys;sp.shim=function(){if(Object.keys){var h=function(){var _=Object.keys(arguments);return _&&_.length===arguments.length}(1,2);h||(Object.keys=function(E){return lw(E)?Uy(sw.call(E)):Uy(E)})}else Object.keys=sp;return Object.keys||sp};var uw=sp,cw=uw,pw=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",hw=Object.prototype.toString,fw=Array.prototype.concat,Ny=Md,dw=function(d){return typeof d=="function"&&hw.call(d)==="[object Function]"},g_=Sp(),mw=function(d,h,_,E){if(h in d){if(E===!0){if(d[h]===_)return}else if(!dw(E)||!E())return}g_?Ny(d,h,_,!0):Ny(d,h,_)},__=function(d,h){var _=arguments.length>2?arguments[2]:{},E=cw(h);pw&&(E=fw.call(E,Object.getOwnPropertySymbols(h)));for(var k=0;k<E.length;k+=1)mw(d,E[k],h[E[k]],_[E[k]])};__.supportsDescriptors=!!g_;var Cu=__;const yw={},vw=Object.freeze(Object.defineProperty({__proto__:null,default:yw},Symbol.toStringTag,{value:"Module"})),gw=st.getAugmentedNamespace(vw);var Dd=typeof Map=="function"&&Map.prototype,Rh=Object.getOwnPropertyDescriptor&&Dd?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,fp=Dd&&Rh&&typeof Rh.get=="function"?Rh.get:null,$y=Dd&&Map.prototype.forEach,Ld=typeof Set=="function"&&Set.prototype,Fh=Object.getOwnPropertyDescriptor&&Ld?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,dp=Ld&&Fh&&typeof Fh.get=="function"?Fh.get:null,qy=Ld&&Set.prototype.forEach,_w=typeof WeakMap=="function"&&WeakMap.prototype,gu=_w?WeakMap.prototype.has:null,xw=typeof WeakSet=="function"&&WeakSet.prototype,_u=xw?WeakSet.prototype.has:null,bw=typeof WeakRef=="function"&&WeakRef.prototype,jy=bw?WeakRef.prototype.deref:null,ww=Boolean.prototype.valueOf,Sw=Object.prototype.toString,Tw=Function.prototype.toString,Iw=String.prototype.match,Rd=String.prototype.slice,oa=String.prototype.replace,Aw=String.prototype.toUpperCase,Gy=String.prototype.toLowerCase,x_=RegExp.prototype.test,Zy=Array.prototype.concat,Wn=Array.prototype.join,Ew=Array.prototype.slice,Wy=Math.floor,ud=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Oh=Object.getOwnPropertySymbols,cd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,pl=typeof Symbol=="function"&&typeof Symbol.iterator=="object",xu=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===pl||!0)?Symbol.toStringTag:null,b_=Object.prototype.propertyIsEnumerable,Hy=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(d){return d.__proto__}:null);function Xy(d,h){if(d===1/0||d===-1/0||d!==d||d&&d>-1e3&&d<1e3||x_.call(/e/,h))return h;var _=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof d=="number"){var E=d<0?-Wy(-d):Wy(d);if(E!==d){var k=String(E),V=Rd.call(h,k.length+1);return oa.call(k,_,"$&_")+"."+oa.call(oa.call(V,/([0-9]{3})/g,"$&_"),/_$/,"")}}return oa.call(h,_,"$&_")}var pd=gw,Ky=pd.custom,Jy=T_(Ky)?Ky:null,w_={__proto__:null,double:'"',single:"'"},Pw={__proto__:null,double:/(["\\])/g,single:/(['\\])/g},Cw=function d(h,_,E,k){var V=_||{};if(Co(V,"quoteStyle")&&!Co(w_,V.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(Co(V,"maxStringLength")&&(typeof V.maxStringLength=="number"?V.maxStringLength<0&&V.maxStringLength!==1/0:V.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var l=Co(V,"customInspect")?V.customInspect:!0;if(typeof l!="boolean"&&l!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(Co(V,"indent")&&V.indent!==null&&V.indent!==" "&&!(parseInt(V.indent,10)===V.indent&&V.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(Co(V,"numericSeparator")&&typeof V.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var re=V.numericSeparator;if(typeof h>"u")return"undefined";if(h===null)return"null";if(typeof h=="boolean")return h?"true":"false";if(typeof h=="string")return A_(h,V);if(typeof h=="number"){if(h===0)return 1/0/h>0?"0":"-0";var q=String(h);return re?Xy(h,q):q}if(typeof h=="bigint"){var me=String(h)+"n";return re?Xy(h,me):me}var pe=typeof V.depth>"u"?5:V.depth;if(typeof E>"u"&&(E=0),E>=pe&&pe>0&&typeof h=="object")return hd(h)?"[Array]":"[Object]";var ke=Ww(V,E);if(typeof k>"u")k=[];else if(I_(k,h)>=0)return"[Circular]";function ae(It,gr,Bo){if(gr&&(k=Ew.call(k),k.push(gr)),Bo){var li={depth:V.depth};return Co(V,"quoteStyle")&&(li.quoteStyle=V.quoteStyle),d(It,li,E+1,k)}return d(It,V,E+1,k)}if(typeof h=="function"&&!Yy(h)){var ve=Ow(h),Ae=qc(h,ae);return"[Function"+(ve?": "+ve:" (anonymous)")+"]"+(Ae.length>0?" { "+Wn.call(Ae,", ")+" }":"")}if(T_(h)){var Je=pl?oa.call(String(h),/^(Symbol\(.*\))_[^)]*$/,"$1"):cd.call(h);return typeof h=="object"&&!pl?vu(Je):Je}if(jw(h)){for(var qe="<"+Gy.call(String(h.nodeName)),pt=h.attributes||[],ot=0;ot<pt.length;ot++)qe+=" "+pt[ot].name+"="+S_(kw(pt[ot].value),"double",V);return qe+=">",h.childNodes&&h.childNodes.length&&(qe+="..."),qe+="</"+Gy.call(String(h.nodeName))+">",qe}if(hd(h)){if(h.length===0)return"[]";var Rt=qc(h,ae);return ke&&!Zw(Rt)?"["+fd(Rt,ke)+"]":"[ "+Wn.call(Rt,", ")+" ]"}if(zw(h)){var bt=qc(h,ae);return!("cause"in Error.prototype)&&"cause"in h&&!b_.call(h,"cause")?"{ ["+String(h)+"] "+Wn.call(Zy.call("[cause]: "+ae(h.cause),bt),", ")+" }":bt.length===0?"["+String(h)+"]":"{ ["+String(h)+"] "+Wn.call(bt,", ")+" }"}if(typeof h=="object"&&l){if(Jy&&typeof h[Jy]=="function"&&pd)return pd(h,{depth:pe-E});if(l!=="symbol"&&typeof h.inspect=="function")return h.inspect()}if(Vw(h)){var Ct=[];return $y&&$y.call(h,function(It,gr){Ct.push(ae(gr,h,!0)+" => "+ae(It,h))}),Qy("Map",fp.call(h),Ct,ke)}if($w(h)){var Qt=[];return qy&&qy.call(h,function(It){Qt.push(ae(It,h))}),Qy("Set",dp.call(h),Qt,ke)}if(Uw(h))return Vh("WeakMap");if(qw(h))return Vh("WeakSet");if(Nw(h))return Vh("WeakRef");if(Dw(h))return vu(ae(Number(h)));if(Rw(h))return vu(ae(ud.call(h)));if(Lw(h))return vu(ww.call(h));if(Bw(h))return vu(ae(String(h)));if(typeof window<"u"&&h===window)return"{ [object Window] }";if(typeof globalThis<"u"&&h===globalThis||typeof st.commonjsGlobal<"u"&&h===st.commonjsGlobal)return"{ [object globalThis] }";if(!Mw(h)&&!Yy(h)){var vr=qc(h,ae),Er=Hy?Hy(h)===Object.prototype:h instanceof Object||h.constructor===Object,er=h instanceof Object?"":"null prototype",Qr=!Er&&xu&&Object(h)===h&&xu in h?Rd.call(la(h),8,-1):er?"Object":"",ei=Er||typeof h.constructor!="function"?"":h.constructor.name?h.constructor.name+" ":"",vi=ei+(Qr||er?"["+Wn.call(Zy.call([],Qr||[],er||[]),": ")+"] ":"");return vr.length===0?vi+"{}":ke?vi+"{"+fd(vr,ke)+"}":vi+"{ "+Wn.call(vr,", ")+" }"}return String(h)};function S_(d,h,_){var E=_.quoteStyle||h,k=w_[E];return k+d+k}function kw(d){return oa.call(String(d),/"/g,""")}function rs(d){return!xu||!(typeof d=="object"&&(xu in d||typeof d[xu]<"u"))}function hd(d){return la(d)==="[object Array]"&&rs(d)}function Mw(d){return la(d)==="[object Date]"&&rs(d)}function Yy(d){return la(d)==="[object RegExp]"&&rs(d)}function zw(d){return la(d)==="[object Error]"&&rs(d)}function Bw(d){return la(d)==="[object String]"&&rs(d)}function Dw(d){return la(d)==="[object Number]"&&rs(d)}function Lw(d){return la(d)==="[object Boolean]"&&rs(d)}function T_(d){if(pl)return d&&typeof d=="object"&&d instanceof Symbol;if(typeof d=="symbol")return!0;if(!d||typeof d!="object"||!cd)return!1;try{return cd.call(d),!0}catch{}return!1}function Rw(d){if(!d||typeof d!="object"||!ud)return!1;try{return ud.call(d),!0}catch{}return!1}var Fw=Object.prototype.hasOwnProperty||function(d){return d in this};function Co(d,h){return Fw.call(d,h)}function la(d){return Sw.call(d)}function Ow(d){if(d.name)return d.name;var h=Iw.call(Tw.call(d),/^function\s*([\w$]+)/);return h?h[1]:null}function I_(d,h){if(d.indexOf)return d.indexOf(h);for(var _=0,E=d.length;_<E;_++)if(d[_]===h)return _;return-1}function Vw(d){if(!fp||!d||typeof d!="object")return!1;try{fp.call(d);try{dp.call(d)}catch{return!0}return d instanceof Map}catch{}return!1}function Uw(d){if(!gu||!d||typeof d!="object")return!1;try{gu.call(d,gu);try{_u.call(d,_u)}catch{return!0}return d instanceof WeakMap}catch{}return!1}function Nw(d){if(!jy||!d||typeof d!="object")return!1;try{return jy.call(d),!0}catch{}return!1}function $w(d){if(!dp||!d||typeof d!="object")return!1;try{dp.call(d);try{fp.call(d)}catch{return!0}return d instanceof Set}catch{}return!1}function qw(d){if(!_u||!d||typeof d!="object")return!1;try{_u.call(d,_u);try{gu.call(d,gu)}catch{return!0}return d instanceof WeakSet}catch{}return!1}function jw(d){return!d||typeof d!="object"?!1:typeof HTMLElement<"u"&&d instanceof HTMLElement?!0:typeof d.nodeName=="string"&&typeof d.getAttribute=="function"}function A_(d,h){if(d.length>h.maxStringLength){var _=d.length-h.maxStringLength,E="... "+_+" more character"+(_>1?"s":"");return A_(Rd.call(d,0,h.maxStringLength),h)+E}var k=Pw[h.quoteStyle||"single"];k.lastIndex=0;var V=oa.call(oa.call(d,k,"\\$1"),/[\x00-\x1f]/g,Gw);return S_(V,"single",h)}function Gw(d){var h=d.charCodeAt(0),_={8:"b",9:"t",10:"n",12:"f",13:"r"}[h];return _?"\\"+_:"\\x"+(h<16?"0":"")+Aw.call(h.toString(16))}function vu(d){return"Object("+d+")"}function Vh(d){return d+" { ? }"}function Qy(d,h,_,E){var k=E?fd(_,E):Wn.call(_,", ");return d+" ("+h+") {"+k+"}"}function Zw(d){for(var h=0;h<d.length;h++)if(I_(d[h],`
|
|
498
|
+
`)>=0)return!1;return!0}function Ww(d,h){var _;if(d.indent===" ")_=" ";else if(typeof d.indent=="number"&&d.indent>0)_=Wn.call(Array(d.indent+1)," ");else return null;return{base:_,prev:Wn.call(Array(h+1),_)}}function fd(d,h){if(d.length===0)return"";var _=`
|
|
499
499
|
`+h.prev+h.base;return _+Wn.call(d,","+_)+`
|
|
500
|
-
`+h.prev}function jc(d,h){var _=hd(d),E=[];if(_){E.length=d.length;for(var k=0;k<d.length;k++)E[k]=Po(d,k)?h(d[k],d):""}var V=typeof Rh=="function"?Rh(d):[],l;if(pl){l={};for(var re=0;re<V.length;re++)l["$"+V[re]]=V[re]}for(var G in d)Po(d,G)&&(_&&String(Number(G))===G&&G<d.length||pl&&l["$"+G]instanceof Symbol||(m_.call(/[^\w$]/,G)?E.push(h(G,d)+": "+h(d[G],d)):E.push(G+": "+h(d[G],d))));if(typeof Rh=="function")for(var me=0;me<V.length;me++)y_.call(d,V[me])&&E.push("["+h(V[me])+"]: "+h(d[V[me]],d));return E}var Tp=function(h){return typeof h=="string"||typeof h=="symbol"},ua=function(h){return!!h&&(typeof h=="function"||typeof h=="object")},Jy=St,Uw=bw,Nw=Tp,$w=ua,jw=function(h,_){if(!$w(h))throw new Jy("Assertion failed: Type(O) is not Object");if(!Nw(_))throw new Jy("Assertion failed: P is not a Property Key, got "+Uw(_));return h[_]},qw=es,zo=function(h){return(typeof h=="number"||typeof h=="bigint")&&!qw(h)&&h!==1/0&&h!==-1/0},Gw=wp,Zw=Ya,Ww=es,Hw=zo,Ip=function(h){if(typeof h!="number"||Ww(h)||!Hw(h))return!1;var _=Gw(h);return Zw(_)===_},Xw=sa,w_=Wt,Kw=hr,dd=Kw("%ArrayBuffer%",!0),lp=w_("ArrayBuffer.prototype.byteLength",!0),Jw=w_("Object.prototype.toString"),Yy=!!dd&&!lp&&new dd(0).slice,Qy=!!Yy&&Xw(Yy),fl=lp||Qy?function(h){if(!h||typeof h!="object")return!1;try{return lp?lp(h):Qy(h,0),!0}catch{return!1}}:dd?function(h){return Jw(h)==="[object ArrayBuffer]"}:function(h){return!1},Yw=Wt,ev=Yw("ArrayBuffer.prototype.byteLength",!0),Qw=fl,S_=function(h){return Qw(h)?ev?ev(h):h.byteLength:NaN},e2=Wt,tv=e2("SharedArrayBuffer.prototype.byteLength",!0),ku=tv?function(h){if(!h||typeof h!="object")return!1;try{return tv(h),!0}catch{return!1}}:function(h){return!1},t2=St,r2=S_,i2=Tu(),n2=Wt,o2=fl,a2=ku,s2=n2("SharedArrayBuffer.prototype.byteLength",!0),dl=function(h){var _=a2(h);if(!o2(h)&&!_)throw new t2("Assertion failed: `arrayBuffer` must be an Object with an [[ArrayBufferData]] internal slot");if((_?s2:r2)(h)===0)try{new st.commonjsGlobal[i2[0]](h)}catch(E){return!!E&&E.name==="TypeError"}return!1},Oh,rv;function T_(){if(rv)return Oh;rv=1;var d=St,h=ko(),_=ua,E=Tp;return Oh=function(V,l){if(!_(V))throw new d("Assertion failed: `O` must be an Object");if(!E(l))throw new d("Assertion failed: `P` must be a Property Key");return h(V,l)},Oh}var l2=hr,I_=l2("%Array%"),u2=!I_.isArray&&Wt("Object.prototype.toString"),A_=I_.isArray||function(h){return u2(h)==="[object Array]"},Fd=A_,Vh,iv;function E_(){return iv||(iv=1,Vh=function(h){return h==="BIGUINT64"||h==="BIGINT64"}),Vh}var Uh,nv;function c2(){return nv||(nv=1,Uh=function(h){return h==="UINT8"||h==="UINT8C"||h==="UINT16"||h==="UINT32"||h==="BIGUINT64"}),Uh}var Nh,ov;function p2(){if(ov)return Nh;ov=1;var d=Qa;return Nh=function(_){var E=_[3]&128?-1:1,k=(_[3]&127)<<1|_[2]>>7,V=(_[2]&127)<<16|_[1]<<8|_[0];return k===0&&V===0?E===1?0:-0:k===255&&V===0?E===1?1/0:-1/0:k===255&&V!==0?NaN:(k-=127,k===-127?E*V*d(2,-149):E*(1+V*d(2,-23))*d(2,k))},Nh}var $h,av;function h2(){if(av)return $h;av=1;var d=Qa;return $h=function(_){var E=_[7]&128?-1:1,k=(_[7]&127)<<4|(_[6]&240)>>4,V=(_[6]&15)*281474976710656+_[5]*1099511627776+_[4]*4294967296+_[3]*16777216+_[2]*65536+_[1]*256+_[0];return k===0&&V===0?E*0:k===2047&&V!==0?NaN:k===2047&&V===0?E*(1/0):(k-=1023,k===-1023?E*V*5e-324:E*(1+V/4503599627370496)*d(2,k))},$h}var jh,sv;function f2(){if(sv)return jh;sv=1;var d=hr,h=Qa,_=d("%Number%"),E=d("%BigInt%",!0);return jh=function(V,l,re,G){for(var me=G?E:_,pe=me(0),Ce=0;Ce<V.length;Ce++)pe+=me(V[Ce]*h(2,8*Ce));if(!re){var ae=l*8;V[l-1]&128&&(pe-=me(h(2,ae)))}return pe},jh}var qh,lv;function d2(){return lv||(lv=1,qh=function(h,_){for(var E=0;E<h.length;E+=1)if(!_(h[E],E,h))return!1;return!0}),qh}var Gh,uv;function m2(){return uv||(uv=1,Gh=function(h){return typeof h=="number"&&h>=0&&h<=255&&(h|0)===h}),Gh}var ml={__proto__:null,name:{__proto__:null,$Int8Array:"INT8",$Uint8Array:"UINT8",$Uint8ClampedArray:"UINT8C",$Int16Array:"INT16",$Uint16Array:"UINT16",$Int32Array:"INT32",$Uint32Array:"UINT32",$BigInt64Array:"BIGINT64",$BigUint64Array:"BIGUINT64",$Float32Array:"FLOAT32",$Float64Array:"FLOAT64"},size:{__proto__:null,$INT8:1,$UINT8:1,$UINT8C:1,$INT16:2,$UINT16:2,$INT32:4,$UINT32:4,$BIGINT64:8,$BIGUINT64:8,$FLOAT32:4,$FLOAT64:8},choices:'"INT8", "UINT8", "UINT8C", "INT16", "UINT16", "INT32", "UINT32", "BIGINT64", "BIGUINT64", "FLOAT32", or "FLOAT64"'},Zh,cv;function y2(){if(cv)return Zh;cv=1;var d=hr,h=Wt,_=Td,E=_n,k=St,V=d("%BigInt%",!0),l=T_(),re=Fd,G=E_(),me=c2(),pe=p2(),Ce=h2(),ae=f2(),ve=d2(),ke=m2(),Xe=h("Array.prototype.reverse"),$e=h("Array.prototype.slice"),At=ml;return Zh=function(dt,Rt,Gt){if(!l(At.size,"$"+dt))throw new k("Assertion failed: `type` must be a TypedArray element type");if(!re(Rt)||!ve(Rt,ke))throw new k("Assertion failed: `rawBytes` must be an Array of bytes");if(typeof Gt!="boolean")throw new k("Assertion failed: `isLittleEndian` must be a Boolean");var Qt=At.size["$"+dt];if(Rt.length!==Qt)throw new _("Assertion failed: `rawBytes` must have a length of "+Qt+" for type "+dt);var fr=G(dt);if(fr&&!V)throw new E("this environment does not support BigInts");return Rt=$e(Rt,0,Qt),Gt||Xe(Rt),dt==="FLOAT32"?pe(Rt):dt==="FLOAT64"?Ce(Rt):ae(Rt,Qt,me(dt),fr)},Zh}var Wh,pv;function P_(){if(pv)return Wh;pv=1;var d={}.toString;return Wh=Array.isArray||function(h){return d.call(h)=="[object Array]"},Wh}var Hh,hv;function v2(){if(hv)return Hh;hv=1;var d=hr,h=d("%Array.prototype.concat%"),_=sa,E=Wt,k=E("Array.prototype.slice"),V=Ed()(),l=V&&Symbol.isConcatSpreadable,re=[],G=l?_.apply(h,re):null,me=l?P_():null;return Hh=l?function(Ce){for(var ae=0;ae<arguments.length;ae+=1){var ve=arguments[ae];if(ve&&typeof ve=="object"&&typeof ve[l]=="boolean"){re[l]||(re[l]=!0);var ke=me(ve)?k(ve):[ve];ke[l]=!0,arguments[ae]=ke}}return G(arguments)}:_(h,re),Hh}var g2=hl,yl=function(h){return!!g2(h)},_2=St,x2=Wt,b2=x2("TypedArray.prototype.buffer",!0),w2=yl,Mu=b2||function(h){if(!w2(h))throw new _2("Not a Typed Array");return h.buffer},Xh,fv;function C_(){if(fv)return Xh;fv=1;var d=hr,h=d("%Uint8Array%",!0),_=d("%Uint32Array%",!0),E=Mu,k=_&&new _([305419896]),V=k&&new h(E(k));return Xh=V?V[0]===120?"little":V[0]===18?"big":V[0]===52?"mixed":"unknown":"indeterminate",Xh}var S2=hr,T2=_n,Ao=St,I2=Wt,A2=Ip,E2=S2("%Uint8Array%",!0),Kh=I2("Array.prototype.slice"),P2=dl,C2=y2(),k2=fl,M2=ku,dv=v2(),qc=ml,z2=C_(),B2=function(h,_,E,k,V){var l=M2(h);if(!k2(h)&&!l)throw new Ao("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!A2(_))throw new Ao("Assertion failed: `byteIndex` must be an integer");if(typeof E!="string"||typeof qc.size["$"+E]!="number")throw new Ao("Assertion failed: `type` must be one of "+qc.choices);if(typeof k!="boolean")throw new Ao("Assertion failed: `isTypedArray` must be a boolean");if(V!=="SEQ-CST"&&V!=="UNORDERED")throw new Ao("Assertion failed: `order` must be either `SEQ-CST` or `UNORDERED`");if(arguments.length>5&&typeof arguments[5]!="boolean")throw new Ao("Assertion failed: `isLittleEndian` must be a boolean, if present");if(P2(h))throw new Ao("Assertion failed: `arrayBuffer` is detached");if(_<0)throw new Ao("Assertion failed: `byteIndex` must be non-negative");var re=qc.size["$"+E];if(!re)throw new Ao("Assertion failed: `type` must be one of "+qc.choices);var G;if(l)throw new T2("SharedArrayBuffer is not supported by this implementation");G=Kh(new E2(h,_),0,re);var me=arguments.length>5?arguments[5]:z2==="little",pe=me?Kh(dv([0,0,0,0,0,0,0,0],G),-re):Kh(dv(G,[0,0,0,0,0,0,0,0]),0,re);return C2(E,pe,me)},mv=es,k_=function(h,_){return h===_?h===0?1/h===1/_:!0:mv(h)&&mv(_)},Gc=St,D2=ua,L2=Tp,yv=k_,vv=function(){try{return delete[].length,!0}catch{return!1}}(),R2=function(h,_,E,k){if(!D2(h))throw new Gc("Assertion failed: `O` must be an Object");if(!L2(_))throw new Gc("Assertion failed: `P` must be a Property Key");if(typeof k!="boolean")throw new Gc("Assertion failed: `Throw` must be a Boolean");if(k){if(h[_]=E,vv&&!yv(h[_],E))throw new Gc("Attempted to assign to readonly property.");return!0}try{return h[_]=E,vv?yv(h[_],E):!0}catch{return!1}},Jh,gv;function F2(){if(gv)return Jh;gv=1;var d=hr,h=d("%BigInt%",!0),_=St,E=_n;return Jh=function(V){if(typeof V!="string")throw new _("`argument` must be a string");if(!h)throw new E("BigInts are not supported in this environment");try{return h(V)}catch{return}},Jh}var Yh,_v;function O2(){return _v||(_v=1,Yh=function(h){return h===null||typeof h!="function"&&typeof h!="object"}),Yh}var M_=Wt,V2=M_("Date.prototype.getDay"),U2=function(h){try{return V2(h),!0}catch{return!1}},N2=M_("Object.prototype.toString"),$2="[object Date]",j2=Mo()(),z_=function(h){return typeof h!="object"||h===null?!1:j2?U2(h):N2(h)===$2},Zc={exports:{}},xv=Wt,q2=Mo()(),G2=ko(),Z2=Co,md;if(q2){var W2=xv("RegExp.prototype.exec"),bv={},Qh=function(){throw bv},wv={toString:Qh,valueOf:Qh};typeof Symbol.toPrimitive=="symbol"&&(wv[Symbol.toPrimitive]=Qh),md=function(h){if(!h||typeof h!="object")return!1;var _=Z2(h,"lastIndex"),E=_&&G2(_,"value");if(!E)return!1;try{W2(h,wv)}catch(k){return k===bv}}}else{var H2=xv("Object.prototype.toString"),X2="[object RegExp]";md=function(h){return!h||typeof h!="object"&&typeof h!="function"?!1:H2(h)===X2}}var B_=md,ef,Sv;function Ap(){if(Sv)return ef;Sv=1;var d=Wt,h=B_,_=d("RegExp.prototype.exec"),E=St;return ef=function(V){if(!h(V))throw new E("`regex` must be a RegExp");return function(re){return _(V,re)!==null}},ef}var Tv;function D_(){if(Tv)return Zc.exports;Tv=1;var d=Wt,h=d("Object.prototype.toString"),_=e_()(),E=Ap();if(_){var k=d("Symbol.prototype.toString"),V=E(/^Symbol\(.*\)$/),l=function(G){return typeof G.valueOf()!="symbol"?!1:V(k(G))};Zc.exports=function(G){if(typeof G=="symbol")return!0;if(!G||typeof G!="object"||h(G)!=="[object Symbol]")return!1;try{return l(G)}catch{return!1}}}else Zc.exports=function(G){return!1};return Zc.exports}var tf,Iv;function K2(){if(Iv)return tf;Iv=1;var d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol",h=O2(),_=bp,E=z_,k=D_(),V=function(G,me){if(typeof G>"u"||G===null)throw new TypeError("Cannot call method on "+G);if(typeof me!="string"||me!=="number"&&me!=="string")throw new TypeError('hint must be "string" or "number"');var pe=me==="string"?["toString","valueOf"]:["valueOf","toString"],Ce,ae,ve;for(ve=0;ve<pe.length;++ve)if(Ce=G[pe[ve]],_(Ce)&&(ae=Ce.call(G),h(ae)))return ae;throw new TypeError("No default value")},l=function(G,me){var pe=G[me];if(pe!==null&&typeof pe<"u"){if(!_(pe))throw new TypeError(pe+" returned for property "+String(me)+" of object "+G+" is not a function");return pe}};return tf=function(G){if(h(G))return G;var me="default";arguments.length>1&&(arguments[1]===String?me="string":arguments[1]===Number&&(me="number"));var pe;if(d&&(Symbol.toPrimitive?pe=l(G,Symbol.toPrimitive):k(G)&&(pe=Symbol.prototype.valueOf)),typeof pe<"u"){var Ce=pe.call(G,me);if(h(Ce))return Ce;throw new TypeError("unable to convert exotic object to primitive")}return me==="default"&&(E(G)||k(G))&&(me="string"),V(G,me==="default"?"number":me)},tf}var rf,Av;function L_(){if(Av)return rf;Av=1;var d=K2();return rf=function(_){return arguments.length>1?d(_,arguments[1]):d(_)},rf}var nf,Ev;function R_(){if(Ev)return nf;Ev=1;var d=hr,h=d("%BigInt%",!0),_=d("%Number%"),E=St,k=_n,V=F2(),l=L_();return nf=function(G){if(!h)throw new k("BigInts are not supported in this environment");var me=l(G,_);if(me==null)throw new E("Cannot convert null or undefined to a BigInt");if(typeof me=="boolean")return h(me?1:0);if(typeof me=="number")throw new E("Cannot convert a Number value to a BigInt");if(typeof me=="string"){var pe=V(me);if(typeof pe>"u")throw new E("Failed to parse String to BigInt");return pe}if(typeof me=="symbol")throw new E("Cannot convert a Symbol value to a BigInt");if(typeof me!="bigint")throw new k("Assertion failed: unknown primitive type");return me},nf}var of,Pv;function F_(){if(Pv)return of;Pv=1;var d=hr,h=d("%BigInt%",!0),_=Td,E=St,k=h&&h(0);return of=function(l,re){if(typeof l!="bigint"||typeof re!="bigint")throw new E("Assertion failed: `n` and `d` arguments must be BigInts");if(re===k)throw new _("Division by zero");return l===k?k:l%re},of}var af,Cv;function O_(){return Cv||(Cv=1,af=function(h,_,E){var k=h(_,E);return k>=0?k:k+E}),af}var sf,kv;function J2(){if(kv)return sf;kv=1;var d=hr,h=d("%BigInt%",!0),_=Qa,E=R_(),k=F_(),V=O_(),l=h&&BigInt(_(2,32))*BigInt(_(2,31)),re=h&&BigInt(_(2,32))*BigInt(_(2,32));return sf=function(me){var pe=E(me),Ce=V(k,pe,re);return Ce>=l?Ce-re:Ce},sf}var lf,Mv;function Y2(){if(Mv)return lf;Mv=1;var d=hr,h=d("%BigInt%",!0),_=Qa,E=R_(),k=F_(),V=O_(),l=h&&BigInt(_(2,32))*BigInt(_(2,32));return lf=function(G){var me=E(G),pe=V(k,me,l);return pe},lf}var uf,zv;function Q2(){if(zv)return uf;zv=1;var d=Ya;return uf=function(_,E){var k=_%E;return d(k>=0?k:k+E)},uf}var cf,Bv;function eS(){return Bv||(Bv=1,cf=Q2()),cf}var pf,Dv;function vl(){if(Dv)return pf;Dv=1;var d=eS();return pf=function(_,E){return d(_,E)},pf}var hf,Lv;function tS(){return Lv||(Lv=1,hf=function(h){return h===null||typeof h!="function"&&typeof h!="object"}),hf}var ff,Rv;function V_(){if(Rv)return ff;Rv=1;var d=St;return ff=function(_){if(_==null)throw new d(arguments.length>0&&arguments[1]||"Cannot call method on "+_);return _},ff}var rS=hr,iS=rS("%String%"),nS=St,U_=function(h){if(typeof h=="symbol")throw new nS("Cannot convert a Symbol value to a string");return iS(h)},df,Fv;function N_(){if(Fv)return df;Fv=1;var d=V_(),h=U_,_=Wt,E=_("String.prototype.replace"),k=/^\s$/.test(""),V=k?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,l=k?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;return df=function(){var G=h(d(this));return E(E(G,V,""),l,"")},df}var mf,Ov;function $_(){if(Ov)return mf;Ov=1;var d=N_(),h="",_="";return mf=function(){return String.prototype.trim&&h.trim()===h&&_.trim()===_&&("_"+_).trim()==="_"+_&&(_+"_").trim()===_+"_"?String.prototype.trim:d},mf}var yf,Vv;function oS(){if(Vv)return yf;Vv=1;var d=Sp(),h=Md,_=$_();return yf=function(){var k=_();return String.prototype.trim!==k&&(d?h(String.prototype,"trim",k,!0):h(String.prototype,"trim",k)),k},yf}var vf,Uv;function aS(){if(Uv)return vf;Uv=1;var d=sa,h=Cu,_=V_(),E=N_(),k=$_(),V=oS(),l=d(k()),re=function(me){return _(me),l(me)};return h(re,{getPolyfill:k,implementation:E,shim:V}),vf=re,vf}var gf,Nv;function sS(){if(Nv)return gf;Nv=1;var d=hr,h=d("%RegExp%"),_=St,E=d("%parseInt%"),k=Wt,V=Ap(),l=k("String.prototype.slice"),re=V(/^0b[01]+$/i),G=V(/^0o[0-7]+$/i),me=V(/^[-+]0x[0-9a-f]+$/i),pe=["
","",""].join(""),Ce=new h("["+pe+"]","g"),ae=V(Ce),ve=aS();return gf=function ke(Xe){if(typeof Xe!="string")throw new _("Assertion failed: `argument` is not a String");if(re(Xe))return+E(l(Xe,2),2);if(G(Xe))return+E(l(Xe,2),8);if(ae(Xe)||me(Xe))return NaN;var $e=ve(Xe);return $e!==Xe?ke($e):+Xe},gf}var lS=hr,$v=St,uS=lS("%Number%"),cS=tS(),pS=L_(),hS=sS(),ca=function(h){var _=cS(h)?h:pS(h,uS);if(typeof _=="symbol")throw new $v("Cannot convert a Symbol value to a number");if(typeof _=="bigint")throw new $v("Conversion from 'BigInt' to 'number' is not allowed.");return typeof _=="string"?hS(_):+_},fS=Ya,Od=function(h){return typeof h=="bigint"?h:fS(h)},jv=Od,dS=St,is=function(h){if(typeof h!="number"&&typeof h!="bigint")throw new dS("argument must be a Number or a BigInt");var _=h<0?-jv(-h):jv(h);return _===0?0:_},_f,qv;function mS(){if(qv)return _f;qv=1;var d=vl(),h=ca,_=is,E=zo,k=65536;return _f=function(l){var re=h(l);if(!E(re)||re===0)return 0;var G=_(re),me=d(G,k);return me>=32768?me-k:me},_f}var xf,Gv;function yS(){if(Gv)return xf;Gv=1;var d=vl(),h=ca,_=is,E=zo,k=2147483648,V=4294967296;return xf=function(re){var G=h(re);if(!E(G)||G===0)return 0;var me=_(G),pe=d(me,V),Ce=pe>=k?pe-V:pe;return Ce===0?0:Ce},xf}var bf,Zv;function vS(){if(Zv)return bf;Zv=1;var d=vl(),h=ca,_=is,E=zo;return bf=function(V){var l=h(V);if(!E(l)||l===0)return 0;var re=_(l),G=d(re,256);return G>=128?G-256:G},bf}var wf,Wv;function gS(){if(Wv)return wf;Wv=1;var d=vl(),h=ca,_=is,E=zo,k=65536;return wf=function(l){var re=h(l);if(!E(re)||re===0)return 0;var G=_(re),me=d(G,k);return me===0?0:me},wf}var Sf,Hv;function _S(){if(Hv)return Sf;Hv=1;var d=vl(),h=ca,_=is,E=zo,k=4294967296;return Sf=function(l){var re=h(l);if(!E(re)||re===0)return 0;var G=_(re),me=d(G,k);return me===0?0:me},Sf}var Tf,Xv;function xS(){if(Xv)return Tf;Xv=1;var d=zo,h=vl(),_=ca,E=is;return Tf=function(V){var l=_(V);if(!d(l)||l===0)return 0;var re=E(l),G=h(re,256);return G},Tf}var If,Kv;function bS(){if(Kv)return If;Kv=1;var d=St,h=Id,_=Ad;return If=function(k,V,l){if(typeof k!="number"||typeof V!="number"||typeof l!="number"||!(V<=l))throw new d("Assertion failed: all three arguments must be MVs, and `lower` must be `<= upper`");return _(h(V,k),l)},If}var Af,Jv;function wS(){if(Jv)return Af;Jv=1;var d=bS(),h=ca,_=Od,E=es;return Af=function(V){var l=h(V);if(E(l))return 0;var re=d(l,0,255),G=_(re);return re<G+.5?G:re>G+.5?G+1:G%2===0?G:G+1},Af}var Ef,Yv;function j_(){return Yv||(Yv=1,Ef=function(h){return h===0&&1/h===-1/0}),Ef}var Pf,Qv;function SS(){if(Qv)return Pf;Qv=1;var d=wp,h=Ya,_=Qa,E=zo,k=es,V=j_(),l=34028234663852886e22;return Pf=function(G,me){if(k(G))return me?[0,0,192,127]:[127,192,0,0];var pe;if(G===0)return pe=V(G)?128:0,me?[0,0,0,pe]:[pe,0,0,0];if(d(G)>l||!E(G))return pe=G<0?255:127,me?[0,0,128,pe]:[pe,128,0,0];var Ce=G<0?1:0;G=d(G);for(var ae=0;G>=2;)ae+=1,G/=2;for(;G<1;)ae-=1,G*=2;var ve=G-1;ve*=_(2,23)+.5,ve=h(ve),ae+=127,ae<<=23;var ke=Ce<<31|ae|ve,Xe=ke&255;ke>>=8;var $e=ke&255;ke>>=8;var At=ke&255;ke>>=8;var et=ke&255;return me?[Xe,$e,At,et]:[et,At,$e,Xe]},Pf}var Cf,eg;function TS(){if(eg)return Cf;eg=1;var d=1075,h=54;return Cf=function(E){var k="";if(E===0)return k;for(var V=d,l,re=0;re<d;re+=1)if(l=E*2,l>=1?(E=l-1,k+="1",V===d&&(V=re)):(E=l,k+="0"),l===1||re-V>h)return k;return k},Cf}var kf,tg;function IS(){if(tg)return kf;tg=1;var d=Ya;return kf=function(_){for(var E="",k;_>0;)k=_/2,_=d(k),k===_?E="0"+E:E="1"+E;return E},kf}var Mf,rg;function AS(){if(rg)return Mf;rg=1;var d=hr,h=d("%parseInt%"),_=wp,E=Ya,k=j_(),V=Wt,l=V("String.prototype.indexOf"),re=V("String.prototype.slice"),G=TS(),me=IS(),pe=1023,Ce="11111111111",ae="00000000000",ve=ae+ae+ae+ae+"0000000";return Mf=function(Xe,$e){var At=Xe<0||k(Xe)?"1":"0",et,dt;if(isNaN(Xe))et=Ce,dt="1"+ve;else if(!isFinite(Xe))et=Ce,dt="0"+ve;else if(Xe===0)et=ae,dt="0"+ve;else{Xe=_(Xe);var Rt=E(Xe),Gt=me(Rt),Qt=G(Xe-Rt),fr;if(Gt)et=Gt.length-1;else{var Er=l(Qt,"1");Er>-1&&(fr=Er+1),et=-fr}dt=Gt+Qt,et<0?(et<=-pe&&(fr=pe-1),dt=re(dt,fr)):dt=re(dt,1),et=re(ae+me(et+pe),-11),dt=re(dt+ve+"0",0,52)}for(var dr=At+et+dt,ei=[],wr=0;wr<8;wr++){var Si=$e?8-wr-1:wr;ei[Si]=h(re(dr,wr*8,(wr+1)*8),2)}return ei},Mf}var zf,ig;function ES(){if(ig)return zf;ig=1;var d=hr,h=d("%Number%"),_=d("%BigInt%",!0);return zf=function(k,V,l){var re=typeof k=="bigint"?_:h;k<0&&(k>>>=0);for(var G=[],me=0;me<V;me++)G[l?me:V-1-me]=h(k&re(255)),k>>=re(8);return G},zf}var Bf,ng;function PS(){if(ng)return Bf;ng=1;var d=St,h=T_(),_=J2(),E=Y2(),k=mS(),V=yS(),l=vS(),re=gS(),G=_S(),me=xS(),pe=wS(),Ce=SS(),ae=AS(),ve=ES(),ke=ml,Xe={__proto__:null,$INT8:l,$UINT8:me,$UINT8C:pe,$INT16:k,$UINT16:re,$INT32:V,$UINT32:G,$BIGINT64:_,$BIGUINT64:E};return Bf=function(At,et,dt){if(typeof At!="string"||!h(ke.size,"$"+At))throw new d("Assertion failed: `type` must be a TypedArray element type");if(typeof et!="number"&&typeof et!="bigint")throw new d("Assertion failed: `value` must be a Number or a BigInt");if(typeof dt!="boolean")throw new d("Assertion failed: `isLittleEndian` must be a Boolean");if(At==="FLOAT32")return Ce(et,dt);if(At==="FLOAT64")return ae(et,dt);var Rt=ke.size["$"+At],Gt=Xe["$"+At],Qt=Gt(et);return ve(Qt,Rt,dt)},Bf}var Df,og;function CS(){return og||(og=1,Df=function(h,_){for(var E=0;E<h.length;E+=1)_(h[E],E,h)}),Df}var kS=hr,MS=_n,Eo=St,zS=Ip,BS=kS("%Uint8Array%",!0),DS=E_(),LS=dl,RS=PS(),FS=fl,OS=ku,VS=ko(),Lf=ml,US=C_(),NS=CS(),$S=function(h,_,E,k,V,l){var re=OS(h);if(!FS(h)&&!re)throw new Eo("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!zS(_)||_<0)throw new Eo("Assertion failed: `byteIndex` must be a non-negative integer");if(typeof E!="string"||!VS(Lf.size,"$"+E))throw new Eo("Assertion failed: `type` must be one of "+Lf.choices);if(typeof k!="number"&&typeof k!="bigint")throw new Eo("Assertion failed: `value` must be a Number or a BigInt");if(typeof V!="boolean")throw new Eo("Assertion failed: `isTypedArray` must be a boolean");if(l!=="SEQ-CST"&&l!=="UNORDERED"&&l!=="INIT")throw new Eo('Assertion failed: `order` must be `"SEQ-CST"`, `"UNORDERED"`, or `"INIT"`');if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Eo("Assertion failed: `isLittleEndian` must be a boolean, if present");if(LS(h))throw new Eo("Assertion failed: ArrayBuffer is detached");if(DS(E)?typeof k!="bigint":typeof k!="number")throw new Eo("Assertion failed: `value` must be a BigInt if type is ~BIGINT64~ or ~BIGUINT64~, otherwise a Number");var G=Lf.size["$"+E],me=arguments.length>6?arguments[6]:US==="little",pe=RS(E,k,me);if(re)throw new MS("SharedArrayBuffer is not supported by this implementation");var Ce=new BS(h,_,G);NS(pe,function(ae,ve){Ce[ve]=ae})},jS=ca,qS=is,GS=es,ZS=zo,WS=function(h){var _=jS(h);return GS(_)||_===0?0:ZS(_)?qS(_):_},HS=_n,XS=St,KS=Ip,JS=hl,ag=ml,Vd=function(h){var _=JS(h);if(!_)throw new XS("Assertion failed: `O` must be a TypedArray");var E=ag.size["$"+ag.name["$"+_]];if(!KS(E)||E<0)throw new HS("Assertion failed: Unknown TypedArray type `"+_+"`");return E},YS=_n,QS=St,eT=hl,tT=ml,rT=function(h){var _=eT(h);if(!_)throw new QS("Assertion failed: `O` must be a TypedArray");var E=tT.name["$"+_];if(typeof E!="string")throw new YS("Assertion failed: Unknown TypedArray type `"+_+"`");return E},yd={exports:{}},iT=hr,Rf,sg;function Ud(){if(sg)return Rf;sg=1;var d=St,h=ko(),_={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};return Rf=function(k){if(!k||typeof k!="object")return!1;for(var V in k)if(h(k,V)&&!_[V])return!1;var l=h(k,"[[Value]]")||h(k,"[[Writable]]"),re=h(k,"[[Get]]")||h(k,"[[Set]]");if(l&&re)throw new d("Property Descriptors may not be both accessor and data descriptors");return!0},Rf}var Ff,lg;function nT(){if(lg)return Ff;lg=1;var d=Sp,h=Iu,_=d.hasArrayLengthDefineBug(),E=_&&A_,k=Wt,V=k("Object.prototype.propertyIsEnumerable");return Ff=function(re,G,me,pe,Ce,ae){if(!h){if(!re(ae)||!ae["[[Configurable]]"]||!ae["[[Writable]]"]||Ce in pe&&V(pe,Ce)!==!!ae["[[Enumerable]]"])return!1;var ve=ae["[[Value]]"];return pe[Ce]=ve,G(pe[Ce],ve)}return _&&Ce==="length"&&"[[Value]]"in ae&&E(pe)&&pe.length!==ae["[[Value]]"]?(pe.length=ae["[[Value]]"],pe.length===ae["[[Value]]"]):(h(pe,Ce,me(ae)),!0)},Ff}var Of,ug;function oT(){return ug||(ug=1,Of=function(h){if(typeof h>"u")return h;var _={};return"[[Value]]"in h&&(_.value=h["[[Value]]"]),"[[Writable]]"in h&&(_.writable=!!h["[[Writable]]"]),"[[Get]]"in h&&(_.get=h["[[Get]]"]),"[[Set]]"in h&&(_.set=h["[[Set]]"]),"[[Enumerable]]"in h&&(_.enumerable=!!h["[[Enumerable]]"]),"[[Configurable]]"in h&&(_.configurable=!!h["[[Configurable]]"]),_}),Of}var Vf,cg;function aT(){if(cg)return Vf;cg=1;var d=St,h=Ud(),_=oT();return Vf=function(k){if(typeof k<"u"&&!h(k))throw new d("Assertion failed: `Desc` must be a Property Descriptor");return _(k)},Vf}var Uf,pg;function sT(){if(pg)return Uf;pg=1;var d=St,h=ko(),_=Ud();return Uf=function(k){if(typeof k>"u")return!1;if(!_(k))throw new d("Assertion failed: `Desc` must be a Property Descriptor");return!(!h(k,"[[Value]]")&&!h(k,"[[Writable]]"))},Uf}var q_=bp,Nf,hg;function lT(){return hg||(hg=1,Nf=function(h){return!!h}),Nf}var $f,fg;function uT(){if(fg)return $f;fg=1;var d=ko(),h=St,_=ua,E=q_,k=lT();return $f=function(l){if(!_(l))throw new h("ToPropertyDescriptor requires an object");var re={};if(d(l,"enumerable")&&(re["[[Enumerable]]"]=k(l.enumerable)),d(l,"configurable")&&(re["[[Configurable]]"]=k(l.configurable)),d(l,"value")&&(re["[[Value]]"]=l.value),d(l,"writable")&&(re["[[Writable]]"]=k(l.writable)),d(l,"get")){var G=l.get;if(typeof G<"u"&&!E(G))throw new h("getter must be a function");re["[[Get]]"]=G}if(d(l,"set")){var me=l.set;if(typeof me<"u"&&!E(me))throw new h("setter must be a function");re["[[Set]]"]=me}if((d(re,"[[Get]]")||d(re,"[[Set]]"))&&(d(re,"[[Value]]")||d(re,"[[Writable]]")))throw new h("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return re},$f}var jf,dg;function cT(){if(dg)return jf;dg=1;var d=St,h=ua,_=Ud(),E=nT(),k=aT(),V=sT(),l=Tp,re=k_,G=uT();return jf=function(pe,Ce,ae){if(!h(pe))throw new d("Assertion failed: Type(O) is not Object");if(!l(Ce))throw new d("Assertion failed: P is not a Property Key");var ve=_(ae)?ae:G(ae);if(!_(ve))throw new d("Assertion failed: Desc is not a valid Property Descriptor");return E(V,re,k,pe,Ce,ve)},jf}var pT=iT,mg=pT("%Reflect.construct%",!0),mp=cT();try{mp({},"",{"[[Get]]":function(){}})}catch{mp=null}if(mp&&mg){var yg={},vg={};mp(vg,"length",{"[[Get]]":function(){throw yg},"[[Enumerable]]":!0}),yd.exports=function(h){try{mg(h,vg)}catch(_){return _===yg}}}else yd.exports=function(h){return typeof h=="function"&&!!h.prototype};var G_=yd.exports,hT=hr,gg=hT("%Symbol.species%",!0),qf=St,_g=ua,fT=G_,dT=function(h,_){if(!_g(h))throw new qf("Assertion failed: Type(O) is not Object");var E=h.constructor;if(typeof E>"u")return _;if(!_g(E))throw new qf("O.constructor is not an Object");var k=gg?E[gg]:void 0;if(k==null)return _;if(fT(k))return k;throw new qf("no constructor found")},mT=St,Z_=Wt,xg=Z_("%ArrayBuffer.prototype.resizable%",!0),bg=Z_("%SharedArrayBuffer.prototype.growable%",!0),yT=fl,vT=ku,W_=function(h){var _=yT(h),E=vT(h);if(!_&&!E)throw new mT("Assertion failed: `arrayBuffer` must be an ArrayBuffer or SharedArrayBuffer");return _&&xg?!xg(h):E&&bg?!bg(h):!0},gT=Ip,wg=ko(),_T=yl,xT=gT,H_=function(h){return!!h&&typeof h=="object"&&wg(h,"[[Object]]")&&wg(h,"[[CachedBufferByteLength]]")&&(xT(h["[[CachedBufferByteLength]]"])&&h["[[CachedBufferByteLength]]"]>=0||h["[[CachedBufferByteLength]]"]==="DETACHED")&&_T(h["[[Object]]"])},bT=ua,X_=Wt,wT=X_("String.prototype.valueOf"),ST=function(h){try{return wT(h),!0}catch{return!1}},TT=X_("Object.prototype.toString"),IT="[object String]",AT=Mo()(),ET=function(h){return typeof h=="string"?!0:!h||typeof h!="object"?!1:AT?ST(h):TT(h)===IT},K_=Wt,PT=K_("Number.prototype.toString"),CT=function(h){try{return PT(h),!0}catch{return!1}},kT=K_("Object.prototype.toString"),MT="[object Number]",zT=Mo()(),BT=function(h){return typeof h=="number"?!0:!h||typeof h!="object"?!1:zT?CT(h):kT(h)===MT},J_=Wt,DT=J_("Boolean.prototype.toString"),LT=J_("Object.prototype.toString"),RT=function(h){try{return DT(h),!0}catch{return!1}},FT="[object Boolean]",OT=Mo()(),VT=function(h){return typeof h=="boolean"?!0:h===null||typeof h!="object"?!1:OT?RT(h):LT(h)===FT},vd={exports:{}},Sg=typeof BigInt<"u"&&BigInt,UT=function(){return typeof Sg=="function"&&typeof BigInt=="function"&&typeof Sg(42)=="bigint"&&typeof BigInt(42)=="bigint"},NT=UT();if(NT){var $T=BigInt.prototype.valueOf,jT=function(h){try{return $T.call(h),!0}catch{}return!1};vd.exports=function(h){return h===null||typeof h>"u"||typeof h=="boolean"||typeof h=="string"||typeof h=="number"||typeof h=="symbol"||typeof h=="function"?!1:typeof h=="bigint"?!0:jT(h)}}else vd.exports=function(h){return!1};var qT=vd.exports,GT=ET,ZT=BT,WT=VT,HT=D_(),XT=qT,KT=function(h){if(h==null||typeof h!="object"&&typeof h!="function")return null;if(GT(h))return"String";if(ZT(h))return"Number";if(WT(h))return"Boolean";if(HT(h))return"Symbol";if(XT(h))return"BigInt"},Nd=typeof Map=="function"&&Map.prototype?Map:null,JT=typeof Set=="function"&&Set.prototype?Set:null,yp;Nd||(yp=function(h){return!1});var Y_=Nd?Map.prototype.has:null,Tg=JT?Set.prototype.has:null;!yp&&!Y_&&(yp=function(h){return!1});var YT=yp||function(h){if(!h||typeof h!="object")return!1;try{if(Y_.call(h),Tg)try{Tg.call(h)}catch{return!0}return h instanceof Nd}catch{}return!1},QT=typeof Map=="function"&&Map.prototype?Map:null,$d=typeof Set=="function"&&Set.prototype?Set:null,vp;$d||(vp=function(h){return!1});var Ig=QT?Map.prototype.has:null,Q_=$d?Set.prototype.has:null;!vp&&!Q_&&(vp=function(h){return!1});var eI=vp||function(h){if(!h||typeof h!="object")return!1;try{if(Q_.call(h),Ig)try{Ig.call(h)}catch{return!0}return h instanceof $d}catch{}return!1},gp=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,Ag=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,_p;gp||(_p=function(h){return!1});var gd=gp?gp.prototype.has:null,Gf=Ag?Ag.prototype.has:null;!_p&&!gd&&(_p=function(h){return!1});var tI=_p||function(h){if(!h||typeof h!="object")return!1;try{if(gd.call(h,gd),Gf)try{Gf.call(h,Gf)}catch{return!0}return h instanceof gp}catch{}return!1},_d={exports:{}},rI=hr,ex=Wt,iI=rI("%WeakSet%",!0),Zf=ex("WeakSet.prototype.has",!0);if(Zf){var Wf=ex("WeakMap.prototype.has",!0);_d.exports=function(h){if(!h||typeof h!="object")return!1;try{if(Zf(h,Zf),Wf)try{Wf(h,Wf)}catch{return!0}return h instanceof iI}catch{}return!1}}else _d.exports=function(h){return!1};var nI=_d.exports,oI=YT,aI=eI,sI=tI,lI=nI,uI=function(h){if(h&&typeof h=="object"){if(oI(h))return"Map";if(aI(h))return"Set";if(sI(h))return"WeakMap";if(lI(h))return"WeakSet"}return!1},cI=Wt,pI=cI("WeakRef.prototype.deref",!0),hI=typeof WeakRef>"u"?function(h){return!1}:function(h){if(!h||typeof h!="object")return!1;try{return pI(h),!0}catch{return!1}},fI=Wt,Eg=fI("FinalizationRegistry.prototype.register",!0),dI=Eg?function(h){if(!h||typeof h!="object")return!1;try{return Eg(h,{},null),!0}catch{return!1}}:function(h){return!1},Su=function(){return typeof(function(){}).name=="string"},bu=Object.getOwnPropertyDescriptor;if(bu)try{bu([],"length")}catch{bu=null}Su.functionsHaveConfigurableNames=function(){if(!Su()||!bu)return!1;var h=bu(function(){},"name");return!!h&&!!h.configurable};var mI=Function.prototype.bind;Su.boundFunctionsHaveNames=function(){return Su()&&typeof mI=="function"&&(function(){}).bind().name!==""};var tx=Su,rx=bp,yI=ko(),vI=tx(),jd=Wt,ix=jd("Function.prototype.toString"),nx=jd("String.prototype.match"),Hf=jd("Object.prototype.toString"),gI=/^class /,_I=function(h){if(rx(h)||typeof h!="function")return!1;try{var _=nx(ix(h),gI);return!!_}catch{}return!1},xI=/\s*function\s+([^(\s]*)\s*/,bI=!(0 in[,]),wI="[object Object]",SI="[object HTMLAllCollection]",TI=Function.prototype,ox=function(){return!1};if(typeof document=="object"){var II=document.all;Hf(II)===Hf(document.all)&&(ox=function(h){if((bI||!h)&&(typeof h>"u"||typeof h=="object"))try{var _=Hf(h);return(_===SI||_===wI)&&h("")==null}catch{}return!1})}var ax=function(){if(ox(this)||!_I(this)&&!rx(this))throw new TypeError("Function.prototype.name sham getter called on non-function");if(vI&&yI(this,"name"))return this.name;if(this===TI)return"";var h=ix(this),_=nx(h,xI),E=_&&_[1];return E},AI=ax,sx=function(){return AI},EI=Cu.supportsDescriptors,PI=tx(),CI=sx,Pg=Object.defineProperty,kI=TypeError,MI=function(){var h=CI();if(PI)return h;if(!EI)throw new kI("Shimming Function.prototype.name support requires ES5 property descriptor support.");var _=Function.prototype;return Pg(_,"name",{configurable:!0,enumerable:!1,get:function(){var E=h.call(this);return this!==_&&Pg(this,"name",{configurable:!0,enumerable:!1,value:E,writable:!1}),E}}),h},zI=Cu,BI=sa,lx=ax,DI=sx,LI=MI,ux=BI(lx);zI(ux,{getPolyfill:DI,implementation:lx,shim:LI});var RI=ux,cx=Wt,FI=Ap(),OI=FI(/^\s*(?:function)?\*/),px=Mo()(),Xf=ts,VI=cx("Object.prototype.toString"),UI=cx("Function.prototype.toString"),NI=function(){if(!px)return!1;try{return Function("return function*() {}")()}catch{}},Kf,$I=function(h){if(typeof h!="function")return!1;if(OI(UI(h)))return!0;if(!px){var _=VI(h);return _==="[object GeneratorFunction]"}if(!Xf)return!1;if(typeof Kf>"u"){var E=NI();Kf=E?Xf(E):!1}return Xf(h)===Kf},Jf,Cg;function jI(){if(Cg)return Jf;Cg=1;const d=(async function(){}).constructor;return Jf=()=>d,Jf}var hx=Wt,qI=Ap(),GI=hx("Object.prototype.toString"),ZI=hx("Function.prototype.toString"),WI=qI(/^\s*async(?:\s+function(?:\s+|\()|\s*\()/),HI=Mo()(),kg=ts,XI=jI(),KI=function(h){if(typeof h!="function")return!1;if(WI(ZI(h)))return!0;if(!HI){var _=GI(h);return _==="[object AsyncFunction]"}if(!kg)return!1;var E=XI();return E&&E.prototype===kg(h)},JI=KT,YI=uI,QI=hl,eA=P_(),tA=z_,rA=B_,iA=hI,nA=dI,oA=RI,aA=$I,sA=KI,lA=Wt,uA=Mo()(),Yf=uA&&Symbol.toStringTag,cA=Object,Mg=lA("Promise.prototype.then",!0),pA=function(h){if(!h||typeof h!="object"||!Mg)return!1;try{return Mg(h,null,function(){}),!0}catch{}return!1},zg=function(h){return!!h&&h!=="BigInt"&&h!=="Boolean"&&h!=="Null"&&h!=="Number"&&h!=="String"&&h!=="Symbol"&&h!=="Undefined"&&h!=="Math"&&h!=="JSON"&&h!=="Reflect"&&h!=="Atomics"&&h!=="Map"&&h!=="Set"&&h!=="WeakMap"&&h!=="WeakSet"&&h!=="BigInt64Array"&&h!=="BigUint64Array"&&h!=="Float32Array"&&h!=="Float64Array"&&h!=="Int16Array"&&h!=="Int32Array"&&h!=="Int8Array"&&h!=="Uint16Array"&&h!=="Uint32Array"&&h!=="Uint8Array"&&h!=="Uint8ClampedArray"&&h!=="Array"&&h!=="Date"&&h!=="FinalizationRegistry"&&h!=="Promise"&&h!=="RegExp"&&h!=="WeakRef"&&h!=="Function"&&h!=="GeneratorFunction"&&h!=="AsyncFunction"},hA=function(h){if(h==null)return h;var _=JI(cA(h))||YI(h)||QI(h);if(_)return _;if(eA(h))return"Array";if(tA(h))return"Date";if(rA(h))return"RegExp";if(iA(h))return"WeakRef";if(nA(h))return"FinalizationRegistry";if(typeof h=="function")return aA(h)?"GeneratorFunction":sA(h)?"AsyncFunction":"Function";if(pA(h))return"Promise";if(Yf&&Yf in h){var E=h[Yf];if(zg(E))return E}if(typeof h.constructor=="function"){var k=oA(h.constructor);if(zg(k))return k}return"Object"},fA=hr,dA=q_,mA=bT,yA=hA,vA=St,Bg=ts,gA=Sd,_A=function(h){if(!mA(h))throw new vA("Reflect.getPrototypeOf called on non-object");if(Bg)return Bg(h);var _=yA(h);if(_){var E=fA("%"+_+".prototype%",!0);if(E)return E}return dA(h.constructor)?h.constructor.prototype:h instanceof Object?gA.prototype:null},xA=_A,Dg=ts,fx=function(){return typeof Reflect=="object"&&Reflect&&Reflect.getPrototypeOf?Reflect.getPrototypeOf:Dg?function(_){return Dg(_)}:xA},dx=wd,bA=sa,wA=fx(),SA=Tu(),xd={__proto__:null},Wc=Co,Lg=Object.defineProperty;if(Wc){var TA=function(d){return d.byteOffset};dx(SA,function(d){if(typeof st.commonjsGlobal[d]=="function"||typeof st.commonjsGlobal[d]=="object"){var h=st.commonjsGlobal[d].prototype,_=Wc(h,"byteOffset");if(!_){var E=wA(h);_=Wc(E,"byteOffset")}if(_&&_.get)xd[d]=bA(_.get);else if(Lg){var k=new st.commonjsGlobal[d](2);_=Wc(k,"byteOffset"),_&&_.configurable&&Lg(k,"length",{value:3}),k.length===2&&(xd[d]=TA)}}})}var IA=function(h){var _;return dx(xd,function(E){if(typeof _!="number")try{var k=E(h);typeof k=="number"&&(_=k)}catch{}}),_},AA=yl,qd=function(h){return AA(h)?IA(h):!1},EA=sa,mx=wd,Hc=Co,PA=yl,CA=Yg,kA=fx(),bd={__proto__:null},Rg=Object.defineProperty;if(Hc){var MA=function(d){return d.length};mx(CA,function(d){var h=st.commonjsGlobal[d];if(typeof h=="function"||typeof h=="object"){var _=h.prototype,E=Hc(_,"length");if(!E){var k=kA(_);E=Hc(k,"length")}if(E&&E.get)bd["$"+d]=EA(E.get);else if(Rg){var V=new st.commonjsGlobal[d](2);E=Hc(V,"length"),E&&E.configurable&&Rg(V,"length",{value:3}),V.length===2&&(bd["$"+d]=MA)}}})}var zA=function(h){var _;return mx(bd,function(E){if(typeof _!="number")try{var k=E(h);typeof k=="number"&&(_=k)}catch{}}),_},yx=function(h){return PA(h)?zA(h):!1},Fg=St,BA=dl,DA=W_,LA=Vd,RA=H_,Og=Mu,FA=qd,OA=yx,Gd=function(h){if(!RA(h))throw new Fg("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");var _=h["[[Object]]"],E=h["[[CachedBufferByteLength]]"];if(BA(Og(_))&&E!=="DETACHED")throw new Fg("Assertion failed: typed array is detached only if the byte length is ~DETACHED~");if(E==="DETACHED")return!0;var k=FA(_),V=DA(Og(_)),l,re=V?OA(_):"AUTO";if(re==="AUTO")l=E;else{var G=LA(_);l=k+re*G}return k>E||l>E},Xc=St,VA=Od,UA=W_,NA=Gd,$A=Vd,jA=H_,qA=Mu,GA=qd,ZA=yx,WA=function(h){if(!jA(h))throw new Xc("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");if(NA(h))throw new Xc("Assertion failed: `taRecord` is out of bounds");var _=h["[[Object]]"],E=UA(qA(_)),k=E?ZA(_):"AUTO";if(k!=="AUTO")return k;if(E)throw new Xc("Assertion failed: array buffer is not fixed length");var V=GA(_),l=$A(_),re=h["[[CachedBufferByteLength]]"];if(re==="DETACHED")throw new Xc("Assertion failed: typed array is detached");return VA((re-V)/l)},Qf=St,HA=dl,XA=fl,KA=ku,JA=S_,YA=Wt,QA=YA("SharedArrayBuffer.prototype.byteLength",!0),eE=function(h,_){var E=KA(h);if(!XA(h)&&!E)throw new Qf("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(_!=="SEQ-CST"&&_!=="UNORDERED")throw new Qf("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(HA(h))throw new Qf("Assertion failed: `arrayBuffer` must not be detached");return E?QA(h):JA(h)},Vg=St,tE=eE,rE=dl,iE=yl,nE=Mu,oE=function(h,_){if(!iE(h))throw new Vg("Assertion failed: `obj` must be a Typed Array");if(_!=="SEQ-CST"&&_!=="UNORDERED")throw new Vg("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");var E=nE(h),k=rE(E)?"DETACHED":tE(E,_);return{"[[Object]]":h,"[[CachedBufferByteLength]]":k}},Kc=St,aE=ua,sE=Gd,lE=oE,uE=yl,vx=function(h,_){if(_!=="SEQ-CST"&&_!=="UNORDERED")throw new Kc("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(!aE(h))throw new Kc("Assertion failed: `O` must be an Object");if(!uE(h))throw new Kc("Assertion failed: `O` must be a Typed Array");var E=lE(h,_);if(sE(E))throw new Kc("`O` must be in-bounds and backed by a non-detached buffer");return E},cE=_n,Jc=St,pE=Fd,hE=G_,fE=Gd,dE=WA,mE=vx,yE=Tu(),vE=function(h,_){if(!hE(h))throw new Jc("Assertion failed: `constructor` must be a constructor");if(!pE(_))throw new Jc("Assertion failed: `argumentList` must be a List");if(yE.length===0)throw new cE("Assertion failed: Typed Arrays are not supported in this environment");var E;_.length===0?E=new h:_.length===1?E=new h(_[0]):_.length===2?E=new h(_[0],_[1]):E=new h(_[0],_[1],_[2]);var k=mE(E,"SEQ-CST");if(_.length===1&&typeof _[0]=="number"){if(fE(k))throw new Jc("new Typed Array is out of bounds");var V=dE(k);if(V<_[0])throw new Jc("`argumentList[0]` must be <= `newTypedArray.length`")}return E},an=hr,gE={__proto__:null,$Int8Array:an("%Int8Array%",!0),$Uint8Array:an("%Uint8Array%",!0),$Uint8ClampedArray:an("%Uint8ClampedArray%",!0),$Int16Array:an("%Int16Array%",!0),$Uint16Array:an("%Uint16Array%",!0),$Int32Array:an("%Int32Array%",!0),$Uint32Array:an("%Uint32Array%",!0),$BigInt64Array:an("%BigInt64Array%",!0),$BigUint64Array:an("%BigUint64Array%",!0),$Float16Array:an("%Float16Array%",!0),$Float32Array:an("%Float32Array%",!0),$Float64Array:an("%Float64Array%",!0)},_E=function(h){return gE["$"+h]},Ug=_n,Ng=St,xE=hl,bE=Tu(),wE=Fd,SE=dT,TE=vE,IE=_E,AE=function(h,_){if(bE.length===0)throw new Ug("Assertion failed: Typed Arrays are not supported in this environment");var E=xE(h);if(!E)throw new Ng("Assertion failed: exemplar must be a TypedArray");if(!wE(_))throw new Ng("Assertion failed: `argumentList` must be a List");var k=IE(E);if(typeof k!="function")throw new Ug("Assertion failed: `constructor` of `exemplar` ("+E+") must exist. Please report this!");var V=SE(h,k);return TE(V,_)},EE=St,PE=jw,CE=B2,kE=dl,ed=Id,$g=Ad,ME=R2,zE=$S,jg=WS,qg=U_,BE=Vd,Gg=rT,DE=AE,LE=vx,td=Mu,Zg=qd,gx=function(h,_){var E=this;LE(E,"SEQ-CST");var k=E.length,V=jg(h),l;V===-1/0?l=0:V<0?l=ed(k+V,0):l=$g(V,k);var re=typeof _>"u"?k:jg(_),G;re===-1/0?G=0:re<0?G=ed(k+re,0):G=$g(re,k);var me=ed(G-l,0),pe=DE(E,[me]);if(me>0){if(kE(td(E)))throw new EE("Cannot use a Typed Array with an underlying ArrayBuffer that is detached");var Ce=Gg(E),ae=Gg(pe);if(Ce===ae)for(var ve=td(E),ke=td(pe),Xe=BE(E),$e=Zg(E),At=l*Xe+$e,et=Zg(pe),dt=et+me*Xe;et<dt;){var Rt=CE(ve,At,"UINT8",!0,"UNORDERED");zE(ke,et,"UINT8",Rt,!0,"UNORDERED"),At+=1,et+=1}else for(var Gt=0;l<G;){var Qt=qg(l),fr=PE(E,Qt);ME(pe,qg(Gt),fr,!0),l+=1,Gt+=1}}return pe},RE=gx,_x=function(){return typeof Uint8Array=="function"&&Uint8Array.prototype.slice||RE},FE=Cu,OE=ts,VE=_x,UE=function(){if(typeof Uint8Array=="function"){var h=VE(),_=OE(Uint8Array.prototype);FE(_,{slice:h},{slice:function(){return _.slice!==h}})}return h},NE=Cu,$E=sa,jE=gx,xx=_x,qE=UE,bx=$E(xx());NE(bx,{getPolyfill:xx,implementation:jE,shim:qE});var GE=bx,wx=hl,Sx=GE,Wg=Co;function gl(d){return Object.prototype.toString.call(d)}function ZE(d){return gl(d)==="[object Date]"}function WE(d){return gl(d)==="[object RegExp]"}function HE(d){return gl(d)==="[object Error]"}function XE(d){return gl(d)==="[object Boolean]"}function KE(d){return gl(d)==="[object Number]"}function JE(d){return gl(d)==="[object String]"}var Tx=Array.isArray||function(h){return Object.prototype.toString.call(h)==="[object Array]"};function Ep(d,h){if(d.forEach)return d.forEach(h);for(var _=0;_<d.length;_++)h(d[_],_,d)}var Pp=Object.keys||function(h){var _=[];for(var E in h)_[_.length]=E;return _},YE=Object.prototype.propertyIsEnumerable,Hg=Object.getOwnPropertySymbols;function Cp(d){var h=Pp(d);if(Hg)for(var _=Hg(d),E=0;E<_.length;E++)YE.call(d,_[E])&&(h[h.length]=_[E]);return h}var kp=Object.prototype.hasOwnProperty||function(d,h){return h in d};function QE(d,h){if(typeof Wg!="function")return!0;var _=Wg(d,h);return!_||!_.writable}function Ix(d,h){if(typeof d=="object"&&d!==null){var _;if(Tx(d))_=[];else if(ZE(d))_=new Date(d.getTime?d.getTime():d);else if(WE(d))_=new RegExp(d);else if(HE(d))_={message:d.message};else if(XE(d)||KE(d)||JE(d))_=Object(d);else{var E=wx(d);if(E)return Sx(d);if(Object.create&&Object.getPrototypeOf)_=Object.create(Object.getPrototypeOf(d));else if(d.constructor===Object)_={};else{var k=d.constructor&&d.constructor.prototype||d.__proto__||{},V=function(){};V.prototype=k,_=new V}}var l=h.includeSymbols?Cp:Pp;return Ep(l(d),function(re){_[re]=d[re]}),_}return d}var Zd={__proto__:null};function Ax(d,h){var _=[],E=[],k=!0,V=arguments.length>2?arguments[2]:Zd,l=V.includeSymbols?Cp:Pp,re=!!V.immutable;return function G(me){var pe=re?Ix(me,V):me,Ce={__proto__:null},ae=!0,ve={node:pe,node_:me,path:[].concat(_),parent:E[E.length-1],parents:E,key:_[_.length-1],removedKeys:{__proto__:null},isRoot:_.length===0,level:_.length,circular:null,update:function($e,At){ve.isRoot||(ve.parent.node[ve.key]=$e),ve.node=$e,At&&(ae=!1)},delete:function($e){delete ve.parent.node[ve.key],ve.parent.removedKeys[ve.key]=!0,$e&&(ae=!1)},remove:function($e){Tx(ve.parent.node)?(ve.parent.node.splice(ve.key,1),ve.parent.removedKeys[ve.key]=!0,$e&&(ae=!1)):ve.delete($e)},keys:null,before:function($e){Ce.before=$e},after:function($e){Ce.after=$e},pre:function($e){Ce.pre=$e},post:function($e){Ce.post=$e},stop:function(){k=!1},block:function(){ae=!1}};if(!k)return ve;function ke(){if(typeof ve.node=="object"&&ve.node!==null){(!ve.keys||ve.node_!==ve.node)&&(ve.keys=l(ve.node)),ve.isLeaf=ve.keys.length===0;for(var $e=0;$e<E.length;$e++)if(E[$e].node_===me){ve.circular=E[$e];break}}else ve.isLeaf=!0,ve.keys=null;ve.notLeaf=!ve.isLeaf,ve.notRoot=!ve.isRoot}ke();var Xe=h.call(ve,ve.node);return Xe!==void 0&&ve.update&&ve.update(Xe),Ce.before&&Ce.before.call(ve,ve.node),ae&&(typeof ve.node=="object"&&ve.node!==null&&!ve.circular&&(E[E.length]=ve,ke(),Ep(ve.keys,function($e,At){var et=At-1 in ve.removedKeys;et&&($e=ve.keys[At-1]),_[_.length]=$e,Ce.pre&&Ce.pre.call(ve,ve.node[$e],$e);var dt=G(ve.node[$e]);re&&kp.call(ve.node,$e)&&!QE(ve.node,$e)&&!et&&(ve.node[$e]=dt.node),dt.isLast=At===ve.keys.length-1,dt.isFirst=At===0,Ce.post&&Ce.post.call(ve,dt),_.pop()}),E.pop()),Ce.after&&Ce.after.call(ve,ve.node)),ve}(d).node}function sn(d){this.options=arguments.length>1?arguments[1]:Zd,this.value=d}sn.prototype.get=function(d){for(var h=this.value,_=0;h&&_<d.length;_++){var E=d[_];if(!kp.call(h,E)||!this.options.includeSymbols&&typeof E=="symbol")return;h=h[E]}return h};sn.prototype.has=function(d){var h=this.value;if(!h&&d.length>0)return!1;for(var _=0;h&&_<d.length;_++){var E=d[_];if(!kp.call(h,E)||!this.options.includeSymbols&&typeof E=="symbol")return!1;h=h[E]}return!0};sn.prototype.set=function(d,h){for(var _=this.value,E=0;E<d.length-1;E++){var k=d[E];kp.call(_,k)||(_[k]={}),_=_[k]}return _[d[E]]=h,h};sn.prototype.map=function(d){return Ax(this.value,d,{__proto__:null,immutable:!0,includeSymbols:!!this.options.includeSymbols})};sn.prototype.forEach=function(d){return this.value=Ax(this.value,d,this.options),this.value};sn.prototype.reduce=function(d,h){var _=arguments.length===1,E=_?this.value:h;return this.forEach(function(k){(!this.isRoot||!_)&&(E=d.call(this,E,k))}),E};sn.prototype.paths=function(){var d=[];return this.forEach(function(){d[d.length]=this.path}),d};sn.prototype.nodes=function(){var d=[];return this.forEach(function(){d[d.length]=this.node}),d};sn.prototype.clone=function(){var d=[],h=[],_=this.options;return wx(this.value)?Sx(this.value):function E(k){for(var V=0;V<d.length;V++)if(d[V]===k)return h[V];if(typeof k=="object"&&k!==null){var l=Ix(k,_);d[d.length]=k,h[h.length]=l;var re=_.includeSymbols?Cp:Pp;return Ep(re(k),function(G){l[G]=E(k[G])}),d.pop(),h.pop(),l}return k}(this.value)};function Ex(d){var h=arguments.length>1?arguments[1]:Zd;return new sn(d,h)}Ep(Cp(sn.prototype),function(d){Ex[d]=function(h){var _=[].slice.call(arguments,1),E=new sn(h);return E[d].apply(E,_)}});var eP=Ex,tP=wi;function wi(d){if(!(this instanceof wi))return new wi(d);this._bbox=d||[1/0,1/0,-1/0,-1/0],this._valid=!!d}wi.prototype.include=function(d){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],d[0]),this._bbox[1]=Math.min(this._bbox[1],d[1]),this._bbox[2]=Math.max(this._bbox[2],d[0]),this._bbox[3]=Math.max(this._bbox[3],d[1]),this};wi.prototype.equals=function(d){var h;return d instanceof wi?h=d.bbox():h=d,this._bbox[0]==h[0]&&this._bbox[1]==h[1]&&this._bbox[2]==h[2]&&this._bbox[3]==h[3]};wi.prototype.center=function(d){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null};wi.prototype.union=function(d){this._valid=!0;var h;return d instanceof wi?h=d.bbox():h=d,this._bbox[0]=Math.min(this._bbox[0],h[0]),this._bbox[1]=Math.min(this._bbox[1],h[1]),this._bbox[2]=Math.max(this._bbox[2],h[2]),this._bbox[3]=Math.max(this._bbox[3],h[3]),this};wi.prototype.bbox=function(){return this._valid?this._bbox:null};wi.prototype.contains=function(d){if(!d)return this._fastContains();if(!this._valid)return null;var h=d[0],_=d[1];return this._bbox[0]<=h&&this._bbox[1]<=_&&this._bbox[2]>=h&&this._bbox[3]>=_};wi.prototype.intersect=function(d){if(!this._valid)return null;var h;return d instanceof wi?h=d.bbox():h=d,!(this._bbox[0]>h[2]||this._bbox[2]<h[0]||this._bbox[3]<h[1]||this._bbox[1]>h[3])};wi.prototype._fastContains=function(){if(!this._valid)return new Function("return null;");var d="return "+this._bbox[0]+"<= ll[0] &&"+this._bbox[1]+"<= ll[1] &&"+this._bbox[2]+">= ll[0] &&"+this._bbox[3]+">= ll[1]";return new Function("ll",d)};wi.prototype.polygon=function(){return this._valid?{type:"Polygon",coordinates:[[[this._bbox[0],this._bbox[1]],[this._bbox[2],this._bbox[1]],[this._bbox[2],this._bbox[3]],[this._bbox[0],this._bbox[3]],[this._bbox[0],this._bbox[1]]]]}:null};var rP=g0,iP=eP,nP=tP,Px={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},oP=Object.keys(Px);xp.exports=function(d){return Wd(d).bbox()};xp.exports.polygon=function(d){return Wd(d).polygon()};xp.exports.bboxify=function(d){return iP(d).map(function(h){if(h){var _=oP.some(function(E){return h[E]?Px[E].indexOf(h.type)!==-1:!1});_&&(h.bbox=Wd(h).bbox(),this.update(h))}})};function Wd(d){for(var h=nP(),_=rP(d),E=0;E<_.length;E++)h.include(_[E]);return h}var aP=xp.exports;const sP=st.getDefaultExportFromCjs(aP),lP={methods:{getIconDetails(d){const h={};switch(d){case"cities":h.name="fa-regular fa-city";break;case"towns":h.name="fa-regular fa-house-chimney-window";break;case"islands":h.name="fa-regular fa-ship";break;case"regions":h.name="fa-regular fa-map-location-dot";break;case"national-parks":h.name="fa-kit fa-vs-icon-national-park";break;case"acco":h.name="fa-regular fa-bed";break;case"acti":h.name="fa-regular fa-person-walking";break;case"attr":h.name="fa-regular fa-camera";break;case"even":h.name="fa-regular fa-ticket";break;case"cate":h.name="fa-regular fa-utensils";break;case"reta":h.name="fa-regular fa-bag-shopping";break;case"featured":h.name="fa-solid fa-star";break;case"twnv":h.name="";break;case"vics":h.name="fa-kit fa-vs-icentre-information";break;case"outlander-castle":h.name="fa-regular fa-chess-rook";break;case"outlander-church-abbey":h.name="fa-regular fa-church";break;case"outlander-city-town-village":h.name="fa-regular fa-city";break;case"outlander-heritage":h.name="fa-regular fa-landmark";break;case"outlander-landscape-park":h.name="fa-regular fa-mountain";break;case"outlander-palace-house":h.name="fa-regular fa-crown";break;case"distilleries":h.name="fa-kit fa-vs-distillery";break;case"itinerary-stop":h.name="";break}return h}}},uP={name:"VsMapMarkerIcon",status:"prototype",release:"0.0.1",components:{VsIcon:st.VsIcon},mixins:[lP],props:{id:{type:String,required:!0},isHovered:{type:Boolean,default:!1},number:{type:String,default:""},isMapMarker:{type:Boolean,default:!1}},computed:{mapMarkerType(){let d="fa-solid fa-location-pin";return this.id==="twnv"&&(d="fa-solid fa-location-dot"),d},parentClasses(){return this.isMapMarker?"vs-map-marker-icon--map-marker":""},markerClasses(){return[`vs-map-marker-icon__marker--${this.id}`,this.isHovered?"vs-map-marker-icon__marker--outline":""]}}},cP={key:0,class:"vs-map-marker-icon__count"};function pP(d,h,_,E,k,V){const l=F.resolveComponent("VsIcon");return F.openBlock(),F.createElementBlock("div",{"data-test":"vs-map-marker-icon",class:F.normalizeClass(["vs-map-marker-icon",V.parentClasses])},[F.createVNode(l,{icon:V.mapMarkerType,class:F.normalizeClass(["vs-map-marker-icon__marker",V.markerClasses]),size:"xl"},null,8,["icon","class"]),_.number?(F.openBlock(),F.createElementBlock("span",cP,[h[0]||(h[0]=F.createElementVNode("span",{class:"visually-hidden"}," Stop ",-1)),F.createTextVNode(" "+F.toDisplayString(_.number),1)])):(F.openBlock(),F.createBlock(l,{key:1,class:"vs-map-marker-icon__icon",icon:d.getIconDetails(_.id).name,size:"xs"},null,8,["icon"]))],2)}const Mp=st._export_sfc(uP,[["render",pP]]);let Xa=null;const hP={name:"VsMapMarker",status:"prototype",release:"0.0.1",components:{VsMapMarkerIcon:Mp},props:{feature:{type:Object,required:!0},mapId:{type:String,required:!0},hasPopups:{type:Boolean,required:!0},selectedPlace:{type:String,default:null}},emits:["showDetail","setCategory"],setup(){Xa=Xi()},computed:{isActive(){return!!(this.activePlace&&this.activePlace.properties&&this.activePlace.properties.id===this.feature.properties.id||this.highlightedPlace&&this.highlightedPlace.properties&&this.highlightedPlace.properties.id===this.feature.properties.id)},...aa.mapState(Xi,{highlightedPlace(d){return d.getHoveredStop(this.mapId)},activePlace(d){return d.getActivePlace(this.mapId)?d.getActivePlace(this.mapId):""},activeSubcat(d){return d.selectedSubCategory}}),getMarkerIcon(){let d;return this.feature.properties.type!==""?d=this.feature.properties.type:this.activeSubcat!==null?d=this.activeSubcat:d="featured",d==="null"&&(d=""),d}},watch:{isActive(){return this.activePlace&&this.activePlace.properties.id===this.feature.properties.id||this.highlightedPlace&&this.highlightedPlace.properties.id===this.feature.properties.id?!0:(this.activePlace&&this.activePlace.properties.id===this.feature.properties.id&&Xa.setActiveMarkerPos(this.feature.geometry.coordinates),!1)},activePlace(){this.activePlace&&this.activePlace.properties.id===this.feature.properties.id&&Xa.setActiveMarkerPos(this.feature.geometry.coordinates)}},mounted(){this.hasPopups&&document.body.addEventListener("click",this.handleClickEvent)},beforeUnmount(){document.body.removeEventListener("click",this.handleClickEvent)},methods:{markerClick(){Xa.setActiveMarkerPos(this.feature.geometry.coordinates),Xa.setActivePlace({mapId:this.mapId,activeFeature:this.feature}),this.$emit("showDetail",this.feature),this.$emit("setCategory",this.feature.properties.type)},handleHover(d){Xa.setHoveredPlace({mapId:this.mapId,hoveredFeature:d})},handleClickEvent(d){const h=document.getElementsByClassName("mapboxgl-canvas");d.target===h[0]&&Xa.setActivePlace({mapId:this.mapId,activeFeature:null})}}},fP=["aria-label"];function dP(d,h,_,E,k,V){const l=F.resolveComponent("VsMapMarkerIcon");return F.openBlock(),F.createElementBlock("button",{type:"button",class:F.normalizeClass(["vs-map-marker",V.isActive?"vs-map-marker--active":""]),"data-test":"vs-map-marker",onClick:h[0]||(h[0]=(...re)=>V.markerClick&&V.markerClick(...re)),onKeydown:h[1]||(h[1]=F.withKeys((...re)=>V.markerClick&&V.markerClick(...re),["enter"])),onMouseover:h[2]||(h[2]=re=>V.handleHover(_.feature)),onMouseleave:h[3]||(h[3]=re=>V.handleHover("")),onFocusin:h[4]||(h[4]=re=>V.handleHover(_.feature)),onFocusout:h[5]||(h[5]=re=>V.handleHover("")),"aria-label":V.getMarkerIcon},[F.createVNode(l,{id:V.getMarkerIcon,"is-map-marker":!0,number:_.feature.properties.stopCount?_.feature.properties.stopCount:""},null,8,["id","number"])],42,fP)}const Cx=st._export_sfc(hP,[["render",dP]]);let al=null;const mP={name:"VsMap",status:"prototype",release:"0.0.1",components:{VsWarning:st.VsWarning,VsLoading:st.VsLoading},props:{overviewMapLatitude:{type:String,default:"57.81"},overviewMapLongitude:{type:String,default:"-5.51748"},overviewMapZoom:{type:String,default:"5"},mapId:{type:String,required:!0},isVisible:{type:Boolean,required:!0},places:{type:Array,required:!0},filters:{type:Array,default(){return[]}},fitToMarkers:{type:Boolean,default:!1},showPolygons:{type:Boolean,default:!1},selectedItem:{type:Object,default:null},boundsData:{type:Object,default:()=>{}},showInfoMessage:{type:Boolean,default:null},resetZoom:{type:Boolean,default:!1},showMarkerPopups:{type:Boolean,default:!0},loadBrandingImmediately:{type:Boolean,default:!1}},emits:["map-ready","setCategory","showDetail","zoom-reset"],setup(){al=Xi()},data(){return{isDesktop:!1,geojsonData:{type:"FeatureCollection",features:[]},polygons:{type:"FeatureCollection",features:[]},multiPolygons:[],mapbox:{map:null,bounds:null,rotation:0,config:{container:this.$refs.mapbox,style:"https://api.visitscotland.com/maps/vector/v1/vts/resources/styles",pitchWithRotate:!1,dragRotate:!1}},markers:[],popup:null,hoveredStateId:null,activeStateId:null,showMapMessage:!0,isLoading:!0,showZoomMessage:null}},computed:{getZoom(){return this.mapbox.map?this.mapbox.map.getZoom():null},...aa.mapState(Xi,{activeMarkerPostion(d){return this.mapbox.map?d.activeMarkerPos:null},highlightedPlace(d){return this.mapbox.map?d.getHoveredStop(this.mapId):null},activePlace(d){return this.mapbox.map?d.getActivePlace(this.mapId):null}})},watch:{isVisible(d){d&&this.mapbox.map!==null&&setTimeout(()=>{this.mapbox.map.resize()},20)},places:{handler(){this.geojsonData.features=[],this.initialiseMapFeatures(),this.initialiseMapMarkers()},deep:!0},showPolygons(d){d===!0?this.showMapPolygons():this.hideMapPolygons()},highlightedPlace(d){d&&(d.length===0?this.removeHoveredPolygon():d.geometry.type!=="Point"&&this.addHoveredPolygon(d))},selectedItem(d){if(d&&d.geometry.type!=="Point"){let h=[];h=this.polygons.features.filter(_=>_.properties.id===d.properties.id),h.length>0&&this.addActivePolygon(d)}d||this.removeActivePolygon()},activeMarkerPostion(d){this.checkPointIsVisible(d)||this.centreMapOnPoint(d)},showInfoMessage(d){d?this.showMapMessage=!0:this.showMapMessage=!1},resetZoom(d){d&&(this.mapbox.map.fitBounds(this.calculateBoundingBox()),this.$emit("zoom-reset"),this.showInfoMessage&&(this.showMapMessage=!0))}},mounted(){al.addMapInstance({id:this.mapId,filters:this.filters,places:this.places,activePins:this.places}),this.lazyloadMapComponent(),this.isTablet=window.innerWidth>=768,window.addEventListener("resize",this.onResize),this.loadBrandingImmediately?dy.init({div:this.mapId}):window.addEventListener("DOMContentLoaded",()=>{dy.init({div:this.mapId})})},methods:{addMap(){const d=this.calculateBoundingBox();this.mapbox.config.container=this.$refs.mapbox,this.mapbox.map=new Zn.Map({container:this.$refs.mapbox,style:"https://api.visitscotland.com/maps/vector/v1/vts/resources/styles",bounds:d,maxZoom:18,minZoom:4,trackResize:!0}),this.mapbox.map.scrollZoom.disable(),this.mapbox.map.on("rotate",()=>{this.mapbox.rotation=this.mapbox.map.transform.angle}),this.mapbox.map.resize(),this.mapbox.map.on("load",()=>{this.addMapPolygons(),this.showMapMessage=!1,this.isLoading=!1,this.$emit("map-ready",!0),this.mapbox.map.boxZoom.enable()}),this.mapbox.map.on("zoomend",()=>{this.mapbox.map.getZoom()===4?(this.showZoomMessage="too-far",this.showMapMessage=!0):this.mapbox.map.getZoom()===18?(this.showZoomMessage="too-close",this.showMapMessage=!0):this.showInfoMessage||(this.showZoomMessage=null,this.showMapMessage=!1)})},addMapControls(){const d=new Zn.NavigationControl;this.mapbox.map.addControl(d,"top-right"),this.mapbox.map.addControl(new Zn.FullscreenControl)},initialiseMapFeatures(){this.places.map(d=>{if(typeof d.geometry<"u"){const h=this.getCoordinateArray(d);return this.getMapFeatures(d,h)}return d.latitude&&d.longitude?this.getItineraryMapFeatures(d):!1})},getCoordinateArray(d){return d.geometry.type==="Polygon"?[d.geometry.coordinates[0]]:d.geometry.type==="MultiPolygon"?[d.geometry.coordinates]:[d.geometry.coordinates[0],d.geometry.coordinates[1]]},getMapFeatures(d,h){return this.geojsonData.features.push({type:"Feature",geometry:{type:d.geometry.type,coordinates:h},properties:{title:d.properties.title,imageSrc:d.image,type:typeof d.properties.category<"u"?d.properties.category.id:"",id:d.properties.id},id:d.properties.id})},getItineraryMapFeatures(d){const h=this._uid;return this.geojsonData.features.push({type:"Feature",geometry:{type:"Point",coordinates:[parseFloat(d.longitude),parseFloat(d.latitude)]},properties:{title:d.title,imageSrc:d.imageSrc,type:"itinerary-stop",stopCount:d.stopCount,id:h},id:h})},initialiseMapMarkers(){let d=0;this.initialLoad&&(d=1e3),setTimeout(()=>{if(this.markers!==null){for(let h=this.markers.length-1;h>=0;h--)this.markers[h].remove();this.markers=[]}this.geojsonData.features.forEach(h=>{h.geometry.type==="Point"&&this.createMapMarker(h)})},d)},createMapMarker(d){const h=F.h(Cx,{feature:d,mapId:this.mapId,hasPopups:this.showMarkerPopups,onShowDetail:k=>{this.$emit("showDetail",k)},onSetCategory:k=>{this.$emit("setCategory",k)}}),_=document.createElement("div");this.$refs.mapboxOuter.appendChild(_),F.render(h,_),d&&this.showMarkerPopups&&this.addMapPopup(d);const E=new Zn.Marker(_.children[0]).setLngLat(d.geometry.coordinates).setPopup(this.popup).addTo(this.mapbox.map);this.setupMarkerListeners(E),this.markers.push(E),_.remove()},hideMapPolygons(){this.mapbox.map.setLayoutProperty("regionFills","visibility","none"),this.mapbox.map.setLayoutProperty("regionBorders","visibility","none")},showMapPolygons(){this.mapbox.map.setLayoutProperty("regionFills","visibility","visible"),this.mapbox.map.setLayoutProperty("regionBorders","visibility","visible")},addMapPolygons(){this.geojsonData.features.forEach(d=>{d.geometry.type==="Polygon"?this.polygons.features.includes(d.properties.id)||this.polygons.features.push(d):d.geometry.type==="MultiPolygon"&&(this.polygons.features.includes(d.properties.id)||this.multiPolygons.push(d))}),this.multiPolygons.forEach(d=>{const h=d.properties;d.geometry.coordinates[0].forEach(_=>{this.polygons.features.push({geometry:{type:"Polygon",coordinates:_},id:h.id,properties:{id:h.id,imageSrc:h.imageSrc,title:h.title,type:h.type},type:"Feature"})})}),this.polygons.features.length>0&&(this.mapbox.map.addSource("regions",{type:"geojson",data:this.polygons,promoteId:"id"}),this.mapbox.map.addLayer({id:"regionFills",type:"fill",source:"regions",layout:{},paint:{"fill-color":["case",["==",["feature-state","interaction-state"],"hover"],"rgba(168,48,140,0.5)",["==",["feature-state","interaction-state"],"active"],"rgba(168,48,140,0.5)","rgba(25,200,197,0.6)"],"fill-opacity":.8}}),this.mapbox.map.addLayer({id:"regionBorders",type:"line",source:"regions",layout:{},paint:{"line-color":"#fff","line-width":1}}),this.hideMapPolygons(),this.mapbox.map.on("mousemove","regionFills",d=>{d.features.length>0&&(this.addMapPopup(d),this.removeHoveredPolygon(),this.addHoveredPolygon(d.features[0]))}),this.mapbox.map.on("mouseleave","regionFills",d=>{this.removeMapPopup(d),this.removeHoveredPolygon()}),this.mapbox.map.on("click","regionFills",d=>{this.removeActivePolygon(),this.addActivePolygon(d.features[0]),this.addMapPopup(d.features[0])}))},removeActivePolygon(){this.mapbox.map.style._layers.regionFills&&(this.mapbox.map.setFeatureState({source:"regions",id:this.activeStateId},{"interaction-state":""}),this.activeStateId=null)},addActivePolygon(d){this.activeStateId=d.properties.id,this.mapbox.map.setFeatureState({source:"regions",id:this.activeStateId},{"interaction-state":"active"}),al.setActivePlace({mapId:this.mapId,activeFeature:d}),this.$emit("showDetail",d),this.$emit("setCategory","regions")},removeHoveredPolygon(){if(this.hoveredStateId){let d="";this.hoveredStateId===this.activeStateId&&(d="active"),this.mapbox.map.setFeatureState({source:"regions",id:this.hoveredStateId},{"interaction-state":d})}al.setHoveredPlace({mapId:this.mapId,hoveredFeature:""}),this.hoveredStateId=null},addHoveredPolygon(d){this.hoveredStateId=d.properties.id,this.mapbox.map.setFeatureState({source:"regions",id:this.hoveredStateId},{"interaction-state":"hover"}),this.addMapPopup(d),al.setHoveredPlace({mapId:this.mapId,hoveredFeature:d})},addMapPopup(d){let h="";d.features?h=d.features[0]:h=d;const _=this.getCoordinates(h),E=this.getPopupHtml(h);h.properties.id&&(this.removeMapPopup(d),this.popup=new Zn.Popup({closeButton:!1,offset:{top:[0,20],bottom:[0,-40],left:[30,-20],right:[-30,-20]}}).setLngLat(_).setHTML(E).addTo(this.mapbox.map))},removeMapPopup(d){this.popup&&(this.popup.remove(),this.popup=null),d._popup&&d._popup.remove()},getCoordinates(d){return d.geometry.type==="Polygon"?this.findFeatureCentre(d.geometry.coordinates):d.geometry.type==="MultiPolygon"?this.findFeatureCentre(d.geometry.coordinates[0]):d.geometry.coordinates},findFeatureCentre(d){const h=[],_=[];return d[0].forEach(E=>{h.push(E[1]),_.push(E[0])}),{lat:(Math.min(...h)+Math.max(...h))/2,lng:(Math.min(..._)+Math.max(..._))/2}},getPopupHtml(d){return d.properties.imageSrc&&d.properties.stopCount?`
|
|
500
|
+
`+h.prev}function qc(d,h){var _=hd(d),E=[];if(_){E.length=d.length;for(var k=0;k<d.length;k++)E[k]=Co(d,k)?h(d[k],d):""}var V=typeof Oh=="function"?Oh(d):[],l;if(pl){l={};for(var re=0;re<V.length;re++)l["$"+V[re]]=V[re]}for(var q in d)Co(d,q)&&(_&&String(Number(q))===q&&q<d.length||pl&&l["$"+q]instanceof Symbol||(x_.call(/[^\w$]/,q)?E.push(h(q,d)+": "+h(d[q],d)):E.push(q+": "+h(d[q],d))));if(typeof Oh=="function")for(var me=0;me<V.length;me++)b_.call(d,V[me])&&E.push("["+h(V[me])+"]: "+h(d[V[me]],d));return E}var Tp=function(h){return typeof h=="string"||typeof h=="symbol"},ua=function(h){return!!h&&(typeof h=="function"||typeof h=="object")},ev=Tt,Hw=Cw,Xw=Tp,Kw=ua,Jw=function(h,_){if(!Kw(h))throw new ev("Assertion failed: Type(O) is not Object");if(!Xw(_))throw new ev("Assertion failed: P is not a Property Key, got "+Hw(_));return h[_]},Yw=es,Hn=function(h){return(typeof h=="number"||typeof h=="bigint")&&!Yw(h)&&h!==1/0&&h!==-1/0},Qw=wp,e2=Ya,t2=es,r2=Hn,Ip=function(h){if(typeof h!="number"||t2(h)||!r2(h))return!1;var _=Qw(h);return e2(_)===_},i2=sa,E_=Wt,n2=fr,dd=n2("%ArrayBuffer%",!0),lp=E_("ArrayBuffer.prototype.byteLength",!0),o2=E_("Object.prototype.toString"),tv=!!dd&&!lp&&new dd(0).slice,rv=!!tv&&i2(tv),fl=lp||rv?function(h){if(!h||typeof h!="object")return!1;try{return lp?lp(h):rv(h,0),!0}catch{return!1}}:dd?function(h){return o2(h)==="[object ArrayBuffer]"}:function(h){return!1},a2=Wt,iv=a2("ArrayBuffer.prototype.byteLength",!0),s2=fl,P_=function(h){return s2(h)?iv?iv(h):h.byteLength:NaN},l2=Wt,nv=l2("SharedArrayBuffer.prototype.byteLength",!0),ku=nv?function(h){if(!h||typeof h!="object")return!1;try{return nv(h),!0}catch{return!1}}:function(h){return!1},u2=Tt,c2=P_,p2=Tu(),h2=Wt,f2=fl,d2=ku,m2=h2("SharedArrayBuffer.prototype.byteLength",!0),dl=function(h){var _=d2(h);if(!f2(h)&&!_)throw new u2("Assertion failed: `arrayBuffer` must be an Object with an [[ArrayBufferData]] internal slot");if((_?m2:c2)(h)===0)try{new st.commonjsGlobal[p2[0]](h)}catch(E){return!!E&&E.name==="TypeError"}return!1},Uh,ov;function C_(){if(ov)return Uh;ov=1;var d=Tt,h=Mo(),_=ua,E=Tp;return Uh=function(V,l){if(!_(V))throw new d("Assertion failed: `O` must be an Object");if(!E(l))throw new d("Assertion failed: `P` must be a Property Key");return h(V,l)},Uh}var y2=fr,k_=y2("%Array%"),v2=!k_.isArray&&Wt("Object.prototype.toString"),M_=k_.isArray||function(h){return v2(h)==="[object Array]"},Fd=M_,Nh,av;function z_(){return av||(av=1,Nh=function(h){return h==="BIGUINT64"||h==="BIGINT64"}),Nh}var $h,sv;function g2(){return sv||(sv=1,$h=function(h){return h==="UINT8"||h==="UINT8C"||h==="UINT16"||h==="UINT32"||h==="BIGUINT64"}),$h}var qh,lv;function _2(){if(lv)return qh;lv=1;var d=Qa;return qh=function(_){var E=_[3]&128?-1:1,k=(_[3]&127)<<1|_[2]>>7,V=(_[2]&127)<<16|_[1]<<8|_[0];return k===0&&V===0?E===1?0:-0:k===255&&V===0?E===1?1/0:-1/0:k===255&&V!==0?NaN:(k-=127,k===-127?E*V*d(2,-149):E*(1+V*d(2,-23))*d(2,k))},qh}var jh,uv;function x2(){if(uv)return jh;uv=1;var d=Qa;return jh=function(_){var E=_[7]&128?-1:1,k=(_[7]&127)<<4|(_[6]&240)>>4,V=(_[6]&15)*281474976710656+_[5]*1099511627776+_[4]*4294967296+_[3]*16777216+_[2]*65536+_[1]*256+_[0];return k===0&&V===0?E*0:k===2047&&V!==0?NaN:k===2047&&V===0?E*(1/0):(k-=1023,k===-1023?E*V*5e-324:E*(1+V/4503599627370496)*d(2,k))},jh}var Gh,cv;function b2(){if(cv)return Gh;cv=1;var d=fr,h=Qa,_=d("%Number%"),E=d("%BigInt%",!0);return Gh=function(V,l,re,q){for(var me=q?E:_,pe=me(0),ke=0;ke<V.length;ke++)pe+=me(V[ke]*h(2,8*ke));if(!re){var ae=l*8;V[l-1]&128&&(pe-=me(h(2,ae)))}return pe},Gh}var Zh,pv;function w2(){return pv||(pv=1,Zh=function(h,_){for(var E=0;E<h.length;E+=1)if(!_(h[E],E,h))return!1;return!0}),Zh}var Wh,hv;function S2(){return hv||(hv=1,Wh=function(h){return typeof h=="number"&&h>=0&&h<=255&&(h|0)===h}),Wh}var ml={__proto__:null,name:{__proto__:null,$Int8Array:"INT8",$Uint8Array:"UINT8",$Uint8ClampedArray:"UINT8C",$Int16Array:"INT16",$Uint16Array:"UINT16",$Int32Array:"INT32",$Uint32Array:"UINT32",$BigInt64Array:"BIGINT64",$BigUint64Array:"BIGUINT64",$Float32Array:"FLOAT32",$Float64Array:"FLOAT64"},size:{__proto__:null,$INT8:1,$UINT8:1,$UINT8C:1,$INT16:2,$UINT16:2,$INT32:4,$UINT32:4,$BIGINT64:8,$BIGUINT64:8,$FLOAT32:4,$FLOAT64:8},choices:'"INT8", "UINT8", "UINT8C", "INT16", "UINT16", "INT32", "UINT32", "BIGINT64", "BIGUINT64", "FLOAT32", or "FLOAT64"'},Hh,fv;function T2(){if(fv)return Hh;fv=1;var d=fr,h=Wt,_=Td,E=_n,k=Tt,V=d("%BigInt%",!0),l=C_(),re=Fd,q=z_(),me=g2(),pe=_2(),ke=x2(),ae=b2(),ve=w2(),Ae=S2(),Je=h("Array.prototype.reverse"),qe=h("Array.prototype.slice"),pt=ml;return Hh=function(Rt,bt,Ct){if(!l(pt.size,"$"+Rt))throw new k("Assertion failed: `type` must be a TypedArray element type");if(!re(bt)||!ve(bt,Ae))throw new k("Assertion failed: `rawBytes` must be an Array of bytes");if(typeof Ct!="boolean")throw new k("Assertion failed: `isLittleEndian` must be a Boolean");var Qt=pt.size["$"+Rt];if(bt.length!==Qt)throw new _("Assertion failed: `rawBytes` must have a length of "+Qt+" for type "+Rt);var vr=q(Rt);if(vr&&!V)throw new E("this environment does not support BigInts");return bt=qe(bt,0,Qt),Ct||Je(bt),Rt==="FLOAT32"?pe(bt):Rt==="FLOAT64"?ke(bt):ae(bt,Qt,me(Rt),vr)},Hh}var Xh,dv;function B_(){if(dv)return Xh;dv=1;var d={}.toString;return Xh=Array.isArray||function(h){return d.call(h)=="[object Array]"},Xh}var Kh,mv;function I2(){if(mv)return Kh;mv=1;var d=fr,h=d("%Array.prototype.concat%"),_=sa,E=Wt,k=E("Array.prototype.slice"),V=Ed()(),l=V&&Symbol.isConcatSpreadable,re=[],q=l?_.apply(h,re):null,me=l?B_():null;return Kh=l?function(ke){for(var ae=0;ae<arguments.length;ae+=1){var ve=arguments[ae];if(ve&&typeof ve=="object"&&typeof ve[l]=="boolean"){re[l]||(re[l]=!0);var Ae=me(ve)?k(ve):[ve];Ae[l]=!0,arguments[ae]=Ae}}return q(arguments)}:_(h,re),Kh}var A2=hl,yl=function(h){return!!A2(h)},E2=Tt,P2=Wt,C2=P2("TypedArray.prototype.buffer",!0),k2=yl,Mu=C2||function(h){if(!k2(h))throw new E2("Not a Typed Array");return h.buffer},Jh,yv;function D_(){if(yv)return Jh;yv=1;var d=fr,h=d("%Uint8Array%",!0),_=d("%Uint32Array%",!0),E=Mu,k=_&&new _([305419896]),V=k&&new h(E(k));return Jh=V?V[0]===120?"little":V[0]===18?"big":V[0]===52?"mixed":"unknown":"indeterminate",Jh}var M2=fr,z2=_n,Eo=Tt,B2=Wt,D2=Ip,L2=M2("%Uint8Array%",!0),Yh=B2("Array.prototype.slice"),R2=dl,F2=T2(),O2=fl,V2=ku,vv=I2(),jc=ml,U2=D_(),N2=function(h,_,E,k,V){var l=V2(h);if(!O2(h)&&!l)throw new Eo("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!D2(_))throw new Eo("Assertion failed: `byteIndex` must be an integer");if(typeof E!="string"||typeof jc.size["$"+E]!="number")throw new Eo("Assertion failed: `type` must be one of "+jc.choices);if(typeof k!="boolean")throw new Eo("Assertion failed: `isTypedArray` must be a boolean");if(V!=="SEQ-CST"&&V!=="UNORDERED")throw new Eo("Assertion failed: `order` must be either `SEQ-CST` or `UNORDERED`");if(arguments.length>5&&typeof arguments[5]!="boolean")throw new Eo("Assertion failed: `isLittleEndian` must be a boolean, if present");if(R2(h))throw new Eo("Assertion failed: `arrayBuffer` is detached");if(_<0)throw new Eo("Assertion failed: `byteIndex` must be non-negative");var re=jc.size["$"+E];if(!re)throw new Eo("Assertion failed: `type` must be one of "+jc.choices);var q;if(l)throw new z2("SharedArrayBuffer is not supported by this implementation");q=Yh(new L2(h,_),0,re);var me=arguments.length>5?arguments[5]:U2==="little",pe=me?Yh(vv([0,0,0,0,0,0,0,0],q),-re):Yh(vv(q,[0,0,0,0,0,0,0,0]),0,re);return F2(E,pe,me)},gv=es,L_=function(h,_){return h===_?h===0?1/h===1/_:!0:gv(h)&&gv(_)},Gc=Tt,$2=ua,q2=Tp,_v=L_,xv=function(){try{return delete[].length,!0}catch{return!1}}(),j2=function(h,_,E,k){if(!$2(h))throw new Gc("Assertion failed: `O` must be an Object");if(!q2(_))throw new Gc("Assertion failed: `P` must be a Property Key");if(typeof k!="boolean")throw new Gc("Assertion failed: `Throw` must be a Boolean");if(k){if(h[_]=E,xv&&!_v(h[_],E))throw new Gc("Attempted to assign to readonly property.");return!0}try{return h[_]=E,xv?_v(h[_],E):!0}catch{return!1}},Qh,bv;function G2(){if(bv)return Qh;bv=1;var d=fr,h=d("%BigInt%",!0),_=Tt,E=_n;return Qh=function(V){if(typeof V!="string")throw new _("`argument` must be a string");if(!h)throw new E("BigInts are not supported in this environment");try{return h(V)}catch{return}},Qh}var ef,wv;function Z2(){return wv||(wv=1,ef=function(h){return h===null||typeof h!="function"&&typeof h!="object"}),ef}var R_=Wt,W2=R_("Date.prototype.getDay"),H2=function(h){try{return W2(h),!0}catch{return!1}},X2=R_("Object.prototype.toString"),K2="[object Date]",J2=zo()(),F_=function(h){return typeof h!="object"||h===null?!1:J2?H2(h):X2(h)===K2},Zc={exports:{}},Sv=Wt,Y2=zo()(),Q2=Mo(),eS=ko,md;if(Y2){var tS=Sv("RegExp.prototype.exec"),Tv={},tf=function(){throw Tv},Iv={toString:tf,valueOf:tf};typeof Symbol.toPrimitive=="symbol"&&(Iv[Symbol.toPrimitive]=tf),md=function(h){if(!h||typeof h!="object")return!1;var _=eS(h,"lastIndex"),E=_&&Q2(_,"value");if(!E)return!1;try{tS(h,Iv)}catch(k){return k===Tv}}}else{var rS=Sv("Object.prototype.toString"),iS="[object RegExp]";md=function(h){return!h||typeof h!="object"&&typeof h!="function"?!1:rS(h)===iS}}var O_=md,rf,Av;function Ap(){if(Av)return rf;Av=1;var d=Wt,h=O_,_=d("RegExp.prototype.exec"),E=Tt;return rf=function(V){if(!h(V))throw new E("`regex` must be a RegExp");return function(re){return _(V,re)!==null}},rf}var Ev;function V_(){if(Ev)return Zc.exports;Ev=1;var d=Wt,h=d("Object.prototype.toString"),_=n_()(),E=Ap();if(_){var k=d("Symbol.prototype.toString"),V=E(/^Symbol\(.*\)$/),l=function(q){return typeof q.valueOf()!="symbol"?!1:V(k(q))};Zc.exports=function(q){if(typeof q=="symbol")return!0;if(!q||typeof q!="object"||h(q)!=="[object Symbol]")return!1;try{return l(q)}catch{return!1}}}else Zc.exports=function(q){return!1};return Zc.exports}var nf,Pv;function nS(){if(Pv)return nf;Pv=1;var d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol",h=Z2(),_=bp,E=F_,k=V_(),V=function(q,me){if(typeof q>"u"||q===null)throw new TypeError("Cannot call method on "+q);if(typeof me!="string"||me!=="number"&&me!=="string")throw new TypeError('hint must be "string" or "number"');var pe=me==="string"?["toString","valueOf"]:["valueOf","toString"],ke,ae,ve;for(ve=0;ve<pe.length;++ve)if(ke=q[pe[ve]],_(ke)&&(ae=ke.call(q),h(ae)))return ae;throw new TypeError("No default value")},l=function(q,me){var pe=q[me];if(pe!==null&&typeof pe<"u"){if(!_(pe))throw new TypeError(pe+" returned for property "+String(me)+" of object "+q+" is not a function");return pe}};return nf=function(q){if(h(q))return q;var me="default";arguments.length>1&&(arguments[1]===String?me="string":arguments[1]===Number&&(me="number"));var pe;if(d&&(Symbol.toPrimitive?pe=l(q,Symbol.toPrimitive):k(q)&&(pe=Symbol.prototype.valueOf)),typeof pe<"u"){var ke=pe.call(q,me);if(h(ke))return ke;throw new TypeError("unable to convert exotic object to primitive")}return me==="default"&&(E(q)||k(q))&&(me="string"),V(q,me==="default"?"number":me)},nf}var of,Cv;function U_(){if(Cv)return of;Cv=1;var d=nS();return of=function(_){return arguments.length>1?d(_,arguments[1]):d(_)},of}var af,kv;function N_(){if(kv)return af;kv=1;var d=fr,h=d("%BigInt%",!0),_=d("%Number%"),E=Tt,k=_n,V=G2(),l=U_();return af=function(q){if(!h)throw new k("BigInts are not supported in this environment");var me=l(q,_);if(me==null)throw new E("Cannot convert null or undefined to a BigInt");if(typeof me=="boolean")return h(me?1:0);if(typeof me=="number")throw new E("Cannot convert a Number value to a BigInt");if(typeof me=="string"){var pe=V(me);if(typeof pe>"u")throw new E("Failed to parse String to BigInt");return pe}if(typeof me=="symbol")throw new E("Cannot convert a Symbol value to a BigInt");if(typeof me!="bigint")throw new k("Assertion failed: unknown primitive type");return me},af}var sf,Mv;function $_(){if(Mv)return sf;Mv=1;var d=fr,h=d("%BigInt%",!0),_=Td,E=Tt,k=h&&h(0);return sf=function(l,re){if(typeof l!="bigint"||typeof re!="bigint")throw new E("Assertion failed: `n` and `d` arguments must be BigInts");if(re===k)throw new _("Division by zero");return l===k?k:l%re},sf}var lf,zv;function q_(){return zv||(zv=1,lf=function(h,_,E){var k=h(_,E);return k>=0?k:k+E}),lf}var uf,Bv;function oS(){if(Bv)return uf;Bv=1;var d=fr,h=d("%BigInt%",!0),_=Qa,E=N_(),k=$_(),V=q_(),l=h&&BigInt(_(2,32))*BigInt(_(2,31)),re=h&&BigInt(_(2,32))*BigInt(_(2,32));return uf=function(me){var pe=E(me),ke=V(k,pe,re);return ke>=l?ke-re:ke},uf}var cf,Dv;function aS(){if(Dv)return cf;Dv=1;var d=fr,h=d("%BigInt%",!0),_=Qa,E=N_(),k=$_(),V=q_(),l=h&&BigInt(_(2,32))*BigInt(_(2,32));return cf=function(q){var me=E(q),pe=V(k,me,l);return pe},cf}var pf,Lv;function sS(){if(Lv)return pf;Lv=1;var d=Ya;return pf=function(_,E){var k=_%E;return d(k>=0?k:k+E)},pf}var hf,Rv;function lS(){return Rv||(Rv=1,hf=sS()),hf}var ff,Fv;function vl(){if(Fv)return ff;Fv=1;var d=lS();return ff=function(_,E){return d(_,E)},ff}var df,Ov;function uS(){return Ov||(Ov=1,df=function(h){return h===null||typeof h!="function"&&typeof h!="object"}),df}var mf,Vv;function j_(){if(Vv)return mf;Vv=1;var d=Tt;return mf=function(_){if(_==null)throw new d(arguments.length>0&&arguments[1]||"Cannot call method on "+_);return _},mf}var cS=fr,pS=cS("%String%"),hS=Tt,G_=function(h){if(typeof h=="symbol")throw new hS("Cannot convert a Symbol value to a string");return pS(h)},yf,Uv;function Z_(){if(Uv)return yf;Uv=1;var d=j_(),h=G_,_=Wt,E=_("String.prototype.replace"),k=/^\s$/.test(""),V=k?/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/:/^[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+/,l=k?/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/:/[\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF]+$/;return yf=function(){var q=h(d(this));return E(E(q,V,""),l,"")},yf}var vf,Nv;function W_(){if(Nv)return vf;Nv=1;var d=Z_(),h="",_="";return vf=function(){return String.prototype.trim&&h.trim()===h&&_.trim()===_&&("_"+_).trim()==="_"+_&&(_+"_").trim()===_+"_"?String.prototype.trim:d},vf}var gf,$v;function fS(){if($v)return gf;$v=1;var d=Sp(),h=Md,_=W_();return gf=function(){var k=_();return String.prototype.trim!==k&&(d?h(String.prototype,"trim",k,!0):h(String.prototype,"trim",k)),k},gf}var _f,qv;function dS(){if(qv)return _f;qv=1;var d=sa,h=Cu,_=j_(),E=Z_(),k=W_(),V=fS(),l=d(k()),re=function(me){return _(me),l(me)};return h(re,{getPolyfill:k,implementation:E,shim:V}),_f=re,_f}var xf,jv;function mS(){if(jv)return xf;jv=1;var d=fr,h=d("%RegExp%"),_=Tt,E=d("%parseInt%"),k=Wt,V=Ap(),l=k("String.prototype.slice"),re=V(/^0b[01]+$/i),q=V(/^0o[0-7]+$/i),me=V(/^[-+]0x[0-9a-f]+$/i),pe=["
","",""].join(""),ke=new h("["+pe+"]","g"),ae=V(ke),ve=dS();return xf=function Ae(Je){if(typeof Je!="string")throw new _("Assertion failed: `argument` is not a String");if(re(Je))return+E(l(Je,2),2);if(q(Je))return+E(l(Je,2),8);if(ae(Je)||me(Je))return NaN;var qe=ve(Je);return qe!==Je?Ae(qe):+Je},xf}var yS=fr,Gv=Tt,vS=yS("%Number%"),gS=uS(),_S=U_(),xS=mS(),ca=function(h){var _=gS(h)?h:_S(h,vS);if(typeof _=="symbol")throw new Gv("Cannot convert a Symbol value to a number");if(typeof _=="bigint")throw new Gv("Conversion from 'BigInt' to 'number' is not allowed.");return typeof _=="string"?xS(_):+_},bS=Ya,Od=function(h){return typeof h=="bigint"?h:bS(h)},Zv=Od,wS=Tt,is=function(h){if(typeof h!="number"&&typeof h!="bigint")throw new wS("argument must be a Number or a BigInt");var _=h<0?-Zv(-h):Zv(h);return _===0?0:_},bf,Wv;function SS(){if(Wv)return bf;Wv=1;var d=vl(),h=ca,_=is,E=Hn,k=65536;return bf=function(l){var re=h(l);if(!E(re)||re===0)return 0;var q=_(re),me=d(q,k);return me>=32768?me-k:me},bf}var wf,Hv;function TS(){if(Hv)return wf;Hv=1;var d=vl(),h=ca,_=is,E=Hn,k=2147483648,V=4294967296;return wf=function(re){var q=h(re);if(!E(q)||q===0)return 0;var me=_(q),pe=d(me,V),ke=pe>=k?pe-V:pe;return ke===0?0:ke},wf}var Sf,Xv;function IS(){if(Xv)return Sf;Xv=1;var d=vl(),h=ca,_=is,E=Hn;return Sf=function(V){var l=h(V);if(!E(l)||l===0)return 0;var re=_(l),q=d(re,256);return q>=128?q-256:q},Sf}var Tf,Kv;function AS(){if(Kv)return Tf;Kv=1;var d=vl(),h=ca,_=is,E=Hn,k=65536;return Tf=function(l){var re=h(l);if(!E(re)||re===0)return 0;var q=_(re),me=d(q,k);return me===0?0:me},Tf}var If,Jv;function ES(){if(Jv)return If;Jv=1;var d=vl(),h=ca,_=is,E=Hn,k=4294967296;return If=function(l){var re=h(l);if(!E(re)||re===0)return 0;var q=_(re),me=d(q,k);return me===0?0:me},If}var Af,Yv;function PS(){if(Yv)return Af;Yv=1;var d=Hn,h=vl(),_=ca,E=is;return Af=function(V){var l=_(V);if(!d(l)||l===0)return 0;var re=E(l),q=h(re,256);return q},Af}var Ef,Qv;function CS(){if(Qv)return Ef;Qv=1;var d=Tt,h=Id,_=Ad;return Ef=function(k,V,l){if(typeof k!="number"||typeof V!="number"||typeof l!="number"||!(V<=l))throw new d("Assertion failed: all three arguments must be MVs, and `lower` must be `<= upper`");return _(h(V,k),l)},Ef}var Pf,eg;function kS(){if(eg)return Pf;eg=1;var d=CS(),h=ca,_=Od,E=es;return Pf=function(V){var l=h(V);if(E(l))return 0;var re=d(l,0,255),q=_(re);return re<q+.5?q:re>q+.5?q+1:q%2===0?q:q+1},Pf}var Cf,tg;function H_(){return tg||(tg=1,Cf=function(h){return h===0&&1/h===-1/0}),Cf}var kf,rg;function MS(){if(rg)return kf;rg=1;var d=wp,h=Ya,_=Qa,E=Hn,k=es,V=H_(),l=34028234663852886e22;return kf=function(q,me){if(k(q))return me?[0,0,192,127]:[127,192,0,0];var pe;if(q===0)return pe=V(q)?128:0,me?[0,0,0,pe]:[pe,0,0,0];if(d(q)>l||!E(q))return pe=q<0?255:127,me?[0,0,128,pe]:[pe,128,0,0];var ke=q<0?1:0;q=d(q);for(var ae=0;q>=2;)ae+=1,q/=2;for(;q<1;)ae-=1,q*=2;var ve=q-1;ve*=_(2,23)+.5,ve=h(ve),ae+=127,ae<<=23;var Ae=ke<<31|ae|ve,Je=Ae&255;Ae>>=8;var qe=Ae&255;Ae>>=8;var pt=Ae&255;Ae>>=8;var ot=Ae&255;return me?[Je,qe,pt,ot]:[ot,pt,qe,Je]},kf}var Mf,ig;function zS(){if(ig)return Mf;ig=1;var d=1075,h=54;return Mf=function(E){var k="";if(E===0)return k;for(var V=d,l,re=0;re<d;re+=1)if(l=E*2,l>=1?(E=l-1,k+="1",V===d&&(V=re)):(E=l,k+="0"),l===1||re-V>h)return k;return k},Mf}var zf,ng;function BS(){if(ng)return zf;ng=1;var d=Ya;return zf=function(_){for(var E="",k;_>0;)k=_/2,_=d(k),k===_?E="0"+E:E="1"+E;return E},zf}var Bf,og;function DS(){return og||(og=1,Bf=Number.isNaN||function(h){return h!==h}),Bf}var Df,ag;function LS(){if(ag)return Df;ag=1;var d=fr,h=d("%parseInt%"),_=wp,E=Ya,k=Hn,V=H_(),l=Wt,re=l("String.prototype.indexOf"),q=l("String.prototype.slice"),me=zS(),pe=BS(),ke=DS(),ae=1023,ve="11111111111",Ae="00000000000",Je=Ae+Ae+Ae+Ae+"0000000";return Df=function(pt,ot){var Rt=pt<0||V(pt)?"1":"0",bt,Ct;if(ke(pt))bt=ve,Ct="1"+Je;else if(!k(pt))bt=ve,Ct="0"+Je;else if(pt===0)bt=Ae,Ct="0"+Je;else{pt=_(pt);var Qt=E(pt),vr=pe(Qt),Er=me(pt-Qt),er;if(vr)bt=vr.length-1;else{var Qr=re(Er,"1");Qr>-1&&(er=Qr+1),bt=-er}Ct=vr+Er,bt<0?(bt<=-ae&&(er=ae-1),Ct=q(Ct,er)):Ct=q(Ct,1),bt=q(Ae+pe(bt+ae),-11),Ct=q(Ct+Je+"0",0,52)}for(var ei=Rt+bt+Ct,vi=[],It=0;It<8;It++){var gr=ot?8-It-1:It;vi[gr]=h(q(ei,It*8,(It+1)*8),2)}return vi},Df}var Lf,sg;function RS(){if(sg)return Lf;sg=1;var d=fr,h=d("%Number%"),_=d("%BigInt%",!0);return Lf=function(k,V,l){var re=typeof k=="bigint"?_:h;k<0&&(k>>>=0);for(var q=[],me=0;me<V;me++)q[l?me:V-1-me]=h(k&re(255)),k>>=re(8);return q},Lf}var Rf,lg;function FS(){if(lg)return Rf;lg=1;var d=Tt,h=C_(),_=oS(),E=aS(),k=SS(),V=TS(),l=IS(),re=AS(),q=ES(),me=PS(),pe=kS(),ke=MS(),ae=LS(),ve=RS(),Ae=ml,Je={__proto__:null,$INT8:l,$UINT8:me,$UINT8C:pe,$INT16:k,$UINT16:re,$INT32:V,$UINT32:q,$BIGINT64:_,$BIGUINT64:E};return Rf=function(pt,ot,Rt){if(typeof pt!="string"||!h(Ae.size,"$"+pt))throw new d("Assertion failed: `type` must be a TypedArray element type");if(typeof ot!="number"&&typeof ot!="bigint")throw new d("Assertion failed: `value` must be a Number or a BigInt");if(typeof Rt!="boolean")throw new d("Assertion failed: `isLittleEndian` must be a Boolean");if(pt==="FLOAT32")return ke(ot,Rt);if(pt==="FLOAT64")return ae(ot,Rt);var bt=Ae.size["$"+pt],Ct=Je["$"+pt],Qt=Ct(ot);return ve(Qt,bt,Rt)},Rf}var Ff,ug;function OS(){return ug||(ug=1,Ff=function(h,_){for(var E=0;E<h.length;E+=1)_(h[E],E,h)}),Ff}var VS=fr,US=_n,Po=Tt,NS=Ip,$S=VS("%Uint8Array%",!0),qS=z_(),jS=dl,GS=FS(),ZS=fl,WS=ku,HS=Mo(),Of=ml,XS=D_(),KS=OS(),JS=function(h,_,E,k,V,l){var re=WS(h);if(!ZS(h)&&!re)throw new Po("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(!NS(_)||_<0)throw new Po("Assertion failed: `byteIndex` must be a non-negative integer");if(typeof E!="string"||!HS(Of.size,"$"+E))throw new Po("Assertion failed: `type` must be one of "+Of.choices);if(typeof k!="number"&&typeof k!="bigint")throw new Po("Assertion failed: `value` must be a Number or a BigInt");if(typeof V!="boolean")throw new Po("Assertion failed: `isTypedArray` must be a boolean");if(l!=="SEQ-CST"&&l!=="UNORDERED"&&l!=="INIT")throw new Po('Assertion failed: `order` must be `"SEQ-CST"`, `"UNORDERED"`, or `"INIT"`');if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Po("Assertion failed: `isLittleEndian` must be a boolean, if present");if(jS(h))throw new Po("Assertion failed: ArrayBuffer is detached");if(qS(E)?typeof k!="bigint":typeof k!="number")throw new Po("Assertion failed: `value` must be a BigInt if type is ~BIGINT64~ or ~BIGUINT64~, otherwise a Number");var q=Of.size["$"+E],me=arguments.length>6?arguments[6]:XS==="little",pe=GS(E,k,me);if(re)throw new US("SharedArrayBuffer is not supported by this implementation");var ke=new $S(h,_,q);KS(pe,function(ae,ve){ke[ve]=ae})},YS=ca,QS=is,eT=es,tT=Hn,rT=function(h){var _=YS(h);return eT(_)||_===0?0:tT(_)?QS(_):_},iT=_n,nT=Tt,oT=Ip,aT=hl,cg=ml,Vd=function(h){var _=aT(h);if(!_)throw new nT("Assertion failed: `O` must be a TypedArray");var E=cg.size["$"+cg.name["$"+_]];if(!oT(E)||E<0)throw new iT("Assertion failed: Unknown TypedArray type `"+_+"`");return E},sT=_n,lT=Tt,uT=hl,cT=ml,pT=function(h){var _=uT(h);if(!_)throw new lT("Assertion failed: `O` must be a TypedArray");var E=cT.name["$"+_];if(typeof E!="string")throw new sT("Assertion failed: Unknown TypedArray type `"+_+"`");return E},yd={exports:{}},hT=fr,Vf,pg;function Ud(){if(pg)return Vf;pg=1;var d=Tt,h=Mo(),_={__proto__:null,"[[Configurable]]":!0,"[[Enumerable]]":!0,"[[Get]]":!0,"[[Set]]":!0,"[[Value]]":!0,"[[Writable]]":!0};return Vf=function(k){if(!k||typeof k!="object")return!1;for(var V in k)if(h(k,V)&&!_[V])return!1;var l=h(k,"[[Value]]")||h(k,"[[Writable]]"),re=h(k,"[[Get]]")||h(k,"[[Set]]");if(l&&re)throw new d("Property Descriptors may not be both accessor and data descriptors");return!0},Vf}var Uf,hg;function fT(){if(hg)return Uf;hg=1;var d=Sp,h=Iu,_=d.hasArrayLengthDefineBug(),E=_&&M_,k=Wt,V=k("Object.prototype.propertyIsEnumerable");return Uf=function(re,q,me,pe,ke,ae){if(!h){if(!re(ae)||!ae["[[Configurable]]"]||!ae["[[Writable]]"]||ke in pe&&V(pe,ke)!==!!ae["[[Enumerable]]"])return!1;var ve=ae["[[Value]]"];return pe[ke]=ve,q(pe[ke],ve)}return _&&ke==="length"&&"[[Value]]"in ae&&E(pe)&&pe.length!==ae["[[Value]]"]?(pe.length=ae["[[Value]]"],pe.length===ae["[[Value]]"]):(h(pe,ke,me(ae)),!0)},Uf}var Nf,fg;function dT(){return fg||(fg=1,Nf=function(h){if(typeof h>"u")return h;var _={};return"[[Value]]"in h&&(_.value=h["[[Value]]"]),"[[Writable]]"in h&&(_.writable=!!h["[[Writable]]"]),"[[Get]]"in h&&(_.get=h["[[Get]]"]),"[[Set]]"in h&&(_.set=h["[[Set]]"]),"[[Enumerable]]"in h&&(_.enumerable=!!h["[[Enumerable]]"]),"[[Configurable]]"in h&&(_.configurable=!!h["[[Configurable]]"]),_}),Nf}var $f,dg;function mT(){if(dg)return $f;dg=1;var d=Tt,h=Ud(),_=dT();return $f=function(k){if(typeof k<"u"&&!h(k))throw new d("Assertion failed: `Desc` must be a Property Descriptor");return _(k)},$f}var qf,mg;function yT(){if(mg)return qf;mg=1;var d=Tt,h=Mo(),_=Ud();return qf=function(k){if(typeof k>"u")return!1;if(!_(k))throw new d("Assertion failed: `Desc` must be a Property Descriptor");return!(!h(k,"[[Value]]")&&!h(k,"[[Writable]]"))},qf}var X_=bp,jf,yg;function vT(){return yg||(yg=1,jf=function(h){return!!h}),jf}var Gf,vg;function gT(){if(vg)return Gf;vg=1;var d=Mo(),h=Tt,_=ua,E=X_,k=vT();return Gf=function(l){if(!_(l))throw new h("ToPropertyDescriptor requires an object");var re={};if(d(l,"enumerable")&&(re["[[Enumerable]]"]=k(l.enumerable)),d(l,"configurable")&&(re["[[Configurable]]"]=k(l.configurable)),d(l,"value")&&(re["[[Value]]"]=l.value),d(l,"writable")&&(re["[[Writable]]"]=k(l.writable)),d(l,"get")){var q=l.get;if(typeof q<"u"&&!E(q))throw new h("getter must be a function");re["[[Get]]"]=q}if(d(l,"set")){var me=l.set;if(typeof me<"u"&&!E(me))throw new h("setter must be a function");re["[[Set]]"]=me}if((d(re,"[[Get]]")||d(re,"[[Set]]"))&&(d(re,"[[Value]]")||d(re,"[[Writable]]")))throw new h("Invalid property descriptor. Cannot both specify accessors and a value or writable attribute");return re},Gf}var Zf,gg;function _T(){if(gg)return Zf;gg=1;var d=Tt,h=ua,_=Ud(),E=fT(),k=mT(),V=yT(),l=Tp,re=L_,q=gT();return Zf=function(pe,ke,ae){if(!h(pe))throw new d("Assertion failed: Type(O) is not Object");if(!l(ke))throw new d("Assertion failed: P is not a Property Key");var ve=_(ae)?ae:q(ae);if(!_(ve))throw new d("Assertion failed: Desc is not a valid Property Descriptor");return E(V,re,k,pe,ke,ve)},Zf}var xT=hT,_g=xT("%Reflect.construct%",!0),mp=_T();try{mp({},"",{"[[Get]]":function(){}})}catch{mp=null}if(mp&&_g){var xg={},bg={};mp(bg,"length",{"[[Get]]":function(){throw xg},"[[Enumerable]]":!0}),yd.exports=function(h){try{_g(h,bg)}catch(_){return _===xg}}}else yd.exports=function(h){return typeof h=="function"&&!!h.prototype};var K_=yd.exports,bT=fr,wg=bT("%Symbol.species%",!0),Wf=Tt,Sg=ua,wT=K_,ST=function(h,_){if(!Sg(h))throw new Wf("Assertion failed: Type(O) is not Object");var E=h.constructor;if(typeof E>"u")return _;if(!Sg(E))throw new Wf("O.constructor is not an Object");var k=wg?E[wg]:void 0;if(k==null)return _;if(wT(k))return k;throw new Wf("no constructor found")},TT=Tt,J_=Wt,Tg=J_("%ArrayBuffer.prototype.resizable%",!0),Ig=J_("%SharedArrayBuffer.prototype.growable%",!0),IT=fl,AT=ku,Y_=function(h){var _=IT(h),E=AT(h);if(!_&&!E)throw new TT("Assertion failed: `arrayBuffer` must be an ArrayBuffer or SharedArrayBuffer");return _&&Tg?!Tg(h):E&&Ig?!Ig(h):!0},ET=Ip,Ag=Mo(),PT=yl,CT=ET,Q_=function(h){return!!h&&typeof h=="object"&&Ag(h,"[[Object]]")&&Ag(h,"[[CachedBufferByteLength]]")&&(CT(h["[[CachedBufferByteLength]]"])&&h["[[CachedBufferByteLength]]"]>=0||h["[[CachedBufferByteLength]]"]==="DETACHED")&&PT(h["[[Object]]"])},kT=ua,ex=Wt,MT=ex("String.prototype.valueOf"),zT=function(h){try{return MT(h),!0}catch{return!1}},BT=ex("Object.prototype.toString"),DT="[object String]",LT=zo()(),RT=function(h){return typeof h=="string"?!0:!h||typeof h!="object"?!1:LT?zT(h):BT(h)===DT},tx=Wt,FT=tx("Number.prototype.toString"),OT=function(h){try{return FT(h),!0}catch{return!1}},VT=tx("Object.prototype.toString"),UT="[object Number]",NT=zo()(),$T=function(h){return typeof h=="number"?!0:!h||typeof h!="object"?!1:NT?OT(h):VT(h)===UT},rx=Wt,qT=rx("Boolean.prototype.toString"),jT=rx("Object.prototype.toString"),GT=function(h){try{return qT(h),!0}catch{return!1}},ZT="[object Boolean]",WT=zo()(),HT=function(h){return typeof h=="boolean"?!0:h===null||typeof h!="object"?!1:WT?GT(h):jT(h)===ZT},vd={exports:{}},Eg=typeof BigInt<"u"&&BigInt,XT=function(){return typeof Eg=="function"&&typeof BigInt=="function"&&typeof Eg(42)=="bigint"&&typeof BigInt(42)=="bigint"},KT=XT();if(KT){var JT=BigInt.prototype.valueOf,YT=function(h){try{return JT.call(h),!0}catch{}return!1};vd.exports=function(h){return h===null||typeof h>"u"||typeof h=="boolean"||typeof h=="string"||typeof h=="number"||typeof h=="symbol"||typeof h=="function"?!1:typeof h=="bigint"?!0:YT(h)}}else vd.exports=function(h){return!1};var QT=vd.exports,eI=RT,tI=$T,rI=HT,iI=V_(),nI=QT,oI=function(h){if(h==null||typeof h!="object"&&typeof h!="function")return null;if(eI(h))return"String";if(tI(h))return"Number";if(rI(h))return"Boolean";if(iI(h))return"Symbol";if(nI(h))return"BigInt"},Nd=typeof Map=="function"&&Map.prototype?Map:null,aI=typeof Set=="function"&&Set.prototype?Set:null,yp;Nd||(yp=function(h){return!1});var ix=Nd?Map.prototype.has:null,Pg=aI?Set.prototype.has:null;!yp&&!ix&&(yp=function(h){return!1});var sI=yp||function(h){if(!h||typeof h!="object")return!1;try{if(ix.call(h),Pg)try{Pg.call(h)}catch{return!0}return h instanceof Nd}catch{}return!1},lI=typeof Map=="function"&&Map.prototype?Map:null,$d=typeof Set=="function"&&Set.prototype?Set:null,vp;$d||(vp=function(h){return!1});var Cg=lI?Map.prototype.has:null,nx=$d?Set.prototype.has:null;!vp&&!nx&&(vp=function(h){return!1});var uI=vp||function(h){if(!h||typeof h!="object")return!1;try{if(nx.call(h),Cg)try{Cg.call(h)}catch{return!0}return h instanceof $d}catch{}return!1},gp=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,kg=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,_p;gp||(_p=function(h){return!1});var gd=gp?gp.prototype.has:null,Hf=kg?kg.prototype.has:null;!_p&&!gd&&(_p=function(h){return!1});var cI=_p||function(h){if(!h||typeof h!="object")return!1;try{if(gd.call(h,gd),Hf)try{Hf.call(h,Hf)}catch{return!0}return h instanceof gp}catch{}return!1},_d={exports:{}},pI=fr,ox=Wt,hI=pI("%WeakSet%",!0),Xf=ox("WeakSet.prototype.has",!0);if(Xf){var Kf=ox("WeakMap.prototype.has",!0);_d.exports=function(h){if(!h||typeof h!="object")return!1;try{if(Xf(h,Xf),Kf)try{Kf(h,Kf)}catch{return!0}return h instanceof hI}catch{}return!1}}else _d.exports=function(h){return!1};var fI=_d.exports,dI=sI,mI=uI,yI=cI,vI=fI,gI=function(h){if(h&&typeof h=="object"){if(dI(h))return"Map";if(mI(h))return"Set";if(yI(h))return"WeakMap";if(vI(h))return"WeakSet"}return!1},_I=Wt,xI=_I("WeakRef.prototype.deref",!0),bI=typeof WeakRef>"u"?function(h){return!1}:function(h){if(!h||typeof h!="object")return!1;try{return xI(h),!0}catch{return!1}},wI=Wt,Mg=wI("FinalizationRegistry.prototype.register",!0),SI=Mg?function(h){if(!h||typeof h!="object")return!1;try{return Mg(h,{},null),!0}catch{return!1}}:function(h){return!1},Su=function(){return typeof(function(){}).name=="string"},bu=Object.getOwnPropertyDescriptor;if(bu)try{bu([],"length")}catch{bu=null}Su.functionsHaveConfigurableNames=function(){if(!Su()||!bu)return!1;var h=bu(function(){},"name");return!!h&&!!h.configurable};var TI=Function.prototype.bind;Su.boundFunctionsHaveNames=function(){return Su()&&typeof TI=="function"&&(function(){}).bind().name!==""};var ax=Su,sx=bp,II=Mo(),AI=ax(),qd=Wt,lx=qd("Function.prototype.toString"),ux=qd("String.prototype.match"),Jf=qd("Object.prototype.toString"),EI=/^class /,PI=function(h){if(sx(h)||typeof h!="function")return!1;try{var _=ux(lx(h),EI);return!!_}catch{}return!1},CI=/\s*function\s+([^(\s]*)\s*/,kI=!(0 in[,]),MI="[object Object]",zI="[object HTMLAllCollection]",BI=Function.prototype,cx=function(){return!1};if(typeof document=="object"){var DI=document.all;Jf(DI)===Jf(document.all)&&(cx=function(h){if((kI||!h)&&(typeof h>"u"||typeof h=="object"))try{var _=Jf(h);return(_===zI||_===MI)&&h("")==null}catch{}return!1})}var px=function(){if(cx(this)||!PI(this)&&!sx(this))throw new TypeError("Function.prototype.name sham getter called on non-function");if(AI&&II(this,"name"))return this.name;if(this===BI)return"";var h=lx(this),_=ux(h,CI),E=_&&_[1];return E},LI=px,hx=function(){return LI},RI=Cu.supportsDescriptors,FI=ax(),OI=hx,zg=Object.defineProperty,VI=TypeError,UI=function(){var h=OI();if(FI)return h;if(!RI)throw new VI("Shimming Function.prototype.name support requires ES5 property descriptor support.");var _=Function.prototype;return zg(_,"name",{configurable:!0,enumerable:!1,get:function(){var E=h.call(this);return this!==_&&zg(this,"name",{configurable:!0,enumerable:!1,value:E,writable:!1}),E}}),h},NI=Cu,$I=sa,fx=px,qI=hx,jI=UI,dx=$I(fx);NI(dx,{getPolyfill:qI,implementation:fx,shim:jI});var GI=dx,mx=Wt,ZI=Ap(),WI=ZI(/^\s*(?:function)?\*/),HI=zo()(),Bg=ts,XI=mx("Object.prototype.toString"),KI=mx("Function.prototype.toString"),JI=p_(),YI=function(h){if(typeof h!="function")return!1;if(WI(KI(h)))return!0;if(!HI){var _=XI(h);return _==="[object GeneratorFunction]"}if(!Bg)return!1;var E=JI();return E&&Bg(h)===E.prototype},yx=Wt,QI=Ap(),eA=yx("Object.prototype.toString"),tA=yx("Function.prototype.toString"),rA=QI(/^\s*async(?:\s+function(?:\s+|\()|\s*\()/),iA=zo()(),Dg=ts,nA=c_(),oA=function(h){if(typeof h!="function")return!1;if(rA(tA(h)))return!0;if(!iA){var _=eA(h);return _==="[object AsyncFunction]"}if(!Dg)return!1;var E=nA();return E&&E.prototype===Dg(h)},aA=oI,sA=gI,lA=hl,uA=B_(),cA=F_,pA=O_,hA=bI,fA=SI,dA=GI,mA=YI,yA=oA,vA=Wt,gA=zo()(),Yf=gA&&Symbol.toStringTag,_A=Object,Lg=vA("Promise.prototype.then",!0),xA=function(h){if(!h||typeof h!="object"||!Lg)return!1;try{return Lg(h,null,function(){}),!0}catch{}return!1},Rg=function(h){return!!h&&h!=="BigInt"&&h!=="Boolean"&&h!=="Null"&&h!=="Number"&&h!=="String"&&h!=="Symbol"&&h!=="Undefined"&&h!=="Math"&&h!=="JSON"&&h!=="Reflect"&&h!=="Atomics"&&h!=="Map"&&h!=="Set"&&h!=="WeakMap"&&h!=="WeakSet"&&h!=="BigInt64Array"&&h!=="BigUint64Array"&&h!=="Float32Array"&&h!=="Float64Array"&&h!=="Int16Array"&&h!=="Int32Array"&&h!=="Int8Array"&&h!=="Uint16Array"&&h!=="Uint32Array"&&h!=="Uint8Array"&&h!=="Uint8ClampedArray"&&h!=="Array"&&h!=="Date"&&h!=="FinalizationRegistry"&&h!=="Promise"&&h!=="RegExp"&&h!=="WeakRef"&&h!=="Function"&&h!=="GeneratorFunction"&&h!=="AsyncFunction"},bA=function(h){if(h==null)return h;var _=aA(_A(h))||sA(h)||lA(h);if(_)return _;if(uA(h))return"Array";if(cA(h))return"Date";if(pA(h))return"RegExp";if(hA(h))return"WeakRef";if(fA(h))return"FinalizationRegistry";if(typeof h=="function")return mA(h)?"GeneratorFunction":yA(h)?"AsyncFunction":"Function";if(xA(h))return"Promise";if(Yf&&Yf in h){var E=h[Yf];if(Rg(E))return E}if(typeof h.constructor=="function"){var k=dA(h.constructor);if(Rg(k))return k}return"Object"},wA=fr,SA=X_,TA=kT,IA=bA,AA=Tt,Fg=ts,EA=Sd,PA=function(h){if(!TA(h))throw new AA("Reflect.getPrototypeOf called on non-object");if(Fg)return Fg(h);var _=IA(h);if(_){var E=wA("%"+_+".prototype%",!0);if(E)return E}return SA(h.constructor)?h.constructor.prototype:h instanceof Object?EA.prototype:null},CA=PA,Og=ts,vx=function(){return typeof Reflect=="object"&&Reflect&&Reflect.getPrototypeOf?Reflect.getPrototypeOf:Og?function(_){return Og(_)}:CA},gx=wd,kA=sa,MA=vx(),zA=Tu(),xd={__proto__:null},Wc=ko,Vg=Object.defineProperty;if(Wc){var BA=function(d){return d.byteOffset};gx(zA,function(d){if(typeof st.commonjsGlobal[d]=="function"||typeof st.commonjsGlobal[d]=="object"){var h=st.commonjsGlobal[d].prototype,_=Wc(h,"byteOffset");if(!_){var E=MA(h);_=Wc(E,"byteOffset")}if(_&&_.get)xd[d]=kA(_.get);else if(Vg){var k=new st.commonjsGlobal[d](2);_=Wc(k,"byteOffset"),_&&_.configurable&&Vg(k,"length",{value:3}),k.length===2&&(xd[d]=BA)}}})}var DA=function(h){var _;return gx(xd,function(E){if(typeof _!="number")try{var k=E(h);typeof k=="number"&&(_=k)}catch{}}),_},LA=yl,jd=function(h){return LA(h)?DA(h):!1},RA=sa,_x=wd,Hc=ko,FA=yl,OA=r_,VA=vx(),bd={__proto__:null},Ug=Object.defineProperty;if(Hc){var UA=function(d){return d.length};_x(OA,function(d){var h=st.commonjsGlobal[d];if(typeof h=="function"||typeof h=="object"){var _=h.prototype,E=Hc(_,"length");if(!E){var k=VA(_);E=Hc(k,"length")}if(E&&E.get)bd["$"+d]=RA(E.get);else if(Ug){var V=new st.commonjsGlobal[d](2);E=Hc(V,"length"),E&&E.configurable&&Ug(V,"length",{value:3}),V.length===2&&(bd["$"+d]=UA)}}})}var NA=function(h){var _;return _x(bd,function(E){if(typeof _!="number")try{var k=E(h);typeof k=="number"&&(_=k)}catch{}}),_},xx=function(h){return FA(h)?NA(h):!1},Ng=Tt,$A=dl,qA=Y_,jA=Vd,GA=Q_,$g=Mu,ZA=jd,WA=xx,Gd=function(h){if(!GA(h))throw new Ng("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");var _=h["[[Object]]"],E=h["[[CachedBufferByteLength]]"];if($A($g(_))&&E!=="DETACHED")throw new Ng("Assertion failed: typed array is detached only if the byte length is ~DETACHED~");if(E==="DETACHED")return!0;var k=ZA(_),V=qA($g(_)),l,re=V?WA(_):"AUTO";if(re==="AUTO")l=E;else{var q=jA(_);l=k+re*q}return k>E||l>E},Xc=Tt,HA=Od,XA=Y_,KA=Gd,JA=Vd,YA=Q_,QA=Mu,eE=jd,tE=xx,rE=function(h){if(!YA(h))throw new Xc("Assertion failed: `taRecord` must be a TypedArray With Buffer Witness Record");if(KA(h))throw new Xc("Assertion failed: `taRecord` is out of bounds");var _=h["[[Object]]"],E=XA(QA(_)),k=E?tE(_):"AUTO";if(k!=="AUTO")return k;if(E)throw new Xc("Assertion failed: array buffer is not fixed length");var V=eE(_),l=JA(_),re=h["[[CachedBufferByteLength]]"];if(re==="DETACHED")throw new Xc("Assertion failed: typed array is detached");return HA((re-V)/l)},Qf=Tt,iE=dl,nE=fl,oE=ku,aE=P_,sE=Wt,lE=sE("SharedArrayBuffer.prototype.byteLength",!0),uE=function(h,_){var E=oE(h);if(!nE(h)&&!E)throw new Qf("Assertion failed: `arrayBuffer` must be an ArrayBuffer or a SharedArrayBuffer");if(_!=="SEQ-CST"&&_!=="UNORDERED")throw new Qf("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(iE(h))throw new Qf("Assertion failed: `arrayBuffer` must not be detached");return E?lE(h):aE(h)},qg=Tt,cE=uE,pE=dl,hE=yl,fE=Mu,dE=function(h,_){if(!hE(h))throw new qg("Assertion failed: `obj` must be a Typed Array");if(_!=="SEQ-CST"&&_!=="UNORDERED")throw new qg("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");var E=fE(h),k=pE(E)?"DETACHED":cE(E,_);return{"[[Object]]":h,"[[CachedBufferByteLength]]":k}},Kc=Tt,mE=ua,yE=Gd,vE=dE,gE=yl,bx=function(h,_){if(_!=="SEQ-CST"&&_!=="UNORDERED")throw new Kc("Assertion failed: `order` must be ~SEQ-CST~ or ~UNORDERED~");if(!mE(h))throw new Kc("Assertion failed: `O` must be an Object");if(!gE(h))throw new Kc("Assertion failed: `O` must be a Typed Array");var E=vE(h,_);if(yE(E))throw new Kc("`O` must be in-bounds and backed by a non-detached buffer");return E},_E=_n,Jc=Tt,xE=Fd,bE=K_,wE=Gd,SE=rE,TE=bx,IE=Tu(),AE=function(h,_){if(!bE(h))throw new Jc("Assertion failed: `constructor` must be a constructor");if(!xE(_))throw new Jc("Assertion failed: `argumentList` must be a List");if(IE.length===0)throw new _E("Assertion failed: Typed Arrays are not supported in this environment");var E;_.length===0?E=new h:_.length===1?E=new h(_[0]):_.length===2?E=new h(_[0],_[1]):E=new h(_[0],_[1],_[2]);var k=TE(E,"SEQ-CST");if(_.length===1&&typeof _[0]=="number"){if(wE(k))throw new Jc("new Typed Array is out of bounds");var V=SE(k);if(V<_[0])throw new Jc("`argumentList[0]` must be <= `newTypedArray.length`")}return E},an=fr,EE={__proto__:null,$Int8Array:an("%Int8Array%",!0),$Uint8Array:an("%Uint8Array%",!0),$Uint8ClampedArray:an("%Uint8ClampedArray%",!0),$Int16Array:an("%Int16Array%",!0),$Uint16Array:an("%Uint16Array%",!0),$Int32Array:an("%Int32Array%",!0),$Uint32Array:an("%Uint32Array%",!0),$BigInt64Array:an("%BigInt64Array%",!0),$BigUint64Array:an("%BigUint64Array%",!0),$Float16Array:an("%Float16Array%",!0),$Float32Array:an("%Float32Array%",!0),$Float64Array:an("%Float64Array%",!0)},PE=function(h){return EE["$"+h]},jg=_n,Gg=Tt,CE=hl,kE=Tu(),ME=Fd,zE=ST,BE=AE,DE=PE,LE=function(h,_){if(kE.length===0)throw new jg("Assertion failed: Typed Arrays are not supported in this environment");var E=CE(h);if(!E)throw new Gg("Assertion failed: exemplar must be a TypedArray");if(!ME(_))throw new Gg("Assertion failed: `argumentList` must be a List");var k=DE(E);if(typeof k!="function")throw new jg("Assertion failed: `constructor` of `exemplar` ("+E+") must exist. Please report this!");var V=zE(h,k);return BE(V,_)},RE=Tt,FE=Jw,OE=N2,VE=dl,ed=Id,Zg=Ad,UE=j2,NE=JS,Wg=rT,Hg=G_,$E=Vd,Xg=pT,qE=LE,jE=bx,td=Mu,Kg=jd,wx=function(h,_){var E=this;jE(E,"SEQ-CST");var k=E.length,V=Wg(h),l;V===-1/0?l=0:V<0?l=ed(k+V,0):l=Zg(V,k);var re=typeof _>"u"?k:Wg(_),q;re===-1/0?q=0:re<0?q=ed(k+re,0):q=Zg(re,k);var me=ed(q-l,0),pe=qE(E,[me]);if(me>0){if(VE(td(E)))throw new RE("Cannot use a Typed Array with an underlying ArrayBuffer that is detached");var ke=Xg(E),ae=Xg(pe);if(ke===ae)for(var ve=td(E),Ae=td(pe),Je=$E(E),qe=Kg(E),pt=l*Je+qe,ot=Kg(pe),Rt=ot+me*Je;ot<Rt;){var bt=OE(ve,pt,"UINT8",!0,"UNORDERED");NE(Ae,ot,"UINT8",bt,!0,"UNORDERED"),pt+=1,ot+=1}else for(var Ct=0;l<q;){var Qt=Hg(l),vr=FE(E,Qt);UE(pe,Hg(Ct),vr,!0),l+=1,Ct+=1}}return pe},GE=wx,Sx=function(){return typeof Uint8Array=="function"&&Uint8Array.prototype.slice||GE},ZE=Cu,WE=ts,HE=Sx,XE=function(){if(typeof Uint8Array=="function"){var h=HE(),_=WE(Uint8Array.prototype);ZE(_,{slice:h},{slice:function(){return _.slice!==h}})}return h},KE=Cu,JE=sa,YE=wx,Tx=Sx,QE=XE,Ix=JE(Tx());KE(Ix,{getPolyfill:Tx,implementation:YE,shim:QE});var eP=Ix,Ax=hl,Ex=eP,Jg=ko;function gl(d){return Object.prototype.toString.call(d)}function tP(d){return gl(d)==="[object Date]"}function rP(d){return gl(d)==="[object RegExp]"}function iP(d){return gl(d)==="[object Error]"}function nP(d){return gl(d)==="[object Boolean]"}function oP(d){return gl(d)==="[object Number]"}function aP(d){return gl(d)==="[object String]"}var Px=Array.isArray||function(h){return Object.prototype.toString.call(h)==="[object Array]"};function Ep(d,h){if(d.forEach)return d.forEach(h);for(var _=0;_<d.length;_++)h(d[_],_,d)}var Pp=Object.keys||function(h){var _=[];for(var E in h)_[_.length]=E;return _},sP=Object.prototype.propertyIsEnumerable,Yg=Object.getOwnPropertySymbols;function Cp(d){var h=Pp(d);if(Yg)for(var _=Yg(d),E=0;E<_.length;E++)sP.call(d,_[E])&&(h[h.length]=_[E]);return h}var kp=Object.prototype.hasOwnProperty||function(d,h){return h in d};function lP(d,h){if(typeof Jg!="function")return!0;var _=Jg(d,h);return!_||!_.writable}function Cx(d,h){if(typeof d=="object"&&d!==null){var _;if(Px(d))_=[];else if(tP(d))_=new Date(d.getTime?d.getTime():d);else if(rP(d))_=new RegExp(d);else if(iP(d))_={message:d.message};else if(nP(d)||oP(d)||aP(d))_=Object(d);else{var E=Ax(d);if(E)return Ex(d);if(Object.create&&Object.getPrototypeOf)_=Object.create(Object.getPrototypeOf(d));else if(d.constructor===Object)_={};else{var k=d.constructor&&d.constructor.prototype||d.__proto__||{},V=function(){};V.prototype=k,_=new V}}var l=h.includeSymbols?Cp:Pp;return Ep(l(d),function(re){_[re]=d[re]}),_}return d}var Zd={__proto__:null};function kx(d,h){var _=[],E=[],k=!0,V=arguments.length>2?arguments[2]:Zd,l=V.includeSymbols?Cp:Pp,re=!!V.immutable;return function q(me){var pe=re?Cx(me,V):me,ke={__proto__:null},ae=!0,ve={node:pe,node_:me,path:[].concat(_),parent:E[E.length-1],parents:E,key:_[_.length-1],removedKeys:{__proto__:null},isRoot:_.length===0,level:_.length,circular:null,update:function(qe,pt){ve.isRoot||(ve.parent.node[ve.key]=qe),ve.node=qe,pt&&(ae=!1)},delete:function(qe){delete ve.parent.node[ve.key],ve.parent.removedKeys[ve.key]=!0,qe&&(ae=!1)},remove:function(qe){Px(ve.parent.node)?(ve.parent.node.splice(ve.key,1),ve.parent.removedKeys[ve.key]=!0,qe&&(ae=!1)):ve.delete(qe)},keys:null,before:function(qe){ke.before=qe},after:function(qe){ke.after=qe},pre:function(qe){ke.pre=qe},post:function(qe){ke.post=qe},stop:function(){k=!1},block:function(){ae=!1}};if(!k)return ve;function Ae(){if(typeof ve.node=="object"&&ve.node!==null){(!ve.keys||ve.node_!==ve.node)&&(ve.keys=l(ve.node)),ve.isLeaf=ve.keys.length===0;for(var qe=0;qe<E.length;qe++)if(E[qe].node_===me){ve.circular=E[qe];break}}else ve.isLeaf=!0,ve.keys=null;ve.notLeaf=!ve.isLeaf,ve.notRoot=!ve.isRoot}Ae();var Je=h.call(ve,ve.node);return Je!==void 0&&ve.update&&ve.update(Je),ke.before&&ke.before.call(ve,ve.node),ae&&(typeof ve.node=="object"&&ve.node!==null&&!ve.circular&&(E[E.length]=ve,Ae(),Ep(ve.keys,function(qe,pt){var ot=pt-1 in ve.removedKeys;ot&&(qe=ve.keys[pt-1]),_[_.length]=qe,ke.pre&&ke.pre.call(ve,ve.node[qe],qe);var Rt=q(ve.node[qe]);re&&kp.call(ve.node,qe)&&!lP(ve.node,qe)&&!ot&&(ve.node[qe]=Rt.node),Rt.isLast=pt===ve.keys.length-1,Rt.isFirst=pt===0,ke.post&&ke.post.call(ve,Rt),_.pop()}),E.pop()),ke.after&&ke.after.call(ve,ve.node)),ve}(d).node}function sn(d){this.options=arguments.length>1?arguments[1]:Zd,this.value=d}sn.prototype.get=function(d){for(var h=this.value,_=0;h&&_<d.length;_++){var E=d[_];if(!kp.call(h,E)||!this.options.includeSymbols&&typeof E=="symbol")return;h=h[E]}return h};sn.prototype.has=function(d){var h=this.value;if(!h&&d.length>0)return!1;for(var _=0;h&&_<d.length;_++){var E=d[_];if(!kp.call(h,E)||!this.options.includeSymbols&&typeof E=="symbol")return!1;h=h[E]}return!0};sn.prototype.set=function(d,h){for(var _=this.value,E=0;E<d.length-1;E++){var k=d[E];kp.call(_,k)||(_[k]={}),_=_[k]}return _[d[E]]=h,h};sn.prototype.map=function(d){return kx(this.value,d,{__proto__:null,immutable:!0,includeSymbols:!!this.options.includeSymbols})};sn.prototype.forEach=function(d){return this.value=kx(this.value,d,this.options),this.value};sn.prototype.reduce=function(d,h){var _=arguments.length===1,E=_?this.value:h;return this.forEach(function(k){(!this.isRoot||!_)&&(E=d.call(this,E,k))}),E};sn.prototype.paths=function(){var d=[];return this.forEach(function(){d[d.length]=this.path}),d};sn.prototype.nodes=function(){var d=[];return this.forEach(function(){d[d.length]=this.node}),d};sn.prototype.clone=function(){var d=[],h=[],_=this.options;return Ax(this.value)?Ex(this.value):function E(k){for(var V=0;V<d.length;V++)if(d[V]===k)return h[V];if(typeof k=="object"&&k!==null){var l=Cx(k,_);d[d.length]=k,h[h.length]=l;var re=_.includeSymbols?Cp:Pp;return Ep(re(k),function(q){l[q]=E(k[q])}),d.pop(),h.pop(),l}return k}(this.value)};function Mx(d){var h=arguments.length>1?arguments[1]:Zd;return new sn(d,h)}Ep(Cp(sn.prototype),function(d){Mx[d]=function(h){var _=[].slice.call(arguments,1),E=new sn(h);return E[d].apply(E,_)}});var uP=Mx,cP=Si;function Si(d){if(!(this instanceof Si))return new Si(d);this._bbox=d||[1/0,1/0,-1/0,-1/0],this._valid=!!d}Si.prototype.include=function(d){return this._valid=!0,this._bbox[0]=Math.min(this._bbox[0],d[0]),this._bbox[1]=Math.min(this._bbox[1],d[1]),this._bbox[2]=Math.max(this._bbox[2],d[0]),this._bbox[3]=Math.max(this._bbox[3],d[1]),this};Si.prototype.equals=function(d){var h;return d instanceof Si?h=d.bbox():h=d,this._bbox[0]==h[0]&&this._bbox[1]==h[1]&&this._bbox[2]==h[2]&&this._bbox[3]==h[3]};Si.prototype.center=function(d){return this._valid?[(this._bbox[0]+this._bbox[2])/2,(this._bbox[1]+this._bbox[3])/2]:null};Si.prototype.union=function(d){this._valid=!0;var h;return d instanceof Si?h=d.bbox():h=d,this._bbox[0]=Math.min(this._bbox[0],h[0]),this._bbox[1]=Math.min(this._bbox[1],h[1]),this._bbox[2]=Math.max(this._bbox[2],h[2]),this._bbox[3]=Math.max(this._bbox[3],h[3]),this};Si.prototype.bbox=function(){return this._valid?this._bbox:null};Si.prototype.contains=function(d){if(!d)return this._fastContains();if(!this._valid)return null;var h=d[0],_=d[1];return this._bbox[0]<=h&&this._bbox[1]<=_&&this._bbox[2]>=h&&this._bbox[3]>=_};Si.prototype.intersect=function(d){if(!this._valid)return null;var h;return d instanceof Si?h=d.bbox():h=d,!(this._bbox[0]>h[2]||this._bbox[2]<h[0]||this._bbox[3]<h[1]||this._bbox[1]>h[3])};Si.prototype._fastContains=function(){if(!this._valid)return new Function("return null;");var d="return "+this._bbox[0]+"<= ll[0] &&"+this._bbox[1]+"<= ll[1] &&"+this._bbox[2]+">= ll[0] &&"+this._bbox[3]+">= ll[1]";return new Function("ll",d)};Si.prototype.polygon=function(){return this._valid?{type:"Polygon",coordinates:[[[this._bbox[0],this._bbox[1]],[this._bbox[2],this._bbox[1]],[this._bbox[2],this._bbox[3]],[this._bbox[0],this._bbox[3]],[this._bbox[0],this._bbox[1]]]]}:null};var pP=w0,hP=uP,fP=cP,zx={features:["FeatureCollection"],coordinates:["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"],geometry:["Feature"],geometries:["GeometryCollection"]},dP=Object.keys(zx);xp.exports=function(d){return Wd(d).bbox()};xp.exports.polygon=function(d){return Wd(d).polygon()};xp.exports.bboxify=function(d){return hP(d).map(function(h){if(h){var _=dP.some(function(E){return h[E]?zx[E].indexOf(h.type)!==-1:!1});_&&(h.bbox=Wd(h).bbox(),this.update(h))}})};function Wd(d){for(var h=fP(),_=pP(d),E=0;E<_.length;E++)h.include(_[E]);return h}var mP=xp.exports;const yP=st.getDefaultExportFromCjs(mP),vP={methods:{getIconDetails(d){const h={};switch(d){case"cities":h.name="fa-regular fa-city";break;case"towns":h.name="fa-regular fa-house-chimney-window";break;case"islands":h.name="fa-regular fa-ship";break;case"regions":h.name="fa-regular fa-map-location-dot";break;case"national-parks":h.name="fa-kit fa-vs-icon-national-park";break;case"acco":h.name="fa-regular fa-bed";break;case"acti":h.name="fa-regular fa-person-walking";break;case"attr":h.name="fa-regular fa-camera";break;case"even":h.name="fa-regular fa-ticket";break;case"cate":h.name="fa-regular fa-utensils";break;case"reta":h.name="fa-regular fa-bag-shopping";break;case"featured":h.name="fa-solid fa-star";break;case"twnv":h.name="";break;case"vics":h.name="fa-kit fa-vs-icentre-information";break;case"outlander-castle":h.name="fa-regular fa-chess-rook";break;case"outlander-church-abbey":h.name="fa-regular fa-church";break;case"outlander-city-town-village":h.name="fa-regular fa-city";break;case"outlander-heritage":h.name="fa-regular fa-landmark";break;case"outlander-landscape-park":h.name="fa-regular fa-mountain";break;case"outlander-palace-house":h.name="fa-regular fa-crown";break;case"distilleries":h.name="fa-kit fa-vs-distillery";break;case"itinerary-stop":h.name="";break}return h}}},gP={name:"VsMapMarkerIcon",status:"prototype",release:"0.0.1",components:{VsIcon:st.VsIcon},mixins:[vP],props:{id:{type:String,required:!0},isHovered:{type:Boolean,default:!1},number:{type:String,default:""},isMapMarker:{type:Boolean,default:!1}},computed:{mapMarkerType(){let d="fa-solid fa-location-pin";return this.id==="twnv"&&(d="fa-solid fa-location-dot"),d},parentClasses(){return this.isMapMarker?"vs-map-marker-icon--map-marker":""},markerClasses(){return[`vs-map-marker-icon__marker--${this.id}`,this.isHovered?"vs-map-marker-icon__marker--outline":""]}}},_P={key:0,class:"vs-map-marker-icon__count"};function xP(d,h,_,E,k,V){const l=F.resolveComponent("VsIcon");return F.openBlock(),F.createElementBlock("div",{"data-test":"vs-map-marker-icon",class:F.normalizeClass(["vs-map-marker-icon",V.parentClasses])},[F.createVNode(l,{icon:V.mapMarkerType,class:F.normalizeClass(["vs-map-marker-icon__marker",V.markerClasses]),size:"xl"},null,8,["icon","class"]),_.number?(F.openBlock(),F.createElementBlock("span",_P,[h[0]||(h[0]=F.createElementVNode("span",{class:"visually-hidden"}," Stop ",-1)),F.createTextVNode(" "+F.toDisplayString(_.number),1)])):(F.openBlock(),F.createBlock(l,{key:1,class:"vs-map-marker-icon__icon",icon:d.getIconDetails(_.id).name,size:"xs"},null,8,["icon"]))],2)}const Mp=st._export_sfc(gP,[["render",xP]]);let Xa=null;const bP={name:"VsMapMarker",status:"prototype",release:"0.0.1",components:{VsMapMarkerIcon:Mp},props:{feature:{type:Object,required:!0},mapId:{type:String,required:!0},hasPopups:{type:Boolean,required:!0},selectedPlace:{type:String,default:null}},emits:["showDetail","setCategory"],setup(){Xa=Xi()},computed:{isActive(){return!!(this.activePlace&&this.activePlace.properties&&this.activePlace.properties.id===this.feature.properties.id||this.highlightedPlace&&this.highlightedPlace.properties&&this.highlightedPlace.properties.id===this.feature.properties.id)},...aa.mapState(Xi,{highlightedPlace(d){return d.getHoveredStop(this.mapId)},activePlace(d){return d.getActivePlace(this.mapId)?d.getActivePlace(this.mapId):""},activeSubcat(d){return d.selectedSubCategory}}),getMarkerIcon(){let d;return this.feature.properties.type!==""?d=this.feature.properties.type:this.activeSubcat!==null?d=this.activeSubcat:d="featured",d==="null"&&(d=""),d}},watch:{isActive(){return this.activePlace&&this.activePlace.properties.id===this.feature.properties.id||this.highlightedPlace&&this.highlightedPlace.properties.id===this.feature.properties.id?!0:(this.activePlace&&this.activePlace.properties.id===this.feature.properties.id&&Xa.setActiveMarkerPos(this.feature.geometry.coordinates),!1)},activePlace(){this.activePlace&&this.activePlace.properties.id===this.feature.properties.id&&Xa.setActiveMarkerPos(this.feature.geometry.coordinates)}},mounted(){this.hasPopups&&document.body.addEventListener("click",this.handleClickEvent)},beforeUnmount(){document.body.removeEventListener("click",this.handleClickEvent)},methods:{markerClick(){Xa.setActiveMarkerPos(this.feature.geometry.coordinates),Xa.setActivePlace({mapId:this.mapId,activeFeature:this.feature}),this.$emit("showDetail",this.feature),this.$emit("setCategory",this.feature.properties.type)},handleHover(d){Xa.setHoveredPlace({mapId:this.mapId,hoveredFeature:d})},handleClickEvent(d){const h=document.getElementsByClassName("mapboxgl-canvas");d.target===h[0]&&Xa.setActivePlace({mapId:this.mapId,activeFeature:null})}}},wP=["aria-label"];function SP(d,h,_,E,k,V){const l=F.resolveComponent("VsMapMarkerIcon");return F.openBlock(),F.createElementBlock("button",{type:"button",class:F.normalizeClass(["vs-map-marker",V.isActive?"vs-map-marker--active":""]),"data-test":"vs-map-marker",onClick:h[0]||(h[0]=(...re)=>V.markerClick&&V.markerClick(...re)),onKeydown:h[1]||(h[1]=F.withKeys((...re)=>V.markerClick&&V.markerClick(...re),["enter"])),onMouseover:h[2]||(h[2]=re=>V.handleHover(_.feature)),onMouseleave:h[3]||(h[3]=re=>V.handleHover("")),onFocusin:h[4]||(h[4]=re=>V.handleHover(_.feature)),onFocusout:h[5]||(h[5]=re=>V.handleHover("")),"aria-label":V.getMarkerIcon},[F.createVNode(l,{id:V.getMarkerIcon,"is-map-marker":!0,number:_.feature.properties.stopCount?_.feature.properties.stopCount:""},null,8,["id","number"])],42,wP)}const Bx=st._export_sfc(bP,[["render",SP]]);let al=null;const TP={name:"VsMap",status:"prototype",release:"0.0.1",components:{VsWarning:st.VsWarning,VsLoading:st.VsLoading},props:{overviewMapLatitude:{type:String,default:"57.81"},overviewMapLongitude:{type:String,default:"-5.51748"},overviewMapZoom:{type:String,default:"5"},mapId:{type:String,required:!0},isVisible:{type:Boolean,required:!0},places:{type:Array,required:!0},filters:{type:Array,default(){return[]}},fitToMarkers:{type:Boolean,default:!1},showPolygons:{type:Boolean,default:!1},selectedItem:{type:Object,default:null},boundsData:{type:Object,default:()=>{}},showInfoMessage:{type:Boolean,default:null},resetZoom:{type:Boolean,default:!1},showMarkerPopups:{type:Boolean,default:!0},loadBrandingImmediately:{type:Boolean,default:!1}},emits:["map-ready","setCategory","showDetail","zoom-reset"],setup(){al=Xi()},data(){return{isDesktop:!1,geojsonData:{type:"FeatureCollection",features:[]},polygons:{type:"FeatureCollection",features:[]},multiPolygons:[],mapbox:{map:null,bounds:null,rotation:0,config:{container:this.$refs.mapbox,style:"https://api.visitscotland.com/maps/vector/v1/vts/resources/styles",pitchWithRotate:!1,dragRotate:!1}},markers:[],popup:null,hoveredStateId:null,activeStateId:null,showMapMessage:!0,isLoading:!0,showZoomMessage:null}},computed:{getZoom(){return this.mapbox.map?this.mapbox.map.getZoom():null},...aa.mapState(Xi,{activeMarkerPostion(d){return this.mapbox.map?d.activeMarkerPos:null},highlightedPlace(d){return this.mapbox.map?d.getHoveredStop(this.mapId):null},activePlace(d){return this.mapbox.map?d.getActivePlace(this.mapId):null}})},watch:{isVisible(d){d&&this.mapbox.map!==null&&setTimeout(()=>{this.mapbox.map.resize()},20)},places:{handler(){this.geojsonData.features=[],this.initialiseMapFeatures(),this.initialiseMapMarkers()},deep:!0},showPolygons(d){d===!0?this.showMapPolygons():this.hideMapPolygons()},highlightedPlace(d){d&&(d.length===0?this.removeHoveredPolygon():d.geometry.type!=="Point"&&this.addHoveredPolygon(d))},selectedItem(d){if(d&&d.geometry.type!=="Point"){let h=[];h=this.polygons.features.filter(_=>_.properties.id===d.properties.id),h.length>0&&this.addActivePolygon(d)}d||this.removeActivePolygon()},activeMarkerPostion(d){this.checkPointIsVisible(d)||this.centreMapOnPoint(d)},showInfoMessage(d){d?this.showMapMessage=!0:this.showMapMessage=!1},resetZoom(d){d&&(this.mapbox.map.fitBounds(this.calculateBoundingBox()),this.$emit("zoom-reset"),this.showInfoMessage&&(this.showMapMessage=!0))}},mounted(){al.addMapInstance({id:this.mapId,filters:this.filters,places:this.places,activePins:this.places}),this.lazyloadMapComponent(),this.isTablet=window.innerWidth>=768,window.addEventListener("resize",this.onResize),this.loadBrandingImmediately?dy.init({div:this.mapId}):window.addEventListener("DOMContentLoaded",()=>{dy.init({div:this.mapId})})},methods:{addMap(){const d=this.calculateBoundingBox();this.mapbox.config.container=this.$refs.mapbox,this.mapbox.map=new Zn.Map({container:this.$refs.mapbox,style:"https://api.visitscotland.com/maps/vector/v1/vts/resources/styles",bounds:d,maxZoom:18,minZoom:4,trackResize:!0}),this.mapbox.map.scrollZoom.disable(),this.mapbox.map.on("rotate",()=>{this.mapbox.rotation=this.mapbox.map.transform.angle}),this.mapbox.map.resize(),this.mapbox.map.on("load",()=>{this.addMapPolygons(),this.showMapMessage=!1,this.isLoading=!1,this.$emit("map-ready",!0),this.mapbox.map.boxZoom.enable()}),this.mapbox.map.on("zoomend",()=>{this.mapbox.map.getZoom()===4?(this.showZoomMessage="too-far",this.showMapMessage=!0):this.mapbox.map.getZoom()===18?(this.showZoomMessage="too-close",this.showMapMessage=!0):this.showInfoMessage||(this.showZoomMessage=null,this.showMapMessage=!1)})},addMapControls(){const d=new Zn.NavigationControl;this.mapbox.map.addControl(d,"top-right"),this.mapbox.map.addControl(new Zn.FullscreenControl)},initialiseMapFeatures(){this.places.map(d=>{if(typeof d.geometry<"u"){const h=this.getCoordinateArray(d);return this.getMapFeatures(d,h)}return d.latitude&&d.longitude?this.getItineraryMapFeatures(d):!1})},getCoordinateArray(d){return d.geometry.type==="Polygon"?[d.geometry.coordinates[0]]:d.geometry.type==="MultiPolygon"?[d.geometry.coordinates]:[d.geometry.coordinates[0],d.geometry.coordinates[1]]},getMapFeatures(d,h){return this.geojsonData.features.push({type:"Feature",geometry:{type:d.geometry.type,coordinates:h},properties:{title:d.properties.title,imageSrc:d.image,type:typeof d.properties.category<"u"?d.properties.category.id:"",id:d.properties.id},id:d.properties.id})},getItineraryMapFeatures(d){const h=this._uid;return this.geojsonData.features.push({type:"Feature",geometry:{type:"Point",coordinates:[parseFloat(d.longitude),parseFloat(d.latitude)]},properties:{title:d.title,imageSrc:d.imageSrc,type:"itinerary-stop",stopCount:d.stopCount,id:h},id:h})},initialiseMapMarkers(){let d=0;this.initialLoad&&(d=1e3),setTimeout(()=>{if(this.markers!==null){for(let h=this.markers.length-1;h>=0;h--)this.markers[h].remove();this.markers=[]}this.geojsonData.features.forEach(h=>{h.geometry.type==="Point"&&this.createMapMarker(h)})},d)},createMapMarker(d){const h=F.h(Bx,{feature:d,mapId:this.mapId,hasPopups:this.showMarkerPopups,onShowDetail:k=>{this.$emit("showDetail",k)},onSetCategory:k=>{this.$emit("setCategory",k)}}),_=document.createElement("div");this.$refs.mapboxOuter.appendChild(_),F.render(h,_),d&&this.showMarkerPopups&&this.addMapPopup(d);const E=new Zn.Marker(_.children[0]).setLngLat(d.geometry.coordinates).setPopup(this.popup).addTo(this.mapbox.map);this.setupMarkerListeners(E),this.markers.push(E),_.remove()},hideMapPolygons(){this.mapbox.map.setLayoutProperty("regionFills","visibility","none"),this.mapbox.map.setLayoutProperty("regionBorders","visibility","none")},showMapPolygons(){this.mapbox.map.setLayoutProperty("regionFills","visibility","visible"),this.mapbox.map.setLayoutProperty("regionBorders","visibility","visible")},addMapPolygons(){this.geojsonData.features.forEach(d=>{d.geometry.type==="Polygon"?this.polygons.features.includes(d.properties.id)||this.polygons.features.push(d):d.geometry.type==="MultiPolygon"&&(this.polygons.features.includes(d.properties.id)||this.multiPolygons.push(d))}),this.multiPolygons.forEach(d=>{const h=d.properties;d.geometry.coordinates[0].forEach(_=>{this.polygons.features.push({geometry:{type:"Polygon",coordinates:_},id:h.id,properties:{id:h.id,imageSrc:h.imageSrc,title:h.title,type:h.type},type:"Feature"})})}),this.polygons.features.length>0&&(this.mapbox.map.addSource("regions",{type:"geojson",data:this.polygons,promoteId:"id"}),this.mapbox.map.addLayer({id:"regionFills",type:"fill",source:"regions",layout:{},paint:{"fill-color":["case",["==",["feature-state","interaction-state"],"hover"],"rgba(168,48,140,0.5)",["==",["feature-state","interaction-state"],"active"],"rgba(168,48,140,0.5)","rgba(25,200,197,0.6)"],"fill-opacity":.8}}),this.mapbox.map.addLayer({id:"regionBorders",type:"line",source:"regions",layout:{},paint:{"line-color":"#fff","line-width":1}}),this.hideMapPolygons(),this.mapbox.map.on("mousemove","regionFills",d=>{d.features.length>0&&(this.addMapPopup(d),this.removeHoveredPolygon(),this.addHoveredPolygon(d.features[0]))}),this.mapbox.map.on("mouseleave","regionFills",d=>{this.removeMapPopup(d),this.removeHoveredPolygon()}),this.mapbox.map.on("click","regionFills",d=>{this.removeActivePolygon(),this.addActivePolygon(d.features[0]),this.addMapPopup(d.features[0])}))},removeActivePolygon(){this.mapbox.map.style._layers.regionFills&&(this.mapbox.map.setFeatureState({source:"regions",id:this.activeStateId},{"interaction-state":""}),this.activeStateId=null)},addActivePolygon(d){this.activeStateId=d.properties.id,this.mapbox.map.setFeatureState({source:"regions",id:this.activeStateId},{"interaction-state":"active"}),al.setActivePlace({mapId:this.mapId,activeFeature:d}),this.$emit("showDetail",d),this.$emit("setCategory","regions")},removeHoveredPolygon(){if(this.hoveredStateId){let d="";this.hoveredStateId===this.activeStateId&&(d="active"),this.mapbox.map.setFeatureState({source:"regions",id:this.hoveredStateId},{"interaction-state":d})}al.setHoveredPlace({mapId:this.mapId,hoveredFeature:""}),this.hoveredStateId=null},addHoveredPolygon(d){this.hoveredStateId=d.properties.id,this.mapbox.map.setFeatureState({source:"regions",id:this.hoveredStateId},{"interaction-state":"hover"}),this.addMapPopup(d),al.setHoveredPlace({mapId:this.mapId,hoveredFeature:d})},addMapPopup(d){let h="";d.features?h=d.features[0]:h=d;const _=this.getCoordinates(h),E=this.getPopupHtml(h);h.properties.id&&(this.removeMapPopup(d),this.popup=new Zn.Popup({closeButton:!1,offset:{top:[0,20],bottom:[0,-40],left:[30,-20],right:[-30,-20]}}).setLngLat(_).setHTML(E).addTo(this.mapbox.map))},removeMapPopup(d){this.popup&&(this.popup.remove(),this.popup=null),d._popup&&d._popup.remove()},getCoordinates(d){return d.geometry.type==="Polygon"?this.findFeatureCentre(d.geometry.coordinates):d.geometry.type==="MultiPolygon"?this.findFeatureCentre(d.geometry.coordinates[0]):d.geometry.coordinates},findFeatureCentre(d){const h=[],_=[];return d[0].forEach(E=>{h.push(E[1]),_.push(E[0])}),{lat:(Math.min(...h)+Math.max(...h))/2,lng:(Math.min(..._)+Math.max(..._))/2}},getPopupHtml(d){return d.properties.imageSrc&&d.properties.stopCount?`
|
|
501
501
|
<img class="vs-map__popup-image" src="${d.properties.imageSrc}" />
|
|
502
502
|
<div>
|
|
503
503
|
<h4 class="vs-map__popup-subtitle">Stop ${d.properties.stopCount}</h4>
|
|
@@ -505,4 +505,4 @@ uniform `+B+" "+L+" u_"+R+`;
|
|
|
505
505
|
</div>
|
|
506
506
|
`:`
|
|
507
507
|
<p class="vs-map__popup-title">${d.properties.title}</p>
|
|
508
|
-
`},setupMarkerListeners(d){document.body.addEventListener("keyup",_=>{(_.key==="Escape"||_.key==="Tab")&&(this.removeMapPopup(d),this.showMarkerPopups&&al.setActivePlace({mapId:this.mapId,activeFeature:null}))}),d.getElement().addEventListener("keyup",_=>{_.key==="Enter"&&(d._popup.isOpen()||d._popup.addTo(this.mapbox.map))})},fitToBounds(){this.mapbox.map.fitBounds(sP(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(Zn.supported({failIfMajorPerformanceCaveat:!0}),!("IntersectionObserver"in window)){this.initialiseMapComponent();return}this.observer=new IntersectionObserver(d=>{d[0].intersectionRatio>0&&(this.observer.unobserve(this.$el),this.initialiseMapComponent())}),this.observer.observe(this.$el)},onResize(){this.isTablet=window.innerWidth>=768},getBoundsFromPolygon(){const d=this.boundsData.coordinates[0];return d.reduce((h,_)=>h.extend(_),new Zn.LngLatBounds(d[0],d[0]))},checkPointIsVisible(){return this.mapbox.map.getBounds().contains(this.activeMarkerPostion)},centreMapOnPoint(d){this.mapbox.map.flyTo({center:d})},calculateBoundingBox(){let d;if(typeof this.boundsData>"u"||this.boundsData.type==="undefined")d=[[-7.555827,54.608836],[-.778285,60.880894]];else if(this.boundsData.type==="bounds"){const h=new Zn.LngLat(this.boundsData.coordinates[1][0],this.boundsData.coordinates[1][1]),_=new Zn.LngLat(this.boundsData.coordinates[0][0],this.boundsData.coordinates[0][1]);d=new Zn.LngLatBounds(h,_)}else this.boundsData.type==="Polygon"?d=this.getBoundsFromPolygon():d=[[-7.555827,54.608836],[-.778285,60.880894]];return d}}},yP={class:"vs-map","data-test":"vs-map"},vP={class:"vs-map__message-box"},gP={class:"vs-map__message-text"},_P={ref:"mapboxOuter",class:"vs-map__map-outer"},xP=["id"];function bP(d,h,_,E,k,V){const l=F.resolveComponent("VsLoading"),re=F.resolveComponent("VsWarning");return F.openBlock(),F.createElementBlock("div",yP,[k.showMapMessage?(F.openBlock(),F.createElementBlock("div",{key:0,class:F.normalizeClass(["vs-map__message",k.showZoomMessage?"":"vs-map__message--with-overlay"]),"data-test":"vs-map__message"},[F.createElementVNode("div",vP,[k.isLoading?(F.openBlock(),F.createBlock(l,{key:0,class:"vs-map__loading"})):F.createCommentVNode("",!0),F.createElementVNode("p",gP,[k.isLoading?F.renderSlot(d.$slots,"map-loading-text",{key:0}):_.showInfoMessage?F.renderSlot(d.$slots,"info-message",{key:1}):k.showZoomMessage==="too-close"?F.renderSlot(d.$slots,"zoom-too-close",{key:2}):k.showZoomMessage==="too-far"?F.renderSlot(d.$slots,"zoom-too-far",{key:3}):F.createCommentVNode("",!0)])])],2)):F.createCommentVNode("",!0),F.createElementVNode("div",_P,[F.createElementVNode("div",{id:_.mapId,class:"vs-map__map",ref:"mapbox"},null,8,xP)],512),F.createVNode(re,{class:"vs-map__no-js"},{default:F.withCtx(()=>[F.renderSlot(d.$slots,"no-js")]),_:3})])}const kx=st._export_sfc(mP,[["render",bP]]),wP={name:"VsMapWithSidebarCategories",status:"prototype",release:"0.0.1",components:{VsMapMarkerIcon:Mp,VsIcon:st.VsIcon},props:{categoryName:{type:String,required:!0},type:{type:String,required:!0},hasSubCat:{type:Boolean,default:!1}},data(){return{isHovered:!1}},methods:{selectCategory(d){this.hasSubCat?this.$parent.$emit("set-subcategory",d):(this.$parent.$emit("set-category",d),this.$parent.$emit("set-stage",1))}}},SP={class:"vs-main-map-category","data-test":"vs-main-map-category"};function TP(d,h,_,E,k,V){const l=F.resolveComponent("VsMapMarkerIcon"),re=F.resolveComponent("VsIcon");return F.openBlock(),F.createElementBlock("div",SP,[F.createElementVNode("button",{type:"button",class:F.normalizeClass(["vs-main-map-category__button",`vs-main-map-category__button--${_.type}`]),"data-test":"vs-main-map-category__button",onClick:h[0]||(h[0]=G=>V.selectCategory(_.type)),onMouseover:h[1]||(h[1]=G=>k.isHovered=!0),onMouseout:h[2]||(h[2]=G=>k.isHovered=!1),onFocusin:h[3]||(h[3]=G=>k.isHovered=!0),onFocusout:h[4]||(h[4]=G=>k.isHovered=!1)},[F.createElementVNode("div",null,[F.createVNode(l,{class:"vs-main-map-category__icon",id:_.type,"is-hovered":k.isHovered},null,8,["id","is-hovered"]),F.createTextVNode(" "+F.toDisplayString(_.categoryName),1)]),F.createVNode(re,{icon:"fa-regular fa-arrow-right",variant:"highlight",size:"xs",class:"vs-main-map-category__icon align-self-center me-0"})],34)])}const IP=st._export_sfc(wP,[["render",TP]]);let Yc=null;const AP={name:"VsMapWithSidebarSubCategories",status:"prototype",release:"0.0.1",components:{BFormGroup:st.ku,BFormCheckboxGroup:st.uu,BFormCheckbox:st.fn,VsMapMarkerIcon:Mp},props:{data:{type:Array,required:!0},selectedSubCategory:{type:String,required:!0}},data(){return{selected:[]}},computed:{activeSubcatFilters(){return Yc?Yc.activeSubcatFilters:null},...aa.mapState(Xi,{activeSubcatFilters(d){return d.activeSubcatFilters}})},mounted(){Yc=Xi(),this.selected=this.activeSubcatFilters,this.emitter&&(this.emitter.on("clearSelectedSubcats",()=>{this.selected=[]}),this.emitter.on("submitCheckboxData",()=>{this.checkboxesChangeSubmit()}));const d=document.getElementsByClassName("vs-main-map-subcategory")[0];d&&d.querySelectorAll('input[type="checkbox"]')[0].focus()},beforeUnmount(){this.emitter&&this.emitter.off("submitCheckboxData")},methods:{checkboxesChangeSubmit(){Yc.setActiveSubcatFilters(this.selected),this.$parent.$emit("subcategories-filtered",this.selected)},emitChange(){this.emitter&&this.emitter.emit("checkboxes-selected",this.selected)}}},EP={class:"vs-main-map-subcategory","data-test":"vs-main-map-subcategory"};function PP(d,h,_,E,k,V){const l=F.resolveComponent("VsMapMarkerIcon"),re=F.resolveComponent("BFormCheckbox"),G=F.resolveComponent("BFormCheckboxGroup"),me=F.resolveComponent("BFormGroup");return F.openBlock(),F.createElementBlock("div",EP,[F.createVNode(me,null,{default:F.withCtx(()=>[F.createVNode(G,{id:"checkbox-group-1",modelValue:k.selected,"onUpdate:modelValue":h[0]||(h[0]=pe=>k.selected=pe),name:_.data.name},{default:F.withCtx(()=>[(F.openBlock(!0),F.createElementBlock(F.Fragment,null,F.renderList(_.data,pe=>(F.openBlock(),F.createBlock(re,{key:pe.id,value:pe.id,onChange:V.emitChange},{default:F.withCtx(()=>[F.createVNode(l,{class:"vs-main-map-subcategory__icon",id:_.selectedSubCategory},null,8,["id"]),F.createTextVNode(" "+F.toDisplayString(pe.name),1)]),_:2},1032,["value","onChange"]))),128))]),_:1},8,["modelValue","name"])]),_:1})])}const CP=st._export_sfc(AP,[["render",PP]]);let rd=null;const kP={name:"VsMapWithSidebarListItem",status:"prototype",release:"0.0.1",components:{VsImg:st.VsImg,VsIcon:st.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)},...aa.mapState(Xi,{highlightedPlace(d){return d.getHoveredStop(this.mapId)}})},created(){this.fromEndpoint?this.formatApiData():this.formattedData=this.itemData},mounted(){rd=Xi(),this.focussed&&this.$refs.btn.focus()},methods:{showItemDetail(d){rd.setActivePlace({mapId:this.mapId,activeFeature:d}),this.$parent.$emit("show-item-detail",d),this.$parent.$emit("set-stage",2)},itemHover(d){rd.setHoveredPlace({mapId:this.mapId,hoveredFeature:d})},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"}}}},MP={class:"vs-map-with-sidebar-list-item__img-container"},zP={class:"vs-map-with-sidebar-list-item__text"};function BP(d,h,_,E,k,V){const l=F.resolveComponent("VsImg"),re=F.resolveComponent("VsIcon");return F.openBlock(),F.createElementBlock("button",{type:"button",class:F.normalizeClass(["vs-map-with-sidebar-list-item",V.isActive?"vs-map-with-sidebar-list-item--hovered":""]),"data-test":"vs-map-with-sidebar-list-item",onClick:h[0]||(h[0]=G=>V.showItemDetail(k.formattedData)),onKeyup:h[1]||(h[1]=F.withKeys(G=>V.showItemDetail(k.formattedData),["enter"])),onMouseover:h[2]||(h[2]=G=>V.itemHover(k.formattedData)),onMouseleave:h[3]||(h[3]=G=>V.itemHover("")),onFocusin:h[4]||(h[4]=G=>V.itemHover(k.formattedData)),onFocusout:h[5]||(h[5]=G=>V.itemHover("")),ref:"btn"},[F.createElementVNode("div",MP,[typeof k.formattedData.properties.image<"u"?(F.openBlock(),F.createBlock(l,{key:0,src:k.formattedData.properties.image,class:"vs-map-with-sidebar-list-item__img"},null,8,["src"])):F.createCommentVNode("",!0)]),F.createElementVNode("span",zP,F.toDisplayString(k.formattedData.properties.title),1),F.createVNode(re,{icon:"fa-regular fa-arrow-right",variant:"highlight",size:"xxs",class:"vs-map-with-sidebar-list-item__icon"})],34)}const DP=st._export_sfc(kP,[["render",BP]]),LP={name:"VsMapWithSidebarDetail",status:"prototype",release:"0.0.1",components:{VsImg:st.VsImg,VsHeading:st.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"}}},RP={class:"vs-map-with-sidebar-detail","data-test":"vs-map-with-sidebar-detail"},FP={key:2,"data-test":"vs-map-with-sidebar-detail__address",class:"vs-map-with-sidebar-detail__address"},OP={key:3,class:"mt-100"},VP=["innerHTML"];function UP(d,h,_,E,k,V){const l=F.resolveComponent("VsImg"),re=F.resolveComponent("VsHeading");return F.openBlock(),F.createElementBlock("div",RP,[typeof _.contentData.properties.image<"u"?(F.openBlock(),F.createBlock(l,{key:0,src:_.contentData.properties.image,class:"vs-map-with-sidebar-detail__image mb-125 mb-lg-075"},null,8,["src"])):F.createCommentVNode("",!0),V.showTitle?(F.openBlock(),F.createBlock(re,{key:1,level:_.headingLevel,"heading-style":"heading-xxs",class:"vs-map-with-sidebar-detail__heading mt-0","data-test":"vs-map-with-sidebar-detail__heading"},{default:F.withCtx(()=>[typeof _.contentData.properties.placeTitle<"u"?(F.openBlock(),F.createElementBlock(F.Fragment,{key:0},[F.createTextVNode(F.toDisplayString(_.contentData.properties.placeTitle),1)],64)):(F.openBlock(),F.createElementBlock(F.Fragment,{key:1},[F.createTextVNode(F.toDisplayString(_.contentData.properties.title),1)],64))]),_:1},8,["level"])):F.createCommentVNode("",!0),typeof _.contentData.properties.address<"u"?(F.openBlock(),F.createElementBlock("p",FP,F.toDisplayString(_.contentData.properties.address.shortAddress),1)):F.createCommentVNode("",!0),_.contentData.properties.subtitle?(F.openBlock(),F.createElementBlock("p",OP,F.toDisplayString(_.contentData.properties.subtitle),1)):F.createCommentVNode("",!0),F.createElementVNode("div",{"data-test":"vs-map-with-sidebar-detail__description",class:"vs-map-with-sidebar-detail__description mb-150",innerHTML:_.contentData.properties.description},null,8,VP)])}const NP=st._export_sfc(LP,[["render",UP]]),$P={name:"VsMapWithSidebarButtons",status:"prototype",release:"0.0.1",components:{VsButton:st.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 jP(d,h,_,E,k,V){const l=F.resolveComponent("VsButton");return F.openBlock(),F.createElementBlock("div",{class:F.normalizeClass(["vs-map-with-sidebar-buttons",_.filterCount!==null?"vs-map-with-sidebar-buttons--filters":""]),"data-test":"vs-map-with-sidebar-buttons"},[_.filterCount!==null?(F.openBlock(),F.createElementBlock(F.Fragment,{key:0},[F.createVNode(l,{class:"vs-map-with-sidebar-buttons__clear-filters","data-test":"vs-map-with-sidebar-buttons__clear-filters",variant:"secondary",size:"sm",onClick:V.clearFiltersClick},{default:F.withCtx(()=>[F.createTextVNode(F.toDisplayString(V.clearFiltersText),1)]),_:1},8,["onClick"]),F.createVNode(l,{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:V.filtersClick},{default:F.withCtx(()=>[F.createTextVNode(F.toDisplayString(_.filterCount)+" "+F.toDisplayString(V.filtersAppliedText),1)]),_:1},8,["onClick"])],64)):(F.openBlock(),F.createElementBlock(F.Fragment,{key:1},[F.createVNode(l,{href:_.contentData.properties.link.link,"data-test":"vs-map-with-sidebar-buttons__discover",class:"mb-050"},{default:F.withCtx(()=>[F.createTextVNode(F.toDisplayString(_.contentData.properties.link.label),1)]),_:1},8,["href"]),V.websiteDataExists?(F.openBlock(),F.createBlock(l,{key:0,href:_.contentData.properties.website.link,target:"_blank",rel:"noopener noreferrer","data-test":"vs-map-with-sidebar-buttons__website",variant:"secondary"},{default:F.withCtx(()=>[F.createTextVNode(F.toDisplayString(_.contentData.properties.website.label),1)]),_:1},8,["href"])):F.createCommentVNode("",!0)],64))],2)}const qP=st._export_sfc($P,[["render",jP]]),GP={name:"VsMapWithSidebarControls",status:"prototype",release:"0.0.1",components:{VsButton:st.VsButton},inject:["clearSelectionText","applyFiltersText"],data(){return{isDisabled:!0}},computed:{...aa.mapState(Xi,{getSubcatFilters(d){return d.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",d=>{d.length>0?this.isDisabled=!1:this.isDisabled=!0}),this.getSubcatFilters.length>0&&(this.isDisabled=!1)}}},ZP={class:"vs-main-map-controls","data-test":"vs-main-map-controls"};function WP(d,h,_,E,k,V){const l=F.resolveComponent("VsButton");return F.openBlock(),F.createElementBlock("div",ZP,[F.createVNode(l,{class:"vs-main-map-controls__clear-selection","data-test":"vs-main-map-subcategory__clear-selection",size:"sm",variant:"secondary",onClick:V.clearSelection,onKeyup:F.withKeys(V.clearSelection,["enter"])},{default:F.withCtx(()=>[F.createTextVNode(F.toDisplayString(V.clearSelectionText),1)]),_:1},8,["onClick","onKeyup"]),F.createVNode(l,{class:"vs-main-map-controls__apply-filters","data-test":"vs-main-map-subcategory__apply-filters",size:"sm",onKeypress:F.withKeys(V.submitCheckboxes,["enter"]),onClick:V.submitCheckboxes,"aria-disabled":k.isDisabled,disabled:k.isDisabled},{default:F.withCtx(()=>[F.createTextVNode(F.toDisplayString(V.applyFiltersText),1)]),_:1},8,["onKeypress","onClick","aria-disabled","disabled"])])}const HP=st._export_sfc(GP,[["render",WP]]);let id=null;const XP={name:"VsMapWithSidebarPanel",status:"prototype",release:"0.0.1",components:{VsButton:st.VsButton,VsMapWithSidebarCategory:IP,VsMapWithSidebarSubcategory:CP,VsHeading:st.VsHeading,VsMapWithSidebarListItem:DP,VsMapWithSidebarDetail:NP,VsMapWithSidebarButtons:qP,VsMapWithSidebarControls:HP},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 d="";if(this.selectedSubcategory!==null)d=this.selectedSubcategoryData[0].label;else switch(this.currentStage){case 0:d=this.categoryHeading;break;case 1:case 2:d=this.currentFilter.label;break}return d},currentData(){return this.selectedCategory==="regions"?this.regions:this.placesData},panelClasses(){let d="";return this.currentStage===2&&(d+=" vs-map-with-sidebar-panel--small-padding"),d},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 d="";return this.filters.forEach(h=>{h.id===this.selectedCategory&&(d=h)}),d},currentPlaceData(){let d=this.placesData;return this.selectedCategory==="regions"&&(d=this.regions),this.currentEndpointData.length>0?this.refineEndpointData(this.currentEndpointData):d.filter(h=>typeof h.properties<"u"&&this.selectedItem?h.properties.id===this.selectedItem.properties.id:!1)},selectedSubcategoryData(){return this.selectedSubcategory?this.filters.filter(h=>h.id===this.selectedSubcategory):[]},...aa.mapState(Xi,{subCatFilterCount(d){return d.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(){id=Xi()},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 d=this.currentStage-1;this.setStage(d)}},resetPanel(){id.setSelectedSubcat(null),this.setStage(0)},setStage(d){d===0&&(this.placesLoaded=1),this.$emit("set-stage",d)},subCatExists(d){return typeof d.subCategory<"u"&&d.subCategory.length>0},refineEndpointData(d){const h=[{isEndpoint:!0,properties:{category:d[0].category[0].id,id:d[0].id,image:d[0].images[0].mediaUrl,placeTitle:d[0].name,description:d[0].description,link:{label:d[0].productLink.label,link:d[0].productLink.link,type:d[0].productLink.type},website:{label:d[0].website.label,link:d[0].website.link,type:d[0].website.type},address:{shortAddress:""}}}];return typeof d[0].address<"u"&&(h[0].properties.address.shortAddress=d[0].address.shortAddress),h},clearSubCatFilters(){id.setActiveSubcatFilters([]),this.setStage(0)},loadMorePlaces(){this.placesLoaded+=1,this.$emit("load-more-places",this.placesLoaded)}}},KP={class:"vs-map-with-sidebar-panel__buttons d-lg-none"},JP={key:0,class:"vs-map-with-sidebar-panel__back"},YP={key:1,class:"vs-map-with-sidebar-panel__back"},QP={class:"vs-map-with-sidebar-panel__close"},eC={key:0,class:"vs-map-with-sidebar-panel__back d-none d-lg-block"},tC={key:2,class:"vs-map-with-sidebar-panel__bottom-message"},rC={class:"vs-map-with-sidebar-panel__list-container"},iC={key:3,class:"vs-map-with-sidebar-panel__overlay"},nC={key:0,class:"vs-map-with-sidebar-panel__overlay-box"},oC={class:"vs-map-with-sidebar-panel__overlay-text"};function aC(d,h,_,E,k,V){const l=F.resolveComponent("VsButton"),re=F.resolveComponent("VsHeading"),G=F.resolveComponent("VsMapWithSidebarSubcategory"),me=F.resolveComponent("VsMapWithSidebarControls"),pe=F.resolveComponent("VsMapWithSidebarCategory"),Ce=F.resolveComponent("VsMapWithSidebarListItem"),ae=F.resolveComponent("VsMapWithSidebarButtons"),ve=F.resolveComponent("VsMapWithSidebarDetail");return F.openBlock(),F.createElementBlock("section",{"data-test":"vs-map-with-sidebar-panel",class:F.normalizeClass(["vs-map-with-sidebar-panel",V.panelClasses])},[F.createElementVNode("div",{class:F.normalizeClass(["vs-map-with-sidebar-panel__header-section",V.headerClasses])},[F.createElementVNode("div",KP,[_.currentStage>1||_.selectedSubcategory?(F.openBlock(),F.createElementBlock("div",JP,[F.createVNode(l,{class:"vs-map-with-sidebar-panel_menu",icon:"vs-icon-control-menu",size:"sm",onClick:V.stageBack,"data-test":"vs-map-with-sidebar__menu-toggle",variant:"secondary"},{default:F.withCtx(()=>[F.renderSlot(d.$slots,"menu-btn-text")]),_:3},8,["onClick"])])):F.createCommentVNode("",!0),_.currentStage===1||_.selectedSubcategory?(F.openBlock(),F.createElementBlock("div",YP,[F.createVNode(l,{"icon-only":"",icon:"fa-regular fa-arrow-left",size:"md",variant:"subtle",onClick:V.stageBack,"data-test":"vs-map-with-sidebar-panel--btn-back"},{default:F.withCtx(()=>[F.renderSlot(d.$slots,"back-btn-text")]),_:3},8,["onClick"])])):F.createCommentVNode("",!0),F.createElementVNode("div",QP,[F.createVNode(l,{"icon-only":"",icon:"vs-icon-control-dismiss",size:"md",variant:"subtle",onClick:V.closePanel,"data-test":"vs-map-with-sidebar-panel--btn-close"},{default:F.withCtx(()=>[F.renderSlot(d.$slots,"close-side-panel-text")]),_:3},8,["onClick"])])]),_.currentStage>0||_.selectedSubcategory?(F.openBlock(),F.createElementBlock("div",eC,[F.createVNode(l,{"icon-only":"",icon:"fa-regular fa-arrow-left",size:"md",variant:"subtle",onClick:V.stageBack,"data-test":"vs-map-with-sidebar-panel--btn-back"},{default:F.withCtx(()=>[F.renderSlot(d.$slots,"back-btn-text")]),_:3},8,["onClick"])])):F.createCommentVNode("",!0),V.currentHeading!==""?(F.openBlock(),F.createBlock(re,{key:1,level:_.headingLevel,"heading-style":_.currentStage===0?"heading-m":"heading-xs",class:F.normalizeClass(["vs-map-with-sidebar-panel__heading text-center mt-200 mt-lg-0",_.currentStage===2?"d-none d-lg-block":""]),"data-test":"vs-map-with-sidebar-panel__heading"},{default:F.withCtx(()=>[F.createTextVNode(F.toDisplayString(V.currentHeading),1)]),_:1},8,["level","heading-style","class"])):F.createCommentVNode("",!0),F.createElementVNode("div",{class:F.normalizeClass(["vs-map-with-sidebar-panel__reset",_.currentStage<2?"d-lg-none":""])},[F.createVNode(l,{"icon-only":"",icon:"vs-icon-control-dismiss",size:"md",variant:"subtle",onClick:V.resetPanel,"data-test":"vs-map-with-sidebar-panel--btn-reset"},{default:F.withCtx(()=>[F.renderSlot(d.$slots,"reset-side-panel-text")]),_:3},8,["onClick"])],2)],2),_.currentStage===0?(F.openBlock(),F.createElementBlock(F.Fragment,{key:0},[_.selectedSubcategory!==null?(F.openBlock(),F.createElementBlock(F.Fragment,{key:0},[F.createVNode(G,{data:V.selectedSubcategoryData[0].subCategory,"selected-sub-category":_.selectedSubcategory},null,8,["data","selected-sub-category"]),F.createVNode(me)],64)):(F.openBlock(!0),F.createElementBlock(F.Fragment,{key:1},F.renderList(V.filtersWithLocations,ke=>(F.openBlock(),F.createBlock(pe,{key:ke.id,"category-name":ke.label,type:ke.id,"has-sub-cat":V.subCatExists(ke)},null,8,["category-name","type","has-sub-cat"]))),128)),_.panelMessage!==null?(F.openBlock(),F.createElementBlock("div",tC,[F.createElementVNode("p",null,F.toDisplayString(_.panelMessage),1)])):F.createCommentVNode("",!0)],64)):F.createCommentVNode("",!0),_.currentStage===1?(F.openBlock(),F.createElementBlock(F.Fragment,{key:1},[_.selectedSubcategory!==null?(F.openBlock(),F.createElementBlock(F.Fragment,{key:0},[F.createElementVNode("div",rC,[(F.openBlock(!0),F.createElementBlock(F.Fragment,null,F.renderList(_.subcategoryLocations,(ke,Xe)=>(F.openBlock(),F.createBlock(Ce,{key:ke.id,"item-data":ke,"from-endpoint":!0,focussed:Xe===_.currentListItemFocus,onShowItemDetail:$e=>d.showDetail(ke)},null,8,["item-data","focussed","onShowItemDetail"]))),128)),V.showLoadMore?(F.openBlock(),F.createBlock(l,{key:0,class:"vs-map-with-sidebar-panel__load-more","data-test":"vs-map-with-sidebar-panel__load-more",onClick:h[0]||(h[0]=ke=>V.loadMorePlaces()),onKeyup:h[1]||(h[1]=F.withKeys(ke=>V.loadMorePlaces(),["enter"]))},{default:F.withCtx(()=>[F.renderSlot(d.$slots,"load-more-text")]),_:3})):F.createCommentVNode("",!0)]),F.createVNode(ae,{"content-data":{},"filter-count":d.subCatFilterCount,onClearFilters:V.clearSubCatFilters},null,8,["filter-count","onClearFilters"])],64)):(F.openBlock(!0),F.createElementBlock(F.Fragment,{key:1},F.renderList(V.currentData,ke=>(F.openBlock(),F.createElementBlock("div",{key:ke.id},[typeof ke.properties<"u"&&ke.properties.category.id===_.selectedCategory?(F.openBlock(),F.createBlock(Ce,{key:0,"item-data":ke,onShowItemDetail:Xe=>d.showDetail(ke)},null,8,["item-data","onShowItemDetail"])):F.createCommentVNode("",!0)]))),128))],64)):F.createCommentVNode("",!0),_.currentStage===2?(F.openBlock(),F.createElementBlock(F.Fragment,{key:2},[F.createVNode(ve,{"heading-level":V.detailHeadingLevel,"content-data":V.currentPlaceData[0]},null,8,["heading-level","content-data"]),F.createVNode(ae,{"content-data":V.currentPlaceData[0]},null,8,["content-data"])],64)):F.createCommentVNode("",!0),_.panelStatus!==null?(F.openBlock(),F.createElementBlock("div",iC,[d.$slots["panel-loading-message"]&&_.panelStatus!=="map-loading"?(F.openBlock(),F.createElementBlock("div",nC,[F.createElementVNode("p",oC,[F.renderSlot(d.$slots,"panel-loading-message")])])):F.createCommentVNode("",!0)])):F.createCommentVNode("",!0)],2)}const sC=st._export_sfc(XP,[["render",aC]]);let Qc=null;const lC={name:"VsMapWithSidebar",status:"prototype",release:"0.0.1",components:{VsContainer:st.VsContainer,VsRow:st.VsRow,VsCol:st.VsCol,VsMap:kx,VsButton:st.VsButton,VsMapWithSidebarPanel:sC,VsButtonToggleGroup:st.VsButtonToggleGroup,VsWarning:st.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(d=>d.geometry.type==="Polygon"||d.geometry.type==="MultiPolygon")},...aa.mapState(Xi,{subCatActiveFilters(d){return d.activeSubcatFilters}}),infoMessage(){let d="";switch(this.mapStatus){case"no-results":d=this.mapNoResultsMessage;break;case"filter-results":d=this.mapFilterMessage;break}return d},existingCategories(){return this.placesData?[...new Set(this.placesData.map(d=>d.properties.category.id))]:[]},filtersWithLocations(){return this.filters.filter(d=>!!(this.existingCategories.includes(d.id)||d.subCategory&&d.subCategory.length))},togglesWithLocations(){return this.existingCategories.indexOf("vics")===-1?this.toggleData.filter(d=>d.value!=="icentres"):this.toggleData}},watch:{selectedSubCategory(d){d===null&&(this.mapStatus="",this.resetZoom=!0)}},mounted(){Qc=Xi(),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(d){document.fullscreenElement&&document.exitFullscreen(),this.selectedItem=d,this.setStage(2),this.openPanel(),this.selectedSubCategory===null&&this.filterPlaces(this.selectedCategory)},setCategory(d){this.selectedCategory=d,this.selectedSubCategory===null&&this.filterPlaces(d)},setSubCategory(d){Qc.setSelectedSubcat(d),this.selectedSubCategory=d,d!==null?(this.getSubcatMarkerData(),this.selectedCategory=d):(Qc.setActiveSubcatFilters([]),this.showAllPlaces())},filterSubCategories(d){let h="";d.forEach(_=>{const E=`&cat=${_}`;h+=E}),this.currentPanelEndpointFilters=h,this.getSubcatMarkerData(h),this.getSubcatPanelData(h,0)},getSubcatMarkerData(d){const h=this.filters.filter(_=>_.id===this.selectedSubCategory);if(h.length>0){let _=h[0].pinsEndpoint;typeof d<"u"&&(_+=d),this.activePins=[],typeof d>"u"?(this.activePins=[],this.mapStatus="filter-results"):st.axios.get(_).then(E=>{this.totalEndpointPins=E.data.features.length,this.totalEndpointPins===0?this.mapStatus="no-results":(E.data.features.forEach(k=>{const V=k;V.properties.apiData=!0,this.activePins.push(V)}),this.mapStatus="")})}},getSubcatPanelData(d,h){let E=this.filters.filter(k=>k.id===this.selectedSubCategory)[0].listProductsEndPoint;typeof d<"u"&&(E+=d),h!==0&&(E+=`${d}&page=${h}`),this.panelStatus="loading-data",st.axios.get(E).then(k=>{typeof k.data.data.products<"u"?(this.setStage(1),h===0?(this.subCatList=k.data.data.products,this.focussedListItem=0):(this.focussedListItem=h*24,this.subCatList=this.subCatList.concat(k.data.data.products))):this.mapStatus="no-results",this.panelStatus=null})},setStage(d){if(d===2&&this.detailsEndpoint!==""&&this.selectedSubCategory!==null){const h=`${this.detailsEndpoint}${this.selectedItem.properties.id}`;st.axios.get(h).then(_=>{const E=[];E.push(_.data.data),this.currentEndpointData=E,this.currentStage=d})}else this.currentStage=d,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);d!==2&&(Qc.setActivePlace({mapId:this.mapId,activeFeature:""}),this.selectedItem=null)},filterPlaces(d){if(d==="regions")this.showRegions=!0,this.activePins=[],this.selectedToggle="regions";else{this.showRegions=!1,this.selectedToggle="places";const h=this.placesData.filter(_=>typeof _.properties<"u"?_.properties.category.id===d:!1);this.activePins=h}},loadMorePlaces(d){this.getSubcatPanelData(this.currentPanelEndpointFilters,d)},showAllPlaces(){this.activePins=this.placesData,this.showRegions=!1},onToggleChanged(d){d==="regions"?(this.setCategory("regions"),this.setStage(1)):d==="icentres"?(this.setCategory("vics"),this.setStage(1)):d==="places-regional"?(this.setCategory("twnv"),this.setStage(1)):(this.showAllPlaces(),this.setStage(0))},setMapReady(d){this.mapReady=d,d?this.panelStatus=null:this.panelStatus="loading"},categoryHasData(d){return this.existingCategories.indexOf(d)!==-1}}};function uC(d,h,_,E,k,V){const l=F.resolveComponent("VsMapWithSidebarPanel"),re=F.resolveComponent("VsButton"),G=F.resolveComponent("VsMap"),me=F.resolveComponent("VsButtonToggleGroup"),pe=F.resolveComponent("VsWarning"),Ce=F.resolveComponent("VsCol"),ae=F.resolveComponent("VsRow"),ve=F.resolveComponent("VsContainer");return F.openBlock(),F.createBlock(ve,{"data-test":"vs-map-with-sidebar"},{default:F.withCtx(()=>[F.createVNode(ae,null,{default:F.withCtx(()=>[F.createVNode(Ce,null,{default:F.withCtx(()=>[F.createElementVNode("div",{class:"vs-map-with-sidebar",ref:_.mapId},[F.createElementVNode("div",{class:F.normalizeClass(["vs-map-with-sidebar__side-panel",V.panelDisplayClass]),"data-test":"vs-map-with-sidebar__side-panel"},[F.createVNode(l,{"category-heading":_.categoryHeading,"selected-category":k.selectedCategory,"selected-subcategory":k.selectedSubCategory,"current-stage":k.currentStage,"selected-item":k.selectedItem,"heading-level":_.mainHeadingExists?"3":"2","subcategory-locations":k.subCatList,"current-endpoint-data":k.currentEndpointData,"panel-status":k.panelStatus,"panel-message":k.currentStage===0?_.panelMessage:null,"total-pins":k.totalEndpointPins,"current-list-item-focus":k.focussedListItem,onSetCategory:V.setCategory,onSetSubcategory:V.setSubCategory,onSubcategoriesFiltered:V.filterSubCategories,onSetStage:V.setStage,onClosePanel:V.closePanel,onShowItemDetail:V.showDetail,onFilterPlaces:V.filterPlaces,onLoadMorePlaces:V.loadMorePlaces},{closePanelText:F.withCtx(()=>[F.renderSlot(d.$slots,"close-side-panel-text")]),"reset-side-panel-text":F.withCtx(()=>[F.renderSlot(d.$slots,"reset-side-panel-text")]),"menu-btn-text":F.withCtx(()=>[F.renderSlot(d.$slots,"menu-btn-text")]),"panel-loading-message":F.withCtx(()=>[F.renderSlot(d.$slots,"panel-loading-message")]),"load-more-text":F.withCtx(()=>[F.renderSlot(d.$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),F.createElementVNode("div",{class:F.normalizeClass(["vs-map-with-sidebar__map",V.mapDisplayClass])},[F.createVNode(re,{class:"vs-map-with-sidebar__map-toggle",icon:"vs-icon-control-menu",size:"sm",onClick:V.openMenu,"data-test":"vs-map-with-sidebar__map-toggle",variant:"secondary"},{default:F.withCtx(()=>[F.renderSlot(d.$slots,"open-side-panel-text")]),_:3},8,["onClick"]),F.createVNode(G,{"is-visible":!k.panelVisible,labels:{},filters:V.filtersWithLocations,places:k.activePins,"selected-item":k.selectedItem,"map-id":_.mapId,"show-polygons":k.showRegions,"show-info-message":k.mapStatus!=="",onShowDetail:V.showDetail,onSetCategory:V.setCategory,onMapReady:V.setMapReady,onZoomReset:h[0]||(h[0]=ke=>k.resetZoom=!1),"bounds-data":_.regionBounds,"reset-zoom":k.resetZoom,"show-marker-popups":!1,"load-branding-immediately":_.loadBrandingImmediately},{"map-loading-text":F.withCtx(()=>[F.renderSlot(d.$slots,"map-loading-text")]),"info-message":F.withCtx(()=>[F.createTextVNode(F.toDisplayString(V.infoMessage),1)]),"zoom-too-close":F.withCtx(()=>[F.renderSlot(d.$slots,"zoom-too-close")]),"zoom-too-far":F.withCtx(()=>[F.renderSlot(d.$slots,"zoom-too-far")]),"no-js":F.withCtx(()=>[F.renderSlot(d.$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"]),V.togglesWithLocations.length>1?(F.openBlock(),F.createBlock(me,{key:0,"data-test":"vs-map-with-sidebar__map-toggle-group","initial-selected":k.selectedToggle,options:V.togglesWithLocations,"buttons-label":_.buttonsLabel,onToggleChanged:V.onToggleChanged},null,8,["initial-selected","options","buttons-label","onToggleChanged"])):F.createCommentVNode("",!0)],2)],512),F.createVNode(pe,{class:"vs-map-with-sidebar__no-js"},{default:F.withCtx(()=>[F.renderSlot(d.$slots,"no-js")]),_:3})]),_:3})]),_:3})]),_:3})}const cC=st._export_sfc(lC,[["render",uC]]);exports.VsMap=kx;exports.VsMapMarker=Cx;exports.VsMapMarkerIcon=Mp;exports.VsMapWithSidebar=cC;
|
|
508
|
+
`},setupMarkerListeners(d){document.body.addEventListener("keyup",_=>{(_.key==="Escape"||_.key==="Tab")&&(this.removeMapPopup(d),this.showMarkerPopups&&al.setActivePlace({mapId:this.mapId,activeFeature:null}))}),d.getElement().addEventListener("keyup",_=>{_.key==="Enter"&&(d._popup.isOpen()||d._popup.addTo(this.mapbox.map))})},fitToBounds(){this.mapbox.map.fitBounds(yP(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(Zn.supported({failIfMajorPerformanceCaveat:!0}),!("IntersectionObserver"in window)){this.initialiseMapComponent();return}this.observer=new IntersectionObserver(d=>{d[0].intersectionRatio>0&&(this.observer.unobserve(this.$el),this.initialiseMapComponent())}),this.observer.observe(this.$el)},onResize(){this.isTablet=window.innerWidth>=768},getBoundsFromPolygon(){const d=this.boundsData.coordinates[0];return d.reduce((h,_)=>h.extend(_),new Zn.LngLatBounds(d[0],d[0]))},checkPointIsVisible(){return this.mapbox.map.getBounds().contains(this.activeMarkerPostion)},centreMapOnPoint(d){this.mapbox.map.flyTo({center:d})},calculateBoundingBox(){let d;if(typeof this.boundsData>"u"||this.boundsData.type==="undefined")d=[[-7.555827,54.608836],[-.778285,60.880894]];else if(this.boundsData.type==="bounds"){const h=new Zn.LngLat(this.boundsData.coordinates[1][0],this.boundsData.coordinates[1][1]),_=new Zn.LngLat(this.boundsData.coordinates[0][0],this.boundsData.coordinates[0][1]);d=new Zn.LngLatBounds(h,_)}else this.boundsData.type==="Polygon"?d=this.getBoundsFromPolygon():d=[[-7.555827,54.608836],[-.778285,60.880894]];return d}}},IP={class:"vs-map","data-test":"vs-map"},AP={class:"vs-map__message-box"},EP={class:"vs-map__message-text"},PP={ref:"mapboxOuter",class:"vs-map__map-outer"},CP=["id"];function kP(d,h,_,E,k,V){const l=F.resolveComponent("VsLoading"),re=F.resolveComponent("VsWarning");return F.openBlock(),F.createElementBlock("div",IP,[k.showMapMessage?(F.openBlock(),F.createElementBlock("div",{key:0,class:F.normalizeClass(["vs-map__message",k.showZoomMessage?"":"vs-map__message--with-overlay"]),"data-test":"vs-map__message"},[F.createElementVNode("div",AP,[k.isLoading?(F.openBlock(),F.createBlock(l,{key:0,class:"vs-map__loading"})):F.createCommentVNode("",!0),F.createElementVNode("p",EP,[k.isLoading?F.renderSlot(d.$slots,"map-loading-text",{key:0}):_.showInfoMessage?F.renderSlot(d.$slots,"info-message",{key:1}):k.showZoomMessage==="too-close"?F.renderSlot(d.$slots,"zoom-too-close",{key:2}):k.showZoomMessage==="too-far"?F.renderSlot(d.$slots,"zoom-too-far",{key:3}):F.createCommentVNode("",!0)])])],2)):F.createCommentVNode("",!0),F.createElementVNode("div",PP,[F.createElementVNode("div",{id:_.mapId,class:"vs-map__map",ref:"mapbox"},null,8,CP)],512),F.createVNode(re,{class:"vs-map__no-js"},{default:F.withCtx(()=>[F.renderSlot(d.$slots,"no-js")]),_:3})])}const Dx=st._export_sfc(TP,[["render",kP]]),MP={name:"VsMapWithSidebarCategories",status:"prototype",release:"0.0.1",components:{VsMapMarkerIcon:Mp,VsIcon:st.VsIcon},props:{categoryName:{type:String,required:!0},type:{type:String,required:!0},hasSubCat:{type:Boolean,default:!1}},data(){return{isHovered:!1}},methods:{selectCategory(d){this.hasSubCat?this.$parent.$emit("set-subcategory",d):(this.$parent.$emit("set-category",d),this.$parent.$emit("set-stage",1))}}},zP={class:"vs-main-map-category","data-test":"vs-main-map-category"};function BP(d,h,_,E,k,V){const l=F.resolveComponent("VsMapMarkerIcon"),re=F.resolveComponent("VsIcon");return F.openBlock(),F.createElementBlock("div",zP,[F.createElementVNode("button",{type:"button",class:F.normalizeClass(["vs-main-map-category__button",`vs-main-map-category__button--${_.type}`]),"data-test":"vs-main-map-category__button",onClick:h[0]||(h[0]=q=>V.selectCategory(_.type)),onMouseover:h[1]||(h[1]=q=>k.isHovered=!0),onMouseout:h[2]||(h[2]=q=>k.isHovered=!1),onFocusin:h[3]||(h[3]=q=>k.isHovered=!0),onFocusout:h[4]||(h[4]=q=>k.isHovered=!1)},[F.createElementVNode("div",null,[F.createVNode(l,{class:"vs-main-map-category__icon",id:_.type,"is-hovered":k.isHovered},null,8,["id","is-hovered"]),F.createTextVNode(" "+F.toDisplayString(_.categoryName),1)]),F.createVNode(re,{icon:"fa-regular fa-arrow-right",variant:"highlight",size:"xs",class:"vs-main-map-category__icon align-self-center me-0"})],34)])}const DP=st._export_sfc(MP,[["render",BP]]);let Yc=null;const LP={name:"VsMapWithSidebarSubCategories",status:"prototype",release:"0.0.1",components:{BFormGroup:st.ku,BFormCheckboxGroup:st.uu,BFormCheckbox:st.fn,VsMapMarkerIcon:Mp},props:{data:{type:Array,required:!0},selectedSubCategory:{type:String,required:!0}},data(){return{selected:[]}},computed:{activeSubcatFilters(){return Yc?Yc.activeSubcatFilters:null},...aa.mapState(Xi,{activeSubcatFilters(d){return d.activeSubcatFilters}})},mounted(){Yc=Xi(),this.selected=this.activeSubcatFilters,this.emitter&&(this.emitter.on("clearSelectedSubcats",()=>{this.selected=[]}),this.emitter.on("submitCheckboxData",()=>{this.checkboxesChangeSubmit()}));const d=document.getElementsByClassName("vs-main-map-subcategory")[0];d&&d.querySelectorAll('input[type="checkbox"]')[0].focus()},beforeUnmount(){this.emitter&&this.emitter.off("submitCheckboxData")},methods:{checkboxesChangeSubmit(){Yc.setActiveSubcatFilters(this.selected),this.$parent.$emit("subcategories-filtered",this.selected)},emitChange(){this.emitter&&this.emitter.emit("checkboxes-selected",this.selected)}}},RP={class:"vs-main-map-subcategory","data-test":"vs-main-map-subcategory"};function FP(d,h,_,E,k,V){const l=F.resolveComponent("VsMapMarkerIcon"),re=F.resolveComponent("BFormCheckbox"),q=F.resolveComponent("BFormCheckboxGroup"),me=F.resolveComponent("BFormGroup");return F.openBlock(),F.createElementBlock("div",RP,[F.createVNode(me,null,{default:F.withCtx(()=>[F.createVNode(q,{id:"checkbox-group-1",modelValue:k.selected,"onUpdate:modelValue":h[0]||(h[0]=pe=>k.selected=pe),name:_.data.name},{default:F.withCtx(()=>[(F.openBlock(!0),F.createElementBlock(F.Fragment,null,F.renderList(_.data,pe=>(F.openBlock(),F.createBlock(re,{key:pe.id,value:pe.id,onChange:V.emitChange},{default:F.withCtx(()=>[F.createVNode(l,{class:"vs-main-map-subcategory__icon",id:_.selectedSubCategory},null,8,["id"]),F.createTextVNode(" "+F.toDisplayString(pe.name),1)]),_:2},1032,["value","onChange"]))),128))]),_:1},8,["modelValue","name"])]),_:1})])}const OP=st._export_sfc(LP,[["render",FP]]);let rd=null;const VP={name:"VsMapWithSidebarListItem",status:"prototype",release:"0.0.1",components:{VsImg:st.VsImg,VsIcon:st.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)},...aa.mapState(Xi,{highlightedPlace(d){return d.getHoveredStop(this.mapId)}})},created(){this.fromEndpoint?this.formatApiData():this.formattedData=this.itemData},mounted(){rd=Xi(),this.focussed&&this.$refs.btn.focus()},methods:{showItemDetail(d){rd.setActivePlace({mapId:this.mapId,activeFeature:d}),this.$parent.$emit("show-item-detail",d),this.$parent.$emit("set-stage",2)},itemHover(d){rd.setHoveredPlace({mapId:this.mapId,hoveredFeature:d})},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"}}}},UP={class:"vs-map-with-sidebar-list-item__img-container"},NP={class:"vs-map-with-sidebar-list-item__text"};function $P(d,h,_,E,k,V){const l=F.resolveComponent("VsImg"),re=F.resolveComponent("VsIcon");return F.openBlock(),F.createElementBlock("button",{type:"button",class:F.normalizeClass(["vs-map-with-sidebar-list-item",V.isActive?"vs-map-with-sidebar-list-item--hovered":""]),"data-test":"vs-map-with-sidebar-list-item",onClick:h[0]||(h[0]=q=>V.showItemDetail(k.formattedData)),onKeyup:h[1]||(h[1]=F.withKeys(q=>V.showItemDetail(k.formattedData),["enter"])),onMouseover:h[2]||(h[2]=q=>V.itemHover(k.formattedData)),onMouseleave:h[3]||(h[3]=q=>V.itemHover("")),onFocusin:h[4]||(h[4]=q=>V.itemHover(k.formattedData)),onFocusout:h[5]||(h[5]=q=>V.itemHover("")),ref:"btn"},[F.createElementVNode("div",UP,[typeof k.formattedData.properties.image<"u"?(F.openBlock(),F.createBlock(l,{key:0,src:k.formattedData.properties.image,class:"vs-map-with-sidebar-list-item__img"},null,8,["src"])):F.createCommentVNode("",!0)]),F.createElementVNode("span",NP,F.toDisplayString(k.formattedData.properties.title),1),F.createVNode(re,{icon:"fa-regular fa-arrow-right",variant:"highlight",size:"xxs",class:"vs-map-with-sidebar-list-item__icon"})],34)}const qP=st._export_sfc(VP,[["render",$P]]),jP={name:"VsMapWithSidebarDetail",status:"prototype",release:"0.0.1",components:{VsImg:st.VsImg,VsHeading:st.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"}}},GP={class:"vs-map-with-sidebar-detail","data-test":"vs-map-with-sidebar-detail"},ZP={key:2,"data-test":"vs-map-with-sidebar-detail__address",class:"vs-map-with-sidebar-detail__address"},WP={key:3,class:"mt-100"},HP=["innerHTML"];function XP(d,h,_,E,k,V){const l=F.resolveComponent("VsImg"),re=F.resolveComponent("VsHeading");return F.openBlock(),F.createElementBlock("div",GP,[typeof _.contentData.properties.image<"u"?(F.openBlock(),F.createBlock(l,{key:0,src:_.contentData.properties.image,class:"vs-map-with-sidebar-detail__image mb-125 mb-lg-075"},null,8,["src"])):F.createCommentVNode("",!0),V.showTitle?(F.openBlock(),F.createBlock(re,{key:1,level:_.headingLevel,"heading-style":"heading-xxs",class:"vs-map-with-sidebar-detail__heading mt-0","data-test":"vs-map-with-sidebar-detail__heading"},{default:F.withCtx(()=>[typeof _.contentData.properties.placeTitle<"u"?(F.openBlock(),F.createElementBlock(F.Fragment,{key:0},[F.createTextVNode(F.toDisplayString(_.contentData.properties.placeTitle),1)],64)):(F.openBlock(),F.createElementBlock(F.Fragment,{key:1},[F.createTextVNode(F.toDisplayString(_.contentData.properties.title),1)],64))]),_:1},8,["level"])):F.createCommentVNode("",!0),typeof _.contentData.properties.address<"u"?(F.openBlock(),F.createElementBlock("p",ZP,F.toDisplayString(_.contentData.properties.address.shortAddress),1)):F.createCommentVNode("",!0),_.contentData.properties.subtitle?(F.openBlock(),F.createElementBlock("p",WP,F.toDisplayString(_.contentData.properties.subtitle),1)):F.createCommentVNode("",!0),F.createElementVNode("div",{"data-test":"vs-map-with-sidebar-detail__description",class:"vs-map-with-sidebar-detail__description mb-150",innerHTML:_.contentData.properties.description},null,8,HP)])}const KP=st._export_sfc(jP,[["render",XP]]),JP={name:"VsMapWithSidebarButtons",status:"prototype",release:"0.0.1",components:{VsButton:st.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 YP(d,h,_,E,k,V){const l=F.resolveComponent("VsButton");return F.openBlock(),F.createElementBlock("div",{class:F.normalizeClass(["vs-map-with-sidebar-buttons",_.filterCount!==null?"vs-map-with-sidebar-buttons--filters":""]),"data-test":"vs-map-with-sidebar-buttons"},[_.filterCount!==null?(F.openBlock(),F.createElementBlock(F.Fragment,{key:0},[F.createVNode(l,{class:"vs-map-with-sidebar-buttons__clear-filters","data-test":"vs-map-with-sidebar-buttons__clear-filters",variant:"secondary",size:"sm",onClick:V.clearFiltersClick},{default:F.withCtx(()=>[F.createTextVNode(F.toDisplayString(V.clearFiltersText),1)]),_:1},8,["onClick"]),F.createVNode(l,{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:V.filtersClick},{default:F.withCtx(()=>[F.createTextVNode(F.toDisplayString(_.filterCount)+" "+F.toDisplayString(V.filtersAppliedText),1)]),_:1},8,["onClick"])],64)):(F.openBlock(),F.createElementBlock(F.Fragment,{key:1},[F.createVNode(l,{href:_.contentData.properties.link.link,"data-test":"vs-map-with-sidebar-buttons__discover",class:"mb-050"},{default:F.withCtx(()=>[F.createTextVNode(F.toDisplayString(_.contentData.properties.link.label),1)]),_:1},8,["href"]),V.websiteDataExists?(F.openBlock(),F.createBlock(l,{key:0,href:_.contentData.properties.website.link,target:"_blank",rel:"noopener noreferrer","data-test":"vs-map-with-sidebar-buttons__website",variant:"secondary"},{default:F.withCtx(()=>[F.createTextVNode(F.toDisplayString(_.contentData.properties.website.label),1)]),_:1},8,["href"])):F.createCommentVNode("",!0)],64))],2)}const QP=st._export_sfc(JP,[["render",YP]]),eC={name:"VsMapWithSidebarControls",status:"prototype",release:"0.0.1",components:{VsButton:st.VsButton},inject:["clearSelectionText","applyFiltersText"],data(){return{isDisabled:!0}},computed:{...aa.mapState(Xi,{getSubcatFilters(d){return d.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",d=>{d.length>0?this.isDisabled=!1:this.isDisabled=!0}),this.getSubcatFilters.length>0&&(this.isDisabled=!1)}}},tC={class:"vs-main-map-controls","data-test":"vs-main-map-controls"};function rC(d,h,_,E,k,V){const l=F.resolveComponent("VsButton");return F.openBlock(),F.createElementBlock("div",tC,[F.createVNode(l,{class:"vs-main-map-controls__clear-selection","data-test":"vs-main-map-subcategory__clear-selection",size:"sm",variant:"secondary",onClick:V.clearSelection,onKeyup:F.withKeys(V.clearSelection,["enter"])},{default:F.withCtx(()=>[F.createTextVNode(F.toDisplayString(V.clearSelectionText),1)]),_:1},8,["onClick","onKeyup"]),F.createVNode(l,{class:"vs-main-map-controls__apply-filters","data-test":"vs-main-map-subcategory__apply-filters",size:"sm",onKeypress:F.withKeys(V.submitCheckboxes,["enter"]),onClick:V.submitCheckboxes,"aria-disabled":k.isDisabled,disabled:k.isDisabled},{default:F.withCtx(()=>[F.createTextVNode(F.toDisplayString(V.applyFiltersText),1)]),_:1},8,["onKeypress","onClick","aria-disabled","disabled"])])}const iC=st._export_sfc(eC,[["render",rC]]);let id=null;const nC={name:"VsMapWithSidebarPanel",status:"prototype",release:"0.0.1",components:{VsButton:st.VsButton,VsMapWithSidebarCategory:DP,VsMapWithSidebarSubcategory:OP,VsHeading:st.VsHeading,VsMapWithSidebarListItem:qP,VsMapWithSidebarDetail:KP,VsMapWithSidebarButtons:QP,VsMapWithSidebarControls:iC},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 d="";if(this.selectedSubcategory!==null)d=this.selectedSubcategoryData[0].label;else switch(this.currentStage){case 0:d=this.categoryHeading;break;case 1:case 2:d=this.currentFilter.label;break}return d},currentData(){return this.selectedCategory==="regions"?this.regions:this.placesData},panelClasses(){let d="";return this.currentStage===2&&(d+=" vs-map-with-sidebar-panel--small-padding"),d},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 d="";return this.filters.forEach(h=>{h.id===this.selectedCategory&&(d=h)}),d},currentPlaceData(){let d=this.placesData;return this.selectedCategory==="regions"&&(d=this.regions),this.currentEndpointData.length>0?this.refineEndpointData(this.currentEndpointData):d.filter(h=>typeof h.properties<"u"&&this.selectedItem?h.properties.id===this.selectedItem.properties.id:!1)},selectedSubcategoryData(){return this.selectedSubcategory?this.filters.filter(h=>h.id===this.selectedSubcategory):[]},...aa.mapState(Xi,{subCatFilterCount(d){return d.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(){id=Xi()},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 d=this.currentStage-1;this.setStage(d)}},resetPanel(){id.setSelectedSubcat(null),this.setStage(0)},setStage(d){d===0&&(this.placesLoaded=1),this.$emit("set-stage",d)},subCatExists(d){return typeof d.subCategory<"u"&&d.subCategory.length>0},refineEndpointData(d){const h=[{isEndpoint:!0,properties:{category:d[0].category[0].id,id:d[0].id,image:d[0].images[0].mediaUrl,placeTitle:d[0].name,description:d[0].description,link:{label:d[0].productLink.label,link:d[0].productLink.link,type:d[0].productLink.type},website:{label:d[0].website.label,link:d[0].website.link,type:d[0].website.type},address:{shortAddress:""}}}];return typeof d[0].address<"u"&&(h[0].properties.address.shortAddress=d[0].address.shortAddress),h},clearSubCatFilters(){id.setActiveSubcatFilters([]),this.setStage(0)},loadMorePlaces(){this.placesLoaded+=1,this.$emit("load-more-places",this.placesLoaded)}}},oC={class:"vs-map-with-sidebar-panel__buttons d-lg-none"},aC={key:0,class:"vs-map-with-sidebar-panel__back"},sC={key:1,class:"vs-map-with-sidebar-panel__back"},lC={class:"vs-map-with-sidebar-panel__close"},uC={key:0,class:"vs-map-with-sidebar-panel__back d-none d-lg-block"},cC={key:2,class:"vs-map-with-sidebar-panel__bottom-message"},pC={class:"vs-map-with-sidebar-panel__list-container"},hC={key:3,class:"vs-map-with-sidebar-panel__overlay"},fC={key:0,class:"vs-map-with-sidebar-panel__overlay-box"},dC={class:"vs-map-with-sidebar-panel__overlay-text"};function mC(d,h,_,E,k,V){const l=F.resolveComponent("VsButton"),re=F.resolveComponent("VsHeading"),q=F.resolveComponent("VsMapWithSidebarSubcategory"),me=F.resolveComponent("VsMapWithSidebarControls"),pe=F.resolveComponent("VsMapWithSidebarCategory"),ke=F.resolveComponent("VsMapWithSidebarListItem"),ae=F.resolveComponent("VsMapWithSidebarButtons"),ve=F.resolveComponent("VsMapWithSidebarDetail");return F.openBlock(),F.createElementBlock("section",{"data-test":"vs-map-with-sidebar-panel",class:F.normalizeClass(["vs-map-with-sidebar-panel",V.panelClasses])},[F.createElementVNode("div",{class:F.normalizeClass(["vs-map-with-sidebar-panel__header-section",V.headerClasses])},[F.createElementVNode("div",oC,[_.currentStage>1||_.selectedSubcategory?(F.openBlock(),F.createElementBlock("div",aC,[F.createVNode(l,{class:"vs-map-with-sidebar-panel_menu",icon:"vs-icon-control-menu",size:"sm",onClick:V.stageBack,"data-test":"vs-map-with-sidebar__menu-toggle",variant:"secondary"},{default:F.withCtx(()=>[F.renderSlot(d.$slots,"menu-btn-text")]),_:3},8,["onClick"])])):F.createCommentVNode("",!0),_.currentStage===1||_.selectedSubcategory?(F.openBlock(),F.createElementBlock("div",sC,[F.createVNode(l,{"icon-only":"",icon:"fa-regular fa-arrow-left",size:"md",variant:"subtle",onClick:V.stageBack,"data-test":"vs-map-with-sidebar-panel--btn-back"},{default:F.withCtx(()=>[F.renderSlot(d.$slots,"back-btn-text")]),_:3},8,["onClick"])])):F.createCommentVNode("",!0),F.createElementVNode("div",lC,[F.createVNode(l,{"icon-only":"",icon:"vs-icon-control-dismiss",size:"md",variant:"subtle",onClick:V.closePanel,"data-test":"vs-map-with-sidebar-panel--btn-close"},{default:F.withCtx(()=>[F.renderSlot(d.$slots,"close-side-panel-text")]),_:3},8,["onClick"])])]),_.currentStage>0||_.selectedSubcategory?(F.openBlock(),F.createElementBlock("div",uC,[F.createVNode(l,{"icon-only":"",icon:"fa-regular fa-arrow-left",size:"md",variant:"subtle",onClick:V.stageBack,"data-test":"vs-map-with-sidebar-panel--btn-back"},{default:F.withCtx(()=>[F.renderSlot(d.$slots,"back-btn-text")]),_:3},8,["onClick"])])):F.createCommentVNode("",!0),V.currentHeading!==""?(F.openBlock(),F.createBlock(re,{key:1,level:_.headingLevel,"heading-style":_.currentStage===0?"heading-m":"heading-xs",class:F.normalizeClass(["vs-map-with-sidebar-panel__heading text-center mt-200 mt-lg-0",_.currentStage===2?"d-none d-lg-block":""]),"data-test":"vs-map-with-sidebar-panel__heading"},{default:F.withCtx(()=>[F.createTextVNode(F.toDisplayString(V.currentHeading),1)]),_:1},8,["level","heading-style","class"])):F.createCommentVNode("",!0),F.createElementVNode("div",{class:F.normalizeClass(["vs-map-with-sidebar-panel__reset",_.currentStage<2?"d-lg-none":""])},[F.createVNode(l,{"icon-only":"",icon:"vs-icon-control-dismiss",size:"md",variant:"subtle",onClick:V.resetPanel,"data-test":"vs-map-with-sidebar-panel--btn-reset"},{default:F.withCtx(()=>[F.renderSlot(d.$slots,"reset-side-panel-text")]),_:3},8,["onClick"])],2)],2),_.currentStage===0?(F.openBlock(),F.createElementBlock(F.Fragment,{key:0},[_.selectedSubcategory!==null?(F.openBlock(),F.createElementBlock(F.Fragment,{key:0},[F.createVNode(q,{data:V.selectedSubcategoryData[0].subCategory,"selected-sub-category":_.selectedSubcategory},null,8,["data","selected-sub-category"]),F.createVNode(me)],64)):(F.openBlock(!0),F.createElementBlock(F.Fragment,{key:1},F.renderList(V.filtersWithLocations,Ae=>(F.openBlock(),F.createBlock(pe,{key:Ae.id,"category-name":Ae.label,type:Ae.id,"has-sub-cat":V.subCatExists(Ae)},null,8,["category-name","type","has-sub-cat"]))),128)),_.panelMessage!==null?(F.openBlock(),F.createElementBlock("div",cC,[F.createElementVNode("p",null,F.toDisplayString(_.panelMessage),1)])):F.createCommentVNode("",!0)],64)):F.createCommentVNode("",!0),_.currentStage===1?(F.openBlock(),F.createElementBlock(F.Fragment,{key:1},[_.selectedSubcategory!==null?(F.openBlock(),F.createElementBlock(F.Fragment,{key:0},[F.createElementVNode("div",pC,[(F.openBlock(!0),F.createElementBlock(F.Fragment,null,F.renderList(_.subcategoryLocations,(Ae,Je)=>(F.openBlock(),F.createBlock(ke,{key:Ae.id,"item-data":Ae,"from-endpoint":!0,focussed:Je===_.currentListItemFocus,onShowItemDetail:qe=>d.showDetail(Ae)},null,8,["item-data","focussed","onShowItemDetail"]))),128)),V.showLoadMore?(F.openBlock(),F.createBlock(l,{key:0,class:"vs-map-with-sidebar-panel__load-more","data-test":"vs-map-with-sidebar-panel__load-more",onClick:h[0]||(h[0]=Ae=>V.loadMorePlaces()),onKeyup:h[1]||(h[1]=F.withKeys(Ae=>V.loadMorePlaces(),["enter"]))},{default:F.withCtx(()=>[F.renderSlot(d.$slots,"load-more-text")]),_:3})):F.createCommentVNode("",!0)]),F.createVNode(ae,{"content-data":{},"filter-count":d.subCatFilterCount,onClearFilters:V.clearSubCatFilters},null,8,["filter-count","onClearFilters"])],64)):(F.openBlock(!0),F.createElementBlock(F.Fragment,{key:1},F.renderList(V.currentData,Ae=>(F.openBlock(),F.createElementBlock("div",{key:Ae.id},[typeof Ae.properties<"u"&&Ae.properties.category.id===_.selectedCategory?(F.openBlock(),F.createBlock(ke,{key:0,"item-data":Ae,onShowItemDetail:Je=>d.showDetail(Ae)},null,8,["item-data","onShowItemDetail"])):F.createCommentVNode("",!0)]))),128))],64)):F.createCommentVNode("",!0),_.currentStage===2?(F.openBlock(),F.createElementBlock(F.Fragment,{key:2},[F.createVNode(ve,{"heading-level":V.detailHeadingLevel,"content-data":V.currentPlaceData[0]},null,8,["heading-level","content-data"]),F.createVNode(ae,{"content-data":V.currentPlaceData[0]},null,8,["content-data"])],64)):F.createCommentVNode("",!0),_.panelStatus!==null?(F.openBlock(),F.createElementBlock("div",hC,[d.$slots["panel-loading-message"]&&_.panelStatus!=="map-loading"?(F.openBlock(),F.createElementBlock("div",fC,[F.createElementVNode("p",dC,[F.renderSlot(d.$slots,"panel-loading-message")])])):F.createCommentVNode("",!0)])):F.createCommentVNode("",!0)],2)}const yC=st._export_sfc(nC,[["render",mC]]);let Qc=null;const vC={name:"VsMapWithSidebar",status:"prototype",release:"0.0.1",components:{VsContainer:st.VsContainer,VsRow:st.VsRow,VsCol:st.VsCol,VsMap:Dx,VsButton:st.VsButton,VsMapWithSidebarPanel:yC,VsButtonToggleGroup:st.VsButtonToggleGroup,VsWarning:st.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(d=>d.geometry.type==="Polygon"||d.geometry.type==="MultiPolygon")},...aa.mapState(Xi,{subCatActiveFilters(d){return d.activeSubcatFilters}}),infoMessage(){let d="";switch(this.mapStatus){case"no-results":d=this.mapNoResultsMessage;break;case"filter-results":d=this.mapFilterMessage;break}return d},existingCategories(){return this.placesData?[...new Set(this.placesData.map(d=>d.properties.category.id))]:[]},filtersWithLocations(){return this.filters.filter(d=>!!(this.existingCategories.includes(d.id)||d.subCategory&&d.subCategory.length))},togglesWithLocations(){return this.existingCategories.indexOf("vics")===-1?this.toggleData.filter(d=>d.value!=="icentres"):this.toggleData}},watch:{selectedSubCategory(d){d===null&&(this.mapStatus="",this.resetZoom=!0)}},mounted(){Qc=Xi(),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(d){document.fullscreenElement&&document.exitFullscreen(),this.selectedItem=d,this.setStage(2),this.openPanel(),this.selectedSubCategory===null&&this.filterPlaces(this.selectedCategory)},setCategory(d){this.selectedCategory=d,this.selectedSubCategory===null&&this.filterPlaces(d)},setSubCategory(d){Qc.setSelectedSubcat(d),this.selectedSubCategory=d,d!==null?(this.getSubcatMarkerData(),this.selectedCategory=d):(Qc.setActiveSubcatFilters([]),this.showAllPlaces())},filterSubCategories(d){let h="";d.forEach(_=>{const E=`&cat=${_}`;h+=E}),this.currentPanelEndpointFilters=h,this.getSubcatMarkerData(h),this.getSubcatPanelData(h,0)},getSubcatMarkerData(d){const h=this.filters.filter(_=>_.id===this.selectedSubCategory);if(h.length>0){let _=h[0].pinsEndpoint;typeof d<"u"&&(_+=d),this.activePins=[],typeof d>"u"?(this.activePins=[],this.mapStatus="filter-results"):st.axios.get(_).then(E=>{this.totalEndpointPins=E.data.features.length,this.totalEndpointPins===0?this.mapStatus="no-results":(E.data.features.forEach(k=>{const V=k;V.properties.apiData=!0,this.activePins.push(V)}),this.mapStatus="")})}},getSubcatPanelData(d,h){let E=this.filters.filter(k=>k.id===this.selectedSubCategory)[0].listProductsEndPoint;typeof d<"u"&&(E+=d),h!==0&&(E+=`${d}&page=${h}`),this.panelStatus="loading-data",st.axios.get(E).then(k=>{typeof k.data.data.products<"u"?(this.setStage(1),h===0?(this.subCatList=k.data.data.products,this.focussedListItem=0):(this.focussedListItem=h*24,this.subCatList=this.subCatList.concat(k.data.data.products))):this.mapStatus="no-results",this.panelStatus=null})},setStage(d){if(d===2&&this.detailsEndpoint!==""&&this.selectedSubCategory!==null){const h=`${this.detailsEndpoint}${this.selectedItem.properties.id}`;st.axios.get(h).then(_=>{const E=[];E.push(_.data.data),this.currentEndpointData=E,this.currentStage=d})}else this.currentStage=d,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);d!==2&&(Qc.setActivePlace({mapId:this.mapId,activeFeature:""}),this.selectedItem=null)},filterPlaces(d){if(d==="regions")this.showRegions=!0,this.activePins=[],this.selectedToggle="regions";else{this.showRegions=!1,this.selectedToggle="places";const h=this.placesData.filter(_=>typeof _.properties<"u"?_.properties.category.id===d:!1);this.activePins=h}},loadMorePlaces(d){this.getSubcatPanelData(this.currentPanelEndpointFilters,d)},showAllPlaces(){this.activePins=this.placesData,this.showRegions=!1},onToggleChanged(d){d==="regions"?(this.setCategory("regions"),this.setStage(1)):d==="icentres"?(this.setCategory("vics"),this.setStage(1)):d==="places-regional"?(this.setCategory("twnv"),this.setStage(1)):(this.showAllPlaces(),this.setStage(0))},setMapReady(d){this.mapReady=d,d?this.panelStatus=null:this.panelStatus="loading"},categoryHasData(d){return this.existingCategories.indexOf(d)!==-1}}};function gC(d,h,_,E,k,V){const l=F.resolveComponent("VsMapWithSidebarPanel"),re=F.resolveComponent("VsButton"),q=F.resolveComponent("VsMap"),me=F.resolveComponent("VsButtonToggleGroup"),pe=F.resolveComponent("VsWarning"),ke=F.resolveComponent("VsCol"),ae=F.resolveComponent("VsRow"),ve=F.resolveComponent("VsContainer");return F.openBlock(),F.createBlock(ve,{"data-test":"vs-map-with-sidebar"},{default:F.withCtx(()=>[F.createVNode(ae,null,{default:F.withCtx(()=>[F.createVNode(ke,null,{default:F.withCtx(()=>[F.createElementVNode("div",{class:"vs-map-with-sidebar",ref:_.mapId},[F.createElementVNode("div",{class:F.normalizeClass(["vs-map-with-sidebar__side-panel",V.panelDisplayClass]),"data-test":"vs-map-with-sidebar__side-panel"},[F.createVNode(l,{"category-heading":_.categoryHeading,"selected-category":k.selectedCategory,"selected-subcategory":k.selectedSubCategory,"current-stage":k.currentStage,"selected-item":k.selectedItem,"heading-level":_.mainHeadingExists?"3":"2","subcategory-locations":k.subCatList,"current-endpoint-data":k.currentEndpointData,"panel-status":k.panelStatus,"panel-message":k.currentStage===0?_.panelMessage:null,"total-pins":k.totalEndpointPins,"current-list-item-focus":k.focussedListItem,onSetCategory:V.setCategory,onSetSubcategory:V.setSubCategory,onSubcategoriesFiltered:V.filterSubCategories,onSetStage:V.setStage,onClosePanel:V.closePanel,onShowItemDetail:V.showDetail,onFilterPlaces:V.filterPlaces,onLoadMorePlaces:V.loadMorePlaces},{closePanelText:F.withCtx(()=>[F.renderSlot(d.$slots,"close-side-panel-text")]),"reset-side-panel-text":F.withCtx(()=>[F.renderSlot(d.$slots,"reset-side-panel-text")]),"menu-btn-text":F.withCtx(()=>[F.renderSlot(d.$slots,"menu-btn-text")]),"panel-loading-message":F.withCtx(()=>[F.renderSlot(d.$slots,"panel-loading-message")]),"load-more-text":F.withCtx(()=>[F.renderSlot(d.$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),F.createElementVNode("div",{class:F.normalizeClass(["vs-map-with-sidebar__map",V.mapDisplayClass])},[F.createVNode(re,{class:"vs-map-with-sidebar__map-toggle",icon:"vs-icon-control-menu",size:"sm",onClick:V.openMenu,"data-test":"vs-map-with-sidebar__map-toggle",variant:"secondary"},{default:F.withCtx(()=>[F.renderSlot(d.$slots,"open-side-panel-text")]),_:3},8,["onClick"]),F.createVNode(q,{"is-visible":!k.panelVisible,labels:{},filters:V.filtersWithLocations,places:k.activePins,"selected-item":k.selectedItem,"map-id":_.mapId,"show-polygons":k.showRegions,"show-info-message":k.mapStatus!=="",onShowDetail:V.showDetail,onSetCategory:V.setCategory,onMapReady:V.setMapReady,onZoomReset:h[0]||(h[0]=Ae=>k.resetZoom=!1),"bounds-data":_.regionBounds,"reset-zoom":k.resetZoom,"show-marker-popups":!1,"load-branding-immediately":_.loadBrandingImmediately},{"map-loading-text":F.withCtx(()=>[F.renderSlot(d.$slots,"map-loading-text")]),"info-message":F.withCtx(()=>[F.createTextVNode(F.toDisplayString(V.infoMessage),1)]),"zoom-too-close":F.withCtx(()=>[F.renderSlot(d.$slots,"zoom-too-close")]),"zoom-too-far":F.withCtx(()=>[F.renderSlot(d.$slots,"zoom-too-far")]),"no-js":F.withCtx(()=>[F.renderSlot(d.$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"]),V.togglesWithLocations.length>1?(F.openBlock(),F.createBlock(me,{key:0,"data-test":"vs-map-with-sidebar__map-toggle-group","initial-selected":k.selectedToggle,options:V.togglesWithLocations,"buttons-label":_.buttonsLabel,onToggleChanged:V.onToggleChanged},null,8,["initial-selected","options","buttons-label","onToggleChanged"])):F.createCommentVNode("",!0)],2)],512),F.createVNode(pe,{class:"vs-map-with-sidebar__no-js"},{default:F.withCtx(()=>[F.renderSlot(d.$slots,"no-js")]),_:3})]),_:3})]),_:3})]),_:3})}const _C=st._export_sfc(vC,[["render",gC]]);exports.VsMap=Dx;exports.VsMapMarker=Bx;exports.VsMapMarkerIcon=Mp;exports.VsMapWithSidebar=_C;
|