@mapxus/mapxus-map-jp 4.1.1 → 4.1.2

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.
Files changed (2) hide show
  1. package/index.js +2 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -17,10 +17,10 @@
17
17
  * Released under MIT license <https://lodash.com/license>
18
18
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
19
19
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
20
- */},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(40);Object.defineProperty(e,"Map",{enumerable:!0,get:function(){return i.Map}});var n=r(19);Object.defineProperty(e,"Indoor",{enumerable:!0,get:function(){return n.Indoor}});var o=r(85);Object.defineProperty(e,"Marker",{enumerable:!0,get:function(){return o.Marker}});var a=r(26);Object.defineProperty(e,"Poi",{enumerable:!0,get:function(){return a.Poi}});var s=r(27);Object.defineProperty(e,"FloorsControl",{enumerable:!0,get:function(){return s.FloorsControl}});var u=r(28);Object.defineProperty(e,"BuildingFilterControl",{enumerable:!0,get:function(){return u.BuildingFilterControl}});var l=r(20);Object.defineProperty(e,"BuildingsService",{enumerable:!0,get:function(){return l.BuildingsService}});var c=r(30);Object.defineProperty(e,"PoisService",{enumerable:!0,get:function(){return c.PoisService}});var p=r(86);Object.defineProperty(e,"RouteService",{enumerable:!0,get:function(){return p.RouteService}});var h=r(5);Object.defineProperty(e,"Evented",{enumerable:!0,get:function(){return h.Evented}});var f=r(88);Object.defineProperty(e,"version",{enumerable:!0,get:function(){return f.version}})},function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var i=Array(t),n=0;for(e=0;e<r;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,n++)i[n]=o[a];return i},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Indoor=void 0;var s,u=a(r(41)),l=r(13),c=r(5),p=r(20),h=a(r(63)),f=r(17);n(d,s=c.Evented),d.prototype.enableSwitch=function(){return this._enableSwitch=!0,this},d.prototype.disableSwitch=function(){return this._enableSwitch=!1,this},d.prototype.enableSwitchBuilding=function(){return this._enableSwitchBuilding=!0,this},d.prototype.disableSwitchBuilding=function(){return this._enableSwitchBuilding=!1,this},Object.defineProperty(d.prototype,"floors",{get:function(){return this._levelNames},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"groundFloor",{get:function(){return this._groundLevel},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"buildingId",{get:function(){return this._buildingId},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"currentFloor",{get:function(){return this._levelName},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"refLevel",{get:function(){return this._refLevel},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"features",{get:function(){return this._features},enumerable:!1,configurable:!0}),d.prototype.getFeature=function(t){var e=this;return f.find(this.features,(function(r){return r.properties.id===(t||e._buildingId)}))},d.prototype.getBuildingByPoint=function(t){var e=this;t=this._map.queryRenderedFeatures(t);return f.some(t,(function(t){return t.properties&&t.properties["ref:building"]===e._buildingId}))?this._currentFeature:t.filter((function(t){return"mapxus-building-line"===t.layer.id}))[0]},d.prototype.selectBuilding=function(t){this._isNotCurrentFeature(t)&&(this._currentFeature=t,this._load()),this.setBuildingsFilter(t&&t.properties.id),t||this._clear(),this.fire(new c.Event("selectBuilding",{feature:t}))},d.prototype.switchBuilding=function(t){var e=u.default(this._getPointList(t));this._map.panTo(e),this.selectBuilding(t)},d.prototype.goToBuilding=function(t,e){var r=this,i=new p.BuildingsService,n=function(){var i;!r._map.areTilesLoaded()||(i=r.getFeature(t))&&(r._map.off("render",n),r.selectBuilding(i),e&&e(i))};i.searchByIds(t).then((function(t){t=t.data.result.buildings[0],r._map.panTo([t.labelCenter.lon,t.labelCenter.lat]),r._map.off("render",n),r._map.on("render",n)})).catch((function(t){r.fire(new c.Event("isIndoorLoaded",{error:t})),e&&e(null)}))},d.prototype.switchFloor=function(t){t&&f.includes(this._levelNames,t)&&(this._footprints.set(this._buildingId,t),this._levelName=t,this._refLevel=this._getRefLevel(),this.setFloorsFilter(this._refLevel),this.fire(new c.Event("switchFloor")))},d.prototype.initLayer=function(){var t=this;this._indoorLayers.forEach((function(e){var r=e.id,i=t._map.getLayer(r);e=i&&i.filter;i&&e&&(e=t._updateFilter(e,["==","building","yes"]),t._map.setFilter(r,e)),i&&t._isPoi(i.type)&&t._addTextHaloColor(r)}))},d.prototype.hiddenOutdoorLayer=function(t){this._isHiddenOutdoor=t,this._setOutdoorLayersHidden(t)},d.prototype.updateLayers=function(){this._indoorLayers=l.getLayers(this._map.getStyle()),this._isHiddenOutdoor&&this._setOutdoorLayersHidden(!0)},d.prototype.setBuildingsFilter=function(t){var e,r,i=this;t||f.forEach(this._indoorLayers,(function(t){e=t.id,(r=(r=i._map.getLayer(e))&&r.filter)&&i._map.getLayer(e)&&(r=i._updateFilter(r,["==","building","yes"]),i._map.setFilter(e,r),i._map.setPaintProperty("mapxus-building-line","fill-opacity",1))}))},d.prototype.setFloorsFilter=function(t){var e,r,i=this;t&&f.forEach(this._indoorLayers,(function(t){e=t.id,(r=(r=i._map.getLayer(e))&&r.filter)&&i._map.getLayer(e)&&"mapxus-building-name"!==e&&("mapxus-building-line"===e?i._map.setPaintProperty(e,"fill-opacity",["match",["get","id"],i._buildingId,0,1]):(r="mapxus-building-line-color"===e?i._updateFilter(r,["!=","id",i._buildingId]):i._isLevel(e)?i._updateFilter(r,["==","id",i._refLevel]):i._updateFilter(r,["==","ref:level",i._refLevel]),i._map.setFilter(e,r)))}))},d.prototype._loadData=function(){this._map.on("load",this._init.bind(this)).on("moveend",this._refresh.bind(this))},d.prototype._init=function(){var t=this;this.updateLayers(),this.initLayer(),this._map.on("data",(function(){t._load(),t._addCustomLevelFillLayer(),t.fire(new c.Event("isIndoorLoaded"))})).on("click",(function(e){t._enableSwitch&&(e=t.getBuildingByPoint(e.point),(t._enableSwitchBuilding||e)&&t.selectBuilding(e))}))},d.prototype._refresh=function(){this._load()},d.prototype._load=function(){this._features=this._getFeatures(),this._currentFeature&&this._buildingId===this._getBuildingId()&&this._refLevel===this._getRefLevel()||(this._buildingId=this._getBuildingId(),this._levelNames=this._getLevelNames(),this._groundLevel=this._getInitialLevelName(),this._levelName=this._footprints.get(this._buildingId)||this._groundLevel,this._refLevel=this._getRefLevel(),this.fire(new c.Event("isDataLoaded")))},d.prototype._clear=function(){this._buildingId=null,this._levelNames=[],this._levelName=null,this._refLevel=null,this._currentFeature=null},d.prototype._updateFilter=function(t,e){var r=!this._isFilterHasBeenReset(t),i=t.length-1,n=t;return r?n="all"===t[0]?o(t,[e]):"match"===t[0]?["all",["any",["==",t[1][1],t[2][0]],["==",t[1][1],t[2][1]]],e]:["all",t,e]:JSON.stringify(f.last(t))!==JSON.stringify(e)&&(n=f.map(t,(function(t,r){return r===i?e:t}))),n},d.prototype._isFilterHasBeenReset=function(t){var e=!1;return t&&(t=t[t.length-1],f.isArray(t)&&(e="=="===t[0]&&("id"===t[1]||"ref:building"===t[1]||"ref:level"===t[1]||"building"===t[1])||"!="===t[0]&&"id"===t[1])),e},d.prototype._addTextHaloColor=function(t,e){this._map.setPaintProperty(t,"text-halo-color",e||"white"),this._map.setPaintProperty(t,"text-halo-width",2)},d.prototype._getFeatures=function(){var t=this._map.getCanvas().getBoundingClientRect(),e=new h.default.Point(t.x,t.y);t=new h.default.Point(t.width,t.height),t=this._map.queryRenderedFeatures([e,t]),t=this._groupFeatures(t);return this._currentFeature&&(this._includeCurrentFeature(t)&&(t=this._removeFeature(t)),t.unshift(this._currentFeature)),t},d.prototype._groupFeatures=function(t){var e,r,i=f.groupBy(t,"properties.id"),n=[];for(e in i)!i[e]||(r=i[e]).length&&(r=f.first(r),n.push(r));return n},d.prototype._getFeatureInfo=function(){return this._currentFeature||null},d.prototype._getLevelNames=function(){var t=this._getFeatureInfo();return t&&t.properties.level_names.split(",")||[]},d.prototype._getBuildingId=function(){var t=this._getFeatureInfo();return t&&t.properties.id||null},d.prototype._getRefLevel=function(){var t=this,e=this._getFeatureInfo();if(e){var r=f.findIndex(this._levelNames,(function(e){return e===t._levelName}));return e.properties.level_ids.split(",")[r]}return null},d.prototype._getInitialLevelName=function(){if(r=this._getFeatureInfo()){var t=r.properties,e=f.minBy(f.reverse(t.ordinals.split(",")),(function(t){return Math.abs(+t)})),r=f.findIndex(t.ordinals.split(","),(function(t){return t===e}));return t.level_names.split(",")[r]}return null},d.prototype._isNotCurrentFeature=function(t){return!t||!this._currentFeature||t.properties.id!==this._currentFeature.properties.id},d.prototype._isLevel=function(t){return-1<t.indexOf("mapxus-level")},d.prototype._isPoi=function(t){return"symbol"===t},d.prototype._includeCurrentFeature=function(t){var e=this;return!!this._currentFeature&&t.some((function(t){var r=t.properties;t=e._currentFeature.properties;return r.id===t.id}))},d.prototype._removeFeature=function(t){var e=this;return f.remove(t,(function(t){var r=t.properties;t=e._currentFeature.properties;return r.id===t.id})),t},d.prototype._getPointList=function(t){var e=t.geometry;t=e.coordinates[0];return 1<e.coordinates.length&&(t=e.coordinates[0][0]),t.map((function(t){return{lng:t[0],lat:t[1]}}))},d.prototype._setOutdoorLayersHidden=function(t){var e=this,r=l.getOutdoorLayers(this._map.getStyle()),i=t?"none":"visible";f.forEach(r,(function(t){e._map.getLayer(t.id)&&e._map.setLayoutProperty(t.id,"visibility",i)}))},d.prototype._addCustomLevelFillLayer=function(){this._hasCustomLevelFill||(this._map.addLayer({id:"custom-level-fill",source:"indoor-planet","source-layer":"mapxus_level",type:"fill",paint:{"fill-opacity":0}}),this._hasCustomLevelFill=!0)},n=d;function d(t,e){var r=s.call(this)||this;return r._hasCustomLevelFill=!1,r._map=t,r._enableSwitch=!0,r._enableSwitchBuilding=!0,r._isHiddenOutdoor=e||!1,r._footprints=new Map,r._loadData(),r}e.Indoor=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BuildingsService=void 0;var i=r(6),n=r(7);o.prototype.searchByIds=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!t.length)throw new Error("Parameter cannot be empty.");var r=this._api+"/"+t.join(",");return this._request.get(r)},o.prototype.searchByDistance=function(t,e,r,n,o){if(void 0===n&&(n=i.OFFSET),void 0===o&&(o=i.PAGE),arguments.length<3)throw new Error("Parameter cannot be empty.");if(2!==e.length)throw new Error("Center lon lat cannot be less than 2.");return o=["region=0","center="+e.join(","),"distance="+r,"offset="+n,"page="+o],t&&o.unshift("keywords="+t),o=this._api+"?"+o.join("&"),this._request.get(o)},o.prototype.searchByBbox=function(t,e,r,n){if(void 0===r&&(r=i.OFFSET),void 0===n&&(n=i.PAGE),arguments.length<2)throw new Error("Parameter cannot be empty.");if(4!==e.length)throw new Error("Bbox parameters cannot be less than 2.");return n=["region=0","bbox="+e.join(","),"offset="+r,"page="+n],t&&n.unshift("keywords="+t),n=this._api+"?"+n.join("&"),this._request.get(n)},o.prototype.searchByGlobal=function(t,e,r){if(void 0===e&&(e=i.OFFSET),void 0===r&&(r=i.PAGE),!arguments.length)throw new Error("Parameter cannot be empty.");return r=["region=0","searchGlobal=true","offset="+e,"page="+r],t&&r.unshift("keywords="+t),r=this._api+"?"+r.join("&"),this._request.get(r)},r=o;function o(){this._api="/api/v1/buildings",this._request=new n.Request}e.BuildingsService=r},function(t,e,r){"use strict";t.exports=function(t,e){return function(){for(var r=new Array(arguments.length),i=0;i<r.length;i++)r[i]=arguments[i];return t.apply(e,r)}}},function(t,e,r){"use strict";var i=r(3),n=r(49),o=r(51),a=r(52),s=r(53),u=r(23),l="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||r(54);t.exports=function(t){return new Promise((function(e,c){var p=t.data,h=t.headers;i.isFormData(p)&&delete h["Content-Type"];var f,d,m=new XMLHttpRequest,y="onreadystatechange",g=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in m||s(t.url)||(m=new window.XDomainRequest,y="onload",g=!0,m.onprogress=function(){},m.ontimeout=function(){}),t.auth&&(f=t.auth.username||"",d=t.auth.password||"",h.Authorization="Basic "+l(f+":"+d)),m.open(t.method.toUpperCase(),o(t.url,t.params,t.paramsSerializer),!0),m.timeout=t.timeout,m[y]=function(){var r;m&&(4===m.readyState||g)&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&(r="getAllResponseHeaders"in m?a(m.getAllResponseHeaders()):null,r={data:t.responseType&&"text"!==t.responseType?m.response:m.responseText,status:1223===m.status?204:m.status,statusText:1223===m.status?"No Content":m.statusText,headers:r,config:t,request:m},n(e,c,r),m=null)},m.onerror=function(){c(u("Network Error",t,null,m)),m=null},m.ontimeout=function(){c(u("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",m)),m=null},i.isStandardBrowserEnv()&&(y=r(55),(y=(t.withCredentials||s(t.url))&&t.xsrfCookieName?y.read(t.xsrfCookieName):void 0)&&(h[t.xsrfHeaderName]=y)),"setRequestHeader"in m&&i.forEach(h,(function(t,e){void 0===p&&"content-type"===e.toLowerCase()?delete h[e]:m.setRequestHeader(e,t)})),t.withCredentials&&(m.withCredentials=!0),t.responseType)try{m.responseType=t.responseType}catch(f){if("json"!==t.responseType)throw f}"function"==typeof t.onDownloadProgress&&m.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&m.upload&&m.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){m&&(m.abort(),c(t),m=null)})),void 0===p&&(p=null),m.send(p)}))}},function(t,e,r){"use strict";var i=r(50);t.exports=function(t,e,r,n,o){return t=new Error(t),i(t,e,r,n,o)}},function(t,e,r){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,r){"use strict";function i(t){this.message=t}i.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},i.prototype.__CANCEL__=!0,t.exports=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Poi=void 0;var i=r(13);Object.defineProperty(n.prototype,"pointClickFunction",{set:function(t){this._pointClickFunction=t},enumerable:!1,configurable:!0}),n.prototype._loadData=function(){this._map.on("style.load",this._init.bind(this))},n.prototype._init=function(){this._layers=i.getLayers(this._map.getStyle()).filter((function(t){return-1<t.id.indexOf("mapxus-poi")})),this._initClick()},n.prototype._initClick=function(){var t=this;this._map.on("click",(function(e){var r=t._map.queryRenderedFeatures(e.point,{layers:t._layers.map((function(t){return t.id}))});r.length&&t._pointClickFunction&&(r={lngLat:e.lngLat,originalEvent:e.originalEvent,point:e.point,feature:r[0]},t._pointClickFunction(r))}))},r=n;function n(t){this._map=t,this._loadData()}e.Poi=r},function(t,e,r){"use strict";var i=this&&this.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var i=Array(t),n=0;for(e=0;e<r;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,n++)i[n]=o[a];return i};Object.defineProperty(e,"__esModule",{value:!0}),e.FloorsControl=void 0,r(65);var n=r(10);Object.defineProperty(o.prototype,"position",{get:function(){return this._position},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"enabled",{get:function(){return this._enableFloorControl},enumerable:!1,configurable:!0}),o.prototype.setMap=function(t){this._map=t},o.prototype.onAdd=function(t){return this._$container=n.domCreate("div","maplibregl-ctrl maplibregl-ctrl-floors",t.getContainer()),this._$container.appendChild(this._$createLayout("div")),this._listener(),this._bindEvent(),this._$container},o.prototype.onRemove=function(){n.domRemove(this._$container)},o.prototype.getDefaultPosition=function(){return"top-right"},Object.defineProperty(o.prototype,"floorClickFunction",{set:function(t){this._floorClickFunction=t},enumerable:!1,configurable:!0}),o.prototype.switchFloor=function(t,e){var r=this;this._indoor.floors&&(this._setCurrentButtonActive(!1),this._$currentButton.style.color=this._fontColor,this._$floorControlButtons.forEach((function(e,i){e.getAttribute("data-floor")===t&&(r._floor=t,r._$currentButton=e,r._setCurrentButtonActive(!0))})),this._indoor.switchFloor(t),e&&e({floor:t,feature:this._indoor.getFeature()}))},o.prototype.setStyle=function(t){var e=this;["fontColor","selectFontColor","selectBoxColor"].forEach((function(r){t.hasOwnProperty(r)&&("fontColor"===r&&(e._fontColor=t[r],e._$floorControlButtons.forEach((function(t){t.style.color=e._fontColor}))),"selectFontColor"===r&&(e._selectFontColor=t[r],e._$currentButton.style.color=e._selectFontColor),"selectBoxColor"===r&&(e._selectBoxColor=t[r],e._$currentButton.style.backgroundColor=e._selectBoxColor))}))},o.prototype.setLayoutHidden=function(t){this._enableFloorControl=!t,t?this._$hideLayout():this._$showLayout()},o.prototype._listener=function(){this._map.getMap().on("moveend",this._refresh.bind(this)),this._map.getIndoor().on("selectBuilding",this._init.bind(this))},o.prototype._init=function(t){var e=this;this._indoor=this._map.getIndoor(),(t=t.feature)&&this._floor===this._indoor.currentFloor&&this._buildingId===this._indoor.buildingId||(this._resetBuildingId(),this._resetFloor(),this._$hideLayout(),this._$clearFloors(),t&&(this._setBuildingId(),this._setFloor(),this._$configLayoutHeight(),this._$createFloors(),this._switchToGroundFloor(),setTimeout((function(){e._scrollToClickedFloor(),e._$showOrHideArrow(),e._isEnableDisplay()&&e._$showLayout()}))))},o.prototype._refresh=function(){this._isEnableDisplay()?this._$showLayout():this._$hideLayout(),this._isEmptyFloors()&&this._$hideLayout()},o.prototype._$createLayout=function(t){return this._$layout=n.domCreate(t,"mapxus-floor-selector-layout hide"),this._$arrowUp=n.domCreate(t,"mapxus-floor-selector-up",this._$layout),this._$arrowDown=n.domCreate(t,"mapxus-floor-selector-down",this._$layout),this._$outer=n.domCreate(t,"mapxus-floor-selector-outer",this._$layout),this._$inner=n.domCreate(t,"mapxus-floor-selector-inner",this._$outer),this._$layout.appendChild(this._$outer),this._$layout},o.prototype._$configLayoutHeight=function(){var t=34*(t=5<=(t=this._indoor.floors.length)?5:t);this._$outer.style.height=t+"px",this._$configArrowDownTop()},o.prototype._$configArrowDownTop=function(){var t=parseInt(this._$outer.style.height.replace(/px/,""),10)-26;this._$arrowDown.style.marginTop=t+"px"},o.prototype._$showOrHideArrow=function(){this._$hideArrowDown(),this._$hideArrowUp(),this._floorScroll()},o.prototype._$showLayout=function(){this._$layout.classList.remove("hide")},o.prototype._$hideLayout=function(){this._$layout.classList.add("hide")},o.prototype._$showArrowUp=function(){this._$arrowUp.classList.remove("hide")},o.prototype._$hideArrowUp=function(){this._$arrowUp.classList.add("hide")},o.prototype._$showArrowDown=function(){this._$arrowDown.classList.remove("hide")},o.prototype._$hideArrowDown=function(){this._$arrowDown.classList.add("hide")},o.prototype._$createFloors=function(){var t=this;i(this._indoor.floors).reverse().forEach((function(e){var r=t._$createFloor(e);t._$inner.appendChild(r),t._$floorControlButtons.push(r),r.style.color=t._fontColor,e===t._floor&&(t._$currentButton=r,t._setCurrentButtonActive(!0))}))},o.prototype._$clearFloors=function(){this._$inner.innerHTML=""},o.prototype._$createFloor=function(t){var e=n.domCreate("button","floor");return e.setAttribute("data-floor",t),e.innerText=t,e},o.prototype._isEmptyFloors=function(){return!Boolean(this._$inner.innerHTML)},o.prototype._isOverflowFloorMax=function(){return 5<Array.prototype.slice.call(this._$inner.querySelectorAll("button.floor")).length},o.prototype._isEnableDisplay=function(){return 16<=this._map.getMap().getZoom()&&this._enableFloorControl},o.prototype._scrollToClickedFloor=function(){for(var t=0,e=this._indoor.floors.slice().reverse(),r=0;r<e.length&&e[r]!==this._floor;r++)t+=30;this._$inner.scrollTop=t},o.prototype._switchToGroundFloor=function(){this._floor&&this._indoor.switchFloor(this._floor)},o.prototype._setFloor=function(){this._floor||(this._floor=this._indoor.currentFloor)},o.prototype._resetFloor=function(){this._floor=null},o.prototype._setCurrentButtonActive=function(t){this._$currentButton.style.color=t?this._selectFontColor:this._fontColor,this._$currentButton.style.backgroundColor=t?this._selectBoxColor:"#fff",this._$currentButton.disabled=t,this._$currentButton.style.cursor=t?"initial":"pointer"},o.prototype._setBuildingId=function(){this._buildingId=this._indoor.buildingId},o.prototype._resetBuildingId=function(){this._buildingId=null},o.prototype._floorClick=function(t){var e=t.target.getAttribute("data-floor");this.switchFloor(e),this._floorClickFunction&&(t={floor:e,originalEvent:t,feature:this._indoor.getFeature()},this._floorClickFunction(t))},o.prototype._floorScroll=function(){var t=this._$inner.clientHeight,e=this._$inner.scrollHeight-t;t=0===this._$inner.scrollTop,e=this._$inner.scrollTop===e;this._isOverflowFloorMax()&&(t?(this._$hideArrowUp(),this._$showArrowDown()):e?(this._$hideArrowDown(),this._$showArrowUp()):(this._$showArrowUp(),this._$showArrowDown()))},o.prototype._floorClickEvent=function(){this._$inner.addEventListener("click",this._floorClick.bind(this))},o.prototype._floorScrollEvent=function(){this._$inner.addEventListener("scroll",this._floorScroll.bind(this))},o.prototype._bindEvent=function(){this._floorClickEvent(),this._floorScrollEvent()},r=o;function o(t){this._fontColor="#bdbdbf",this._selectFontColor="#fff",this._selectBoxColor="#68afce",this._$floorControlButtons=[],this._position=t||"top-right",this._enableFloorControl=!0}e.FloorsControl=r},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BuildingFilterControl=void 0,r(70);var i=r(10),n=r(17);o.prototype.setMap=function(t){this._map=t},o.prototype.setPosition=function(t){},o.prototype.onAdd=function(t){return this._container=i.domCreate("div","maplibregl-ctrl maplibregl-ctrl-building-filter",t.getContainer()),this._container.appendChild(this._buildingFilterIconCreate("div")),this._container.appendChild(this._buildingNameListCreate("div")),this._loadData(),this._container},o.prototype.onRemove=function(){i.domRemove(this._container)},Object.defineProperty(o.prototype,"position",{get:function(){return this._position},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"enabled",{get:function(){return this._enableBuildingSelector},enumerable:!1,configurable:!0}),o.prototype.getDefaultPosition=function(){return"top-right"},o.prototype.setLayoutHidden=function(t){this._enableBuildingSelector=!t,t?this._$hideLayout():this._$showLayout()},o.prototype._loadData=function(){this._init(),this._map.getMap().on("moveend",this._refresh.bind(this)),this._map.getIndoor().on("selectBuilding",this._select.bind(this)).on("isDataLoaded",this._refresh.bind(this))},o.prototype._init=function(){this._load()},o.prototype._refresh=function(){this._load()},o.prototype._select=function(t){this._buildingId=t.feature?t.feature.properties.id:null,this._refresh()},o.prototype._load=function(){this._indoor=this._map.getIndoor(),this._buildingNameListClean(),this._buildingNameListUpdate(this._indoor.features,this._features=[],this._buildingId)},o.prototype._includes=function(t,e){return t.some((function(t){return t.properties.id===e.properties.id}))},o.prototype._getFeatureByName=function(t){return n.find(this._features,(function(e){return e.properties.name===t}))},o.prototype._buildingFilterIconCreate=function(t){return(t=window.document.createElement(t)).className="mapxus-building-filter-icon",this._buildingToggleListEvent(t,!0),t},o.prototype._buildingNameListCreate=function(t){return this._buildingNameLayout=window.document.createElement(t),this._buildingNameLayout.className="mapxus-building-name-layout",this._buildingNameLayout.style.display="none",this._buildingNameList=window.document.createElement(t),this._buildingNameList.className="mapxus-building-name-list",this._buildingNameLayout.appendChild(this._buildingNameList),this._buildingToggleListEvent(this._buildingNameLayout,!1),this._buildingNameLayout},o.prototype._buildingNameListUpdate=function(t,e,r){var i=this;n.forEach(t,(function(t){var n;i._includes(e,t)||"yes"!==t.properties.building||(e.push(t),n=!1,r&&t.properties.id===r&&(n=!0),i._buildingNameList.appendChild(i._buildingNameCreate("p",t.properties.name,n)))})),this._buildingNameListHeight(e)},o.prototype._buildingNameListClean=function(){this._buildingNameList.innerHTML=""},o.prototype._buildingNameListHeight=function(t){t=26*t.length,this._buildingNameList.style.height=this._buildingNameLayout.style.height=(208<=t?208:t)+"px",-1<this._position.indexOf("bottom")&&(this._buildingNameLayout.style.marginTop=-(208<=t?208:t)+"px"),-1<this._position.indexOf("left")&&(this._buildingNameLayout.style.left="45px"),-1<this._position.indexOf("right")&&(this._buildingNameLayout.style.right="45px")},o.prototype._buildingNameCreate=function(t,e,r){return(t=window.document.createElement(t)).className="mapxus-building-name",t.innerHTML=e,r&&t.classList.add("active"),this._buildingNameClickEvent(t),t},o.prototype._toggleList=function(t){this._buildingNameLayout.style.display=t?"block":"none"},o.prototype._buildingNameClickEvent=function(t){var e=this;t.onclick||(t.onclick=function(t){t=t.target.innerText,t=e._getFeatureByName(t),e._indoor.switchBuilding(t)})},o.prototype._buildingToggleListEvent=function(t,e){var r=this;t.onmouseenter||(t.onmouseenter=function(t){r._toggleList(!0)}),t.onmouseleave||e||(t.onmouseleave=function(t){r._toggleList(!1)})},o.prototype._$showLayout=function(){this._container.classList.remove("hide")},o.prototype._$hideLayout=function(){this._container.classList.add("hide")},r=o;function o(t){this._position=t||"top-right",this._enableBuildingSelector=!0}e.BuildingFilterControl=r},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getCustomizedThemeUrl=e.mapxusTheme_v2=e.landsDTheme=e.mapxusTheme=e.mappyBeeTheme=e.halloweenTheme=e.commonTheme=e.christmasTheme=void 0;var i=r(6);function n(t){return i.BMS_URL+"/api/v2/tiles/styles/"+t}e.christmasTheme=n("christmas_mims2_v1"),e.commonTheme=n("common_mims2_v1"),e.halloweenTheme=n("halloween_mims2_v1"),e.mappyBeeTheme=n("mappybee_mims2_v1"),e.mapxusTheme=n("mapxus_mims2_v1"),e.landsDTheme=n("lands_d_mims2_v1"),e.mapxusTheme_v2=n("mapxus_mims2_v4"),e.getCustomizedThemeUrl=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PoisService=void 0;var i=r(6),n=r(7),o=r(82);a.prototype.searchByIds=function(t){if(!t.length)throw new Error("Parameter cannot be empty.");return t=this._apiV1+"/"+t.join(","),this._request.get(t)},a.prototype.searchByDistance=function(t,e,r,n,o){if(void 0===n&&(n=i.OFFSET),void 0===o&&(o=i.PAGE),arguments.length<3)throw new Error("Parameter cannot be empty.");if(2!==e.length)throw new Error("Center lon lat cannot be less than 2.");return r=Math.round(r),o=["center="+e.join(","),"distance="+r,"offset="+n,"page="+o],t&&o.unshift("category="+t),o=this._apiV1+"?"+o.join("&"),this._request.get(o)},a.prototype.searchByBbox=function(t,e,r,n){if(void 0===r&&(r=i.OFFSET),void 0===n&&(n=i.PAGE),arguments.length<2)throw new Error("Parameter cannot be empty.");if(4!==e.length)throw new Error("Bbox parameters cannot be less than 2.");return n=["bbox="+e.join(","),"offset="+r,"page="+n],t&&n.unshift("keywords="+t),n=this._apiV1+"?"+n.join("&"),this._request.get(n)},a.prototype.searchByBuildingId=function(t,e,r,n){if(void 0===r&&(r=i.OFFSET),void 0===n&&(n=i.PAGE),arguments.length<2)throw new Error("Parameter cannot be empty.");return n=["buildingId="+e,"offset="+r,"page="+n],t&&n.unshift("keywords="+t),n=this._apiV1+"?"+n.join("&"),this._request.get(n)},a.prototype.searchCategory=function(t,e){if(!arguments.length)throw new Error("Missing buildingId");return t=["buildingId="+t],e&&t.push("floor="+e),t=this._categories+"/pois?"+t.join("&"),this._request.get(t)},a.prototype.searchOrientation=function(t,e,r,i,n,a){if(void 0===n&&(n=o.DistanceSearchType.POINT),6!==arguments.length)throw new Error("Parameter length should be 6.");return t=Math.round(t),i=Math.round(i),a=["angle="+t,"buildingId="+e,"center="+r.join(","),"distance="+i,"distanceSearchType="+n,"floor="+a],a=this._apiV1+"/orientation?"+a.join("&"),this._request.get(a)},r=a;function a(){this._apiV1="/api/v1/pois",this._categories="/api/v1/categories",this._request=new n.Request}e.PoisService=r},,,,,,,,,,function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Map=void 0;var o,a=r(19),s=r(26),u=r(27),l=r(28),c=r(73),p=r(7),h=r(29),f=r(74),d=r(5),m=r(75),y=r(79),g=r(30),_=r(83),v=r(13),x=r(84),b=r(17);n(w,o=d.Evented),w.prototype.renderComplete=function(t){this.on("isRenderComplete",(function(e){return t(e)}))},w.prototype.getIndoor=function(){return this._indoor},w.prototype.getMap=function(){return this._map},w.prototype.transformPoiTextFieldLanguage=function(t){var e=this,r=v.getLayers(this._map.getStyle());r=b.filter(r,(function(t){return"symbol"===e._map.getLayer(t.id).type}));_.getTextFieldCoalesceList(r,t).forEach((function(t){e._map.setLayoutProperty(t.layerId,"text-field",t.coalesce)}))},w.prototype.enableSwitch=function(){return this._indoor.enableSwitch(),this},w.prototype.disableSwitch=function(){return this._indoor.disableSwitch(),this},w.prototype.enableSwitchBuilding=function(){return this._indoor.enableSwitchBuilding(),this},w.prototype.disableSwitchBuilding=function(){return this._indoor.disableSwitchBuilding(),this},w.prototype.hiddenOutdoorLayer=function(t){this.getIndoor().hiddenOutdoorLayer(t)},Object.defineProperty(w.prototype,"floors",{get:function(){return this.getIndoor().floors},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"currentFloor",{get:function(){return this.getIndoor().currentFloor},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"building",{get:function(){return this.getIndoor().getFeature()&&this.getIndoor().getFeature().properties},enumerable:!1,configurable:!0}),w.prototype.getFeature=function(t){return this.getIndoor().getFeature(t)},w.prototype.selectBuilding=function(t){return this._indoor.selectBuilding(t),this},w.prototype.switchBuilding=function(t,e){return this._indoor.goToBuilding(t,e),this},w.prototype.switchFloor=function(t,e){return this._floorsControl&&(this._floorsControl.switchFloor(t,e),t={floor:t,originalEvent:null,feature:this._indoor.getFeature()},this._switchFloor(t)),this},w.prototype.onMapClickListener=function(t){var e=this;return this._map.on("click",(function(r){r.feature=e._indoor.getBuildingByPoint(r.point),t(r)})),this},w.prototype.onIndoorPoiListener=function(t){return this._poi.pointClickFunction=t,this},w.prototype.onFloorChangeListener=function(t){return this._floorsControl&&(this._floorsControl.floorClickFunction=t,this._switchFloor=t),this},w.prototype.onBuildingChangeListener=function(t){return this._indoor.on("selectBuilding",(function(e){return t(e.feature)})),this},w.prototype.disableFloorControl=function(){return this._floorsControl.setLayoutHidden(!0),this},w.prototype.enableFloorControl=function(t){return t&&t!==this._floorsControl.position?(this._removeControl(this._floorsControl),this._addControl(this._floorsControl=new u.FloorsControl(t),t),this.building&&this.selectBuilding(this.getIndoor().getFeature())):this._floorsControl.enabled||this._floorsControl.setLayoutHidden(!1),this},w.prototype.disableBuildingSelector=function(){return this._buildingFilterControl.setLayoutHidden(!0),this},w.prototype.enableBuildingSelector=function(t){return t&&t!==this._buildingFilterControl.position?(this._removeControl(this._buildingFilterControl),this._addControl(this._buildingFilterControl=new l.BuildingFilterControl(t),t)):this._buildingFilterControl.setLayoutHidden(!1),this},w.prototype.switchTheme=function(t){this._setStyle(this._getThemeStyleName(t)),this._attributionControl.changeTheme(t),this._map.on("styledata",b.debounce(this._setIndoorFilter.bind(this),250))},w.prototype.setFloorsControlStyle=function(t){this._floorsControl.setStyle(t)},w.prototype._setIndoorFilter=function(){this._indoor.updateLayers(),this._indoor.setBuildingsFilter(this._indoor.buildingId),this._indoor.setFloorsFilter(this._indoor.refLevel)},w.prototype._getThemeStyleName=function(t){var e;if(-1<b.values(x.ThemeType).indexOf(t))switch(t){case x.ThemeType.CHRISTMAS:e=h.christmasTheme;break;case x.ThemeType.HALLOWEEN:e=h.halloweenTheme;break;case x.ThemeType.MAPPY_BEE:e=h.mappyBeeTheme;break;case x.ThemeType.MAPXUS:e=h.mapxusTheme;break;case x.ThemeType.MAPXUS_V2:e=h.mapxusTheme_v2;break;case x.ThemeType.COMMON:e=h.commonTheme;break;case x.ThemeType.LANDS_D:e=h.landsDTheme}else e=h.getCustomizedThemeUrl(t);return e},w.prototype._setStyle=function(t){this._map.setStyle(t,{localIdeographFontFamily:"'Arial Unicode MS', 'Open Sans'"})},w.prototype._addControl=function(t,e){return t.setMap&&t.setMap(this),t instanceof l.BuildingFilterControl&&e&&t.setPosition(e),this._map.addControl(t,e),this},w.prototype._removeControl=function(t){return this._map.removeControl(t),this},w.prototype._defaultSetMapZoom=function(){return this._map.setZoom(17),this},w.prototype._defaultSelectedBuilding=function(t){var e=this;return this._buildingId=t.buildingId,this._indoor.goToBuilding(this._buildingId,(function(){if(t.floor&&e._floorsControl){if(!b.includes(e.building.level_names.split(","),t.floor))throw new Error("floor exclude in the building");e._floorsControl.switchFloor(t.floor)}e.fire(new d.Event("isLoadedBuilding"))})),this},w.prototype._defaultSelectedPoi=function(t){var e=this;return(new g.PoisService).searchByIds([t.poiId]).then((function(t){var r=t.data.result.pois[0];e._buildingId=r.buildingId,e._indoor.goToBuilding(e._buildingId,(function(){e._floorsControl&&e._floorsControl.switchFloor(r.floor),e._map.setZoom(19),e._map.panTo([r.location.lon,r.location.lat]),e.fire(new d.Event("isLoadedBuilding"))}))})).catch((function(){throw new Error("poi don't exist.")})),this},w.prototype._switchFloor=function(t){},n=w;function w(t){var e=o.call(this)||this;if(!t.map)throw new Error("Outdoor Map parameter missing.");if(!t.appId||!t.secret)throw new Error("Permission parameter missing.");return p.Request.authorization(t.appId,t.secret).then((function(){return e._enableFloorControl=!1!==t.enableFloorControl,e._enableBuildingSelector=!1!==t.enableBuildingSelector,e._map=t.map,e._poi=new s.Poi(e._map),e._indoor=new a.Indoor(e._map,t.hiddenOutdoor),e._mapZoom=t.map.getZoom(),p.Request.map=e._map,new Promise((function(t,e){(new f).get((function(e){t(e)}))}))})).then((function(r){p.Request.identifier=r,(r=e._map)._requestManager?r._requestManager.transformRequest=p.Request.transformRequest:r._transformRequest=p.Request.transformRequest,e._indoor.setEventedParent(e,{indoor:e._indoor}),e._addControl(e._buildingFilterControl=new l.BuildingFilterControl),e._addControl(e._floorsControl=new u.FloorsControl),e._addControl(new m.LogoControl),e._addControl(e._attributionControl=new y.AttributionControl({theme:t.theme})),(e._mapZoom<8||22<e._mapZoom)&&(e._defaultSetMapZoom(),1<e._mapZoom&&console.error("The allowed map zoom is in the range of [8, 22].")),t.buildingId&&e._defaultSelectedBuilding(t),t.poiId&&e._defaultSelectedPoi(t),e._enableBuildingSelector||e._buildingFilterControl.setLayoutHidden(!0),e._enableFloorControl||e._floorsControl.setLayoutHidden(!0),r=c.outdoorConfig().url,t.theme&&(r=e._getThemeStyleName(t.theme)),e._setStyle(r),e._map.once("styledata",(function(){e._initialHiddenLayers=v.getLayers(e._map.getStyle()).filter((function(t){return-1===t.id.indexOf("mapxus-building")})),e._initialHiddenLayers.forEach((function(t){e._map.setLayoutProperty(t.id,"visibility","none")}))})),e._indoor.once("switchFloor",(function(){e._initialHiddenLayers.forEach((function(t){e._map.setLayoutProperty(t.id,"visibility","visible")}))})),e.once("isIndoorLoaded",(function(t){t.error?e.fire(new d.Event("isRenderComplete",t)):(e.transformPoiTextFieldLanguage(window.navigator.language),e._buildingId?e.once("isLoadedBuilding",(function(){e.fire(new d.Event("isRenderComplete",t))})):e.fire(new d.Event("isRenderComplete",t)))}))})).catch((function(){throw new Error("Authorization does not pass.")})),e}e.Map=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.length,r=0,i=0;return t.forEach((function(t){r+=t.lng*Math.PI/180,i+=t.lat*Math.PI/180})),i/=e,{lng:180*(r/=e)/Math.PI,lat:180*i/Math.PI}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extend=void 0,e.extend=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];for(var i=0,n=e;i<n.length;i++){var o,a=n[i];for(o in a)a.hasOwnProperty(o)&&(t[o]=a[o])}return t}},function(t,e,r){t.exports=r(44)},function(t,e,r){"use strict";var i=r(3),n=r(21),o=r(46),a=r(14);function s(t){var e=new o(t);t=n(o.prototype.request,e);return i.extend(t,o.prototype,e),i.extend(t,e),t}var u=s(a);u.Axios=o,u.create=function(t){return s(i.merge(a,t))},u.Cancel=r(25),u.CancelToken=r(61),u.isCancel=r(24),u.all=function(t){return Promise.all(t)},u.spread=r(62),t.exports=u,t.exports.default=u},function(t,e){function r(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}
20
+ */},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(40);Object.defineProperty(e,"Map",{enumerable:!0,get:function(){return i.Map}});var n=r(19);Object.defineProperty(e,"Indoor",{enumerable:!0,get:function(){return n.Indoor}});var o=r(85);Object.defineProperty(e,"Marker",{enumerable:!0,get:function(){return o.Marker}});var a=r(26);Object.defineProperty(e,"Poi",{enumerable:!0,get:function(){return a.Poi}});var s=r(27);Object.defineProperty(e,"FloorsControl",{enumerable:!0,get:function(){return s.FloorsControl}});var u=r(28);Object.defineProperty(e,"BuildingFilterControl",{enumerable:!0,get:function(){return u.BuildingFilterControl}});var l=r(20);Object.defineProperty(e,"BuildingsService",{enumerable:!0,get:function(){return l.BuildingsService}});var c=r(30);Object.defineProperty(e,"PoisService",{enumerable:!0,get:function(){return c.PoisService}});var p=r(86);Object.defineProperty(e,"RouteService",{enumerable:!0,get:function(){return p.RouteService}});var h=r(5);Object.defineProperty(e,"Evented",{enumerable:!0,get:function(){return h.Evented}});var f=r(88);Object.defineProperty(e,"version",{enumerable:!0,get:function(){return f.version}})},function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var i=Array(t),n=0;for(e=0;e<r;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,n++)i[n]=o[a];return i},a=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Indoor=void 0;var s,u=a(r(41)),l=r(13),c=r(5),p=r(20),h=a(r(63)),f=r(17);n(d,s=c.Evented),d.prototype.enableSwitch=function(){return this._enableSwitch=!0,this},d.prototype.disableSwitch=function(){return this._enableSwitch=!1,this},d.prototype.enableSwitchBuilding=function(){return this._enableSwitchBuilding=!0,this},d.prototype.disableSwitchBuilding=function(){return this._enableSwitchBuilding=!1,this},Object.defineProperty(d.prototype,"floors",{get:function(){return this._levelNames},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"groundFloor",{get:function(){return this._groundLevel},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"buildingId",{get:function(){return this._buildingId},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"currentFloor",{get:function(){return this._levelName},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"refLevel",{get:function(){return this._refLevel},enumerable:!1,configurable:!0}),Object.defineProperty(d.prototype,"features",{get:function(){return this._features},enumerable:!1,configurable:!0}),d.prototype.getFeature=function(t){var e=this;return f.find(this.features,(function(r){return r.properties.id===(t||e._buildingId)}))},d.prototype.getBuildingByPoint=function(t){var e=this,r=this.refLevel;if(r){var i=this._map.queryRenderedFeatures(t,{layers:["custom-level-fill"]});return f.find(i,(function(t){return t.properties.id===r}))&&this._currentFeature||this._getBuildingLineByPoint(t,(function(t){return t.properties.id!==e._buildingId}))}return this._getBuildingLineByPoint(t)},d.prototype.selectBuilding=function(t){this._isNotCurrentFeature(t)&&(this._currentFeature=t,this._load()),this.setBuildingsFilter(t&&t.properties.id),t||this._clear(),this.fire(new c.Event("selectBuilding",{feature:t}))},d.prototype.switchBuilding=function(t){var e=u.default(this._getPointList(t));this._map.panTo(e),this.selectBuilding(t)},d.prototype.goToBuilding=function(t,e){var r=this,i=new p.BuildingsService,n=function(){var i;!r._map.areTilesLoaded()||(i=r.getFeature(t))&&(r._map.off("render",n),r.selectBuilding(i),e&&e(i))};i.searchByIds(t).then((function(t){t=t.data.result.buildings[0],r._map.panTo([t.labelCenter.lon,t.labelCenter.lat]),r._map.off("render",n),r._map.on("render",n)})).catch((function(t){r.fire(new c.Event("isIndoorLoaded",{error:t})),e&&e(null)}))},d.prototype.switchFloor=function(t){t&&f.includes(this._levelNames,t)&&(this._footprints.set(this._buildingId,t),this._levelName=t,this._refLevel=this._getRefLevel(),this.setFloorsFilter(this._refLevel),this.fire(new c.Event("switchFloor")))},d.prototype.initLayer=function(){var t=this;this._indoorLayers.forEach((function(e){var r=e.id,i=t._map.getLayer(r);e=i&&i.filter;i&&e&&(e=t._updateFilter(e,["==","building","yes"]),t._map.setFilter(r,e)),i&&t._isPoi(i.type)&&t._addTextHaloColor(r)}))},d.prototype.hiddenOutdoorLayer=function(t){this._isHiddenOutdoor=t,this._setOutdoorLayersHidden(t)},d.prototype.updateLayers=function(){this._indoorLayers=l.getLayers(this._map.getStyle()),this._isHiddenOutdoor&&this._setOutdoorLayersHidden(!0)},d.prototype.setBuildingsFilter=function(t){var e,r,i=this;t||f.forEach(this._indoorLayers,(function(t){e=t.id,(r=(r=i._map.getLayer(e))&&r.filter)&&i._map.getLayer(e)&&(r=i._updateFilter(r,["==","building","yes"]),i._map.setFilter(e,r),i._map.setPaintProperty("mapxus-building-line","fill-opacity",1))}))},d.prototype.setFloorsFilter=function(t){var e,r,i=this;t&&f.forEach(this._indoorLayers,(function(t){e=t.id,(r=(r=i._map.getLayer(e))&&r.filter)&&i._map.getLayer(e)&&"mapxus-building-name"!==e&&("mapxus-building-line"===e?i._map.setPaintProperty(e,"fill-opacity",["match",["get","id"],i._buildingId,0,1]):(r="mapxus-building-line-color"===e?i._updateFilter(r,["!=","id",i._buildingId]):i._isLevel(e)?i._updateFilter(r,["==","id",i._refLevel]):i._updateFilter(r,["==","ref:level",i._refLevel]),i._map.setFilter(e,r)))}))},d.prototype._loadData=function(){this._map.on("load",this._init.bind(this)).on("moveend",this._refresh.bind(this))},d.prototype._init=function(){var t=this;this.updateLayers(),this.initLayer(),this._map.on("data",(function(){t._load(),t._addCustomLevelFillLayer(),t.fire(new c.Event("isIndoorLoaded"))})).on("click",(function(e){t._enableSwitch&&(e=t.getBuildingByPoint(e.point),(t._enableSwitchBuilding||e)&&t.selectBuilding(e))}))},d.prototype._refresh=function(){this._load()},d.prototype._load=function(){this._features=this._getFeatures(),this._currentFeature&&this._buildingId===this._getBuildingId()&&this._refLevel===this._getRefLevel()||(this._buildingId=this._getBuildingId(),this._levelNames=this._getLevelNames(),this._groundLevel=this._getInitialLevelName(),this._levelName=this._footprints.get(this._buildingId)||this._groundLevel,this._refLevel=this._getRefLevel(),this.fire(new c.Event("isDataLoaded")))},d.prototype._clear=function(){this._buildingId=null,this._levelNames=[],this._levelName=null,this._refLevel=null,this._currentFeature=null},d.prototype._updateFilter=function(t,e){var r=!this._isFilterHasBeenReset(t),i=t.length-1,n=t;return r?n="all"===t[0]?o(t,[e]):"match"===t[0]?["all",["any",["==",t[1][1],t[2][0]],["==",t[1][1],t[2][1]]],e]:["all",t,e]:JSON.stringify(f.last(t))!==JSON.stringify(e)&&(n=f.map(t,(function(t,r){return r===i?e:t}))),n},d.prototype._isFilterHasBeenReset=function(t){var e=!1;return t&&(t=t[t.length-1],f.isArray(t)&&(e="=="===t[0]&&("id"===t[1]||"ref:building"===t[1]||"ref:level"===t[1]||"building"===t[1])||"!="===t[0]&&"id"===t[1])),e},d.prototype._addTextHaloColor=function(t,e){this._map.setPaintProperty(t,"text-halo-color",e||"white"),this._map.setPaintProperty(t,"text-halo-width",2)},d.prototype._getFeatures=function(){var t=this._map.getCanvas().getBoundingClientRect(),e=new h.default.Point(t.x,t.y);t=new h.default.Point(t.width,t.height),t=this._map.queryRenderedFeatures([e,t]),t=this._groupFeatures(t);return this._currentFeature&&(this._includeCurrentFeature(t)&&(t=this._removeFeature(t)),t.unshift(this._currentFeature)),t},d.prototype._groupFeatures=function(t){var e,r,i=f.groupBy(t,"properties.id"),n=[];for(e in i)!i[e]||(r=i[e]).length&&(r=f.first(r),n.push(r));return n},d.prototype._getFeatureInfo=function(){return this._currentFeature||null},d.prototype._getLevelNames=function(){var t=this._getFeatureInfo();return t&&t.properties.level_names.split(",")||[]},d.prototype._getBuildingId=function(){var t=this._getFeatureInfo();return t&&t.properties.id||null},d.prototype._getRefLevel=function(){var t=this,e=this._getFeatureInfo();if(e){var r=f.findIndex(this._levelNames,(function(e){return e===t._levelName}));return e.properties.level_ids.split(",")[r]}return null},d.prototype._getInitialLevelName=function(){if(r=this._getFeatureInfo()){var t=r.properties,e=f.minBy(f.reverse(t.ordinals.split(",")),(function(t){return Math.abs(+t)})),r=f.findIndex(t.ordinals.split(","),(function(t){return t===e}));return t.level_names.split(",")[r]}return null},d.prototype._isNotCurrentFeature=function(t){return!t||!this._currentFeature||t.properties.id!==this._currentFeature.properties.id},d.prototype._isLevel=function(t){return-1<t.indexOf("mapxus-level")},d.prototype._isPoi=function(t){return"symbol"===t},d.prototype._includeCurrentFeature=function(t){var e=this;return!!this._currentFeature&&t.some((function(t){var r=t.properties;t=e._currentFeature.properties;return r.id===t.id}))},d.prototype._removeFeature=function(t){var e=this;return f.remove(t,(function(t){var r=t.properties;t=e._currentFeature.properties;return r.id===t.id})),t},d.prototype._getPointList=function(t){var e=t.geometry;t=e.coordinates[0];return 1<e.coordinates.length&&(t=e.coordinates[0][0]),t.map((function(t){return{lng:t[0],lat:t[1]}}))},d.prototype._setOutdoorLayersHidden=function(t){var e=this,r=l.getOutdoorLayers(this._map.getStyle()),i=t?"none":"visible";f.forEach(r,(function(t){e._map.getLayer(t.id)&&e._map.setLayoutProperty(t.id,"visibility",i)}))},d.prototype._addCustomLevelFillLayer=function(){this._hasCustomLevelFill||(this._map.addLayer({id:"custom-level-fill",source:"indoor-planet","source-layer":"mapxus_level",type:"fill",paint:{"fill-opacity":0}}),this._hasCustomLevelFill=!0)},d.prototype._getBuildingLineByPoint=function(t,e){return t=this._map.queryRenderedFeatures(t,{layers:["mapxus-building-line"]}),e?f.find(t,e):t[0]},n=d;function d(t,e){var r=s.call(this)||this;return r._hasCustomLevelFill=!1,r._map=t,r._enableSwitch=!0,r._enableSwitchBuilding=!0,r._isHiddenOutdoor=e||!1,r._footprints=new Map,r._loadData(),r}e.Indoor=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BuildingsService=void 0;var i=r(6),n=r(7);o.prototype.searchByIds=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(!t.length)throw new Error("Parameter cannot be empty.");var r=this._api+"/"+t.join(",");return this._request.get(r)},o.prototype.searchByDistance=function(t,e,r,n,o){if(void 0===n&&(n=i.OFFSET),void 0===o&&(o=i.PAGE),arguments.length<3)throw new Error("Parameter cannot be empty.");if(2!==e.length)throw new Error("Center lon lat cannot be less than 2.");return o=["region=0","center="+e.join(","),"distance="+r,"offset="+n,"page="+o],t&&o.unshift("keywords="+t),o=this._api+"?"+o.join("&"),this._request.get(o)},o.prototype.searchByBbox=function(t,e,r,n){if(void 0===r&&(r=i.OFFSET),void 0===n&&(n=i.PAGE),arguments.length<2)throw new Error("Parameter cannot be empty.");if(4!==e.length)throw new Error("Bbox parameters cannot be less than 2.");return n=["region=0","bbox="+e.join(","),"offset="+r,"page="+n],t&&n.unshift("keywords="+t),n=this._api+"?"+n.join("&"),this._request.get(n)},o.prototype.searchByGlobal=function(t,e,r){if(void 0===e&&(e=i.OFFSET),void 0===r&&(r=i.PAGE),!arguments.length)throw new Error("Parameter cannot be empty.");return r=["region=0","searchGlobal=true","offset="+e,"page="+r],t&&r.unshift("keywords="+t),r=this._api+"?"+r.join("&"),this._request.get(r)},r=o;function o(){this._api="/api/v1/buildings",this._request=new n.Request}e.BuildingsService=r},function(t,e,r){"use strict";t.exports=function(t,e){return function(){for(var r=new Array(arguments.length),i=0;i<r.length;i++)r[i]=arguments[i];return t.apply(e,r)}}},function(t,e,r){"use strict";var i=r(3),n=r(49),o=r(51),a=r(52),s=r(53),u=r(23),l="undefined"!=typeof window&&window.btoa&&window.btoa.bind(window)||r(54);t.exports=function(t){return new Promise((function(e,c){var p=t.data,h=t.headers;i.isFormData(p)&&delete h["Content-Type"];var f,d,m=new XMLHttpRequest,y="onreadystatechange",g=!1;if("undefined"==typeof window||!window.XDomainRequest||"withCredentials"in m||s(t.url)||(m=new window.XDomainRequest,y="onload",g=!0,m.onprogress=function(){},m.ontimeout=function(){}),t.auth&&(f=t.auth.username||"",d=t.auth.password||"",h.Authorization="Basic "+l(f+":"+d)),m.open(t.method.toUpperCase(),o(t.url,t.params,t.paramsSerializer),!0),m.timeout=t.timeout,m[y]=function(){var r;m&&(4===m.readyState||g)&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&(r="getAllResponseHeaders"in m?a(m.getAllResponseHeaders()):null,r={data:t.responseType&&"text"!==t.responseType?m.response:m.responseText,status:1223===m.status?204:m.status,statusText:1223===m.status?"No Content":m.statusText,headers:r,config:t,request:m},n(e,c,r),m=null)},m.onerror=function(){c(u("Network Error",t,null,m)),m=null},m.ontimeout=function(){c(u("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",m)),m=null},i.isStandardBrowserEnv()&&(y=r(55),(y=(t.withCredentials||s(t.url))&&t.xsrfCookieName?y.read(t.xsrfCookieName):void 0)&&(h[t.xsrfHeaderName]=y)),"setRequestHeader"in m&&i.forEach(h,(function(t,e){void 0===p&&"content-type"===e.toLowerCase()?delete h[e]:m.setRequestHeader(e,t)})),t.withCredentials&&(m.withCredentials=!0),t.responseType)try{m.responseType=t.responseType}catch(f){if("json"!==t.responseType)throw f}"function"==typeof t.onDownloadProgress&&m.addEventListener("progress",t.onDownloadProgress),"function"==typeof t.onUploadProgress&&m.upload&&m.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then((function(t){m&&(m.abort(),c(t),m=null)})),void 0===p&&(p=null),m.send(p)}))}},function(t,e,r){"use strict";var i=r(50);t.exports=function(t,e,r,n,o){return t=new Error(t),i(t,e,r,n,o)}},function(t,e,r){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},function(t,e,r){"use strict";function i(t){this.message=t}i.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},i.prototype.__CANCEL__=!0,t.exports=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Poi=void 0;var i=r(13);Object.defineProperty(n.prototype,"pointClickFunction",{set:function(t){this._pointClickFunction=t},enumerable:!1,configurable:!0}),n.prototype._loadData=function(){this._map.on("style.load",this._init.bind(this))},n.prototype._init=function(){this._layers=i.getLayers(this._map.getStyle()).filter((function(t){return-1<t.id.indexOf("mapxus-poi")})),this._initClick()},n.prototype._initClick=function(){var t=this;this._map.on("click",(function(e){var r=t._map.queryRenderedFeatures(e.point,{layers:t._layers.map((function(t){return t.id}))});r.length&&t._pointClickFunction&&(r={lngLat:e.lngLat,originalEvent:e.originalEvent,point:e.point,feature:r[0]},t._pointClickFunction(r))}))},r=n;function n(t){this._map=t,this._loadData()}e.Poi=r},function(t,e,r){"use strict";var i=this&&this.__spreadArrays||function(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;var i=Array(t),n=0;for(e=0;e<r;e++)for(var o=arguments[e],a=0,s=o.length;a<s;a++,n++)i[n]=o[a];return i};Object.defineProperty(e,"__esModule",{value:!0}),e.FloorsControl=void 0,r(65);var n=r(10);Object.defineProperty(o.prototype,"position",{get:function(){return this._position},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"enabled",{get:function(){return this._enableFloorControl},enumerable:!1,configurable:!0}),o.prototype.setMap=function(t){this._map=t},o.prototype.onAdd=function(t){return this._$container=n.domCreate("div","maplibregl-ctrl maplibregl-ctrl-floors",t.getContainer()),this._$container.appendChild(this._$createLayout("div")),this._listener(),this._bindEvent(),this._$container},o.prototype.onRemove=function(){n.domRemove(this._$container)},o.prototype.getDefaultPosition=function(){return"top-right"},Object.defineProperty(o.prototype,"floorClickFunction",{set:function(t){this._floorClickFunction=t},enumerable:!1,configurable:!0}),o.prototype.switchFloor=function(t,e){var r=this;this._indoor.floors&&(this._setCurrentButtonActive(!1),this._$currentButton.style.color=this._fontColor,this._$floorControlButtons.forEach((function(e,i){e.getAttribute("data-floor")===t&&(r._floor=t,r._$currentButton=e,r._setCurrentButtonActive(!0))})),this._indoor.switchFloor(t),e&&e({floor:t,feature:this._indoor.getFeature()}))},o.prototype.setStyle=function(t){var e=this;["fontColor","selectFontColor","selectBoxColor"].forEach((function(r){t.hasOwnProperty(r)&&("fontColor"===r&&(e._fontColor=t[r],e._$floorControlButtons.forEach((function(t){t.style.color=e._fontColor}))),"selectFontColor"===r&&(e._selectFontColor=t[r],e._$currentButton.style.color=e._selectFontColor),"selectBoxColor"===r&&(e._selectBoxColor=t[r],e._$currentButton.style.backgroundColor=e._selectBoxColor))}))},o.prototype.setLayoutHidden=function(t){this._enableFloorControl=!t,t?this._$hideLayout():this._$showLayout()},o.prototype.moveFloorControl=function(t,e){var r=document.querySelector(".maplibregl-ctrl-"+t);t=r.querySelector(".maplibregl-ctrl-floors"),e=document.querySelector(".maplibregl-ctrl-"+e);t&&(r.removeChild(t),e.prepend(t))},o.prototype._listener=function(){this._map.getMap().on("moveend",this._refresh.bind(this)),this._map.getIndoor().on("selectBuilding",this._init.bind(this))},o.prototype._init=function(t){var e=this;this._indoor=this._map.getIndoor(),(t=t.feature)&&this._floor===this._indoor.currentFloor&&this._buildingId===this._indoor.buildingId||(this._resetBuildingId(),this._resetFloor(),this._$hideLayout(),this._$clearFloors(),t&&(this._setBuildingId(),this._setFloor(),this._$configLayoutHeight(),this._$createFloors(),this._switchToGroundFloor(),setTimeout((function(){e._scrollToClickedFloor(),e._$showOrHideArrow(),e._isEnableDisplay()&&e._$showLayout()}))))},o.prototype._refresh=function(){this._isEnableDisplay()?this._$showLayout():this._$hideLayout(),this._isEmptyFloors()&&this._$hideLayout()},o.prototype._$createLayout=function(t){return this._$layout=n.domCreate(t,"mapxus-floor-selector-layout hide"),this._$arrowUp=n.domCreate(t,"mapxus-floor-selector-up",this._$layout),this._$arrowDown=n.domCreate(t,"mapxus-floor-selector-down",this._$layout),this._$outer=n.domCreate(t,"mapxus-floor-selector-outer",this._$layout),this._$inner=n.domCreate(t,"mapxus-floor-selector-inner",this._$outer),this._$layout.appendChild(this._$outer),this._$layout},o.prototype._$configLayoutHeight=function(){var t=34*(t=5<=(t=this._indoor.floors.length)?5:t);this._$outer.style.height=t+"px",this._$configArrowDownTop()},o.prototype._$configArrowDownTop=function(){var t=parseInt(this._$outer.style.height.replace(/px/,""),10)-26;this._$arrowDown.style.marginTop=t+"px"},o.prototype._$showOrHideArrow=function(){this._$hideArrowDown(),this._$hideArrowUp(),this._floorScroll()},o.prototype._$showLayout=function(){this._$container.classList.remove("hide")},o.prototype._$hideLayout=function(){this._$container.classList.add("hide")},o.prototype._$showArrowUp=function(){this._$arrowUp.classList.remove("hide")},o.prototype._$hideArrowUp=function(){this._$arrowUp.classList.add("hide")},o.prototype._$showArrowDown=function(){this._$arrowDown.classList.remove("hide")},o.prototype._$hideArrowDown=function(){this._$arrowDown.classList.add("hide")},o.prototype._$createFloors=function(){var t=this;i(this._indoor.floors).reverse().forEach((function(e){var r=t._$createFloor(e);t._$inner.appendChild(r),t._$floorControlButtons.push(r),r.style.color=t._fontColor,e===t._floor&&(t._$currentButton=r,t._setCurrentButtonActive(!0))})),this._$layout.classList.remove("hide")},o.prototype._$clearFloors=function(){this._$inner.innerHTML=""},o.prototype._$createFloor=function(t){var e=n.domCreate("button","floor");return e.setAttribute("data-floor",t),e.innerText=t,e},o.prototype._isEmptyFloors=function(){return!Boolean(this._$inner.innerHTML)},o.prototype._isOverflowFloorMax=function(){return 5<Array.prototype.slice.call(this._$inner.querySelectorAll("button.floor")).length},o.prototype._isEnableDisplay=function(){return 16<=this._map.getMap().getZoom()&&this._enableFloorControl},o.prototype._scrollToClickedFloor=function(){for(var t=0,e=this._indoor.floors.slice().reverse(),r=0;r<e.length&&e[r]!==this._floor;r++)t+=30;this._$inner.scrollTop=t},o.prototype._switchToGroundFloor=function(){this._floor&&this._indoor.switchFloor(this._floor)},o.prototype._setFloor=function(){this._floor||(this._floor=this._indoor.currentFloor)},o.prototype._resetFloor=function(){this._floor=null},o.prototype._setCurrentButtonActive=function(t){this._$currentButton.style.color=t?this._selectFontColor:this._fontColor,this._$currentButton.style.backgroundColor=t?this._selectBoxColor:"#fff",this._$currentButton.disabled=t,this._$currentButton.style.cursor=t?"initial":"pointer"},o.prototype._setBuildingId=function(){this._buildingId=this._indoor.buildingId},o.prototype._resetBuildingId=function(){this._buildingId=null},o.prototype._floorClick=function(t){var e=t.target.getAttribute("data-floor");this.switchFloor(e),this._floorClickFunction&&(t={floor:e,originalEvent:t,feature:this._indoor.getFeature()},this._floorClickFunction(t))},o.prototype._floorScroll=function(){var t=this._$inner.clientHeight,e=this._$inner.scrollHeight-t;t=0===this._$inner.scrollTop,e=this._$inner.scrollTop===e;this._isOverflowFloorMax()&&(t?(this._$hideArrowUp(),this._$showArrowDown()):e?(this._$hideArrowDown(),this._$showArrowUp()):(this._$showArrowUp(),this._$showArrowDown()))},o.prototype._floorClickEvent=function(){this._$inner.addEventListener("click",this._floorClick.bind(this))},o.prototype._floorScrollEvent=function(){this._$inner.addEventListener("scroll",this._floorScroll.bind(this))},o.prototype._bindEvent=function(){this._floorClickEvent(),this._floorScrollEvent()},r=o;function o(t){this._fontColor="#bdbdbf",this._selectFontColor="#fff",this._selectBoxColor="#68afce",this._$floorControlButtons=[],this._position=t||"top-right",this._enableFloorControl=!0}e.FloorsControl=r},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BuildingFilterControl=void 0,r(70);var i=r(10),n=r(17);o.prototype.setMap=function(t){this._map=t},o.prototype.setPosition=function(t){},o.prototype.onAdd=function(t){return this._container=i.domCreate("div","maplibregl-ctrl maplibregl-ctrl-building-filter",t.getContainer()),this._container.appendChild(this._buildingFilterIconCreate("div")),this._container.appendChild(this._buildingNameListCreate("div")),this._loadData(),this._container},o.prototype.onRemove=function(){i.domRemove(this._container)},Object.defineProperty(o.prototype,"position",{get:function(){return this._position},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"enabled",{get:function(){return this._enableBuildingSelector},enumerable:!1,configurable:!0}),o.prototype.getDefaultPosition=function(){return"top-right"},o.prototype.setLayoutHidden=function(t){this._enableBuildingSelector=!t,t?this._$hideLayout():this._$showLayout()},o.prototype.moveBuildingFilter=function(t,e){var r=document.querySelector(".maplibregl-ctrl-"+t);t=r.querySelector(".maplibregl-ctrl-building-filter"),e=document.querySelector(".maplibregl-ctrl-"+e);t&&(r.removeChild(t),e.prepend(t))},o.prototype._loadData=function(){this._init(),this._map.getMap().on("moveend",this._refresh.bind(this)),this._map.getIndoor().on("selectBuilding",this._select.bind(this)).on("isDataLoaded",this._refresh.bind(this))},o.prototype._init=function(){this._load()},o.prototype._refresh=function(){this._load()},o.prototype._select=function(t){this._buildingId=t.feature?t.feature.properties.id:null,this._refresh()},o.prototype._load=function(){this._indoor=this._map.getIndoor(),this._buildingNameListClean(),this._buildingNameListUpdate(this._indoor.features,this._features=[],this._buildingId)},o.prototype._includes=function(t,e){return t.some((function(t){return t.properties.id===e.properties.id}))},o.prototype._getFeatureByName=function(t){return n.find(this._features,(function(e){return e.properties.name===t}))},o.prototype._buildingFilterIconCreate=function(t){return(t=window.document.createElement(t)).className="mapxus-building-filter-icon",this._buildingToggleListEvent(t,!0),t},o.prototype._buildingNameListCreate=function(t){return this._buildingNameLayout=window.document.createElement(t),this._buildingNameLayout.className="mapxus-building-name-layout",this._buildingNameLayout.style.display="none",this._buildingNameList=window.document.createElement(t),this._buildingNameList.className="mapxus-building-name-list",this._buildingNameLayout.appendChild(this._buildingNameList),this._buildingToggleListEvent(this._buildingNameLayout,!1),this._buildingNameLayout},o.prototype._buildingNameListUpdate=function(t,e,r){var i=this;n.forEach(t,(function(t){var n;i._includes(e,t)||"yes"!==t.properties.building||(e.push(t),n=!1,r&&t.properties.id===r&&(n=!0),i._buildingNameList.appendChild(i._buildingNameCreate("p",t.properties.name,n)))})),this._buildingNameListHeight(e)},o.prototype._buildingNameListClean=function(){this._buildingNameList.innerHTML=""},o.prototype._buildingNameListHeight=function(t){t=26*t.length,this._buildingNameList.style.height=this._buildingNameLayout.style.height=(208<=t?208:t)+"px",-1<this._position.indexOf("bottom")&&(this._buildingNameLayout.style.marginTop=-(208<=t?208:t)+"px"),-1<this._position.indexOf("left")&&(this._buildingNameLayout.style.left="45px"),-1<this._position.indexOf("right")&&(this._buildingNameLayout.style.right="45px")},o.prototype._buildingNameCreate=function(t,e,r){return(t=window.document.createElement(t)).className="mapxus-building-name",t.innerHTML=e,r&&t.classList.add("active"),this._buildingNameClickEvent(t),t},o.prototype._toggleList=function(t){this._buildingNameLayout.style.display=t?"block":"none"},o.prototype._buildingNameClickEvent=function(t){var e=this;t.onclick||(t.onclick=function(t){t=t.target.innerText,t=e._getFeatureByName(t),e._indoor.switchBuilding(t)})},o.prototype._buildingToggleListEvent=function(t,e){var r=this;t.onmouseenter||(t.onmouseenter=function(t){r._toggleList(!0)}),t.onmouseleave||e||(t.onmouseleave=function(t){r._toggleList(!1)})},o.prototype._$showLayout=function(){this._container.classList.remove("hide")},o.prototype._$hideLayout=function(){this._container.classList.add("hide")},r=o;function o(t){this._position=t||"top-right",this._enableBuildingSelector=!0}e.BuildingFilterControl=r},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getCustomizedThemeUrl=e.mapxusTheme_v2=e.landsDTheme=e.mapxusTheme=e.mappyBeeTheme=e.halloweenTheme=e.commonTheme=e.christmasTheme=void 0;var i=r(6);function n(t){return i.BMS_URL+"/api/v2/tiles/styles/"+t}e.christmasTheme=n("christmas_mims2_v1"),e.commonTheme=n("common_mims2_v1"),e.halloweenTheme=n("halloween_mims2_v1"),e.mappyBeeTheme=n("mappybee_mims2_v1"),e.mapxusTheme=n("mapxus_mims2_v1"),e.landsDTheme=n("lands_d_mims2_v1"),e.mapxusTheme_v2=n("mapxus_mims2_v4"),e.getCustomizedThemeUrl=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PoisService=void 0;var i=r(6),n=r(7),o=r(82);a.prototype.searchByIds=function(t){if(!t.length)throw new Error("Parameter cannot be empty.");return t=this._apiV1+"/"+t.join(","),this._request.get(t)},a.prototype.searchByDistance=function(t,e,r,n,o){if(void 0===n&&(n=i.OFFSET),void 0===o&&(o=i.PAGE),arguments.length<3)throw new Error("Parameter cannot be empty.");if(2!==e.length)throw new Error("Center lon lat cannot be less than 2.");return r=Math.round(r),o=["center="+e.join(","),"distance="+r,"offset="+n,"page="+o],t&&o.unshift("category="+t),o=this._apiV1+"?"+o.join("&"),this._request.get(o)},a.prototype.searchByBbox=function(t,e,r,n){if(void 0===r&&(r=i.OFFSET),void 0===n&&(n=i.PAGE),arguments.length<2)throw new Error("Parameter cannot be empty.");if(4!==e.length)throw new Error("Bbox parameters cannot be less than 2.");return n=["bbox="+e.join(","),"offset="+r,"page="+n],t&&n.unshift("keywords="+t),n=this._apiV1+"?"+n.join("&"),this._request.get(n)},a.prototype.searchByBuildingId=function(t,e,r,n){if(void 0===r&&(r=i.OFFSET),void 0===n&&(n=i.PAGE),arguments.length<2)throw new Error("Parameter cannot be empty.");return n=["buildingId="+e,"offset="+r,"page="+n],t&&n.unshift("keywords="+t),n=this._apiV1+"?"+n.join("&"),this._request.get(n)},a.prototype.searchCategory=function(t,e){if(!arguments.length)throw new Error("Missing buildingId");return t=["buildingId="+t],e&&t.push("floor="+e),t=this._categories+"/pois?"+t.join("&"),this._request.get(t)},a.prototype.searchOrientation=function(t,e,r,i,n,a){if(void 0===n&&(n=o.DistanceSearchType.POINT),6!==arguments.length)throw new Error("Parameter length should be 6.");return t=Math.round(t),i=Math.round(i),a=["angle="+t,"buildingId="+e,"center="+r.join(","),"distance="+i,"distanceSearchType="+n,"floor="+a],a=this._apiV1+"/orientation?"+a.join("&"),this._request.get(a)},r=a;function a(){this._apiV1="/api/v1/pois",this._categories="/api/v1/categories",this._request=new n.Request}e.PoisService=r},,,,,,,,,,function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Map=void 0;var o,a=r(19),s=r(26),u=r(27),l=r(28),c=r(73),p=r(7),h=r(29),f=r(74),d=r(5),m=r(75),y=r(79),g=r(30),_=r(83),v=r(13),x=r(84),b=r(17);n(w,o=d.Evented),w.prototype.renderComplete=function(t){this.on("isRenderComplete",(function(e){return t(e)}))},w.prototype.getIndoor=function(){return this._indoor},w.prototype.getMap=function(){return this._map},w.prototype.transformPoiTextFieldLanguage=function(t){var e=this,r=v.getLayers(this._map.getStyle());r=b.filter(r,(function(t){return"symbol"===e._map.getLayer(t.id).type}));_.getTextFieldCoalesceList(r,t).forEach((function(t){e._map.setLayoutProperty(t.layerId,"text-field",t.coalesce)}))},w.prototype.enableSwitch=function(){return this._indoor.enableSwitch(),this},w.prototype.disableSwitch=function(){return this._indoor.disableSwitch(),this},w.prototype.enableSwitchBuilding=function(){return this._indoor.enableSwitchBuilding(),this},w.prototype.disableSwitchBuilding=function(){return this._indoor.disableSwitchBuilding(),this},w.prototype.hiddenOutdoorLayer=function(t){this.getIndoor().hiddenOutdoorLayer(t)},Object.defineProperty(w.prototype,"floors",{get:function(){return this.getIndoor().floors},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"currentFloor",{get:function(){return this.getIndoor().currentFloor},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"building",{get:function(){return this.getIndoor().getFeature()&&this.getIndoor().getFeature().properties},enumerable:!1,configurable:!0}),w.prototype.getFeature=function(t){return this.getIndoor().getFeature(t)},w.prototype.selectBuilding=function(t){return this._indoor.selectBuilding(t),this},w.prototype.switchBuilding=function(t,e){return this._indoor.goToBuilding(t,e),this},w.prototype.switchFloor=function(t,e){return this._floorsControl&&(this._floorsControl.switchFloor(t,e),t={floor:t,originalEvent:null,feature:this._indoor.getFeature()},this._switchFloor(t)),this},w.prototype.onMapClickListener=function(t){var e=this;return this._map.on("click",(function(r){r.feature=e._indoor.getBuildingByPoint(r.point),t(r)})),this},w.prototype.onIndoorPoiListener=function(t){return this._poi.pointClickFunction=t,this},w.prototype.onFloorChangeListener=function(t){return this._floorsControl&&(this._floorsControl.floorClickFunction=t,this._switchFloor=t),this},w.prototype.onBuildingChangeListener=function(t){return this._indoor.on("selectBuilding",(function(e){return t(e.feature)})),this},w.prototype.disableFloorControl=function(){return this._floorsControl.setLayoutHidden(!0),this},w.prototype.enableFloorControl=function(t){return t&&t!==this._floorsControl.position&&this._floorsControl.moveFloorControl(this._floorsControl.position,t),this._floorsControl.enabled||this._floorsControl.setLayoutHidden(!1),this},w.prototype.disableBuildingSelector=function(){return this._buildingFilterControl.setLayoutHidden(!0),this},w.prototype.enableBuildingSelector=function(t){return t&&t!==this._buildingFilterControl.position&&this._buildingFilterControl.moveBuildingFilter(this._buildingFilterControl.position,t),this._buildingFilterControl.enabled||this._buildingFilterControl.setLayoutHidden(!1),this},w.prototype.switchTheme=function(t){this._setStyle(this._getThemeStyleName(t)),this._attributionControl.changeTheme(t),this._map.on("styledata",b.debounce(this._setIndoorFilter.bind(this),250))},w.prototype.setFloorsControlStyle=function(t){this._floorsControl.setStyle(t)},w.prototype._setIndoorFilter=function(){this._indoor.updateLayers(),this._indoor.setBuildingsFilter(this._indoor.buildingId),this._indoor.setFloorsFilter(this._indoor.refLevel)},w.prototype._getThemeStyleName=function(t){var e;if(-1<b.values(x.ThemeType).indexOf(t))switch(t){case x.ThemeType.CHRISTMAS:e=h.christmasTheme;break;case x.ThemeType.HALLOWEEN:e=h.halloweenTheme;break;case x.ThemeType.MAPPY_BEE:e=h.mappyBeeTheme;break;case x.ThemeType.MAPXUS:e=h.mapxusTheme;break;case x.ThemeType.MAPXUS_V2:e=h.mapxusTheme_v2;break;case x.ThemeType.COMMON:e=h.commonTheme;break;case x.ThemeType.LANDS_D:e=h.landsDTheme}else e=h.getCustomizedThemeUrl(t);return e},w.prototype._setStyle=function(t){this._map.setStyle(t,{localIdeographFontFamily:"'Arial Unicode MS', 'Open Sans'"})},w.prototype._addControl=function(t,e){return t.setMap&&t.setMap(this),t instanceof l.BuildingFilterControl&&e&&t.setPosition(e),this._map.addControl(t,e),this},w.prototype._defaultSetMapZoom=function(){return this._map.setZoom(17),this},w.prototype._defaultSelectedBuilding=function(t){var e=this;return this._buildingId=t.buildingId,this._indoor.goToBuilding(this._buildingId,(function(){if(t.floor&&e._floorsControl){if(!b.includes(e.building.level_names.split(","),t.floor))throw new Error("floor exclude in the building");e._floorsControl.switchFloor(t.floor)}e.fire(new d.Event("isLoadedBuilding"))})),this},w.prototype._defaultSelectedPoi=function(t){var e=this;return(new g.PoisService).searchByIds([t.poiId]).then((function(t){var r=t.data.result.pois[0];e._buildingId=r.buildingId,e._indoor.goToBuilding(e._buildingId,(function(){e._floorsControl&&e._floorsControl.switchFloor(r.floor),e._map.setZoom(19),e._map.panTo([r.location.lon,r.location.lat]),e.fire(new d.Event("isLoadedBuilding"))}))})).catch((function(){throw new Error("poi don't exist.")})),this},w.prototype._switchFloor=function(t){},n=w;function w(t){var e=o.call(this)||this;if(!t.map)throw new Error("Outdoor Map parameter missing.");if(!t.appId||!t.secret)throw new Error("Permission parameter missing.");return p.Request.authorization(t.appId,t.secret).then((function(){return e._enableFloorControl=!1!==t.enableFloorControl&&(Boolean(t.buildingId)||Boolean(t.poiId)),e._enableBuildingSelector=!1!==t.enableBuildingSelector,e._map=t.map,e._poi=new s.Poi(e._map),e._indoor=new a.Indoor(e._map,t.hiddenOutdoor),e._mapZoom=t.map.getZoom(),p.Request.map=e._map,new Promise((function(t,e){(new f).get((function(e){t(e)}))}))})).then((function(r){p.Request.identifier=r,(r=e._map)._requestManager?r._requestManager.transformRequest=p.Request.transformRequest:r._transformRequest=p.Request.transformRequest,e._indoor.setEventedParent(e,{indoor:e._indoor}),e._addControl(e._buildingFilterControl=new l.BuildingFilterControl),e._addControl(e._floorsControl=new u.FloorsControl),e._addControl(new m.LogoControl),e._addControl(e._attributionControl=new y.AttributionControl({theme:t.theme})),(e._mapZoom<8||22<e._mapZoom)&&(e._defaultSetMapZoom(),1<e._mapZoom&&console.error("The allowed map zoom is in the range of [8, 22].")),t.buildingId&&e._defaultSelectedBuilding(t),t.poiId&&e._defaultSelectedPoi(t),e._enableBuildingSelector||e._buildingFilterControl.setLayoutHidden(!0),e._enableFloorControl||e._floorsControl.setLayoutHidden(!0),r=c.outdoorConfig().url,t.theme&&(r=e._getThemeStyleName(t.theme)),e._setStyle(r),e._map.once("styledata",(function(){e._initialHiddenLayers=v.getLayers(e._map.getStyle()).filter((function(t){return-1===t.id.indexOf("mapxus-building")})),e._initialHiddenLayers.forEach((function(t){e._map.setLayoutProperty(t.id,"visibility","none")}))})),e._indoor.once("switchFloor",(function(){e._initialHiddenLayers.forEach((function(t){e._map.setLayoutProperty(t.id,"visibility","visible")}))})),e.once("isIndoorLoaded",(function(t){t.error?e.fire(new d.Event("isRenderComplete",t)):(e.transformPoiTextFieldLanguage(window.navigator.language),e._buildingId?e.once("isLoadedBuilding",(function(){e.fire(new d.Event("isRenderComplete",t))})):e.fire(new d.Event("isRenderComplete",t)))}))})).catch((function(){throw new Error("Authorization does not pass.")})),e}e.Map=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.length,r=0,i=0;return t.forEach((function(t){r+=t.lng*Math.PI/180,i+=t.lat*Math.PI/180})),i/=e,{lng:180*(r/=e)/Math.PI,lat:180*i/Math.PI}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.extend=void 0,e.extend=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];for(var i=0,n=e;i<n.length;i++){var o,a=n[i];for(o in a)a.hasOwnProperty(o)&&(t[o]=a[o])}return t}},function(t,e,r){t.exports=r(44)},function(t,e,r){"use strict";var i=r(3),n=r(21),o=r(46),a=r(14);function s(t){var e=new o(t);t=n(o.prototype.request,e);return i.extend(t,o.prototype,e),i.extend(t,e),t}var u=s(a);u.Axios=o,u.create=function(t){return s(i.merge(a,t))},u.Cancel=r(25),u.CancelToken=r(61),u.isCancel=r(24),u.all=function(t){return Promise.all(t)},u.spread=r(62),t.exports=u,t.exports.default=u},function(t,e){function r(t){return!!t.constructor&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}
21
21
  /*!
22
22
  * Determine if an object is a Buffer
23
23
  *
24
24
  * @author Feross Aboukhadijeh <https://feross.org>
25
25
  * @license MIT
26
- */t.exports=function(t){return null!=t&&(r(t)||"function"==typeof(e=t).readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))||!!t._isBuffer);var e}},function(t,e,r){"use strict";var i=r(14),n=r(3),o=r(56),a=r(57);function s(t){this.defaults=t,this.interceptors={request:new o,response:new o}}s.prototype.request=function(t){"string"==typeof t&&(t=n.merge({url:arguments[0]},arguments[1])),(t=n.merge(i,{method:"get"},this.defaults,t)).method=t.method.toLowerCase();var e=[a,void 0],r=Promise.resolve(t);for(this.interceptors.request.forEach((function(t){e.unshift(t.fulfilled,t.rejected)})),this.interceptors.response.forEach((function(t){e.push(t.fulfilled,t.rejected)}));e.length;)r=r.then(e.shift(),e.shift());return r},n.forEach(["delete","get","head","options"],(function(t){s.prototype[t]=function(e,r){return this.request(n.merge(r||{},{method:t,url:e}))}})),n.forEach(["post","put","patch"],(function(t){s.prototype[t]=function(e,r,i){return this.request(n.merge(i||{},{method:t,url:e,data:r}))}})),t.exports=s},function(t,e){var r,i;t=t.exports={};function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===n||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:n}catch(t){r=n}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(t){i=o}}();var s,u=[],l=!1,c=-1;function p(){l&&s&&(l=!1,s.length?u=s.concat(u):c=-1,u.length&&h())}function h(){if(!l){var t=a(p);l=!0;for(var e=u.length;e;){for(s=u,u=[];++c<e;)s&&s[c].run();c=-1,e=u.length}s=null,l=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===o||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function d(){}t.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new f(t,e)),1!==u.length||l||a(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=d,t.addListener=d,t.once=d,t.off=d,t.removeListener=d,t.removeAllListeners=d,t.emit=d,t.prependListener=d,t.prependOnceListener=d,t.listeners=function(t){return[]},t.binding=function(t){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(t){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},function(t,e,r){"use strict";var i=r(3);t.exports=function(t,e){i.forEach(t,(function(r,i){i!==e&&i.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[i])}))}},function(t,e,r){"use strict";var i=r(23);t.exports=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(i("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)}},function(t,e,r){"use strict";t.exports=function(t,e,r,i,n){return t.config=e,r&&(t.code=r),t.request=i,t.response=n,t}},function(t,e,r){"use strict";var i=r(3);function n(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,r){return e?((e=r?r(e):i.isURLSearchParams(e)?e.toString():(o=[],i.forEach(e,(function(t,e){null!=t&&(i.isArray(t)?e+="[]":t=[t],i.forEach(t,(function(t){i.isDate(t)?t=t.toISOString():i.isObject(t)&&(t=JSON.stringify(t)),o.push(n(e)+"="+n(t))})))})),o.join("&")))&&(t+=(-1===t.indexOf("?")?"?":"&")+e),t):t;var o}},function(t,e,r){"use strict";var i=r(3),n=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,r,o={};return t&&i.forEach(t.split("\n"),(function(t){r=t.indexOf(":"),e=i.trim(t.substr(0,r)).toLowerCase(),r=i.trim(t.substr(r+1)),e&&(o[e]&&0<=n.indexOf(e)||(o[e]="set-cookie"===e?(o[e]||[]).concat([r]):o[e]?o[e]+", "+r:r))})),o}},function(t,e,r){"use strict";var i,n,o,a=r(3);function s(t){return n&&(o.setAttribute("href",t),t=o.href),o.setAttribute("href",t),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname}}t.exports=a.isStandardBrowserEnv()?(n=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a"),i=s(window.location.href),function(t){return(t=a.isString(t)?s(t):t).protocol===i.protocol&&t.host===i.host}):function(){return!0}},function(t,e,r){"use strict";function i(){this.message="String contains an invalid character"}(i.prototype=new Error).code=5,i.prototype.name="InvalidCharacterError",t.exports=function(t){for(var e,r,n=String(t),o="",a=0,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.charAt(0|a)||(s="=",a%1);o+=s.charAt(63&e>>8-a%1*8)){if(255<(r=n.charCodeAt(a+=.75)))throw new i;e=e<<8|r}return o}},function(t,e,r){"use strict";var i=r(3);t.exports=i.isStandardBrowserEnv()?{write:function(t,e,r,n,o,a){var s=[];s.push(t+"="+encodeURIComponent(e)),i.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),i.isString(n)&&s.push("path="+n),i.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){return(t=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)")))?decodeURIComponent(t[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,r){"use strict";var i=r(3);function n(){this.handlers=[]}n.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},n.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},n.prototype.forEach=function(t){i.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=n},function(t,e,r){"use strict";var i=r(3),n=r(58),o=r(24),a=r(14),s=r(59),u=r(60);function l(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return l(t),t.baseURL&&!s(t.url)&&(t.url=u(t.baseURL,t.url)),t.headers=t.headers||{},t.data=n(t.data,t.headers,t.transformRequest),t.headers=i.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),i.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||a.adapter)(t).then((function(e){return l(t),e.data=n(e.data,e.headers,t.transformResponse),e}),(function(e){return o(e)||(l(t),e&&e.response&&(e.response.data=n(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},function(t,e,r){"use strict";var i=r(3);t.exports=function(t,e,r){return i.forEach(r,(function(r){t=r(t,e)})),t}},function(t,e,r){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,r){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,r){"use strict";var i=r(25);function n(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;t((function(t){r.reason||(r.reason=new i(t),e(r.reason))}))}n.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},n.source=function(){var t;return{token:new n((function(e){t=e})),cancel:t}},t.exports=n},function(t,e,r){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,r){t.exports=function(){"use strict";var t,e,r;function i(i,n){if(t)if(e){var o="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",a={};t(a),r=n(a),"undefined"!=typeof window&&(r.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else e=n;else t=n}return i(0,(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=i;function i(t,e,r,i){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=i,this.p2x=r,this.p2y=i}i.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},i.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},i.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},i.prototype.solveCurveX=function(t,e){var r,i,n,o,a;for(void 0===e&&(e=1e-6),n=t,a=0;a<8;a++){if(o=this.sampleCurveX(n)-t,Math.abs(o)<e)return n;var s=this.sampleCurveDerivativeX(n);if(Math.abs(s)<1e-6)break;n-=o/s}if((n=t)<(r=0))return r;if(n>(i=1))return i;for(;r<i;){if(o=this.sampleCurveX(n),Math.abs(o-t)<e)return n;o<t?r=n:i=n,n=.5*(i-r)+r}return n},i.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var n=o;function o(t,e){this.x=t,this.y=e}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},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(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x;return e*e+(t=t.y-this.y)*t},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t);t=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=t,this},_rotateAround:function(t,e){var r=Math.cos(t),i=Math.sin(t);t=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-i*(this.y-e.y),this.y=t,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(t){return t instanceof o||!Array.isArray(t)?t:new o(t[0],t[1])};var a="undefined"!=typeof self?self:{},s=Math.pow(2,53)-1;function u(t,e,i,n){var o=new r(t,e,i,n);return function(t){return o.solve(t)}}var l=u(.25,.1,.25,1);function c(t,e,r){return Math.min(r,Math.max(e,t))}function p(t,e,r){var i;return(i=((t-e)%(i=r-e)+i)%i+e)===e?r:i}function h(t){for(var e=[],r=arguments.length-1;0<r--;)e[r]=arguments[r+1];for(var i=0,n=e;i<n.length;i+=1){var o,a=n[i];for(o in a)t[o]=a[o]}return t}var f=1;function d(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function m(t){return t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function y(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function g(t,e){return-1!==t.indexOf(e,t.length-e.length)}function _(t,e,r){var i,n={};for(i in t)n[i]=e.call(r||this,t[i],i,t);return n}function v(t,e,r){var i,n={};for(i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function x(t){return Array.isArray(t)?t.map(x):"object"==typeof t&&t?_(t,x):t}var b={};function w(t){b[t]||("undefined"!=typeof console&&console.warn(t),b[t]=!0)}function S(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function T(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function E(t){var e={};return t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,i,n){return n=i||n,e[r]=!n||n.toLowerCase(),""})),e["max-age"]&&(t=parseInt(e["max-age"],10),isNaN(t)?delete e["max-age"]:e["max-age"]=t),e}var I=null;function A(t){var e;return null==I&&(e=t.navigator?t.navigator.userAgent:null,I=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))),I}function C(t){try{var e=a[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var P,M,k,z,L=a.performance&&a.performance.now?a.performance.now.bind(a.performance):Date.now.bind(Date),B=a.requestAnimationFrame||a.mozRequestAnimationFrame||a.webkitRequestAnimationFrame||a.msRequestAnimationFrame,D=a.cancelAnimationFrame||a.mozCancelAnimationFrame||a.webkitCancelAnimationFrame||a.msCancelAnimationFrame,R={now:L,frame:function(t){var e=B(t);return{cancel:function(){return D(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=a.document.createElement("canvas"),i=r.getContext("2d");if(!i)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,i.drawImage(t,0,0,t.width,t.height),i.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return(P=P||a.document.createElement("a")).href=t,P.href},hardwareConcurrency:a.navigator&&a.navigator.hardwareConcurrency||4,get devicePixelRatio(){return a.devicePixelRatio},get prefersReducedMotion(){return!!a.matchMedia&&(null==M&&(M=a.matchMedia("(prefers-reduced-motion: reduce)")),M.matches)}},O={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"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,REGISTERED_PROTOCOLS:{}},F={supported:!1,testSupport:function(t){!j&&z&&(U?N(t):k=t)}},j=!1,U=!1;function N(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,z),t.isContextLost())return;F.supported=!0}catch(t){}t.deleteTexture(e),j=!0}function V(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()}a.document&&((z=a.document.createElement("img")).onload=function(){k&&N(k),U=!(k=null)},z.onerror=function(){j=!0,k=null},z.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var q="01";function G(t){return 0===t.indexOf("mapbox:")}V.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",q,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},V.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},V.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},V.prototype.normalizeStyleURL=function(t,e){return G(t)?((t=X(t)).path="/styles/v1"+t.path,this._makeAPIURL(t,this._customAccessToken||e)):t},V.prototype.normalizeGlyphsURL=function(t,e){return G(t)?((t=X(t)).path="/fonts/v1"+t.path,this._makeAPIURL(t,this._customAccessToken||e)):t},V.prototype.normalizeSourceURL=function(t,e){return G(t)?((t=X(t)).path="/v4/"+t.authority+".json",t.params.push("secure"),this._makeAPIURL(t,this._customAccessToken||e)):t},V.prototype.normalizeSpriteURL=function(t,e,r,i){var n=X(t);return G(t)?(n.path="/styles/v1"+n.path+"/sprite"+e+r,this._makeAPIURL(n,this._customAccessToken||i)):(n.path+=""+e+r,K(n))},V.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!G(t))return t;var r=X(t);return r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(2<=R.devicePixelRatio||512===e?"@2x":"")+(F.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path,e=this._customAccessToken||function(){for(var t=0,e=r.params;t<e.length;t+=1){var i=e[t].match(/^access_token=(.*)$/);if(i)return i[1]}return null}()||O.ACCESS_TOKEN,O.REQUIRE_ACCESS_TOKEN&&e&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,e)},V.prototype.canonicalizeTileURL=function(t,e){var r=X(t);return r.path.match(/(^\/v4\/)/)&&r.path.match(/\.[\w]+$/)?(t="mapbox://tiles/",t+=r.path.replace("/v4/",""),r=r.params,e&&(r=r.filter((function(t){return!t.match(/^access_token=/)}))),r.length&&(t+="?"+r.join("&")),t):t},V.prototype.canonicalizeTileset=function(t,e){for(var r=!!e&&G(e),i=[],n=0,o=t.tiles||[];n<o.length;n+=1){var a=o[n];Z(a)?i.push(this.canonicalizeTileURL(a,r)):i.push(a)}return i},V.prototype._makeAPIURL=function(t,e){var r,i="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",n=X(O.API_URL);if(t.protocol=n.protocol,t.authority=n.authority,"http"===t.protocol&&0<=(r=t.params.indexOf("secure"))&&t.params.splice(r,1),"/"!==n.path&&(t.path=""+n.path+t.path),!O.REQUIRE_ACCESS_TOKEN)return K(t);if(!(e=e||O.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+i);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+i);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),K(t)},V.prototype.setTransformRequest=function(t){this._transformRequestFn=t};var H=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Z(t){return H.test(t)}var W=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function X(t){if(!(t=t.match(W)))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 K(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function J(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(a.atob(e[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}(ho=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}).prototype.getStorageKey=function(t){var e=(e=J(O.ACCESS_TOKEN))&&e.u?a.btoa(encodeURIComponent(e.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):O.ACCESS_TOKEN||"";return t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},ho.prototype.fetchEventData=function(){var t=C("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var i=a.localStorage.getItem(e);i&&(this.eventData=JSON.parse(i)),(i=a.localStorage.getItem(r))&&(this.anonId=i)}catch(t){w("Unable to read from LocalStorage")}},ho.prototype.saveEventData=function(){var t=C("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{a.localStorage.setItem(r,this.anonId),1<=Object.keys(this.eventData).length&&a.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){w("Unable to write to LocalStorage")}},ho.prototype.processRequests=function(t){},ho.prototype.postEvent=function(t,e,r,i){var n,o=this;O.EVENTS_URL&&((n=X(O.EVENTS_URL)).params.push("access_token="+(i||O.ACCESS_TOKEN||"")),t={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.15.2",skuId:q,userId:this.anonId},t=e?h(t,e):t,t={url:K(n),headers:{"Content-Type":"text/plain"},body:JSON.stringify([t])},this.pendingRequest=bt(t,(function(t){o.pendingRequest=null,r(t),o.saveEventData(),o.processRequests(i)})))},ho.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var Y,Q,$,tt,et=((tt=ho)&&(st.__proto__=tt),((st.prototype=Object.create(tt&&tt.prototype)).constructor=st).prototype.postMapLoadEvent=function(t,e,r,i){this.skuToken=r,(O.EVENTS_URL&&i||O.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return G(t)||Z(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},i)},st.prototype.processRequests=function(t){var e,r,i=this;this.pendingRequest||0===this.queue.length||(r=this.queue.shift(),e=r.id,r=r.timestamp,e&&this.success[e]||(this.anonId||this.fetchEventData(),m(this.anonId)||(this.anonId=d()),this.postEvent(r,{skuToken:this.skuToken},(function(t){t||e&&(i.success[e]=!0)}),t)))},st),rt=($s=(($=ho)&&(at.__proto__=$),((at.prototype=Object.create($&&$.prototype)).constructor=at).prototype.postTurnstileEvent=function(t,e){O.EVENTS_URL&&O.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return G(t)||Z(t)}))&&this.queueRequest(Date.now(),e)},at.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=J(O.ACCESS_TOKEN),i=r?r.u:O.ACCESS_TOKEN,n=i!==this.eventData.tokenU;m(this.anonId)||(this.anonId=d(),n=!0);var o,a,s=this.queue.shift();if(!(n=!this.eventData.lastSuccess||(o=new Date(this.eventData.lastSuccess),a=new Date(s),r=(s-this.eventData.lastSuccess)/864e5,n||1<=r||r<-1||o.getDate()!==a.getDate())))return this.processRequests();this.postEvent(s,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=s,e.eventData.tokenU=i)}),t)}},new at)).postTurnstileEvent.bind($s),it=(Ao=new et).postMapLoadEvent.bind(Ao),nt=500,ot=50;function at(t){$.call(this,"appUserTurnstile"),this._customAccessToken=t}function st(){tt.call(this,"map.load"),this.success={},this.skuToken=""}function ut(){a.caches&&!Y&&(Y=a.caches.open("mapbox-tiles"))}function lt(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var ct,pt=1/0;function ht(){return null==ct&&(ct=a.OffscreenCanvas&&new a.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof a.createImageBitmap),ct}var ft={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(ft);var dt,mt=((dt=Error)&&(gt.__proto__=dt),((gt.prototype=Object.create(dt&&dt.prototype)).constructor=gt).prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},gt),yt=T()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===a.location.protocol?a.parent:a).location.href};function gt(t,e,r){401===e&&Z(r)&&(t+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),dt.call(this,t),this.status=e,this.url=r,this.name=this.constructor.name,this.message=t}function _t(t,e){var r=new a.AbortController,i=new a.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:yt(),signal:r.signal}),n=!1,o=!1,s=0<(u=i.url).indexOf("sku=")&&Z(u);"json"===t.type&&i.headers.set("Accept","application/json");var u=function(r,n,u){if(!o){if(r&&"SecurityError"!==r.message&&w(r),n&&u)return l(n);var c=Date.now();a.fetch(i).then((function(r){if(r.ok){var i=s?r.clone():null;return l(r,i,c)}return e(new mt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},l=function(r,s,u){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){var l,c,p,h,f;o||(s&&u&&(l=i,c=s,p=u,ut(),Y&&(h={status:c.status,statusText:c.statusText,headers:new a.Headers},c.headers.forEach((function(t,e){return h.headers.set(e,t)})),(f=E(c.headers.get("Cache-Control")||""))["no-store"]||(f["max-age"]&&h.headers.set("Expires",new Date(p+1e3*f["max-age"]).toUTCString()),new Date(h.headers.get("Expires")).getTime()-p<42e4||function(t,e){if(void 0===Q)try{new Response(new ReadableStream),Q=!0}catch(t){Q=!1}Q?e(t.body):t.blob().then(e)}(c,(function(t){var e=new a.Response(t,h);ut(),Y&&Y.then((function(t){return t.put(lt(l.url),e)})).catch((function(t){return w(t.message)}))}))))),n=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){o||e(new Error(t.message))}))};return s?function(t,e){if(ut(),!Y)return e(null);var r=lt(t.url);Y.then((function(t){t.match(r).then((function(i){var n=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0);t=E(t.headers.get("Cache-Control")||"");return e>Date.now()&&!t["no-cache"]}(i);t.delete(r),n&&t.put(r,i.clone()),e(null,i,n)})).catch(e)})).catch(e)}(i,u):u(null,null),{cancel:function(){o=!0,n||r.abort()}}}function vt(t,e){if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){if(T()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e);if(!T()){var r=t.url.substring(0,t.url.indexOf("://"));return(O.REGISTERED_PROTOCOLS[r]||_t)(t,e)}}if(!(/^file:/.test(r=t.url)||/^file:/.test(yt())&&!/^\w+:/.test(r))){if(a.fetch&&a.Request&&a.AbortController&&a.Request.prototype.hasOwnProperty("signal"))return _t(t,e);if(T()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}return function(t,e){var r,i=new a.XMLHttpRequest;for(r in i.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(i.responseType="arraybuffer"),t.headers)i.setRequestHeader(r,t.headers[r]);return"json"===t.type&&(i.responseType="text",i.setRequestHeader("Accept","application/json")),i.withCredentials="include"===t.credentials,i.onerror=function(){e(new Error(i.statusText))},i.onload=function(){if((200<=i.status&&i.status<300||0===i.status)&&null!==i.response){var r=i.response;if("json"===t.type)try{r=JSON.parse(i.response)}catch(r){return e(r)}e(null,r,i.getResponseHeader("Cache-Control"),i.getResponseHeader("Expires"))}else e(new mt(i.statusText,i.status,t.url))},i.send(t.body),{cancel:function(){return i.abort()}}}(t,e)}function xt(t,e){return vt(h(t,{type:"arrayBuffer"}),e)}var bt=function(t,e){return vt(h(t,{method:"POST"}),e)},wt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=",St=[],Tt=0,Et=function(t,e){if(F.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),Tt>=O.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return St.push(r),r}function i(){if(!n)for(n=!0,Tt--;St.length&&Tt<O.MAX_PARALLEL_IMAGE_REQUESTS;){var t=St.shift();t.cancelled||(t.cancel=Et(t.requestParameters,t.callback).cancel)}}Tt++;var n=!1,o=xt(t,(function(t,r,n,o){var s;i(),t?e(t):r&&(ht()?(s=e,t=new a.Blob([new Uint8Array(r)],{type:"image/png"}),a.createImageBitmap(t).then((function(t){s(null,t)})).catch((function(t){s(new Error("Could not load image because of "+t.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))):function(t,e,r,i){var n=new a.Image,o=a.URL;n.onload=function(){e(null,n),o.revokeObjectURL(n.src),n.onload=null,a.requestAnimationFrame((function(){n.src=wt}))},n.onerror=function(){return e(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 s=new a.Blob([new Uint8Array(t)],{type:"image/png"});n.cacheControl=r,n.expires=i,n.src=t.byteLength?o.createObjectURL(s):wt}(r,e,n,o))}));return{cancel:function(){o.cancel(),i()}}};function It(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function At(t,e,r){r&&r[t]&&-1!==(e=r[t].indexOf(e))&&r[t].splice(e,1)}function Ct(t,e){void 0===e&&(e={}),h(this,e),this.type=t}function Pt(){}var Mt,kt=((Mt=Ct)&&(zt.__proto__=Mt),(zt.prototype=Object.create(Mt&&Mt.prototype)).constructor=zt);function zt(t,e){void 0===e&&(e={}),Mt.call(this,"error",h({error:t},e))}Pt.prototype.on=function(t,e){return this._listeners=this._listeners||{},It(t,e,this._listeners),this},Pt.prototype.off=function(t,e){return At(t,e,this._listeners),At(t,e,this._oneTimeListeners),this},Pt.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},It(t,e,this._oneTimeListeners),this},Pt.prototype.fire=function(t,e){"string"==typeof t&&(t=new Ct(t,e||{}));var r=t.type;if(this.listens(r)){for(var i=0,n=(t.target=this)._listeners&&this._listeners[r]?this._listeners[r].slice():[];i<n.length;i+=1)n[i].call(this,t);for(var o=0,a=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];o<a.length;o+=1){var s=a[o];At(r,s,this._oneTimeListeners),s.call(this,t)}(e=this._eventedParent)&&(h(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),e.fire(t))}else t instanceof kt&&console.error(t.error);return this},Pt.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&0<this._listeners[t].length||this._oneTimeListeners&&this._oneTimeListeners[t]&&0<this._oneTimeListeners[t].length||this._eventedParent&&this._eventedParent.listens(t)};var Lt={$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:!(Pt.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this})},"*":{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"}}},Bt=function(t,e,r,i){this.message=(t?t+": ":"")+r,i&&(this.identifier=i),null!=e&&e.__line__&&(this.line=e.__line__)};function Dt(t){var e=t.value;return e?[new Bt(t.key,e,"constants have been deprecated as of v8")]:[]}function Rt(t){for(var e=[],r=arguments.length-1;0<r--;)e[r]=arguments[r+1];for(var i=0,n=e;i<n.length;i+=1){var o,a=n[i];for(o in a)t[o]=a[o]}return t}function Ot(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Ft(t){if(Array.isArray(t))return t.map(Ft);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e,r={};for(e in t)r[e]=Ft(t[e]);return r}return Ot(t)}function jt(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,i=e;r<i.length;r+=1){var n=i[r];this.bindings[n[0]]=n[1]}}var Ut,Nt=((Ut=Error)&&(Vt.__proto__=Ut),(Vt.prototype=Object.create(Ut&&Ut.prototype)).constructor=Vt);function Vt(t,e){Ut.call(this,e),this.message=e,this.key=t}jt.prototype.concat=function(t){return new jt(this,t)},jt.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},jt.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var qt={kind:"null"},Gt={kind:"number"},Ht={kind:"string"},Zt={kind:"boolean"},Wt={kind:"color"},Xt={kind:"object"},Kt={kind:"value"},Jt={kind:"collator"},Yt={kind:"formatted"},Qt={kind:"resolvedImage"};function $t(t,e){return{kind:"array",itemType:t,N:e}}function te(t){if("array"!==t.kind)return t.kind;var e=te(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}var ee=[qt,Gt,Ht,Zt,Wt,Yt,Xt,$t(Kt),Qt];function re(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!re(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,i=ee;r<i.length;r+=1)if(!re(i[r],e))return null}return"Expected "+te(t)+" but found "+te(e)+" instead."}function ie(t,e){return e.some((function(e){return e.kind===t.kind}))}function ne(t,e){return e.some((function(e){return"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t}))}var oe=e((function(t,e){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 i(t){return(t=Math.round(t))<0?0:255<t?255:t}function n(t){return i("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(t="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:1<t?1:t}function a(t,e,r){return r<0?r+=1:1<r&&--r,6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e=t.replace(/ /g,"").toLowerCase();if(e in r)return r[e].slice();if("#"===e[0])return 4===e.length?0<=(u=parseInt(e.substr(1),16))&&u<=4095?[(3840&u)>>4|(3840&u)>>8,240&u|(240&u)>>4,15&u|(15&u)<<4,1]:null:7===e.length&&0<=(u=parseInt(e.substr(1),16))&&u<=16777215?[(16711680&u)>>16,(65280&u)>>8,255&u,1]:null;var s=e.indexOf("(");t=e.indexOf(")");if(-1!==s&&t+1===e.length){var u=e.substr(0,s),l=e.substr(s+1,t-(s+1)).split(","),c=1;switch(u){case"rgba":if(4!==l.length)return null;c=o(l.pop());case"rgb":return 3!==l.length?null:[n(l[0]),n(l[1]),n(l[2]),c];case"hsla":if(4!==l.length)return null;c=o(l.pop());case"hsl":if(3!==l.length)return null;var p,h=(parseFloat(l[0])%360+360)%360/360,f=o(l[1]);return[i(255*a(p=2*(p=o(l[2]))-(f=p<=.5?p*(f+1):p+f-p*f),f,h+1/3)),i(255*a(p,f,h)),i(255*a(p,f,h-1/3)),c];default:return null}}return null}}catch(t){}})).parseCSSColor,ae=function(t,e,r,i){void 0===i&&(i=1),this.r=t,this.g=e,this.b=r,this.a=i};ae.parse=function(t){if(t){if(t instanceof ae)return t;if("string"==typeof t&&(t=oe(t)))return new ae(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}},ae.prototype.toString=function(){var t=this.toArray(),e=t[1],r=t[2],i=t[3];return"rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(r)+","+i+")"},ae.prototype.toArray=function(){var t=this.a;return 0===t?[0,0,0,0]:[255*this.r/t,255*this.g/t,255*this.b/t,t]},ae.black=new ae(0,0,0,1),ae.white=new ae(1,1,1,1),ae.transparent=new ae(0,0,0,0),ae.red=new ae(1,0,0,1);var se=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale||[],{sensitivity:this.sensitivity,usage:"search"})};function ue(t,e,r,i,n){this.text=t,this.image=e,this.scale=r,this.fontStack=i,this.textColor=n}se.prototype.compare=function(t,e){return this.collator.compare(t,e)},se.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale||[]).resolvedOptions().locale};var le=function(t){this.sections=t};le.fromString=function(t){return new le([new ue(t,null,null,null,null)])},le.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},le.factory=function(t){return t instanceof le?t:le.fromString(t)},le.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},le.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var i,n=r[e];n.image?t.push(["image",n.image.name]):(t.push(n.text),i={},n.fontStack&&(i["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(i["font-scale"]=n.scale),n.textColor&&(i["text-color"]=["rgba"].concat(n.textColor.toArray())),t.push(i))}return t};var ce=function(t){this.name=t.name,this.available=t.available};function pe(t,e,r,i){return"number"==typeof t&&0<=t&&t<=255&&"number"==typeof e&&0<=e&&e<=255&&"number"==typeof r&&0<=r&&r<=255?void 0===i||"number"==typeof i&&0<=i&&i<=1?null:"Invalid rgba value ["+[t,e,r,i].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof i?[t,e,r,i]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function he(t){if(null===t)return 1;if("string"==typeof t)return 1;if("boolean"==typeof t)return 1;if("number"==typeof t)return 1;if(t instanceof ae)return 1;if(t instanceof se)return 1;if(t instanceof le)return 1;if(t instanceof ce)return 1;if(Array.isArray(t)){for(var e=0,r=t;e<r.length;e+=1)if(!he(r[e]))return;return 1}if("object"==typeof t){for(var i in t)if(!he(t[i]))return;return 1}}function fe(t){if(null===t)return qt;if("string"==typeof t)return Ht;if("boolean"==typeof t)return Zt;if("number"==typeof t)return Gt;if(t instanceof ae)return Wt;if(t instanceof se)return Jt;if(t instanceof le)return Yt;if(t instanceof ce)return Qt;if(Array.isArray(t)){for(var e,r=t.length,i=0,n=t;i<n.length;i+=1){var o=fe(n[i]);if(e){if(e===o)continue;e=Kt;break}e=o}return $t(e||Kt,r)}return Xt}function de(t){var e=typeof t;return null===t?"":"string"==e||"number"==e||"boolean"==e?String(t):t instanceof ae||t instanceof le||t instanceof ce?t.toString():JSON.stringify(t)}function me(t,e){this.type=t,this.value=e}ce.prototype.toString=function(){return this.name},ce.fromString=function(t){return t?new ce({name:t,available:!1}):null},ce.prototype.serialize=function(){return["image",this.name]},me.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!he(t[1]))return e.error("invalid value");var r=t[1];t=fe(r),e=e.expectedType;return"array"!==t.kind||0!==t.N||!e||"array"!==e.kind||"number"==typeof e.N&&0!==e.N||(t=e),new me(t,r)},me.prototype.evaluate=function(){return this.value},me.prototype.eachChild=function(){},me.prototype.outputDefined=function(){return!0},me.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof ae?["rgba"].concat(this.value.toArray()):this.value instanceof le?this.value.serialize():this.value};var ye=function(t){this.name="ExpressionEvaluationError",this.message=t};function ge(t,e){this.type=t,this.args=e}ye.prototype.toJSON=function(){return this.message};var _e={string:Ht,number:Gt,boolean:Zt,object:Xt};function ve(t){this.type=Yt,this.sections=t}function xe(t){this.type=Qt,this.input=t}function be(t,e){this.type=t,this.args=e}ge.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r,i=1,n=t[0];if("array"===n){if(2<t.length){var o=t[1];if("string"!=typeof o||!(o in _e)||"object"===o)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=_e[o],i++}else o=Kt;if(3<t.length){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);r=t[2],i++}r=$t(o,r)}else r=_e[n];for(var a=[];i<t.length;i++){var s=e.parse(t[i],i,Kt);if(!s)return null;a.push(s)}return new ge(r,a)},ge.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!re(this.type,fe(r)))return r;if(e===this.args.length-1)throw new ye("Expected value to be of type "+te(this.type)+", but found "+te(fe(r))+" instead.")}return null},ge.prototype.eachChild=function(t){this.args.forEach(t)},ge.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ge.prototype.serialize=function(){var t,e=this.type,r=[e.kind];return"array"===e.kind&&("string"!==(t=e.itemType).kind&&"number"!==t.kind&&"boolean"!==t.kind||(r.push(t.kind),("number"==typeof(e=e.N)||1<this.args.length)&&r.push(e))),r.concat(this.args.map((function(t){return t.serialize()})))},ve.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var i=[],n=!1,o=1;o<=t.length-1;++o){var a=t[o];if(n&&"object"==typeof a&&!Array.isArray(a)){n=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,Gt)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,$t(Ht))))return null;var l=null;if(a["text-color"]&&!(l=e.parse(a["text-color"],1,Wt)))return null;var c=i[i.length-1];c.scale=s,c.font=u,c.textColor=l}else{if(!(c=e.parse(t[o],1,Kt)))return null;if("string"!==(l=c.type.kind)&&"value"!==l&&"null"!==l&&"resolvedImage"!==l)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,i.push({content:c,scale:null,font:null,textColor:null})}}return new ve(i)},ve.prototype.evaluate=function(t){return new le(this.sections.map((function(e){var r=e.content.evaluate(t);return fe(r)===Qt?new ue("",r,null,null,null):new ue(de(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},ve.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var i=r[e];t(i.content),i.scale&&t(i.scale),i.font&&t(i.font),i.textColor&&t(i.textColor)}},ve.prototype.outputDefined=function(){return!1},ve.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var i=r[e];t.push(i.content.serialize());var n={};i.scale&&(n["font-scale"]=i.scale.serialize()),i.font&&(n["text-font"]=i.font.serialize()),i.textColor&&(n["text-color"]=i.textColor.serialize()),t.push(n)}return t},xe.parse=function(t,e){return 2!==t.length?e.error("Expected two arguments."):(t=e.parse(t[1],1,Ht))?new xe(t):e.error("No image name provided.")},xe.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=ce.fromString(e);return r&&t.availableImages&&(r.available=-1<t.availableImages.indexOf(e)),r},xe.prototype.eachChild=function(t){t(this.input)},xe.prototype.outputDefined=function(){return!1},xe.prototype.serialize=function(){return["image",this.input.serialize()]};var we={"to-boolean":Zt,"to-color":Wt,"to-number":Gt,"to-string":Ht};function Se(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}be.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");if(("to-boolean"===(r=t[0])||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var r=we[r],i=[],n=1;n<t.length;n++){var o=e.parse(t[n],n,Kt);if(!o)return null;i.push(o)}return new be(r,i)},be.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,r,i=0,n=this.args;i<n.length;i+=1){if(r=null,(e=n[i].evaluate(t))instanceof ae)return e;if("string"==typeof e){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(r=e.length<3||4<e.length?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":pe(e[0],e[1],e[2],e[3])))return new ae(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ye(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"!==this.type.kind)return"formatted"===this.type.kind?le.fromString(de(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?ce.fromString(de(this.args[0].evaluate(t))):de(this.args[0].evaluate(t));for(var a=null,s=0,u=this.args;s<u.length;s+=1){if(null===(a=u[s].evaluate(t)))return 0;var l=Number(a);if(!isNaN(l))return l}throw new ye("Could not convert "+JSON.stringify(a)+" to number.")},be.prototype.eachChild=function(t){this.args.forEach(t)},be.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},be.prototype.serialize=function(){if("formatted"===this.type.kind)return new ve([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new xe(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var Te=["Unknown","Point","LineString","Polygon"];Se.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Se.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?Te[this.feature.type]:this.feature.type:null},Se.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Se.prototype.canonicalID=function(){return this.canonical},Se.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Se.prototype.parseColor=function(t){return this._parseColorCache[t]||(this._parseColorCache[t]=ae.parse(t))};var Ee=function(t,e,r,i){this.name=t,this.type=e,this._evaluate=r,this.args=i};function Ie(t,e,r){this.type=Jt,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e}function Ae(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Ce(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Pe(t,e){for(var r,i,n,o,a=!1,s=0,u=e.length;s<u;s++)for(var l=e[s],c=0,p=l.length;c<p-1;c++){if((r=t[0]-(n=l[c])[0])*(o=t[1]-(i=l[c+1])[1])-(i=t[0]-i[0])*(n=t[1]-n[1])==0&&r*i<=0&&n*o<=0)return;i=t,n=l[c],o=l[c+1],n[1]>i[1]!=o[1]>i[1]&&i[0]<(o[0]-n[0])*(i[1]-n[1])/(o[1]-n[1])+n[0]&&(a=!a)}return a}function Me(t,e,r,i){var n=i[0]-r[0];i=i[1]-r[1],t=(t[0]-r[0])*i-n*(t[1]-r[1]),r=(e[0]-r[0])*i-n*(e[1]-r[1]);return 0<t&&r<0||t<0&&0<r}function ke(t,e){for(var r=0;r<t.length;++r)if(!Pe(t[r],e))return;for(var i=0;i<t.length-1;++i)if(function(t,e,r){for(var i,n,o,a,s=0,u=r;s<u.length;s+=1)for(var l=u[s],c=0;c<l.length-1;++c)if(0!=(o=[(n=l[c+1])[0]-(i=l[c])[0],n[1]-i[1]])[0]*(a=[e[0]-t[0],e[1]-t[1]])[1]-o[1]*a[0]&&Me(t,e,i,n)&&Me(i,n,t,e))return 1}(t[i],t[i+1],e))return;return 1}function ze(t,e,r){for(var i,n,o=[],a=0;a<t.length;a++){for(var s=[],u=0;u<t[a].length;u++){var l=(l=r,void 0,n=(180+(i=t[a][u])[0])/360,i=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,l=Math.pow(2,l.z),[Math.round(n*l*8192),Math.round(i*l*8192)]);Ae(e,l),s.push(l)}o.push(s)}return o}function Le(t,e,r){for(var i=[],n=0;n<t.length;n++){var o=ze(t[n],e,r);i.push(o)}return i}function Be(t,e,r,i){var n,o;(t[0]<r[0]||t[0]>r[2])&&(n=.5*i,0===(o=t[0]-r[0]>n?-i:r[0]-t[0]>n?i:0)&&(o=t[0]-r[2]>n?-i:r[2]-t[0]>n?i:0),t[0]+=o),Ae(e,t)}function De(t,e,r,i){for(var n=8192*Math.pow(2,i.z),o=[8192*i.x,8192*i.y],a=[],s=0,u=t;s<u.length;s+=1)for(var l=0,c=u[s];l<c.length;l+=1){var p;Be(p=[(p=c[l]).x+o[0],p.y+o[1]],e,r,n),a.push(p)}return a}function Re(t,e,r,i){for(var n=8192*Math.pow(2,i.z),o=[8192*i.x,8192*i.y],a=[],s=0,u=t;s<u.length;s+=1){for(var l=[],c=0,p=u[s];c<p.length;c+=1){var h;Ae(e,h=[(h=p[c]).x+o[0],h.y+o[1]]),l.push(h)}a.push(l)}if(e[2]-e[0]<=n/2){(t=e)[0]=t[1]=1/0,t[2]=t[3]=-1/0;for(var f=0,d=a;f<d.length;f+=1)for(var m=0,y=d[f];m<y.length;m+=1)Be(y[m],e,r,n)}return a}Ee.prototype.evaluate=function(t){return this._evaluate(t,this.args)},Ee.prototype.eachChild=function(t){this.args.forEach(t)},Ee.prototype.outputDefined=function(){return!1},Ee.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},Ee.parse=function(t,e){var r=t[0],i=Ee.definitions[r];if(!i)return e.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0);for(var n=Array.isArray(i)?i[0]:i.type,o=(v=Array.isArray(i)?[[i[1],i[2]]]:i.overloads).filter((function(e){return e=e[0],!Array.isArray(e)||e.length===t.length-1})),a=null,s=0,u=o;s<u.length;s+=1){for(var l=(c=u[s])[0],c=c[1],p=(a=new Ve(e.registry,e.path,null,e.scope),[]),h=!1,f=1;f<t.length;f++){var d=t[f],m=Array.isArray(l)?l[f-1]:l.type;if(!(m=a.parse(d,1+p.length,m))){h=!0;break}p.push(m)}if(!h)if(Array.isArray(l)&&l.length!==p.length)a.error("Expected "+l.length+" arguments, but found "+p.length+" instead.");else{for(var y=0;y<p.length;y++){var g=Array.isArray(l)?l[y]:l.type,_=p[y];a.concat(y+1).checkSubtype(g,_.type)}if(0===a.errors.length)return new Ee(r,n,c,p)}}if(1===o.length)(i=e.errors).push.apply(i,a.errors);else{for(var v=(o.length?o:v).map((function(t){return t=t[0],Array.isArray(t)?"("+t.map(te).join(", ")+")":"("+te(t.type)+"...)"})).join(" | "),x=[],b=1;b<t.length;b++){var w=e.parse(t[b],1+x.length);if(!w)return null;x.push(te(w.type))}e.error("Expected arguments of type "+v+", but found ("+x.join(", ")+") instead.")}return null},Ee.register=function(t,e){for(var r in Ee.definitions=e)t[r]=Ee},Ie.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var i=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Zt);if(!i)return null;var n=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Zt);return n?(t=null,r.locale&&!(t=e.parse(r.locale,1,Ht))?null:new Ie(i,n,t)):null},Ie.prototype.evaluate=function(t){return new se(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},Ie.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},Ie.prototype.outputDefined=function(){return!1},Ie.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var Oe=function(t,e){this.type=Zt,this.geojson=t,this.geometries=e};function Fe(t){if(t instanceof Ee){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof Oe)return!1;var e=!0;return t.eachChild((function(t){e&&!Fe(t)&&(e=!1)})),e}function je(t){if(!(t instanceof Ee&&"feature-state"===t.name)){var e=!0;return t.eachChild((function(t){e&&!je(t)&&(e=!1)})),e}}function Ue(t,e){if(t instanceof Ee&&0<=e.indexOf(t.name))return!1;var r=!0;return t.eachChild((function(t){r&&!Ue(t,e)&&(r=!1)})),r}function Ne(t,e){this.type=e.type,this.name=t,this.boundExpression=e}Oe.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(he(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var i=0;i<r.features.length;++i){var n=r.features[i].geometry.type;if("Polygon"===n||"MultiPolygon"===n)return new Oe(r,r.features[i].geometry)}else if("Feature"===r.type){if("Polygon"===(t=r.geometry.type)||"MultiPolygon"===t)return new Oe(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new Oe(r,r)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Oe.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){var o=ze(e.coordinates,i,n),a=De(t.geometry(),r,i,n);if(!Ce(r,i))return!1;for(var s=0,u=a;s<u.length;s+=1)if(!Pe(u[s],o))return!1}if("MultiPolygon"===e.type){var l=Le(e.coordinates,i,n);n=De(t.geometry(),r,i,n);if(!Ce(r,i))return!1;for(var c=0,p=n;c<p.length;c+=1)if(!function(t,e){for(var r=0;r<e.length;r++)if(Pe(t,e[r]))return 1}(p[c],l))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){var o=ze(e.coordinates,i,n),a=Re(t.geometry(),r,i,n);if(!Ce(r,i))return!1;for(var s=0,u=a;s<u.length;s+=1)if(!ke(u[s],o))return!1}if("MultiPolygon"===e.type){var l=Le(e.coordinates,i,n);n=Re(t.geometry(),r,i,n);if(!Ce(r,i))return!1;for(var c=0,p=n;c<p.length;c+=1)if(!function(t,e){for(var r=0;r<e.length;r++)if(ke(t,e[r]))return 1}(p[c],l))return!1}return!0}(t,this.geometries)}return!1},Oe.prototype.eachChild=function(){},Oe.prototype.outputDefined=function(){return!0},Oe.prototype.serialize=function(){return["within",this.geojson]},Ne.parse=function(t,e){return 2!==t.length||"string"!=typeof t[1]?e.error("'var' expression requires exactly one string literal argument."):(t=t[1],e.scope.has(t)?new Ne(t,e.scope.get(t)):e.error('Unknown variable "'+t+'". Make sure "'+t+'" has been bound in an enclosing "let" expression before using it.',1))},Ne.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Ne.prototype.eachChild=function(){},Ne.prototype.outputDefined=function(){return!1},Ne.prototype.serialize=function(){return["var",this.name]};var Ve=function(t,e,r,i,n){void 0===e&&(e=[]),void 0===i&&(i=new jt),void 0===n&&(n=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=i,this.errors=n,this.expectedType=r};function qe(t,e){for(var r,i,n=t.length-1,o=0,a=n;o<=a;)if((r=t[i=Math.floor((o+a)/2)])<=e){if(i===n||e<t[i+1])return i;o=i+1}else{if(!(e<r))throw new ye("Input is not a number.");a=i-1}return 0}Ve.prototype.parse=function(t,e,r,i,n){return void 0===n&&(n={}),(e?this.concat(e,r,i):this)._parse(t,n)},Ve.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new ge(e,[t]):"coerce"===r?new be(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var i=t[0];if("string"!=typeof i)return this.error("Expression name must be a string, but found "+typeof i+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;if(a=this.registry[i]){var n=a.parse(t,this);if(!n)return null;if(this.expectedType){var o=this.expectedType,a=n.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==a.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==a.kind&&"string"!==a.kind){if(this.checkSubtype(o,a))return null}else n=r(n,o,e.typeAnnotation||"coerce");else n=r(n,o,e.typeAnnotation||"assert")}if(!(n instanceof me)&&"resolvedImage"!==n.type.kind&&function t(e){if(e instanceof Ne)return t(e.boundExpression);if(e instanceof Ee&&"error"===e.name)return!1;if(e instanceof Ie)return!1;if(e instanceof Oe)return!1;var r=e instanceof be||e instanceof ge,i=!0;return e.eachChild((function(e){i=r?i&&t(e):i&&e instanceof me})),!!i&&Fe(e)&&Ue(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(n)){var s=new Se;try{n=new me(n.type,n.evaluate(s))}catch(t){return this.error(t.message),null}}return n}return this.error('Unknown expression "'+i+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},Ve.prototype.concat=function(t,e,r){return t="number"==typeof t?this.path.concat(t):this.path,r=r?this.scope.concat(r):this.scope,new Ve(this.registry,t,e||null,r,this.errors)},Ve.prototype.error=function(t){for(var e=[],r=arguments.length-1;0<r--;)e[r]=arguments[r+1];var i=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Nt(i,t))},Ve.prototype.checkSubtype=function(t,e){return(e=re(t,e))&&this.error(e),e};var Ge=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var i=0,n=r;i<n.length;i+=1){var o=n[i],a=o[1];this.labels.push(o[0]),this.outputs.push(a)}};function He(t,e,r){return t*(1-r)+e*r}Ge.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var r=e.parse(t[1],1,Gt);if(!r)return null;var i=[],n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var o=1;o<t.length;o+=2){var a=1===o?-1/0:t[o],s=t[o+1],u=o,l=o+1;if("number"!=typeof a)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',u);if(i.length&&i[i.length-1][0]>=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);if(!(l=e.parse(s,l,n)))return null;n=n||l.type,i.push([a,l])}return new Ge(n,r,i)},Ge.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);var n=e.length;return(i>=e[n-1]?r[n-1]:r[qe(e,i)]).evaluate(t)},Ge.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},Ge.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},Ge.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)0<e&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Ze=Object.freeze({__proto__:null,number:He,color:function(t,e,r){return new ae(He(t.r,e.r,r),He(t.g,e.g,r),He(t.b,e.b,r),He(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,i){return He(t,e[i],r)}))}}),We=6/29*3*(6/29),Xe=Math.PI/180,Ke=180/Math.PI;function Je(t){return.008856451679035631<t?Math.pow(t,1/3):t/We+4/29}function Ye(t){return 6/29<t?t*t*t:We*(t-4/29)}function Qe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function $e(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function tr(t){var e=$e(t.r),r=$e(t.g),i=$e(t.b),n=Je((.4124564*e+.3575761*r+.1804375*i)/.95047),o=Je(.2126729*e+.7151522*r+.072175*i);return{l:116*o-16,a:500*(n-o),b:200*(o-Je((.0193339*e+.119192*r+.9503041*i)/1.08883)),alpha:t.a}}function er(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,i=isNaN(t.b)?e:e-t.b/200;e=+Ye(e),r=.95047*Ye(r),i=1.08883*Ye(i);return new ae(Qe(3.2404542*r-1.5371385*e-.4985314*i),Qe(-.969266*r+1.8760108*e+.041556*i),Qe(.0556434*r-.2040259*e+1.0572252*i),t.alpha)}var rr={forward:tr,reverse:er,interpolate:function(t,e,r){return{l:He(t.l,e.l,r),a:He(t.a,e.a,r),b:He(t.b,e.b,r),alpha:He(t.alpha,e.alpha,r)}}},ir={forward:function(t){var e,r=(e=tr(t)).l,i=e.a,n=e.b;return{h:(e=Math.atan2(n,i)*Ke)<0?360+e:e,c:Math.sqrt(i*i+n*n),l:r,alpha:t.a}},reverse:function(t){var e=t.h*Xe,r=t.c;return er({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:(i=t.h,n=e.h,i+r*(180<(n-=i)||n<-180?n-360*Math.round(n/360):n)),c:He(t.c,e.c,r),l:He(t.l,e.l,r),alpha:He(t.alpha,e.alpha,r)};var i,n}},nr=Object.freeze({__proto__:null,lab:rr,hcl:ir}),or=function(t,e,r,i,n){this.type=t,this.operator=e,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];for(var o=0,a=n;o<a.length;o+=1){var s=a[o],u=s[1];this.labels.push(s[0]),this.outputs.push(u)}};function ar(t,e,r,i){return i-=r,r=t-r,0==i?0:1===e?r/i:(Math.pow(e,r)-1)/(Math.pow(e,i)-1)}or.interpolationFactor=function(t,e,i,n){var o=0;return"exponential"===t.name?o=ar(e,t.base,i,n):"linear"===t.name?o=ar(e,1,i,n):"cubic-bezier"===t.name&&(t=t.controlPoints,o=new r(t[0],t[1],t[2],t[3]).solve(ar(e,1,i,n))),o},or.parse=function(t,e){var r=t[0],i=t[1],n=t[2],o=t.slice(3);if(!Array.isArray(i)||0===i.length)return e.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){var a=i[1];if("number"!=typeof a)return e.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:a}}else{if("cubic-bezier"!==i[0])return e.error("Unknown interpolation type "+String(i[0]),1,0);if(4!==(a=i.slice(1)).length||a.some((function(t){return"number"!=typeof t||t<0||1<t})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:a}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(n=e.parse(n,2,Gt)))return null;var s=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=Wt:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var l=0;l<o.length;l+=2){var c=o[l],p=o[l+1],h=l+3,f=l+4;if("number"!=typeof c)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',h);if(s.length&&s[s.length-1][0]>=c)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',h);if(!(f=e.parse(p,f,u)))return null;u=u||f.type,s.push([c,f])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new or(u,r,i,n,s):e.error("Type "+te(u)+" is not interpolatable.")},or.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);var n=e.length;return i>=e[n-1]?r[n-1].evaluate(t):(n=qe(e,i),i=or.interpolationFactor(this.interpolation,i,e[n],e[n+1]),e=r[n].evaluate(t),t=r[n+1].evaluate(t),"interpolate"===this.operator?Ze[this.type.kind.toLowerCase()](e,t,i):"interpolate-hcl"===this.operator?ir.reverse(ir.interpolate(ir.forward(e),ir.forward(t),i)):rr.reverse(rr.interpolate(rr.forward(e),rr.forward(t),i)))},or.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},or.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},or.prototype.serialize=function(){for(var t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints),e=[this.operator,t,this.input.serialize()],r=0;r<this.labels.length;r++)e.push(this.labels[r],this.outputs[r].serialize());return e};var sr=function(t,e){this.type=t,this.args=e};sr.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,i=e.expectedType;i&&"value"!==i.kind&&(r=i);for(var n=[],o=0,a=t.slice(1);o<a.length;o+=1){var s=e.parse(a[o],1+n.length,r,void 0,{typeAnnotation:"omit"});if(!s)return null;r=r||s.type,n.push(s)}return t=i&&n.some((function(t){return re(i,t.type)})),new sr(t?Kt:r,n)},sr.prototype.evaluate=function(t){for(var e,r=null,i=0,n=0,o=this.args;n<o.length&&(i++,(r=o[n].evaluate(t))&&r instanceof ce&&!r.available&&(e=e||r.name,r=null,i===this.args.length&&(r=e)),null===r);n+=1);return r},sr.prototype.eachChild=function(t){this.args.forEach(t)},sr.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},sr.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var ur=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};function lr(t,e,r){this.type=t,this.index=e,this.input=r}function cr(t,e){this.type=Zt,this.needle=t,this.haystack=e}function pr(t,e,r){this.type=Gt,this.needle=t,this.haystack=e,this.fromIndex=r}function hr(t,e,r,i,n,o){this.inputType=t,this.type=e,this.input=r,this.cases=i,this.outputs=n,this.otherwise=o}function fr(t,e,r){this.type=t,this.branches=e,this.otherwise=r}function dr(t,e,r,i){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=i}function mr(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function yr(t,e,r,i){return 0===i.compare(e,r)}function gr(t,e,r){var i="=="!==t&&"!="!==t;return n.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],o=e.parse(t[1],1,Kt);if(!o)return null;if(!mr(r,o.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+te(o.type)+"'.");var a=e.parse(t[2],2,Kt);if(!a)return null;if(!mr(r,a.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+te(a.type)+"'.");if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+te(o.type)+"' and '"+te(a.type)+"'.");if(i&&("value"===o.type.kind&&"value"!==a.type.kind?o=new ge(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new ge(o.type,[a]))),r=null,4===t.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(r=e.parse(t[3],3,Jt)))return null}return new n(o,a,r)},n.prototype.evaluate=function(n){var o=this.lhs.evaluate(n),a=this.rhs.evaluate(n);if(i&&this.hasUntypedArgument){var s=fe(o),u=fe(a);if(s.kind!==u.kind||"string"!==s.kind&&"number"!==s.kind)throw new ye('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+u.kind+") instead.")}return this.collator&&!i&&this.hasUntypedArgument&&(s=fe(o),u=fe(a),"string"!==s.kind||"string"!==u.kind)?e(n,o,a):this.collator?r(n,o,a,this.collator.evaluate(n)):e(n,o,a)},n.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},n.prototype.outputDefined=function(){return!0},n.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},n;function n(t,e,r){this.type=Zt,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}}function _r(t,e,r,i,n){this.type=Ht,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=i,this.maxFractionDigits=n}ur.prototype.evaluate=function(t){return this.result.evaluate(t)},ur.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1)t(r[e][1]);t(this.result)},ur.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],i=1;i<t.length-1;i+=2){var n=t[i];if("string"!=typeof n)return e.error("Expected string, but found "+typeof n+" instead.",i);if(/[^a-zA-Z0-9_]/.test(n))return e.error("Variable names must contain only alphanumeric characters or '_'.",i);var o=e.parse(t[i+1],i+1);if(!o)return null;r.push([n,o])}var a=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return a?new ur(r,a):null},ur.prototype.outputDefined=function(){return this.result.outputDefined()},ur.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var i=r[e];t.push(i[0],i[1].serialize())}return t.push(this.result.serialize()),t},lr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Gt);e=e.parse(t[2],2,$t(e.expectedType||Kt));return r&&e?new lr(e.type.itemType,r,e):null},lr.prototype.evaluate=function(t){var e=this.index.evaluate(t);t=this.input.evaluate(t);if(e<0)throw new ye("Array index out of bounds: "+e+" < 0.");if(e>=t.length)throw new ye("Array index out of bounds: "+e+" > "+(t.length-1)+".");if(e!==Math.floor(e))throw new ye("Array index must be an integer, but found "+e+" instead.");return t[e]},lr.prototype.eachChild=function(t){t(this.index),t(this.input)},lr.prototype.outputDefined=function(){return!1},lr.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]},cr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Kt);t=e.parse(t[2],2,Kt);return r&&t?ie(r.type,[Zt,Ht,Gt,qt,Kt])?new cr(r,t):e.error("Expected first argument to be of type boolean, string, number or null, but found "+te(r.type)+" instead"):null},cr.prototype.evaluate=function(t){var e=this.needle.evaluate(t);if(!(t=this.haystack.evaluate(t)))return!1;if(!ne(e,["boolean","string","number","null"]))throw new ye("Expected first argument to be of type boolean, string, number or null, but found "+te(fe(e))+" instead.");if(!ne(t,["string","array"]))throw new ye("Expected second argument to be of type array or string, but found "+te(fe(t))+" instead.");return 0<=t.indexOf(e)},cr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},cr.prototype.outputDefined=function(){return!0},cr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]},pr.parse=function(t,e){if(t.length<=2||5<=t.length)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Kt),i=e.parse(t[2],2,Kt);return r&&i?ie(r.type,[Zt,Ht,Gt,qt,Kt])?4!==t.length?new pr(r,i):(t=e.parse(t[3],3,Gt))?new pr(r,i,t):null:e.error("Expected first argument to be of type boolean, string, number or null, but found "+te(r.type)+" instead"):null},pr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!ne(e,["boolean","string","number","null"]))throw new ye("Expected first argument to be of type boolean, string, number or null, but found "+te(fe(e))+" instead.");if(!ne(r,["string","array"]))throw new ye("Expected second argument to be of type array or string, but found "+te(fe(r))+" instead.");return this.fromIndex?(t=this.fromIndex.evaluate(t),r.indexOf(e,t)):r.indexOf(e)},pr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},pr.prototype.outputDefined=function(){return!1},pr.prototype.serialize=function(){if(null==this.fromIndex||void 0===this.fromIndex)return["index-of",this.needle.serialize(),this.haystack.serialize()];var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]},hr.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var n={},o=[],a=2;a<t.length-1;a+=2){var s=t[a],u=t[a+1];Array.isArray(s)||(s=[s]);var l=e.concat(a);if(0===s.length)return l.error("Expected at least one branch label.");for(var c=0,p=s;c<p.length;c+=1){var h=p[c];if("number"!=typeof h&&"string"!=typeof h)return l.error("Branch labels must be numbers or strings.");if("number"==typeof h&&Math.abs(h)>Number.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return l.error("Numeric branch labels must be integer values.");if(r){if(l.checkSubtype(r,fe(h)))return null}else r=fe(h);if(void 0!==n[String(h)])return l.error("Branch labels must be unique.");n[String(h)]=o.length}if(!(u=e.parse(u,a,i)))return null;i=i||u.type,o.push(u)}var f=e.parse(t[1],1,Kt);if(!f)return null;var d=e.parse(t[t.length-1],t.length-1,i);return!d||"value"!==f.type.kind&&e.concat(1).checkSubtype(r,f.type)?null:new hr(r,i,f,n,o,d)},hr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(fe(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},hr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},hr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},hr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],i={},n=0,o=Object.keys(this.cases).sort();n<o.length;n+=1){var a=o[n];void 0===(c=i[this.cases[a]])?(i[this.cases[a]]=r.length,r.push([this.cases[a],[a]])):r[c][1].push(a)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},u=0,l=r;u<l.length;u+=1){var c=(p=l[u])[0],p=p[1];e.push(1===p.length?s(p[0]):p.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e},fr.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var i=[],n=1;n<t.length-1;n+=2){var o=e.parse(t[n],n,Zt);if(!o)return null;var a=e.parse(t[n+1],n+1,r);if(!a)return null;i.push([o,a]),r=r||a.type}var s=e.parse(t[t.length-1],t.length-1,r);return s?new fr(r,i,s):null},fr.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var i=r[e],n=i[1];if(i[0].evaluate(t))return n.evaluate(t)}return this.otherwise.evaluate(t)},fr.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var i=r[e],n=i[1];t(i[0]),t(n)}t(this.otherwise)},fr.prototype.outputDefined=function(){return this.branches.every((function(t){return t[1].outputDefined()}))&&this.otherwise.outputDefined()},fr.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t},dr.parse=function(t,e){if(t.length<=2||5<=t.length)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Kt),i=e.parse(t[2],2,Gt);return r&&i?ie(r.type,[$t(Kt),Ht,Kt])?4!==t.length?new dr(r.type,r,i):(t=e.parse(t[3],3,Gt))?new dr(r.type,r,i,t):null:e.error("Expected first argument to be of type array or string, but found "+te(r.type)+" instead"):null},dr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!ne(e,["string","array"]))throw new ye("Expected first argument to be of type array or string, but found "+te(fe(e))+" instead.");return this.endIndex?(t=this.endIndex.evaluate(t),e.slice(r,t)):e.slice(r)},dr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},dr.prototype.outputDefined=function(){return!1},dr.prototype.serialize=function(){if(null==this.endIndex||void 0===this.endIndex)return["slice",this.input.serialize(),this.beginIndex.serialize()];var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]};var vr=gr("==",(function(t,e,r){return e===r}),yr),xr=gr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,i){return!yr(0,e,r,i)})),br=gr("<",(function(t,e,r){return e<r}),(function(t,e,r,i){return i.compare(e,r)<0})),wr=gr(">",(function(t,e,r){return r<e}),(function(t,e,r,i){return 0<i.compare(e,r)})),Sr=gr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,i){return i.compare(e,r)<=0})),Tr=gr(">=",(function(t,e,r){return r<=e}),(function(t,e,r,i){return 0<=i.compare(e,r)}));function Er(t){this.type=Gt,this.input=t}_r.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Gt);if(!r)return null;var i=t[2];if("object"!=typeof i||Array.isArray(i))return e.error("NumberFormat options argument must be an object.");var n=null;if(i.locale&&!(n=e.parse(i.locale,1,Ht)))return null;var o=null;if(i.currency&&!(o=e.parse(i.currency,1,Ht)))return null;var a=null;return i["min-fraction-digits"]&&!(a=e.parse(i["min-fraction-digits"],1,Gt))?null:(t=null,i["max-fraction-digits"]&&!(t=e.parse(i["max-fraction-digits"],1,Gt))?null:new _r(r,n,o,a,t))},_r.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},_r.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},_r.prototype.outputDefined=function(){return!1},_r.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]},Er.parse=function(t,e){return 2!==t.length?e.error("Expected 1 argument, but found "+(t.length-1)+" instead."):(t=e.parse(t[1],1))?"array"!==t.type.kind&&"string"!==t.type.kind&&"value"!==t.type.kind?e.error("Expected argument of type string or array, but found "+te(t.type)+" instead."):new Er(t):null},Er.prototype.evaluate=function(t){if("string"==typeof(t=this.input.evaluate(t)))return t.length;if(Array.isArray(t))return t.length;throw new ye("Expected value to be of type string or array, but found "+te(fe(t))+" instead.")},Er.prototype.eachChild=function(t){t(this.input)},Er.prototype.outputDefined=function(){return!1},Er.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Ir={"==":vr,"!=":xr,">":wr,"<":br,">=":Tr,"<=":Sr,array:ge,at:lr,boolean:ge,case:fr,coalesce:sr,collator:Ie,format:ve,image:xe,in:cr,"index-of":pr,interpolate:or,"interpolate-hcl":or,"interpolate-lab":or,length:Er,let:ur,literal:me,match:hr,number:ge,"number-format":_r,object:ge,slice:dr,step:Ge,string:ge,"to-boolean":be,"to-color":be,"to-number":be,"to-string":be,var:Ne,within:Oe};function Ar(t,e){var r=e[0],i=e[1],n=e[2];e=e[3];if(t=pe(r=r.evaluate(t),i=i.evaluate(t),n=n.evaluate(t),e=e?e.evaluate(t):1))throw new ye(t);return new ae(r/255*e,i/255*e,n/255*e,e)}function Cr(t,e){return void 0===(t=e[t])?null:t}function Pr(t){return{type:t}}function Mr(t){return{result:"success",value:t}}function kr(t){return{result:"error",value:t}}function zr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Lr(t){return t.expression&&-1<t.expression.parameters.indexOf("zoom")}function Br(t){return t.expression&&t.expression.interpolated}function Dr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Rr(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Or(t){return t}function Fr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function jr(t,e,r,i,n){return Fr(typeof r===n?i[r]:void 0,t.default,e.default)}function Ur(t,e,r){return"number"!==Dr(r)?Fr(t.default,e.default):1===(e=t.stops.length)||r<=t.stops[0][0]?t.stops[0][1]:r>=t.stops[e-1][0]?t.stops[e-1][1]:(r=qe(t.stops.map((function(t){return t[0]})),r),t.stops[r][1])}function Nr(t,e,r){var i=void 0!==t.base?t.base:1;if("number"!==Dr(r))return Fr(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var o,a,s=qe(t.stops.map((function(t){return t[0]})),r),u=(o=i,n=t.stops[s][0],i=t.stops[s+1][0]-n,n=r-n,0==i?0:1===o?n/i:(Math.pow(o,n)-1)/(Math.pow(o,i)-1)),l=t.stops[s][1],c=t.stops[s+1][1],p=Ze[e.type]||Or;return t.colorSpace&&"rgb"!==t.colorSpace&&(a=nr[t.colorSpace],p=function(t,e){return a.reverse(a.interpolate(a.forward(t),a.forward(e),u))}),"function"==typeof l.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=l.evaluate.apply(void 0,t),i=c.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==i)return p(r,i,u)}}:p(l,c,u)}function Vr(t,e,r){return"color"===e.type?r=ae.parse(r):"formatted"===e.type?r=le.fromString(r.toString()):"resolvedImage"===e.type?r=ce.fromString(r.toString()):Dr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Fr(r,t.default,e.default)}Ee.register(Ir,{error:[{kind:"error"},[Ht],function(t,e){throw new ye(e[0].evaluate(t))}],typeof:[Ht,[Kt],function(t,e){return te(fe(e[0].evaluate(t)))}],"to-rgba":[$t(Gt,4),[Wt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Wt,[Gt,Gt,Gt],Ar],rgba:[Wt,[Gt,Gt,Gt,Gt],Ar],has:{type:Zt,overloads:[[[Ht],function(t,e){return e[0].evaluate(t)in t.properties()}],[[Ht,Xt],function(t,e){var r=e[1];return e[0].evaluate(t)in r.evaluate(t)}]]},get:{type:Kt,overloads:[[[Ht],function(t,e){return Cr(e[0].evaluate(t),t.properties())}],[[Ht,Xt],function(t,e){var r=e[1];return Cr(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[Kt,[Ht],function(t,e){return Cr(e[0].evaluate(t),t.featureState||{})}],properties:[Xt,[],function(t){return t.properties()}],"geometry-type":[Ht,[],function(t){return t.geometryType()}],id:[Kt,[],function(t){return t.id()}],zoom:[Gt,[],function(t){return t.globals.zoom}],"heatmap-density":[Gt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Gt,[],function(t){return t.globals.lineProgress||0}],accumulated:[Kt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Gt,Pr(Gt),function(t,e){for(var r=0,i=0,n=e;i<n.length;i+=1)r+=n[i].evaluate(t);return r}],"*":[Gt,Pr(Gt),function(t,e){for(var r=1,i=0,n=e;i<n.length;i+=1)r*=n[i].evaluate(t);return r}],"-":{type:Gt,overloads:[[[Gt,Gt],function(t,e){var r=e[1];return e[0].evaluate(t)-r.evaluate(t)}],[[Gt],function(t,e){return-e[0].evaluate(t)}]]},"/":[Gt,[Gt,Gt],function(t,e){var r=e[1];return e[0].evaluate(t)/r.evaluate(t)}],"%":[Gt,[Gt,Gt],function(t,e){var r=e[1];return e[0].evaluate(t)%r.evaluate(t)}],ln2:[Gt,[],function(){return Math.LN2}],pi:[Gt,[],function(){return Math.PI}],e:[Gt,[],function(){return Math.E}],"^":[Gt,[Gt,Gt],function(t,e){var r=e[1];return Math.pow(e[0].evaluate(t),r.evaluate(t))}],sqrt:[Gt,[Gt],function(t,e){return Math.sqrt(e[0].evaluate(t))}],log10:[Gt,[Gt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN10}],ln:[Gt,[Gt],function(t,e){return Math.log(e[0].evaluate(t))}],log2:[Gt,[Gt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN2}],sin:[Gt,[Gt],function(t,e){return Math.sin(e[0].evaluate(t))}],cos:[Gt,[Gt],function(t,e){return Math.cos(e[0].evaluate(t))}],tan:[Gt,[Gt],function(t,e){return Math.tan(e[0].evaluate(t))}],asin:[Gt,[Gt],function(t,e){return Math.asin(e[0].evaluate(t))}],acos:[Gt,[Gt],function(t,e){return Math.acos(e[0].evaluate(t))}],atan:[Gt,[Gt],function(t,e){return Math.atan(e[0].evaluate(t))}],min:[Gt,Pr(Gt),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[Gt,Pr(Gt),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[Gt,[Gt],function(t,e){return Math.abs(e[0].evaluate(t))}],round:[Gt,[Gt],function(t,e){return(t=e[0].evaluate(t))<0?-Math.round(-t):Math.round(t)}],floor:[Gt,[Gt],function(t,e){return Math.floor(e[0].evaluate(t))}],ceil:[Gt,[Gt],function(t,e){return Math.ceil(e[0].evaluate(t))}],"filter-==":[Zt,[Ht,Kt],function(t,e){var r=e[0];e=e[1];return t.properties()[r.value]===e.value}],"filter-id-==":[Zt,[Kt],function(t,e){return e=e[0],t.id()===e.value}],"filter-type-==":[Zt,[Ht],function(t,e){return e=e[0],t.geometryType()===e.value}],"filter-<":[Zt,[Ht,Kt],function(t,e){var r=e[0];e=e[1];return typeof(r=t.properties()[r.value])==typeof(e=e.value)&&r<e}],"filter-id-<":[Zt,[Kt],function(t,e){return e=e[0],typeof(t=t.id())==typeof(e=e.value)&&t<e}],"filter->":[Zt,[Ht,Kt],function(t,e){var r=e[0];e=e[1];return typeof(r=t.properties()[r.value])==typeof(e=e.value)&&e<r}],"filter-id->":[Zt,[Kt],function(t,e){return e=e[0],typeof(t=t.id())==typeof(e=e.value)&&e<t}],"filter-<=":[Zt,[Ht,Kt],function(t,e){var r=e[0];e=e[1];return typeof(r=t.properties()[r.value])==typeof(e=e.value)&&r<=e}],"filter-id-<=":[Zt,[Kt],function(t,e){return e=e[0],typeof(t=t.id())==typeof(e=e.value)&&t<=e}],"filter->=":[Zt,[Ht,Kt],function(t,e){var r=e[0];e=e[1];return typeof(r=t.properties()[r.value])==typeof(e=e.value)&&e<=r}],"filter-id->=":[Zt,[Kt],function(t,e){return e=e[0],typeof(t=t.id())==typeof(e=e.value)&&e<=t}],"filter-has":[Zt,[Kt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Zt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Zt,[$t(Ht)],function(t,e){return 0<=e[0].value.indexOf(t.geometryType())}],"filter-id-in":[Zt,[$t(Kt)],function(t,e){return 0<=e[0].value.indexOf(t.id())}],"filter-in-small":[Zt,[Ht,$t(Kt)],function(t,e){var r=e[0];return 0<=e[1].value.indexOf(t.properties()[r.value])}],"filter-in-large":[Zt,[Ht,$t(Kt)],function(t,e){var r=e[0];e=e[1];return function(t,e,r,i){for(;r<=i;){var n=r+i>>1;if(e[n]===t)return!0;e[n]>t?i=n-1:r=1+n}return!1}(t.properties()[r.value],e.value,0,e.value.length-1)}],all:{type:Zt,overloads:[[[Zt,Zt],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[Pr(Zt),function(t,e){for(var r=0,i=e;r<i.length;r+=1)if(!i[r].evaluate(t))return!1;return!0}]]},any:{type:Zt,overloads:[[[Zt,Zt],function(t,e){var r=e[1];return e[0].evaluate(t)||r.evaluate(t)}],[Pr(Zt),function(t,e){for(var r=0,i=e;r<i.length;r+=1)if(i[r].evaluate(t))return!0;return!1}]]},"!":[Zt,[Zt],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[Zt,[Ht],function(t,e){var r=t.globals&&t.globals.isSupportedScript;return!r||r(e[0].evaluate(t))}],upcase:[Ht,[Ht],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[Ht,[Ht],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[Ht,Pr(Kt),function(t,e){return e.map((function(e){return de(e.evaluate(t))})).join("")}],"resolved-locale":[Ht,[Jt],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var qr=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new Se,this._defaultValue=e?"color"===(t=e).type&&Rr(t.default)?new ae(0,0,0,0):"color"===t.type?ae.parse(t.default)||null:void 0===t.default?null:t.default:null,this._enumValues=e&&"enum"===e.type?e.values:null};function Gr(t){return Array.isArray(t)&&0<t.length&&"string"==typeof t[0]&&t[0]in Ir}function Hr(t,e){var r;return(t=(r=new Ve(Ir,[],e?(r={color:Wt,string:Ht,number:Gt,enum:Ht,boolean:Zt,formatted:Yt,resolvedImage:Qt},"array"===e.type?$t(r[e.value]||Kt,e.length):r[e.type]):void 0)).parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0))?Mr(new qr(t,e)):kr(r.errors)}qr.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,n,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},qr.prototype.evaluate=function(t,e,r,i,n,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new ye("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Zr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!je(e.expression)};Zr.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,n,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,o)},Zr.prototype.evaluate=function(t,e,r,i,n,o){return this._styleExpression.evaluate(t,e,r,i,n,o)};var Wr=function(t,e,r,i){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!je(e.expression),this.interpolationType=i};function Xr(t,e){if("error"===(t=Hr(t,e)).result)return t;var r=t.value.expression,i=Fe(r);if(!i&&!zr(e))return kr([new Nt("","data expressions not supported")]);var n=Ue(r,["zoom"]);return n||Lr(e)?(r=function t(e){var r=null;if(e instanceof ur)r=t(e.result);else if(e instanceof sr)for(var i=0,n=e.args;i<n.length&&!(r=t(n[i]));i+=1);else(e instanceof Ge||e instanceof or)&&e.input instanceof Ee&&"zoom"===e.input.name&&(r=e);return r instanceof Nt||e.eachChild((function(e){(e=t(e))instanceof Nt?r=e:!r&&e?r=new Nt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&e&&r!==e&&(r=new Nt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),r}(r))||n?r instanceof Nt?kr([r]):r instanceof or&&!Br(e)?kr([new Nt("",'"interpolate" expressions cannot be used with this property')]):Mr(r?new Wr(i?"camera":"composite",t.value,r.labels,r instanceof or?r.interpolation:void 0):new Zr(i?"constant":"source",t.value)):kr([new Nt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]):kr([new Nt("","zoom expressions not supported")])}function Kr(t,e){this._parameters=t,this._specification=e,Rt(this,function t(e,r){var i,n,o,a="color"===r.type,s=e.stops&&"object"==typeof e.stops[0][0],u=s||!(s||void 0!==e.property),l=e.type||(Br(r)?"exponential":"interval");if(a&&((e=Rt({},e)).stops&&(e.stops=e.stops.map((function(t){return[t[0],ae.parse(t[1])]}))),e.default=ae.parse(e.default||r.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!nr[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===l)i=Nr;else if("interval"===l)i=Ur;else if("categorical"===l){i=jr,n=Object.create(null);for(var c=0,p=e.stops;c<p.length;c+=1){var h=p[c];n[h[0]]=h[1]}o=typeof e.stops[0][0]}else{if("identity"!==l)throw new Error('Unknown function type "'+l+'"');i=Vr}if(s){for(var f={},d=[],m=0;m<e.stops.length;m++){var y=e.stops[m],g=y[0].zoom;void 0===f[g]&&(f[g]={zoom:g,type:e.type,property:e.property,default:e.default,stops:[]},d.push(g)),f[g].stops.push([y[0].value,y[1]])}for(var _=[],v=0,x=d;v<x.length;v+=1){var b=x[v];_.push([f[b].zoom,t(f[b],r)])}return{kind:"composite",interpolationType:s={name:"linear"},interpolationFactor:or.interpolationFactor.bind(void 0,s),zoomStops:_.map((function(t){return t[0]})),evaluate:function(t,i){return t=t.zoom,Nr({stops:_,base:e.base},r,t).evaluate(t,i)}}}return u?{kind:"camera",interpolationType:l="exponential"===l?{name:"exponential",base:void 0!==e.base?e.base:1}:null,interpolationFactor:or.interpolationFactor.bind(void 0,l),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){return i(e,r,t.zoom,n,o)}}:{kind:"source",evaluate:function(t,a){return void 0===(a=a&&a.properties?a.properties[e.property]:void 0)?Fr(e.default,r.default):i(e,r,a,n,o)}}}(this._parameters,this._specification))}function Jr(t){var e,r,i=t.key,n=t.value,o=t.valueSpec||{},a=t.objectElementValidators||{},s=t.style,u=t.styleSpec,l=[];if("object"!==(t=Dr(n)))return[new Bt(i,n,"object expected, "+t+" found")];for(e in n){var c=e.split(".")[0],p=o[c]||o["*"],h=void 0;if(a[c])h=a[c];else if(o[c])h=bi;else if(a["*"])h=a["*"];else{if(!o["*"]){l.push(new Bt(i,n[e],'unknown property "'+e+'"'));continue}h=bi}l=l.concat(h({key:(i&&i+".")+e,value:n[e],valueSpec:p,style:s,styleSpec:u,object:n,objectKey:e},n))}for(r in o)a[r]||o[r].required&&void 0===o[r].default&&void 0===n[r]&&l.push(new Bt(i,n,'missing required property "'+r+'"'));return l}function Yr(t){var e=t.value,r=t.valueSpec,i=t.style,n=t.styleSpec,o=t.key,a=t.arrayElementValidator||bi;if("array"!==Dr(e))return[new Bt(o,e,"array expected, "+Dr(e)+" found")];if(r.length&&e.length!==r.length)return[new Bt(o,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return[new Bt(o,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var s={type:r.value,values:r.values};n.$version<7&&(s.function=r.function),"object"===Dr(r.value)&&(s=r.value);for(var u=[],l=0;l<e.length;l++)u=u.concat(a({array:e,arrayIndex:l,value:e[l],valueSpec:s,style:i,styleSpec:n,key:o+"["+l+"]"}));return u}function Qr(t){var e=t.key,r=t.value,i=t.valueSpec;return"number"===(t=Dr(r))&&r!=r&&(t="NaN"),"number"!==t?[new Bt(e,r,"number expected, "+t+" found")]:"minimum"in i&&r<i.minimum?[new Bt(e,r,r+" is less than the minimum value "+i.minimum)]:"maximum"in i&&r>i.maximum?[new Bt(e,r,r+" is greater than the maximum value "+i.maximum)]:[]}function $r(t){var e,r,i,n=t.valueSpec,o=Ot(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,l="array"===Dr(t.value.stops)&&"array"===Dr(t.value.stops[0])&&"object"===Dr(t.value.stops[0][0]),c=Jr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new Bt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;e=e.concat(Yr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:p}));return"array"===Dr(r)&&0===r.length&&e.push(new Bt(t.key,r,"array must have at least one stop")),e},default:function(t){return bi({key:t.key,value:t.value,valueSpec:n,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&c.push(new Bt(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||c.push(new Bt(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!Br(t.valueSpec)&&c.push(new Bt(t.key,t.value,"exponential functions not supported")),8<=t.styleSpec.$version&&(u&&!zr(t.valueSpec)?c.push(new Bt(t.key,t.value,"property functions not supported")):s&&!Lr(t.valueSpec)&&c.push(new Bt(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!l||void 0!==t.value.property||c.push(new Bt(t.key,t.value,'"property" property is required')),c;function p(t){var e=[],o=t.value,s=t.key;if("array"!==Dr(o))return[new Bt(s,o,"array expected, "+Dr(o)+" found")];if(2!==o.length)return[new Bt(s,o,"array length 2 expected, length "+o.length+" found")];if(l){if("object"!==Dr(o[0]))return[new Bt(s,o,"object expected, "+Dr(o[0])+" found")];if(void 0===o[0].zoom)return[new Bt(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new Bt(s,o,"object stop key must have value")];if(i&&i>Ot(o[0].zoom))return[new Bt(s,o[0].zoom,"stop zoom values must appear in ascending order")];Ot(o[0].zoom)!==i&&(i=Ot(o[0].zoom),r=void 0,a={}),e=e.concat(Jr({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Qr,value:h}}))}else e=e.concat(h({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Gr(Ft(o[1]))?e.concat([new Bt(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(bi({key:s+"[1]",value:o[1],valueSpec:n,style:t.style,styleSpec:t.styleSpec}))}function h(t,i){var s=Dr(t.value),u=Ot(t.value);i=null!==t.value?t.value:i;if(e){if(s!==e)return[new Bt(t.key,i,s+" stop domain type must match previous stop domain type "+e)]}else e=s;return"number"!==s&&"string"!==s&&"boolean"!==s?[new Bt(t.key,i,"stop domain value must be a number, string, or boolean")]:"number"===s||"categorical"===o?"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===s&&void 0!==r&&u<r?[new Bt(t.key,i,"stop domain values must appear in ascending order")]:(r=u,"categorical"===o&&u in a?[new Bt(t.key,i,"stop domain values must be unique")]:(a[u]=!0,[])):[new Bt(t.key,i,"integer expected, found "+u)]:(s="number expected, "+s+" found",zr(n)&&void 0===o&&(s+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Bt(t.key,i,s)])}}function ti(t){var e=("property"===t.expressionContext?Xr:Hr)(Ft(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new Bt(""+t.key+e.key,t.value,e.message)}));if(e=e.value.expression||e.value._styleExpression.expression,"property"===t.expressionContext&&"text-font"===t.propertyKey&&!e.outputDefined())return[new Bt(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===t.expressionContext&&"layout"===t.propertyType&&!je(e))return[new Bt(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!je(e))return[new Bt(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Ue(e,["zoom","feature-state"]))return[new Bt(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Fe(e))return[new Bt(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ei(t){var e=t.key,r=t.value,i=t.valueSpec;t=[];return Array.isArray(i.values)?-1===i.values.indexOf(Ot(r))&&t.push(new Bt(e,r,"expected one of ["+i.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(i.values).indexOf(Ot(r))&&t.push(new Bt(e,r,"expected one of ["+Object.keys(i.values).join(", ")+"], "+JSON.stringify(r)+" found")),t}function ri(t){if(!0===t||!1===t)return 1;if(Array.isArray(t)&&0!==t.length)switch(t[0]){case"has":return 2<=t.length&&"$id"!==t[1]&&"$type"!==t[1];case"in":return 3<=t.length&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);e<r.length;e+=1){var i=r[e];if(!ri(i)&&"boolean"!=typeof i)return}return 1;default:return 1}}Wr.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,n,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,o)},Wr.prototype.evaluate=function(t,e,r,i,n,o){return this._styleExpression.evaluate(t,e,r,i,n,o)},Wr.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?or.interpolationFactor(this.interpolationType,t,e,r):0},Kr.deserialize=function(t){return new Kr(t._parameters,t._specification)};var ii={type:"boolean",default:!(Kr.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}}),transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function ni(t){if(null==t)return{filter:function(){return!0},needGeometry:!1};ri(t)||(t=ai(t));var e=Hr(t,ii);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return{filter:function(t,r,i){return e.value.evaluate(t,r,{},i)},needGeometry:function t(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var r=1;r<e.length;r++)if(t(e[r]))return!0;return!1}(t)}}function oi(t,e){return t<e?-1:e<t?1:0}function ai(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?si(t[1],t[2],"=="):"!="===r?ci(si(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?si(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(ai))):"all"===r?["all"].concat(t.slice(1).map(ai)):"none"===r?["all"].concat(t.slice(1).map(ai).map(ci)):"in"===r?ui(t[1],t.slice(2)):"!in"===r?ci(ui(t[1],t.slice(2))):"has"===r?li(t[1]):"!has"===r?ci(li(t[1])):"within"!==r||t}function si(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function ui(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return 200<e.length&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(oi)]]:["filter-in-small",t,["literal",e]]}}function li(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function ci(t){return["!",t]}function pi(t){return ri(Ft(t.value))?ti(Rt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,i=e.key;if("array"!==Dr(r))return[new Bt(i,r,"array expected, "+Dr(r)+" found")];var n,o=e.styleSpec,a=[];if(r.length<1)return[new Bt(i,r,"filter array must have at least 1 element")];switch(a=a.concat(ei({key:i+"[0]",value:r[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),Ot(r[0])){case"<":case"<=":case">":case">=":2<=r.length&&"$type"===Ot(r[1])&&a.push(new Bt(i,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new Bt(i,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":2<=r.length&&"string"!==(n=Dr(r[1]))&&a.push(new Bt(i+"[1]",r[1],"string expected, "+n+" found"));for(var s=2;s<r.length;s++)n=Dr(r[s]),"$type"===Ot(r[1])?a=a.concat(ei({key:i+"["+s+"]",value:r[s],valueSpec:o.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==n&&"number"!==n&&"boolean"!==n&&a.push(new Bt(i+"["+s+"]",r[s],"string, number, or boolean expected, "+n+" found"));break;case"any":case"all":case"none":for(var u=1;u<r.length;u++)a=a.concat(t({key:i+"["+u+"]",value:r[u],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":n=Dr(r[1]),2!==r.length?a.push(new Bt(i,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==n&&a.push(new Bt(i+"[1]",r[1],"string expected, "+n+" found"));break;case"within":n=Dr(r[1]),2!==r.length?a.push(new Bt(i,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"object"!==n&&a.push(new Bt(i+"[1]",r[1],"object expected, "+n+" found"))}return a}(t)}function hi(t,e){var r=t.key,i=t.style,n=t.styleSpec,o=t.value,a=t.objectKey,s=n[e+"_"+t.layerType];if(!s)return[];var u=a.match(/^(.*)-transition$/);if("paint"===e&&u&&s[u[1]]&&s[u[1]].transition)return bi({key:r,value:o,valueSpec:n.transition,style:i,styleSpec:n});if(!(s=t.valueSpec||s[a]))return[new Bt(r,o,'unknown property "'+a+'"')];if("string"===Dr(o)&&zr(s)&&!s.tokens&&(l=/^{([^}]+)}$/.exec(o)))return[new Bt(r,o,'"'+a+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(l[1])+" }`.")];var l=[];return"symbol"===t.layerType&&("text-field"===a&&i&&!i.glyphs&&l.push(new Bt(r,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&Rr(Ft(o))&&"identity"===Ot(o.type)&&l.push(new Bt(r,o,'"text-font" does not support identity functions'))),l.concat(bi({key:t.key,value:o,valueSpec:s,style:i,styleSpec:n,expressionContext:"property",propertyType:e,propertyKey:a}))}function fi(t){return hi(t,"paint")}function di(t){return hi(t,"layout")}function mi(t){var e=[],r=t.value,i=t.key,n=t.style,o=t.styleSpec;r.type||r.ref||e.push(new Bt(i,r,'either "type" or "ref" is required'));var a,s,u,l=Ot(r.type),c=Ot(r.ref);if(r.id)for(var p=Ot(r.id),h=0;h<t.arrayIndex;h++){var f=n.layers[h];Ot(f.id)===p&&e.push(new Bt(i,r.id,'duplicate layer id "'+r.id+'", previously used at line '+f.id.__line__))}return"ref"in r?(["type","source","source-layer","filter","layout"].forEach((function(t){t in r&&e.push(new Bt(i,r[t],'"'+t+'" is prohibited for ref layers'))})),n.layers.forEach((function(t){Ot(t.id)===c&&(a=t)})),a?a.ref?e.push(new Bt(i,r.ref,"ref cannot reference another ref layer")):l=Ot(a.type):e.push(new Bt(i,r.ref,'ref layer "'+c+'" not found'))):"background"!==l&&(r.source?(u=(s=n.sources&&n.sources[r.source])&&Ot(s.type),s?"vector"===u&&"raster"===l?e.push(new Bt(i,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===u&&"raster"!==l?e.push(new Bt(i,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==u||r["source-layer"]?"raster-dem"===u&&"hillshade"!==l?e.push(new Bt(i,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==l||!r.paint||!r.paint["line-gradient"]||"geojson"===u&&s.lineMetrics||e.push(new Bt(i,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new Bt(i,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new Bt(i,r.source,'source "'+r.source+'" not found'))):e.push(new Bt(i,r,'missing required property "source"'))),e=e.concat(Jr({key:i,value:r,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return bi({key:i+".type",value:r.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:pi,layout:function(t){return Jr({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return di(Rt({layerType:l},t))}}})},paint:function(t){return Jr({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return fi(Rt({layerType:l},t))}}})}}}))}function yi(t){var e=t.value,r=t.key;return"string"!==(t=Dr(e))?[new Bt(r,e,"string expected, "+t+" found")]:[]}var gi={promoteId:function(t){var e=t.key,r=t.value;if("string"===Dr(r))return yi({key:e,value:r});var i,n=[];for(i in r)n.push.apply(n,yi({key:e+"."+i,value:r[i]}));return n}};function _i(t){var e=t.value,r=t.key,i=t.styleSpec,n=t.style;if(!e.type)return[new Bt(r,e,'"type" is required')];var o,a=Ot(e.type);switch(a){case"vector":case"raster":case"raster-dem":return Jr({key:r,value:e,valueSpec:i["source_"+a.replace("-","_")],style:t.style,styleSpec:i,objectElementValidators:gi});case"geojson":if(o=Jr({key:r,value:e,valueSpec:i.source_geojson,style:n,styleSpec:i,objectElementValidators:gi}),e.cluster)for(var s in e.clusterProperties){var u=e.clusterProperties[s],l="string"==typeof(l=u[0])?[l,["accumulated"],["get",s]]:l;o.push.apply(o,ti({key:r+"."+s+".map",value:u[1],expressionContext:"cluster-map"})),o.push.apply(o,ti({key:r+"."+s+".reduce",value:l,expressionContext:"cluster-reduce"}))}return o;case"video":return Jr({key:r,value:e,valueSpec:i.source_video,style:n,styleSpec:i});case"image":return Jr({key:r,value:e,valueSpec:i.source_image,style:n,styleSpec:i});case"canvas":return[new Bt(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return ei({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,styleSpec:i})}}function vi(t){var e,r=t.value,i=t.styleSpec,n=i.light,o=t.style,a=[];t=Dr(r);if(void 0===r)return a;if("object"!==t)return a.concat([new Bt("light",r,"object expected, "+t+" found")]);for(e in r){var s=e.match(/^(.*)-transition$/);a=a.concat(s&&n[s[1]]&&n[s[1]].transition?bi({key:e,value:r[e],valueSpec:i.transition,style:o,styleSpec:i}):n[e]?bi({key:e,value:r[e],valueSpec:n[e],style:o,styleSpec:i}):[new Bt(e,r[e],'unknown property "'+e+'"')])}return a}var xi={"*":function(){return[]},array:Yr,boolean:function(t){var e=t.value,r=t.key;return"boolean"!==(t=Dr(e))?[new Bt(r,e,"boolean expected, "+t+" found")]:[]},number:Qr,color:function(t){var e=t.key,r=t.value;return"string"!==(t=Dr(r))?[new Bt(e,r,"color expected, "+t+" found")]:null===oe(r)?[new Bt(e,r,'color expected, "'+r+'" found')]:[]},constants:Dt,enum:ei,filter:pi,function:$r,layer:mi,object:Jr,source:_i,light:vi,string:yi,formatted:function(t){return 0===yi(t).length?[]:ti(t)},resolvedImage:function(t){return 0===yi(t).length?[]:ti(t)}};function bi(t){var e=t.value,r=t.valueSpec,i=t.styleSpec;return r.expression&&Rr(Ot(e))?$r(t):r.expression&&Gr(Ft(e))?ti(t):r.type&&xi[r.type]?xi[r.type](t):Jr(Rt({},t,{valueSpec:r.type?i[r.type]:r}))}function wi(t){var e=t.value,r=t.key;return(t=yi(t)).length||(-1===e.indexOf("{fontstack}")&&t.push(new Bt(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&t.push(new Bt(r,e,'"glyphs" url must include a "{range}" token'))),t}function Si(t,e){void 0===e&&(e=Lt);var r=(r=[]).concat(bi({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:wi,"*":function(){return[]}}}));return t.constants&&(r=r.concat(Dt({key:"constants",value:t.constants,style:t,styleSpec:e}))),Ti(r)}function Ti(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function Ei(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return Ti(t.apply(this,e))}}Si.source=Ei(_i),Si.light=Ei(vi),Si.layer=Ei(mi),Si.filter=Ei(pi),Si.paintProperty=Ei(fi),Si.layoutProperty=Ei(di);var Ii=Si,Ai=Ii.light,Ci=Ii.paintProperty,Pi=Ii.layoutProperty;function Mi(t,e){var r=!1;if(e&&e.length)for(var i=0,n=e;i<n.length;i+=1)t.fire(new kt(new Error(n[i].message))),r=!0;return r}var ki=zi;function zi(t,e,r){var i=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var n=new Int32Array(this.arrayBuffer);t=n[0],this.d=(e=n[1])+2*(r=n[2]);for(var o=0;o<this.d*this.d;o++){var a=n[3+o],s=n[3+o+1];i.push(a===s?null:n.subarray(a,s))}var u=n[3+i.length+1];this.keys=n.subarray(n[3+i.length],u),this.bboxes=n.subarray(u),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var l=0;l<this.d*this.d;l++)i.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0,e=r/e*t,this.min=-e,this.max=t+e}zi.prototype.insert=function(t,e,r,i,n){this._forEachCell(e,r,i,n,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)},zi.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},zi.prototype._insertCell=function(t,e,r,i,n,o){this.cells[n].push(o)},zi.prototype.query=function(t,e,r,i,n){var o=this.min,a=this.max;return t<=o&&e<=o&&a<=r&&a<=i&&!n?Array.prototype.slice.call(this.keys):(a=[],this._forEachCell(t,e,r,i,this._queryCell,a,{},n),a)},zi.prototype._queryCell=function(t,e,r,i,n,o,a,s){var u=this.cells[n];if(null!==u)for(var l=this.keys,c=this.bboxes,p=0;p<u.length;p++){var h,f=u[p];void 0===a[f]&&(h=4*f,(s?s(c[0+h],c[1+h],c[2+h],c[3+h]):t<=c[2+h]&&e<=c[3+h]&&r>=c[0+h]&&i>=c[1+h])?(a[f]=!0,o.push(l[f])):a[f]=!1)}},zi.prototype._forEachCell=function(t,e,r,i,n,o,a,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),c=this._convertToCellCoord(r),p=this._convertToCellCoord(i),h=u;h<=c;h++)for(var f=l;f<=p;f++){var d=this.d*f+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(f),this._convertFromCellCoord(h+1),this._convertFromCellCoord(f+1)))&&n.call(this,t,e,r,i,d,o,a,s))return}},zi.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},zi.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},zi.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,i=0;i<this.cells.length;i++)r+=this.cells[i].length;var n=new Int32Array(e+r+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;for(var o=e,a=0;a<t.length;a++){var s=t[a];n[3+a]=o,n.set(s,o),o+=s.length}return n[3+t.length]=o,n.set(this.keys,o),n[3+t.length+1]=o+=this.keys.length,n.set(this.bboxes,o),o+=this.bboxes.length,n.buffer};var Li,Bi=a.ImageData,Di=a.ImageBitmap,Ri={};function Oi(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Ri[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}for(Li in Oi("Object",Object),ki.serialize=function(t,e){return t=t.toArrayBuffer(),e&&e.push(t),{buffer:t}},ki.deserialize=function(t){return new ki(t.buffer)},Oi("Grid",ki),Oi("Color",ae),Oi("Error",Error),Oi("ResolvedImage",ce),Oi("StylePropertyFunction",Kr),Oi("StyleExpression",qr,{omit:["_evaluator"]}),Oi("ZoomDependentExpression",Wr),Oi("ZoomConstantExpression",Zr),Oi("CompoundExpression",Ee,{omit:["_evaluate"]}),Ir)Ir[Li]._classRegistryKey||Oi("Expression_"+Li,Ir[Li]);function Fi(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function ji(t){return Di&&t instanceof Di}function Ui(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(Fi(t)||ji(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof Bi)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var i=[],n=0,o=t;n<o.length;n+=1)i.push(Ui(o[n],e));return i}if("object"!=typeof t)throw new Error("can't serialize object of type "+typeof t);var a=(r=t.constructor)._classRegistryKey;if(!a)throw new Error("can't serialize object of unregistered class");var s,u=r.serialize?r.serialize(t,e):{};if(!r.serialize){for(var l in t)!t.hasOwnProperty(l)||0<=Ri[a].omit.indexOf(l)||(s=t[l],u[l]=0<=Ri[a].shallow.indexOf(l)?s:Ui(s,e));t instanceof Error&&(u.message=t.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==a&&(u.$name=a),u}function Ni(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||Fi(t)||ji(t)||ArrayBuffer.isView(t)||t instanceof Bi)return t;if(Array.isArray(t))return t.map(Ni);if("object"!=typeof t)throw new Error("can't deserialize object of type "+typeof t);var e=t.$name||"Object",r=Ri[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var i=Object.create(r.prototype),n=0,o=Object.keys(t);n<o.length;n+=1){var a,s=o[n];"$name"!==s&&(a=t[s],i[s]=0<=Ri[e].shallow.indexOf(s)?a:Ni(a))}return i}function Vi(){this.first=!0}Vi.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))};var qi={"Latin-1 Supplement":function(t){return 128<=t&&t<=255},Arabic:function(t){return 1536<=t&&t<=1791},"Arabic Supplement":function(t){return 1872<=t&&t<=1919},"Arabic Extended-A":function(t){return 2208<=t&&t<=2303},"Hangul Jamo":function(t){return 4352<=t&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return 5120<=t&&t<=5759},Khmer:function(t){return 6016<=t&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return 6320<=t&&t<=6399},"General Punctuation":function(t){return 8192<=t&&t<=8303},"Letterlike Symbols":function(t){return 8448<=t&&t<=8527},"Number Forms":function(t){return 8528<=t&&t<=8591},"Miscellaneous Technical":function(t){return 8960<=t&&t<=9215},"Control Pictures":function(t){return 9216<=t&&t<=9279},"Optical Character Recognition":function(t){return 9280<=t&&t<=9311},"Enclosed Alphanumerics":function(t){return 9312<=t&&t<=9471},"Geometric Shapes":function(t){return 9632<=t&&t<=9727},"Miscellaneous Symbols":function(t){return 9728<=t&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return 11008<=t&&t<=11263},"CJK Radicals Supplement":function(t){return 11904<=t&&t<=12031},"Kangxi Radicals":function(t){return 12032<=t&&t<=12255},"Ideographic Description Characters":function(t){return 12272<=t&&t<=12287},"CJK Symbols and Punctuation":function(t){return 12288<=t&&t<=12351},Hiragana:function(t){return 12352<=t&&t<=12447},Katakana:function(t){return 12448<=t&&t<=12543},Bopomofo:function(t){return 12544<=t&&t<=12591},"Hangul Compatibility Jamo":function(t){return 12592<=t&&t<=12687},Kanbun:function(t){return 12688<=t&&t<=12703},"Bopomofo Extended":function(t){return 12704<=t&&t<=12735},"CJK Strokes":function(t){return 12736<=t&&t<=12783},"Katakana Phonetic Extensions":function(t){return 12784<=t&&t<=12799},"Enclosed CJK Letters and Months":function(t){return 12800<=t&&t<=13055},"CJK Compatibility":function(t){return 13056<=t&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return 13312<=t&&t<=19903},"Yijing Hexagram Symbols":function(t){return 19904<=t&&t<=19967},"CJK Unified Ideographs":function(t){return 19968<=t&&t<=40959},"Yi Syllables":function(t){return 40960<=t&&t<=42127},"Yi Radicals":function(t){return 42128<=t&&t<=42191},"Hangul Jamo Extended-A":function(t){return 43360<=t&&t<=43391},"Hangul Syllables":function(t){return 44032<=t&&t<=55215},"Hangul Jamo Extended-B":function(t){return 55216<=t&&t<=55295},"Private Use Area":function(t){return 57344<=t&&t<=63743},"CJK Compatibility Ideographs":function(t){return 63744<=t&&t<=64255},"Arabic Presentation Forms-A":function(t){return 64336<=t&&t<=65023},"Vertical Forms":function(t){return 65040<=t&&t<=65055},"CJK Compatibility Forms":function(t){return 65072<=t&&t<=65103},"Small Form Variants":function(t){return 65104<=t&&t<=65135},"Arabic Presentation Forms-B":function(t){return 65136<=t&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return 65280<=t&&t<=65519}};function Gi(t){for(var e=0,r=t;e<r.length;e+=1)if(Hi(r[e].charCodeAt(0)))return!0;return!1}function Hi(t){return 746===t||747===t||!(t<4352)&&(qi["Bopomofo Extended"](t)||qi.Bopomofo(t)||qi["CJK Compatibility Forms"](t)&&!(65097<=t&&t<=65103)||qi["CJK Compatibility Ideographs"](t)||qi["CJK Compatibility"](t)||qi["CJK Radicals Supplement"](t)||qi["CJK Strokes"](t)||!(!qi["CJK Symbols and Punctuation"](t)||12296<=t&&t<=12305||12308<=t&&t<=12319||12336===t)||qi["CJK Unified Ideographs Extension A"](t)||qi["CJK Unified Ideographs"](t)||qi["Enclosed CJK Letters and Months"](t)||qi["Hangul Compatibility Jamo"](t)||qi["Hangul Jamo Extended-A"](t)||qi["Hangul Jamo Extended-B"](t)||qi["Hangul Jamo"](t)||qi["Hangul Syllables"](t)||qi.Hiragana(t)||qi["Ideographic Description Characters"](t)||qi.Kanbun(t)||qi["Kangxi Radicals"](t)||qi["Katakana Phonetic Extensions"](t)||qi.Katakana(t)&&12540!==t||!(!qi["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||65306<=t&&t<=65310||65339===t||65341===t||65343===t||65371<=t&&t<=65503||65507===t||65512<=t&&t<=65519)||!(!qi["Small Form Variants"](t)||65112<=t&&t<=65118||65123<=t&&t<=65126)||qi["Unified Canadian Aboriginal Syllabics"](t)||qi["Unified Canadian Aboriginal Syllabics Extended"](t)||qi["Vertical Forms"](t)||qi["Yijing Hexagram Symbols"](t)||qi["Yi Syllables"](t)||qi["Yi Radicals"](t))}function Zi(t){return!(Hi(t)||(t=t,qi["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||qi["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||qi["Letterlike Symbols"](t)||qi["Number Forms"](t)||qi["Miscellaneous Technical"](t)&&(8960<=t&&t<=8967||8972<=t&&t<=8991||8996<=t&&t<=9e3||9003===t||9085<=t&&t<=9114||9150<=t&&t<=9165||9167===t||9169<=t&&t<=9179||9186<=t&&t<=9215)||qi["Control Pictures"](t)&&9251!==t||qi["Optical Character Recognition"](t)||qi["Enclosed Alphanumerics"](t)||qi["Geometric Shapes"](t)||qi["Miscellaneous Symbols"](t)&&!(9754<=t&&t<=9759)||qi["Miscellaneous Symbols and Arrows"](t)&&(11026<=t&&t<=11055||11088<=t&&t<=11097||11192<=t&&t<=11243)||qi["CJK Symbols and Punctuation"](t)||qi.Katakana(t)||qi["Private Use Area"](t)||qi["CJK Compatibility Forms"](t)||qi["Small Form Variants"](t)||qi["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||9984<=t&&t<=10087||10102<=t&&t<=10131||65532===t||65533===t))}function Wi(t){return 1424<=t&&t<=2303||qi["Arabic Presentation Forms-A"](t)||qi["Arabic Presentation Forms-B"](t)}function Xi(t){t&&"string"==typeof t&&-1<t.indexOf("NetworkError")&&(Ji="error"),Ki&&Ki(t)}var Ki=null,Ji="unavailable",Yi=null;function Qi(){en.fire(new Ct("pluginStateChange",{pluginStatus:Ji,pluginURL:Yi}))}function $i(){if("deferred"!==Ji||!Yi)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Ji="loading",Qi(),Yi&&xt({url:Yi},(function(t){t?Xi(t):(Ji="loaded",Qi())}))}function tn(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Vi,this.transition={})}var en=new Pt,rn={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===Ji||null!=rn.applyArabicShaping},isLoading:function(){return"loading"===Ji},setState:function(t){Ji=t.pluginStatus,Yi=t.pluginURL},isParsed:function(){return null!=rn.applyArabicShaping&&null!=rn.processBidirectionalText&&null!=rn.processStyledBidirectionalText},getPluginURL:function(){return Yi}};function nn(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Rr(t))return new Kr(t,e);if(Gr(t)){var r=Xr(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var i=t;return"string"==typeof t&&"color"===e.type&&(i=ae.parse(t)),{kind:"constant",evaluate:function(){return i}}}(void 0===e?t.specification.default:e,t.specification)}function on(t){this.property=t,this.value=new nn(t,void 0)}function an(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}tn.prototype.isSupportedScript=function(t){return function(t,e){for(var r,i=0,n=t;i<n.length;i+=1)if(r=n[i].charCodeAt(0),!e&&Wi(r)||2304<=r&&r<=3583||3840<=r&&r<=4255||qi.Khmer(r))return!1;return!0}(t,rn.isLoaded())},tn.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},tn.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}},nn.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},nn.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)},on.prototype.transitioned=function(t,e){return new sn(this.property,this.value,e,h({},t.transition,this.transition),t.now)},on.prototype.untransitioned=function(){return new sn(this.property,this.value,null,{},0)},an.prototype.getValue=function(t){return x(this._values[t].value.value)},an.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new on(this._values[t].property)),this._values[t].value=new nn(this._values[t].property,null===e?void 0:x(e))},an.prototype.getTransition=function(t){return x(this._values[t].transition)},an.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new on(this._values[t].property)),this._values[t].transition=x(e)||void 0},an.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var i=r[e],n=this.getValue(i);void 0!==n&&(t[i]=n),void 0!==(n=this.getTransition(i))&&(t[i+"-transition"]=n)}return t},an.prototype.transitioned=function(t,e){for(var r=new un(this._properties),i=0,n=Object.keys(this._values);i<n.length;i+=1){var o=n[i];r._values[o]=this._values[o].transitioned(t,e._values[o])}return r},an.prototype.untransitioned=function(){for(var t=new un(this._properties),e=0,r=Object.keys(this._values);e<r.length;e+=1){var i=r[e];t._values[i]=this._values[i].untransitioned()}return t};var sn=function(t,e,r,i,n){this.property=t,this.value=e,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,t.specification.transition&&(i.delay||i.duration)&&(this.prior=r)};sn.prototype.possiblyEvaluate=function(t,e,r){var i=t.now||0,n=this.value.possiblyEvaluate(t,e,r),o=this.prior;if(o){if(i>this.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(i<this.begin)return o.possiblyEvaluate(t,e,r);var a=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(t,e,r),n,function(){if(a<=0)return 0;if(1<=a)return 1;var t=a*a,e=t*a;return 4*(a<.5?e:3*(a-t)+e-.75)}())}return n};var un=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};function ln(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}function cn(t,e,r){this.property=t,this.value=e,this.parameters=r}un.prototype.possiblyEvaluate=function(t,e,r){for(var i=new pn(this._properties),n=0,o=Object.keys(this._values);n<o.length;n+=1){var a=o[n];i._values[a]=this._values[a].possiblyEvaluate(t,e,r)}return i},un.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1)if(this._values[e[t]].prior)return!0;return!1},ln.prototype.getValue=function(t){return x(this._values[t].value)},ln.prototype.setValue=function(t,e){this._values[t]=new nn(this._values[t].property,null===e?void 0:x(e))},ln.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var i=r[e],n=this.getValue(i);void 0!==n&&(t[i]=n)}return t},ln.prototype.possiblyEvaluate=function(t,e,r){for(var i=new pn(this._properties),n=0,o=Object.keys(this._values);n<o.length;n+=1){var a=o[n];i._values[a]=this._values[a].possiblyEvaluate(t,e,r)}return i},cn.prototype.isConstant=function(){return"constant"===this.value.kind},cn.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},cn.prototype.evaluate=function(t,e,r,i){return this.property.evaluate(this.value,this.parameters,t,e,r,i)};var pn=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};function hn(t){this.specification=t}pn.prototype.get=function(t){return this._values[t]},hn.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},hn.prototype.interpolate=function(t,e,r){var i=Ze[this.specification.type];return i?i(t,e,r):t},(nc=function(t,e){this.specification=t,this.overrides=e}).prototype.possiblyEvaluate=function(t,e,r,i){return new cn(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},r,i)}:t.expression,e)},nc.prototype.interpolate=function(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new cn(this,{kind:"constant",value:void 0},t.parameters);var i=Ze[this.specification.type];return i?new cn(this,{kind:"constant",value:i(t.value.value,e.value.value,r)},t.parameters):t},nc.prototype.evaluate=function(t,e,r,i,n,o){return"constant"===t.kind?t.value:t.evaluate(e,r,i,n,o)};var fn,dn=((fn=nc)&&(mn.__proto__=fn),((mn.prototype=Object.create(fn&&fn.prototype)).constructor=mn).prototype.possiblyEvaluate=function(t,e,r,i){return void 0===t.value?new cn(this,{kind:"constant",value:void 0},e):"constant"===t.expression.kind?(i=t.expression.evaluate(e,null,{},r,i),i="resolvedImage"===t.property.specification.type&&"string"!=typeof i?i.name:i,new cn(this,{kind:"constant",value:i=this._calculate(i,i,i,e)},e)):"camera"!==t.expression.kind?new cn(this,t.expression,e):new cn(this,{kind:"constant",value:t=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e)},e)},mn.prototype.evaluate=function(t,e,r,i,n,o){return"source"!==t.kind?"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,i),t.evaluate({zoom:Math.floor(e.zoom)},r,i),t.evaluate({zoom:Math.floor(e.zoom)+1},r,i),e):t.value:(o=t.evaluate(e,r,i,n,o),this._calculate(o,o,o,e))},mn.prototype._calculate=function(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},mn.prototype.interpolate=function(t){return t},mn);function mn(){fn.apply(this,arguments)}(sc=function(t){this.specification=t}).prototype.possiblyEvaluate=function(t,e,r,i){if(void 0!==t.value)return"constant"!==t.expression.kind?this._calculate(t.expression.evaluate(new tn(Math.floor(e.zoom-1),e)),t.expression.evaluate(new tn(Math.floor(e.zoom),e)),t.expression.evaluate(new tn(Math.floor(e.zoom+1),e)),e):(i=t.expression.evaluate(e,null,{},r,i),this._calculate(i,i,i,e))},sc.prototype._calculate=function(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},sc.prototype.interpolate=function(t){return t};var yn=function(t){this.specification=t};function gn(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){(i=t[e]).specification.overridable&&this.overridableProperties.push(e);var r=this.defaultPropertyValues[e]=new nn(i,void 0),i=this.defaultTransitionablePropertyValues[e]=new on(i);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=r.possiblyEvaluate({})}}yn.prototype.possiblyEvaluate=function(t,e,r,i){return!!t.expression.evaluate(e,null,{},r,i)},yn.prototype.interpolate=function(){return!1},Oi("DataDrivenProperty",nc),Oi("DataConstantProperty",hn),Oi("CrossFadedDataDrivenProperty",dn),Oi("CrossFadedProperty",sc),Oi("ColorRampProperty",yn);var _n,vn=((_n=Pt)&&(wn.__proto__=_n),((wn.prototype=Object.create(_n&&_n.prototype)).constructor=wn).prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},wn.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},wn.prototype.setLayoutProperty=function(t,e,r){void 0===r&&(r={}),null!=e&&this._validate(Pi,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},wn.prototype.getPaintProperty=function(t){return g(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},wn.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e&&this._validate(Ci,"layers."+this.id+".paint."+t,t,e,r))return!1;if(g(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var i="cross-faded-data-driven"===(n=this._transitionablePaint._values[t]).property.specification["property-type"],n=(r=n.value.isDataDriven(),n.value);return this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t),(e=this._transitionablePaint._values[t].value).isDataDriven()||r||i||this._handleOverridablePaintPropertyUpdate(t,n,e)},wn.prototype._handleSpecialPaintPropertyUpdate=function(t){},wn.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},wn.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility},wn.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},wn.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},wn.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},wn.prototype.serialize=function(){var t={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&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),v(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},wn.prototype._validate=function(t,e,r,i,n){return void 0===n&&(n={}),(!n||!1!==n.validate)&&Mi(this,t.call(Ii,{key:e,layerType:this.type,objectKey:r,value:i,styleSpec:Lt,style:{glyphs:!0,sprite:!0}}))},wn.prototype.is3D=function(){return!1},wn.prototype.isTileClipped=function(){return!1},wn.prototype.hasOffscreenPass=function(){return!1},wn.prototype.resize=function(){},wn.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof cn&&zr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},wn),xn={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},bn=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8};function wn(t,e){if(_n.call(this),this.id=t.id,this.type=t.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),e.layout&&(this._unevaluatedLayout=new ln(e.layout)),e.paint)){for(var r in this._transitionablePaint=new an(e.paint),t.paint)this.setPaintProperty(r,t.paint[r],{validate:!1});for(var i in t.layout)this.setLayoutProperty(i,t.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new pn(e.paint)}}function Sn(t,e){void 0===e&&(e=1);var r=0,i=0;return{members:t.map((function(t){var n=xn[t.type].BYTES_PER_ELEMENT,o=r=Tn(r,Math.max(e,n)),a=t.components||1;return i=Math.max(i,n),r+=n*a,{name:t.name,type:t.type,components:a,offset:o}})),size:Tn(r,Math.max(i,e)),alignment:e}}function Tn(t,e){return Math.ceil(t/e)*e}(va=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}).serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},va.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},va.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},va.prototype.clear=function(){this.length=0},va.prototype.resize=function(t){this.reserve(t),this.length=t},va.prototype.reserve=function(t){t>this.capacity&&(this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement),t=this.uint8,this._refreshViews(),t&&this.uint8.set(t))},va.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var En,In=((En=va)&&(An.__proto__=En),((An.prototype=Object.create(En&&En.prototype)).constructor=An).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},An.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},An.prototype.emplace=function(t,e,r){var i=2*t;return this.int16[0+i]=e,this.int16[1+i]=r,t},An);function An(){En.apply(this,arguments)}In.prototype.bytesPerElement=4,Oi("StructArrayLayout2i4",In);var Cn,Pn=((Cn=va)&&(Mn.__proto__=Cn),((Mn.prototype=Object.create(Cn&&Cn.prototype)).constructor=Mn).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},Mn.prototype.emplaceBack=function(t,e,r,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)},Mn.prototype.emplace=function(t,e,r,i,n){var o=4*t;return this.int16[0+o]=e,this.int16[1+o]=r,this.int16[2+o]=i,this.int16[3+o]=n,t},Mn);function Mn(){Cn.apply(this,arguments)}Pn.prototype.bytesPerElement=8,Oi("StructArrayLayout4i8",Pn);var kn,zn=((kn=va)&&(Ln.__proto__=kn),((Ln.prototype=Object.create(kn&&kn.prototype)).constructor=Ln).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},Ln.prototype.emplaceBack=function(t,e,r,i,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n,o)},Ln.prototype.emplace=function(t,e,r,i,n,o,a){var s=6*t;return this.int16[0+s]=e,this.int16[1+s]=r,this.int16[2+s]=i,this.int16[3+s]=n,this.int16[4+s]=o,this.int16[5+s]=a,t},Ln);function Ln(){kn.apply(this,arguments)}zn.prototype.bytesPerElement=12,Oi("StructArrayLayout2i4i12",zn);var Bn,Dn=((Bn=va)&&(Rn.__proto__=Bn),((Rn.prototype=Object.create(Bn&&Bn.prototype)).constructor=Rn).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},Rn.prototype.emplaceBack=function(t,e,r,i,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n,o)},Rn.prototype.emplace=function(t,e,r,i,n,o,a){var s=4*t,u=8*t;return this.int16[0+s]=e,this.int16[1+s]=r,this.uint8[4+u]=i,this.uint8[5+u]=n,this.uint8[6+u]=o,this.uint8[7+u]=a,t},Rn);function Rn(){Bn.apply(this,arguments)}Dn.prototype.bytesPerElement=8,Oi("StructArrayLayout2i4ub8",Dn);var On,Fn=((On=va)&&(jn.__proto__=On),((jn.prototype=Object.create(On&&On.prototype)).constructor=jn).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},jn.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},jn.prototype.emplace=function(t,e,r){var i=2*t;return this.float32[0+i]=e,this.float32[1+i]=r,t},jn);function jn(){On.apply(this,arguments)}Fn.prototype.bytesPerElement=8,Oi("StructArrayLayout2f8",Fn);var Un,Nn=((Un=va)&&(Vn.__proto__=Un),((Vn.prototype=Object.create(Un&&Un.prototype)).constructor=Vn).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},Vn.prototype.emplaceBack=function(t,e,r,i,n,o,a,s,u,l){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,i,n,o,a,s,u,l)},Vn.prototype.emplace=function(t,e,r,i,n,o,a,s,u,l,c){var p=10*t;return this.uint16[0+p]=e,this.uint16[1+p]=r,this.uint16[2+p]=i,this.uint16[3+p]=n,this.uint16[4+p]=o,this.uint16[5+p]=a,this.uint16[6+p]=s,this.uint16[7+p]=u,this.uint16[8+p]=l,this.uint16[9+p]=c,t},Vn);function Vn(){Un.apply(this,arguments)}Nn.prototype.bytesPerElement=20,Oi("StructArrayLayout10ui20",Nn);var qn,Gn=((qn=va)&&(Hn.__proto__=qn),((Hn.prototype=Object.create(qn&&qn.prototype)).constructor=Hn).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},Hn.prototype.emplaceBack=function(t,e,r,i,n,o,a,s,u,l,c,p){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,i,n,o,a,s,u,l,c,p)},Hn.prototype.emplace=function(t,e,r,i,n,o,a,s,u,l,c,p,h){var f=12*t;return this.int16[0+f]=e,this.int16[1+f]=r,this.int16[2+f]=i,this.int16[3+f]=n,this.uint16[4+f]=o,this.uint16[5+f]=a,this.uint16[6+f]=s,this.uint16[7+f]=u,this.int16[8+f]=l,this.int16[9+f]=c,this.int16[10+f]=p,this.int16[11+f]=h,t},Hn);function Hn(){qn.apply(this,arguments)}Gn.prototype.bytesPerElement=24,Oi("StructArrayLayout4i4ui4i24",Gn);var Zn,Wn=((Zn=va)&&(Xn.__proto__=Zn),((Xn.prototype=Object.create(Zn&&Zn.prototype)).constructor=Xn).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},Xn.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},Xn.prototype.emplace=function(t,e,r,i){var n=3*t;return this.float32[0+n]=e,this.float32[1+n]=r,this.float32[2+n]=i,t},Xn);function Xn(){Zn.apply(this,arguments)}Wn.prototype.bytesPerElement=12,Oi("StructArrayLayout3f12",Wn);var Kn,Jn,Yn=((Kn=va)&&(Qn.__proto__=Kn),((Qn.prototype=Object.create(Kn&&Kn.prototype)).constructor=Qn).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},Qn.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},Qn.prototype.emplace=function(t,e){return this.uint32[+t+0]=e,t},Qn);function Qn(){Kn.apply(this,arguments)}function $n(){Jn.apply(this,arguments)}Yn.prototype.bytesPerElement=4,Oi("StructArrayLayout1ul4",Yn),(Sa=((Jn=va)&&($n.__proto__=Jn),(($n.prototype=Object.create(Jn&&Jn.prototype)).constructor=$n).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)},$n.prototype.emplaceBack=function(t,e,r,i,n,o,a,s,u){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,i,n,o,a,s,u)},$n.prototype.emplace=function(t,e,r,i,n,o,a,s,u,l){var c=10*t,p=5*t;return this.int16[0+c]=e,this.int16[1+c]=r,this.int16[2+c]=i,this.int16[3+c]=n,this.int16[4+c]=o,this.int16[5+c]=a,this.uint32[3+p]=s,this.uint16[8+c]=u,this.uint16[9+c]=l,t},$n)).prototype.bytesPerElement=20,Oi("StructArrayLayout6i1ul2ui20",Sa);var to,eo=((to=va)&&(ro.__proto__=to),((ro.prototype=Object.create(to&&to.prototype)).constructor=ro).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},ro.prototype.emplaceBack=function(t,e,r,i,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n,o)},ro.prototype.emplace=function(t,e,r,i,n,o,a){var s=6*t;return this.int16[0+s]=e,this.int16[1+s]=r,this.int16[2+s]=i,this.int16[3+s]=n,this.int16[4+s]=o,this.int16[5+s]=a,t},ro);function ro(){to.apply(this,arguments)}eo.prototype.bytesPerElement=12,Oi("StructArrayLayout2i2i2i12",eo);var io,no=((io=va)&&(oo.__proto__=io),((oo.prototype=Object.create(io&&io.prototype)).constructor=oo).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},oo.prototype.emplaceBack=function(t,e,r,i,n){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,i,n)},oo.prototype.emplace=function(t,e,r,i,n,o){var a=4*t,s=8*t;return this.float32[0+a]=e,this.float32[1+a]=r,this.float32[2+a]=i,this.int16[6+s]=n,this.int16[7+s]=o,t},oo);function oo(){io.apply(this,arguments)}no.prototype.bytesPerElement=16,Oi("StructArrayLayout2f1f2i16",no);var ao,so=((ao=va)&&(uo.__proto__=ao),((uo.prototype=Object.create(ao&&ao.prototype)).constructor=uo).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},uo.prototype.emplaceBack=function(t,e,r,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)},uo.prototype.emplace=function(t,e,r,i,n){var o=12*t,a=3*t;return this.uint8[0+o]=e,this.uint8[1+o]=r,this.float32[1+a]=i,this.float32[2+a]=n,t},uo);function uo(){ao.apply(this,arguments)}so.prototype.bytesPerElement=12,Oi("StructArrayLayout2ub2f12",so);var lo,co,po,ho,fo=((lo=va)&&(mo.__proto__=lo),((mo.prototype=Object.create(lo&&lo.prototype)).constructor=mo).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},mo.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},mo.prototype.emplace=function(t,e,r,i){var n=3*t;return this.uint16[0+n]=e,this.uint16[1+n]=r,this.uint16[2+n]=i,t},mo);function mo(){lo.apply(this,arguments)}function yo(){co.apply(this,arguments)}function go(){po.apply(this,arguments)}fo.prototype.bytesPerElement=6,Oi("StructArrayLayout3ui6",fo),(L=((co=va)&&(yo.__proto__=co),((yo.prototype=Object.create(co&&co.prototype)).constructor=yo).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)},yo.prototype.emplaceBack=function(t,e,r,i,n,o,a,s,u,l,c,p,h,f,d,m,y){var g=this.length;return this.resize(g+1),this.emplace(g,t,e,r,i,n,o,a,s,u,l,c,p,h,f,d,m,y)},yo.prototype.emplace=function(t,e,r,i,n,o,a,s,u,l,c,p,h,f,d,m,y,g){var _=24*t,v=12*t,x=48*t;return this.int16[0+_]=e,this.int16[1+_]=r,this.uint16[2+_]=i,this.uint16[3+_]=n,this.uint32[2+v]=o,this.uint32[3+v]=a,this.uint32[4+v]=s,this.uint16[10+_]=u,this.uint16[11+_]=l,this.uint16[12+_]=c,this.float32[7+v]=p,this.float32[8+v]=h,this.uint8[36+x]=f,this.uint8[37+x]=d,this.uint8[38+x]=m,this.uint32[10+v]=y,this.int16[22+_]=g,t},yo)).prototype.bytesPerElement=48,Oi("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",L),(ho=((po=va)&&(go.__proto__=po),((go.prototype=Object.create(po&&po.prototype)).constructor=go).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)},go.prototype.emplaceBack=function(t,e,r,i,n,o,a,s,u,l,c,p,h,f,d,m,y,g,_,v,x,b,w,S,T,E,I,A){var C=this.length;return this.resize(C+1),this.emplace(C,t,e,r,i,n,o,a,s,u,l,c,p,h,f,d,m,y,g,_,v,x,b,w,S,T,E,I,A)},go.prototype.emplace=function(t,e,r,i,n,o,a,s,u,l,c,p,h,f,d,m,y,g,_,v,x,b,w,S,T,E,I,A,C){var P=34*t,M=17*t;return this.int16[0+P]=e,this.int16[1+P]=r,this.int16[2+P]=i,this.int16[3+P]=n,this.int16[4+P]=o,this.int16[5+P]=a,this.int16[6+P]=s,this.int16[7+P]=u,this.uint16[8+P]=l,this.uint16[9+P]=c,this.uint16[10+P]=p,this.uint16[11+P]=h,this.uint16[12+P]=f,this.uint16[13+P]=d,this.uint16[14+P]=m,this.uint16[15+P]=y,this.uint16[16+P]=g,this.uint16[17+P]=_,this.uint16[18+P]=v,this.uint16[19+P]=x,this.uint16[20+P]=b,this.uint16[21+P]=w,this.uint16[22+P]=S,this.uint32[12+M]=T,this.float32[13+M]=E,this.float32[14+M]=I,this.float32[15+M]=A,this.float32[16+M]=C,t},go)).prototype.bytesPerElement=68,Oi("StructArrayLayout8i15ui1ul4f68",ho);var _o,vo,xo,bo=((_o=va)&&(wo.__proto__=_o),((wo.prototype=Object.create(_o&&_o.prototype)).constructor=wo).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},wo.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},wo.prototype.emplace=function(t,e){return this.float32[+t+0]=e,t},wo);function wo(){_o.apply(this,arguments)}function So(){vo.apply(this,arguments)}function To(){xo.apply(this,arguments)}bo.prototype.bytesPerElement=4,Oi("StructArrayLayout1f4",bo),($s=((vo=va)&&(So.__proto__=vo),((So.prototype=Object.create(vo&&vo.prototype)).constructor=So).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},So.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},So.prototype.emplace=function(t,e,r,i){var n=3*t;return this.int16[0+n]=e,this.int16[1+n]=r,this.int16[2+n]=i,t},So)).prototype.bytesPerElement=6,Oi("StructArrayLayout3i6",$s),(et=((xo=va)&&(To.__proto__=xo),((To.prototype=Object.create(xo&&xo.prototype)).constructor=To).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},To.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},To.prototype.emplace=function(t,e,r,i){var n=4*t;return this.uint32[2*t+0]=e,this.uint16[2+n]=r,this.uint16[3+n]=i,t},To)).prototype.bytesPerElement=8,Oi("StructArrayLayout1ul2ui8",et);var Eo,Io,Ao,Co=((Eo=va)&&(Po.__proto__=Eo),((Po.prototype=Object.create(Eo&&Eo.prototype)).constructor=Po).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},Po.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},Po.prototype.emplace=function(t,e,r){var i=2*t;return this.uint16[0+i]=e,this.uint16[1+i]=r,t},Po);function Po(){Eo.apply(this,arguments)}function Mo(){Io.apply(this,arguments)}Co.prototype.bytesPerElement=4,Oi("StructArrayLayout2ui4",Co),(Ao=((Io=va)&&(Mo.__proto__=Io),((Mo.prototype=Object.create(Io&&Io.prototype)).constructor=Mo).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},Mo.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},Mo.prototype.emplace=function(t,e){return this.uint16[+t+0]=e,t},Mo)).prototype.bytesPerElement=2,Oi("StructArrayLayout1ui2",Ao);var ko,zo=((ko=va)&&(Lo.__proto__=ko),((Lo.prototype=Object.create(ko&&ko.prototype)).constructor=Lo).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},Lo.prototype.emplaceBack=function(t,e,r,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)},Lo.prototype.emplace=function(t,e,r,i,n){var o=4*t;return this.float32[0+o]=e,this.float32[1+o]=r,this.float32[2+o]=i,this.float32[3+o]=n,t},Lo);function Lo(){ko.apply(this,arguments)}zo.prototype.bytesPerElement=16,Oi("StructArrayLayout4f16",zo);var Bo=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;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 n(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(bn);Bo.prototype.size=20;var Do,Ro=((Do=Sa)&&(Oo.__proto__=Do),((Oo.prototype=Object.create(Do&&Do.prototype)).constructor=Oo).prototype.get=function(t){return new Bo(this,t)},Oo);function Oo(){Do.apply(this,arguments)}Oi("CollisionBoxArray",Ro);var Fo=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;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(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(bn);Fo.prototype.size=48;var jo,Uo=((jo=L)&&(No.__proto__=jo),((No.prototype=Object.create(jo&&jo.prototype)).constructor=No).prototype.get=function(t){return new Fo(this,t)},No);function No(){jo.apply(this,arguments)}Oi("PlacedSymbolArray",Uo);var Vo=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;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(t){this._structArray.uint32[this._pos4+12]=t},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(e.prototype,r),e}(bn);Vo.prototype.size=68;var qo,Go=((qo=ho)&&(Ho.__proto__=qo),((Ho.prototype=Object.create(qo&&qo.prototype)).constructor=Ho).prototype.get=function(t){return new Vo(this,t)},Ho);function Ho(){qo.apply(this,arguments)}Oi("SymbolInstanceArray",Go);var Zo,Wo=((Zo=bo)&&(Xo.__proto__=Zo),((Xo.prototype=Object.create(Zo&&Zo.prototype)).constructor=Xo).prototype.getoffsetX=function(t){return this.float32[+t+0]},Xo);function Xo(){Zo.apply(this,arguments)}Oi("GlyphOffsetArray",Wo);var Ko,Jo=((Ko=$s)&&(Yo.__proto__=Ko),((Yo.prototype=Object.create(Ko&&Ko.prototype)).constructor=Yo).prototype.getx=function(t){return this.int16[3*t+0]},Yo.prototype.gety=function(t){return this.int16[3*t+1]},Yo.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},Yo);function Yo(){Ko.apply(this,arguments)}Oi("SymbolLineVertexArray",Jo);var Qo=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;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(e.prototype,r),e}(bn);Qo.prototype.size=8;var $o,ta=(($o=et)&&(ea.__proto__=$o),((ea.prototype=Object.create($o&&$o.prototype)).constructor=ea).prototype.get=function(t){return new Qo(this,t)},ea);function ea(){$o.apply(this,arguments)}function ra(t){void 0===t&&(t=[]),this.segments=t}Oi("FeatureIndexArray",ta);var ia=Sn([{name:"a_pos",components:2,type:"Int16"}],4).members;function na(t,e){return 256*(t=c(Math.floor(t),0,255))+c(Math.floor(e),0,255)}ra.prototype.prepareSegment=function(t,e,r,i){var n=this.segments[this.segments.length-1];return ra.MAX_VERTEX_ARRAY_LENGTH<t&&w("Max vertices per segment is "+ra.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!n||n.vertexLength+t>ra.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==i)&&(n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==i&&(n.sortKey=i),this.segments.push(n)),n},ra.prototype.get=function(){return this.segments},ra.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var r,i=e[t];for(r in i.vaos)i.vaos[r].destroy()}},ra.simpleSegment=function(t,e,r,i){return new ra([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:i,vaos:{},sortKey:0}])},ra.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Oi("SegmentVector",ra);var oa=Sn([{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"}]),aa=(vr=e((function(t){t.exports=function(t,e){for(var r,i,n,o=t.length-(r=3&t.length),a=e,s=3432918353,u=461845907,l=0;l<o;)n=255&t.charCodeAt(l)|(255&t.charCodeAt(++l))<<8|(255&t.charCodeAt(++l))<<16|(255&t.charCodeAt(++l))<<24,++l,a=27492+(65535&(i=5*(65535&(a=(a^=n=(65535&(n=(n=(65535&n)*s+(((n>>>16)*s&65535)<<16)&4294967295)<<15|n>>>17))*u+(((n>>>16)*u&65535)<<16)&4294967295)<<13|a>>>19))+((5*(a>>>16)&65535)<<16)&4294967295))+((58964+(i>>>16)&65535)<<16);switch(n=0,r){case 3:n^=(255&t.charCodeAt(l+2))<<16;case 2:n^=(255&t.charCodeAt(l+1))<<8;case 1:a^=n=(65535&(n=(n=(65535&(n^=255&t.charCodeAt(l)))*s+(((n>>>16)*s&65535)<<16)&4294967295)<<15|n>>>17))*u+(((n>>>16)*u&65535)<<16)&4294967295}return a^=t.length,a=2246822507*(65535&(a^=a>>>16))+((2246822507*(a>>>16)&65535)<<16)&4294967295,a=3266489909*(65535&(a^=a>>>13))+((3266489909*(a>>>16)&65535)<<16)&4294967295,(a^=a>>>16)>>>0}})),xr=e((function(t){t.exports=function(t,e){for(var r,i=t.length,n=e^i,o=0;4<=i;)r=1540483477*(65535&(r=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16),i-=4,++o;switch(i){case 3:n^=(255&t.charCodeAt(o+2))<<16;case 2:n^=(255&t.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(o)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0}})),vr);wr=xr;function sa(){this.ids=[],this.positions=[],this.indexed=!1}aa.murmur3=vr,aa.murmur2=wr,sa.prototype.add=function(t,e,r,i){this.ids.push(la(t)),this.positions.push(e,r,i)},sa.prototype.getPositions=function(t){for(var e=la(t),r=0,i=this.ids.length-1;r<i;){var n=r+i>>1;this.ids[n]>=e?i=n:r=1+n}for(var o=[];this.ids[r]===e;)o.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return o},sa.serialize=function(t,e){var r=new Float64Array(t.ids);return function t(e,r,i,n){for(;i<n;){for(var o=e[i+n>>1],a=i-1,s=n+1;;){for(;e[++a]<o;);for(;e[--s]>o;);if(s<=a)break;ca(e,a,s),ca(r,3*a,3*s),ca(r,3*a+1,3*s+1),ca(r,3*a+2,3*s+2)}s-i<n-s?(t(e,r,i,s),i=s+1):(t(e,r,s+1,n),n=s)}}(r,t=new Uint32Array(t.positions),0,r.length-1),e&&e.push(r.buffer,t.buffer),{ids:r,positions:t}},sa.deserialize=function(t){var e=new sa;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var ua=Math.pow(2,53)-1;function la(t){var e=+t;return!isNaN(e)&&e<=ua?e:aa(String(t))}function ca(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}Oi("FeaturePositionMap",sa);(ga=br=function(t,e){this.gl=t.gl,this.location=e})&&(Ma.__proto__=ga),((Ma.prototype=Object.create(ga&&ga.prototype)).constructor=Ma).prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},Tr=Ma;var pa,ha,fa,da,ma,ya,ga,_a=((ya=br)&&(Pa.__proto__=ya),((Pa.prototype=Object.create(ya&&ya.prototype)).constructor=Pa).prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},Pa),va=(Sr=((ma=br)&&(Ca.__proto__=ma),((Ca.prototype=Object.create(ma&&ma.prototype)).constructor=Ca).prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))},Ca),(da=br)&&(Aa.__proto__=da),((Aa.prototype=Object.create(da&&da.prototype)).constructor=Aa).prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))},Aa),xa=((fa=br)&&(Ia.__proto__=fa),((Ia.prototype=Object.create(fa&&fa.prototype)).constructor=Ia).prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},Ia),ba=((ha=br)&&(Ea.__proto__=ha),((Ea.prototype=Object.create(ha&&ha.prototype)).constructor=Ea).prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},Ea),wa=new Float32Array(16),Sa=((pa=br)&&(Ta.__proto__=pa),((Ta.prototype=Object.create(pa&&pa.prototype)).constructor=Ta).prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}},Ta);function Ta(t,e){pa.call(this,t,e),this.current=wa}function Ea(t,e){ha.call(this,t,e),this.current=ae.transparent}function Ia(t,e){fa.call(this,t,e),this.current=[0,0,0,0]}function Aa(t,e){da.call(this,t,e),this.current=[0,0,0]}function Ca(t,e){ma.call(this,t,e),this.current=[0,0]}function Pa(t,e){ya.call(this,t,e),this.current=0}function Ma(t,e){ga.call(this,t,e),this.current=0}function ka(t){return[na(255*t.r,255*t.g),na(255*t.b,255*t.a)]}function za(t,e,r){this.value=t,this.uniformNames=e.map((function(t){return"u_"+t})),this.type=r}function La(t,e){this.uniformNames=e.map((function(t){return"u_"+t})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}function Ba(t,e,r,i){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?2:1,offset:0}})),this.paintVertexArray=new i}function Da(t,e,r,i,n,o){this.expression=t,this.uniformNames=e.map((function(t){return"u_"+t+"_t"})),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?4:2,offset:0}})),this.paintVertexArray=new o}function Ra(t,e,r,i,n,o){this.expression=t,this.type=e,this.useIntegerZoom=r,this.zoom=i,this.layerId=o,this.zoomInPaintVertexArray=new n,this.zoomOutPaintVertexArray=new n}function Oa(t,e,r){this.binders={},this._buffers=[];var i,n,o,a,s,u,l,c=[];for(i in t.paint._values)!r(i)||(a=t.paint.get(i))instanceof cn&&zr(a.property.specification)&&(u=i,l=t.type,n={"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"]}[u]||[u.replace(l+"-","").replace(/-/g,"_")],o=a.value,u=a.property.specification.type,l=a.property.useIntegerZoom,a="cross-faded"===(a=a.property.specification["property-type"])||"cross-faded-data-driven"===a,"constant"===o.kind?(this.binders[i]=a?new La(o.value,n):new za(o.value,n,u),c.push("/u_"+i)):"source"===o.kind||a?(s=ja(i,u,"source"),this.binders[i]=a?new Ra(o,u,l,e,s,t.id):new Ba(o,n,u,s),c.push("/a_"+i)):(s=ja(i,u,"composite"),this.binders[i]=new Da(o,n,u,l,e,s),c.push("/z_"+i)));this.cacheKey=c.sort().join("")}function Fa(t,e,r){void 0===r&&(r=function(){return!0}),this.programConfigurations={};for(var i=0,n=t;i<n.length;i+=1){var o=n[i];this.programConfigurations[o.id]=new Oa(o,e,r)}this.needsUpload=!1,this._featureMap=new sa,this._bufferOffset=0}function ja(t,e,r){var i={color:{source:Fn,composite:zo},number:{source:bo,composite:Fn}};return(t={"line-pattern":{source:Nn,composite:Nn},"fill-pattern":{source:Nn,composite:Nn},"fill-extrusion-pattern":{source:Nn,composite:Nn}}[t])&&t[r]||i[e][r]}za.prototype.setUniform=function(t,e,r){t.set(r.constantOr(this.value))},za.prototype.getBinding=function(t,e,r){return new("color"===this.type?ba:_a)(t,e)},La.prototype.setConstantPatternPositions=function(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr},La.prototype.setUniform=function(t,e,r,i){(i="u_pattern_to"===i?this.patternTo:"u_pattern_from"===i?this.patternFrom:"u_pixel_ratio_to"===i?this.pixelRatioTo:"u_pixel_ratio_from"===i?this.pixelRatioFrom:null)&&t.set(i)},La.prototype.getBinding=function(t,e,r){return new("u_pattern"===r.substr(0,9)?xa:_a)(t,e)},Ba.prototype.populatePaintArray=function(t,e,r,i,n){var o=this.paintVertexArray.length;n=this.expression.evaluate(new tn(0),e,{},i,[],n);this.paintVertexArray.resize(t),this._setPaintValue(o,t,n)},Ba.prototype.updatePaintArray=function(t,e,r,i){i=this.expression.evaluate({zoom:0},r,i),this._setPaintValue(t,e,i)},Ba.prototype._setPaintValue=function(t,e,r){if("color"===this.type)for(var i=ka(r),n=t;n<e;n++)this.paintVertexArray.emplace(n,i[0],i[1]);else{for(var o=t;o<e;o++)this.paintVertexArray.emplace(o,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}},Ba.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Ba.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Da.prototype.populatePaintArray=function(t,e,r,i,n){var o=this.expression.evaluate(new tn(this.zoom),e,{},i,[],n);i=this.expression.evaluate(new tn(this.zoom+1),e,{},i,[],n),n=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(n,t,o,i)},Da.prototype.updatePaintArray=function(t,e,r,i){var n=this.expression.evaluate({zoom:this.zoom},r,i);i=this.expression.evaluate({zoom:this.zoom+1},r,i);this._setPaintValue(t,e,n,i)},Da.prototype._setPaintValue=function(t,e,r,i){if("color"===this.type)for(var n=ka(r),o=ka(i),a=t;a<e;a++)this.paintVertexArray.emplace(a,n[0],n[1],o[0],o[1]);else{for(var s=t;s<e;s++)this.paintVertexArray.emplace(s,r,i);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(i))}},Da.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Da.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Da.prototype.setUniform=function(t,e){e=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,e=c(this.expression.interpolationFactor(e,this.zoom,this.zoom+1),0,1),t.set(e)},Da.prototype.getBinding=function(t,e,r){return new _a(t,e)},Ra.prototype.populatePaintArray=function(t,e,r){var i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(i,t,e.patterns&&e.patterns[this.layerId],r)},Ra.prototype.updatePaintArray=function(t,e,r,i,n){this._setPaintValues(t,e,r.patterns&&r.patterns[this.layerId],n)},Ra.prototype._setPaintValues=function(t,e,r,i){if(i&&r){var n=i[r.min],o=i[r.mid],a=i[r.max];if(n&&o&&a)for(var s=t;s<e;s++)this.zoomInPaintVertexArray.emplace(s,o.tl[0],o.tl[1],o.br[0],o.br[1],n.tl[0],n.tl[1],n.br[0],n.br[1],o.pixelRatio,n.pixelRatio),this.zoomOutPaintVertexArray.emplace(s,o.tl[0],o.tl[1],o.br[0],o.br[1],a.tl[0],a.tl[1],a.br[0],a.br[1],o.pixelRatio,a.pixelRatio)}},Ra.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,oa.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,oa.members,this.expression.isStateDependent))},Ra.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()},Oa.prototype.getMaxValue=function(t){return(t=this.binders[t])instanceof Ba||t instanceof Da?t.maxValue:0},Oa.prototype.populatePaintArrays=function(t,e,r,i,n){for(var o in this.binders){var a=this.binders[o];(a instanceof Ba||a instanceof Da||a instanceof Ra)&&a.populatePaintArray(t,e,r,i,n)}},Oa.prototype.setConstantPatternPositions=function(t,e){for(var r in this.binders){var i=this.binders[r];i instanceof La&&i.setConstantPatternPositions(t,e)}},Oa.prototype.updatePaintArrays=function(t,e,r,i,n){var o,a=!1;for(o in t)for(var s=0,u=e.getPositions(o);s<u.length;s+=1){var l,c=u[s],p=r.feature(c.index);for(l in this.binders){var h,f=this.binders[l];(f instanceof Ba||f instanceof Da||f instanceof Ra)&&!0===f.expression.isStateDependent&&(h=i.paint.get(l),f.expression=h.value,f.updatePaintArray(c.start,c.end,p,t[o],n),a=!0)}}return a},Oa.prototype.defines=function(){var t,e=[];for(t in this.binders){var r=this.binders[t];(r instanceof za||r instanceof La)&&e.push.apply(e,r.uniformNames.map((function(t){return"#define HAS_UNIFORM_"+t})))}return e},Oa.prototype.getBinderAttributes=function(){var t,e=[];for(t in this.binders){var r=this.binders[t];if(r instanceof Ba||r instanceof Da)for(var i=0;i<r.paintVertexAttributes.length;i++)e.push(r.paintVertexAttributes[i].name);else if(r instanceof Ra)for(var n=0;n<oa.members.length;n++)e.push(oa.members[n].name)}return e},Oa.prototype.getBinderUniforms=function(){var t,e=[];for(t in this.binders){var r=this.binders[t];if(r instanceof za||r instanceof La||r instanceof Da)for(var i=0,n=r.uniformNames;i<n.length;i+=1)e.push(n[i])}return e},Oa.prototype.getPaintVertexBuffers=function(){return this._buffers},Oa.prototype.getUniforms=function(t,e){var r,i=[];for(r in this.binders){var n=this.binders[r];if(n instanceof za||n instanceof La||n instanceof Da)for(var o=0,a=n.uniformNames;o<a.length;o+=1){var s,u=a[o];e[u]&&(s=n.getBinding(t,e[u],u),i.push({name:u,property:r,binding:s}))}}return i},Oa.prototype.setUniforms=function(t,e,r,i){for(var n=0,o=e;n<o.length;n+=1){var a=o[n],s=a.name,u=a.property;this.binders[u].setUniform(a.binding,i,r.get(u),s)}},Oa.prototype.updatePaintBuffers=function(t){for(var e in this._buffers=[],this.binders){var r,i=this.binders[e];t&&i instanceof Ra?(r=2===t.fromScale?i.zoomInPaintVertexBuffer:i.zoomOutPaintVertexBuffer)&&this._buffers.push(r):(i instanceof Ba||i instanceof Da)&&i.paintVertexBuffer&&this._buffers.push(i.paintVertexBuffer)}},Oa.prototype.upload=function(t){for(var e in this.binders){var r=this.binders[e];(r instanceof Ba||r instanceof Da||r instanceof Ra)&&r.upload(t)}this.updatePaintBuffers()},Oa.prototype.destroy=function(){for(var t in this.binders){var e=this.binders[t];(e instanceof Ba||e instanceof Da||e instanceof Ra)&&e.destroy()}},Fa.prototype.populatePaintArrays=function(t,e,r,i,n,o){for(var a in this.programConfigurations)this.programConfigurations[a].populatePaintArrays(t,e,i,n,o);void 0!==e.id&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0},Fa.prototype.updatePaintArrays=function(t,e,r,i){for(var n=0,o=r;n<o.length;n+=1){var a=o[n];this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(t,this._featureMap,e,a,i)||this.needsUpload}},Fa.prototype.get=function(t){return this.programConfigurations[t]},Fa.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},Fa.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},Oi("ConstantBinder",za),Oi("CrossFadedConstantBinder",La),Oi("SourceExpressionBinder",Ba),Oi("CrossFadedCompositeBinder",Ra),Oi("CompositeExpressionBinder",Da),Oi("ProgramConfiguration",Oa,{omit:["_buffers"]}),Oi("ProgramConfigurationSet",Fa);var Ua=Math.pow(2,14)-1,Na=-Ua-1;function Va(t){for(var e=8192/t.extent,r=t.loadGeometry(),i=0;i<r.length;i++)for(var n=r[i],o=0;o<n.length;o++){var a=n[o],s=Math.round(a.x*e),u=Math.round(a.y*e);a.x=c(s,Na,Ua),a.y=c(u,Na,Ua),(s<a.x||s>a.x+1||u<a.y||u>a.y+1)&&w("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function qa(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Va(t):[]}}function Ga(t,e,r,i,n){t.emplaceBack(2*e+(i+1)/2,2*r+(n+1)/2)}function Ha(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new In,this.indexArray=new fo,this.segments=new ra,this.programConfigurations=new Fa(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))}function Za(t,e){for(var r=0;r<t.length;r++)if(Qa(e,t[r]))return!0;for(var i=0;i<e.length;i++)if(Qa(t,e[i]))return!0;return!!Xa(t,e)}function Wa(t,e){if(1===t.length)return Ya(e,t[0]);for(var r=0;r<e.length;r++)for(var i=e[r],n=0;n<i.length;n++)if(Qa(t,i[n]))return!0;for(var o=0;o<t.length;o++)if(Ya(e,t[o]))return!0;for(var a=0;a<e.length;a++)if(Xa(t,e[a]))return!0;return!1}function Xa(t,e){if(0!==t.length&&0!==e.length)for(var r,i,n,o,a=0;a<t.length-1;a++)for(var s=t[a],u=t[a+1],l=0;l<e.length-1;l++)if(i=u,S(r=s,n=e[l],o=e[l+1])!==S(i,n,o)&&S(r,i,n)!==S(r,i,o))return 1}function Ka(t,e,r){var i=r*r;if(1===e.length)return t.distSqr(e[0])<i;for(var n=1;n<e.length;n++)if(Ja(t,e[n-1],e[n])<i)return 1}function Ja(t,e,r){var i=e.distSqr(r);return 0===i?t.distSqr(e):(i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/i,t.distSqr(i<0?e:1<i?r:r.sub(e)._mult(i)._add(e)))}function Ya(t,e){for(var r,i,n,o=!1,a=0;a<t.length;a++)for(var s=0,u=(r=t[a]).length-1;s<r.length;u=s++)(i=r[s]).y>e.y!=(n=r[u]).y>e.y&&e.x<(n.x-i.x)*(e.y-i.y)/(n.y-i.y)+i.x&&(o=!o);return o}function Qa(t,e){for(var r=!1,i=0,n=t.length-1;i<t.length;n=i++){var o=t[i],a=t[n];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function $a(t,e,r){var i=e.paint.get(t).value;return"constant"===i.kind?i.value:r.programConfigurations.get(e.id).getMaxValue(t)}function ts(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function es(t,e,r,i,o){if(!e[0]&&!e[1])return t;var a=n.convert(e)._mult(o);"viewport"===r&&a._rotate(-i);for(var s=[],u=0;u<t.length;u++)s.push(t[u].sub(a));return s}Ha.prototype.populate=function(t,e,r){var i=this.layers[0],n=[],o=null,a=!1;"circle"===i.type&&(a=!(o=i.layout.get("circle-sort-key")).isConstant());for(var s=0,u=t;s<u.length;s+=1){var l=u[s],c=l.feature,p=l.id,h=l.index,f=l.sourceLayerIndex,d=this.layers[0]._featureFilter.needGeometry,m=qa(c,d);this.layers[0]._featureFilter.filter(new tn(this.zoom),m,r)&&(l=a?o.evaluate(m,{},r):void 0,l={id:p,properties:c.properties,type:c.type,sourceLayerIndex:f,index:h,geometry:d?m.geometry:Va(c),patterns:{},sortKey:l},n.push(l))}a&&n.sort((function(t,e){return t.sortKey-e.sortKey}));for(var y=0,g=n;y<g.length;y+=1){var _=g[y],v=_.geometry,x=_.index,b=_.sourceLayerIndex,w=t[x].feature;this.addFeature(_,v,x,r),e.featureIndex.insert(w,v,x,b,this.index)}},Ha.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Ha.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Ha.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ha.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ia),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Ha.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Ha.prototype.addFeature=function(t,e,r,i){for(var n=0,o=e;n<o.length;n+=1)for(var a=0,s=o[n];a<s.length;a+=1){var u,l=s[a],c=l.x,p=l.y;c<0||8192<=c||p<0||8192<=p||(l=(u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey)).vertexLength,Ga(this.layoutVertexArray,c,p,-1,-1),Ga(this.layoutVertexArray,c,p,1,-1),Ga(this.layoutVertexArray,c,p,1,1),Ga(this.layoutVertexArray,c,p,-1,1),this.indexArray.emplaceBack(l,l+1,l+2),this.indexArray.emplaceBack(l,l+3,l+2),u.vertexLength+=4,u.primitiveLength+=2)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},i)},Oi("CircleBucket",Ha,{omit:["layers"]});L=new gn({"circle-sort-key":new nc(Lt.layout_circle["circle-sort-key"])});var rs={paint:new gn({"circle-radius":new nc(Lt.paint_circle["circle-radius"]),"circle-color":new nc(Lt.paint_circle["circle-color"]),"circle-blur":new nc(Lt.paint_circle["circle-blur"]),"circle-opacity":new nc(Lt.paint_circle["circle-opacity"]),"circle-translate":new hn(Lt.paint_circle["circle-translate"]),"circle-translate-anchor":new hn(Lt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new hn(Lt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new hn(Lt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new nc(Lt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new nc(Lt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new nc(Lt.paint_circle["circle-stroke-opacity"])}),layout:L},is="undefined"!=typeof Float32Array?Float32Array:Array;function ns(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function os(t,e,r){var i=e[0],n=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],p=e[8],h=e[9],f=e[10],d=e[11],m=e[12],y=e[13],g=e[14],_=e[15],v=r[0],x=r[1],b=r[2];e=r[3];return t[0]=v*i+x*s+b*p+e*m,t[1]=v*n+x*u+b*h+e*y,t[2]=v*o+x*l+b*f+e*g,t[3]=v*a+x*c+b*d+e*_,t[4]=(v=r[4])*i+(x=r[5])*s+(b=r[6])*p+(e=r[7])*m,t[5]=v*n+x*u+b*h+e*y,t[6]=v*o+x*l+b*f+e*g,t[7]=v*a+x*c+b*d+e*_,t[8]=(v=r[8])*i+(x=r[9])*s+(b=r[10])*p+(e=r[11])*m,t[9]=v*n+x*u+b*h+e*y,t[10]=v*o+x*l+b*f+e*g,t[11]=v*a+x*c+b*d+e*_,t[12]=(v=r[12])*i+(x=r[13])*s+(b=r[14])*p+(e=r[15])*m,t[13]=v*n+x*u+b*h+e*y,t[14]=v*o+x*l+b*f+e*g,t[15]=v*a+x*c+b*d+e*_,t}function as(t,e,r){var i=e[0],n=e[1],o=e[2];e=e[3];return t[0]=r[0]*i+r[4]*n+r[8]*o+r[12]*e,t[1]=r[1]*i+r[5]*n+r[9]*o+r[13]*e,t[2]=r[2]*i+r[6]*n+r[10]*o+r[14]*e,t[3]=r[3]*i+r[7]*n+r[11]*o+r[15]*e,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)}),ho=os,$s=new is(3),is!=Float32Array&&($s[0]=0,$s[1]=0,$s[2]=0),bn=new is(4),is!=Float32Array&&(bn[0]=0,bn[1]=0,bn[2]=0,bn[3]=0);var ss;et=new is(2),is!=Float32Array&&(et[0]=0,et[1]=0),(ss=vn)&&(us.__proto__=ss),((us.prototype=Object.create(ss&&ss.prototype)).constructor=us).prototype.createBucket=function(t){return new Ha(t)},us.prototype.queryRadius=function(t){return $a("circle-radius",this,t)+$a("circle-stroke-width",this,t)+ts(this.paint.get("circle-translate"))},us.prototype.queryIntersectsFeature=function(t,e,r,i,n,o,a,s){t=es(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),r=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r);for(var u,l="map"===this.paint.get("circle-pitch-alignment"),c=l?t:(u=s,t.map((function(t){return ls(t,u)}))),p=l?r*a:r,h=0,f=i;h<f.length;h+=1)for(var d=0,m=f[h];d<m.length;d+=1){var y=m[d],g=l?y:ls(y,s),_=p;y=as([],[y.x,y.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?_*=y[3]/o.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(_*=o.cameraToCenterDistance/y[3]),y=_,Qa(_=c,g=g)||Ka(g,_,y))return!0}return!1},xr=us;function us(t){ss.call(this,t,rs)}function ls(t,e){return e=as([],[t.x,t.y,0,1],e),new n(e[0]/e[3],e[1]/e[3])}var cs,ps=((cs=Ha)&&(hs.__proto__=cs),(hs.prototype=Object.create(cs&&cs.prototype)).constructor=hs);function hs(){cs.apply(this,arguments)}function fs(t,e,r,i){var n=e.width;e=e.height;if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==n*e*r)throw new RangeError("mismatched image size")}else i=new Uint8Array(n*e*r);return t.width=n,t.height=e,t.data=i,t}function ds(t,e,r){var i=e.width,n=e.height;i===t.width&&n===t.height||(ms(t,e=fs({},{width:i,height:n},r),{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,i),height:Math.min(t.height,n)},r),t.width=i,t.height=n,t.data=e.data)}function ms(t,e,r,i,n,o){if(0===n.width||0===n.height)return e;if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,u=0;u<n.height;u++)for(var l=((r.y+u)*t.width+r.x)*o,c=((i.y+u)*e.width+i.x)*o,p=0;p<n.width*o;p++)s[c+p]=a[l+p];return e}Oi("HeatmapBucket",ps,{omit:["layers"]});var ys=function(t,e){fs(this,t,1,e)};function gs(t,e){fs(this,t,4,e)}ys.prototype.resize=function(t){ds(this,t,1)},ys.prototype.clone=function(){return new ys({width:this.width,height:this.height},new Uint8Array(this.data))},ys.copy=function(t,e,r,i,n){ms(t,e,r,i,n,1)},gs.prototype.resize=function(t){ds(this,t,4)},gs.prototype.replace=function(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t},gs.prototype.clone=function(){return new gs({width:this.width,height:this.height},new Uint8Array(this.data))},gs.copy=function(t,e,r,i,n){ms(t,e,r,i,n,4)},Oi("AlphaImage",ys),Oi("RGBAImage",gs);var _s={paint:new gn({"heatmap-radius":new nc(Lt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new nc(Lt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new hn(Lt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new yn(Lt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new hn(Lt.paint_heatmap["heatmap-opacity"])})};function vs(t){function e(e,i,n){r[t.evaluationKey]=n,n=t.expression.evaluate(r),o.data[e+i+0]=Math.floor(255*n.r/n.a),o.data[e+i+1]=Math.floor(255*n.g/n.a),o.data[e+i+2]=Math.floor(255*n.b/n.a),o.data[e+i+3]=Math.floor(255*n.a)}var r={},i=t.resolution||256,n=t.clips?t.clips.length:1,o=t.image||new gs({width:i,height:n});if(t.clips)for(var a=0,s=0;a<n;++a,s+=4*i)for(var u=0,l=0;u<i;u++,l+=4){var c=u/(i-1),p=t.clips[a];e(s,l,p.start*(1-c)+p.end*c)}else for(var h=0,f=0;h<i;h++,f+=4)e(0,f,h/(i-1));return o}(bs=vn)&&(Is.__proto__=bs),((Is.prototype=Object.create(bs&&bs.prototype)).constructor=Is).prototype.createBucket=function(t){return new ps(t)},Is.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},Is.prototype._updateColorRamp=function(){this.colorRamp=vs({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},Is.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},Is.prototype.queryRadius=function(){return 0},Is.prototype.queryIntersectsFeature=function(){return!1},Is.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},vr=Is;var xs,bs,ws={paint:new gn({"hillshade-illumination-direction":new hn(Lt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new hn(Lt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new hn(Lt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new hn(Lt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new hn(Lt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new hn(Lt.paint_hillshade["hillshade-accent-color"])})},Ss=(wr=((xs=vn)&&(Es.__proto__=xs),((Es.prototype=Object.create(xs&&xs.prototype)).constructor=Es).prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},Es),Sn([{name:"a_pos",components:2,type:"Int16"}],4).members),Ts=As;br=As;function Es(t){xs.call(this,t,ws)}function Is(t){bs.call(this,t,_s),this._updateColorRamp()}function As(t,e,r){r=r||2;var i,n,o,a,s,u,l,c=e&&e.length,p=c?e[0]*r:t.length,h=Cs(t,0,p,r,!0),f=[];if(!h||h.next===h.prev)return f;if(c&&(h=function(t,e,r,i){for(var n,o,a,s=[],u=0,l=e.length;u<l;u++)(n=Cs(t,e[u]*i,u<l-1?e[u+1]*i:t.length,i,!1))===n.next&&(n.steiner=!0),s.push(function(t){for(var e=t,r=t;(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),(e=e.next)!==t;);return r}(n));for(s.sort(Ms),u=0;u<s.length;u++)(a=function(t,e){var r,i=e,n=t.x,o=t.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&a<s){if((a=s)===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x<i.next.x?i:i.next}}}while((i=i.next)!==e);if(!r)return null;if(n===a)return r;var u,l,c,p=r,h=r.x,f=r.y,d=1/0;for(i=r;n>=i.x&&i.x>=h&&n!==i.x&&zs(o<f?n:a,o,h,f,o<f?a:n,o,i.x,i.y)&&(u=Math.abs(o-i.y)/(n-i.x),Fs(i,t)&&(u<d||u===d&&(i.x>r.x||i.x===r.x&&(c=i,Ls((l=r).prev,l,c.prev)<0&&Ls(c.next,l,l.next)<0)))&&(r=i,d=u)),(i=i.next)!==p;);return r}(o=s[u],a=r))&&(o=js(a,o),Ps(a,a.next),Ps(o,o.next)),r=Ps(r,r.next);return r}(t,e,h,r)),t.length>80*r){i=o=t[0],n=a=t[1];for(var d=r;d<p;d+=r)(s=t[d])<i&&(i=s),(u=t[d+1])<n&&(n=u),o<s&&(o=s),a<u&&(a=u);l=0!==(l=Math.max(o-i,a-n))?1/l:0}return function t(e,r,i,n,o,a,s){if(e){!s&&a&&function(t,e,r,i){for(var n=t;null===n.z&&(n.z=ks(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,(n=n.next)!==t;);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,r,i,n,o,a,s,u,l=1;do{for(r=t,o=t=null,a=0;r;){for(a++,i=r,e=s=0;e<l&&(s++,i=i.nextZ);e++);for(u=l;0<s||0<u&&i;)0!==s&&(0===u||!i||r.z<=i.z)?(r=(n=r).nextZ,s--):(i=(n=i).nextZ,u--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}}while(o.nextZ=null,l*=2,1<a)}(n)}(e,n,o,a);for(var u,l,c=e;e.prev!==e.next;)if(u=e.prev,l=e.next,a?function(t,e,r,i){var n=t.prev,o=t,a=t.next;if(0<=Ls(n,o,a))return!1;for(var s=(n.x>o.x?n.x>a.x?n:a:o.x>a.x?o:a).x,u=(n.y>o.y?n.y>a.y?n:a:o.y>a.y?o:a).y,l=ks((n.x<o.x?n.x<a.x?n:a:o.x<a.x?o:a).x,(n.y<o.y?n.y<a.y?n:a:o.y<a.y?o:a).y,e,r,i),c=ks(s,u,e,r,i),p=t.prevZ,h=t.nextZ;p&&p.z>=l&&h&&h.z<=c;){if(p!==t.prev&&p!==t.next&&zs(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=Ls(p.prev,p,p.next))return!1;if(p=p.prevZ,h!==t.prev&&h!==t.next&&zs(n.x,n.y,o.x,o.y,a.x,a.y,h.x,h.y)&&0<=Ls(h.prev,h,h.next))return!1;h=h.nextZ}for(;p&&p.z>=l;){if(p!==t.prev&&p!==t.next&&zs(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=Ls(p.prev,p,p.next))return!1;p=p.prevZ}for(;h&&h.z<=c;){if(h!==t.prev&&h!==t.next&&zs(n.x,n.y,o.x,o.y,a.x,a.y,h.x,h.y)&&0<=Ls(h.prev,h,h.next))return!1;h=h.nextZ}return!0}(e,n,o,a):function(t){var e=t.prev,r=t,i=t.next;if(0<=Ls(e,r,i))return!1;for(var n=t.next.next;n!==t.prev;){if(zs(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&0<=Ls(n.prev,n,n.next))return!1;n=n.next}return!0}(e))r.push(u.i/i),r.push(e.i/i),r.push(l.i/i),Ns(e),e=l.next,c=l.next;else if((e=l)===c){s?1===s?t(e=function(t,e,r){var i=t;do{var n=i.prev,o=i.next.next}while(!Bs(n,o)&&Ds(n,i,i.next,o)&&Fs(n,o)&&Fs(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),Ns(i),Ns(i.next),i=t=o),(i=i.next)!==t);return Ps(i)}(Ps(e),r,i),r,i,n,o,a,2):2===s&&function(e,r,i,n,o,a){var s=e;do{for(var u=s.next.next;u!==s.prev;){if(s.i!==u.i&&function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Ds(r,r.next,t,e))return 1}while((r=r.next)!==t)}(t,e)&&(Fs(t,e)&&Fs(e,t)&&function(t,e){for(var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),(r=r.next)!==t;);return i}(t,e)&&(Ls(t.prev,t,e.prev)||Ls(t,e.prev,e))||Bs(t,e)&&0<Ls(t.prev,t,t.next)&&0<Ls(e.prev,e,e.next))}(s,u)){var l=js(s,u);return s=Ps(s,s.next),l=Ps(l,l.next),t(s,r,i,n,o,a),t(l,r,i,n,o,a)}u=u.next}}while((s=s.next)!==e)}(e,r,i,n,o,a):t(Ps(e),r,i,n,o,a,1);break}}}(h,f,r,i,n,l),f}function Cs(t,e,r,i,n){var o,a;if(n===0<qs(t,e,r,i))for(o=e;o<r;o+=i)a=Us(o,t[o],t[o+1],a);else for(o=r-i;e<=o;o-=i)a=Us(o,t[o],t[o+1],a);return a&&Bs(a,a.next)&&(Ns(a),a=a.next),a}function Ps(t,e){if(!t)return t;e=e||t;var r,i=t;do{if(r=!1,i.steiner||!Bs(i,i.next)&&0!==Ls(i.prev,i,i.next))i=i.next;else{if(Ns(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function Ms(t,e){return t.x-e.x}function ks(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function zs(t,e,r,i,n,o,a,s){return 0<=(n-a)*(e-s)-(t-a)*(o-s)&&0<=(t-a)*(i-s)-(r-a)*(e-s)&&0<=(r-a)*(o-s)-(n-a)*(i-s)}function Ls(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Bs(t,e){return t.x===e.x&&t.y===e.y}function Ds(t,e,r,i){var n=Os(Ls(t,e,r)),o=Os(Ls(t,e,i)),a=Os(Ls(r,i,t)),s=Os(Ls(r,i,e));return n!==o&&a!==s||0===n&&Rs(t,r,e)||0===o&&Rs(t,i,e)||0===a&&Rs(r,t,i)||0===s&&Rs(r,e,i)}function Rs(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Os(t){return 0<t?1:t<0?-1:0}function Fs(t,e){return Ls(t.prev,t,t.next)<0?0<=Ls(t,e,t.next)&&0<=Ls(t,t.prev,e):Ls(t,e,t.prev)<0||Ls(t,t.next,e)<0}function js(t,e){var r=new Vs(t.i,t.x,t.y),i=new Vs(e.i,e.x,e.y),n=t.next,o=e.prev;return(t.next=e).prev=t,(r.next=n).prev=r,(i.next=r).prev=i,(o.next=i).prev=o,i}function Us(t,e,r,i){return r=new Vs(t,e,r),i?(r.next=i.next,(r.prev=i).next.prev=r,i.next=r):(r.prev=r).next=r,r}function Ns(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Vs(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function qs(t,e,r,i){for(var n=0,o=e,a=r-i;o<r;o+=i)n+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return n}function Gs(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function Hs(t,e){return t<e?-1:e<t?1:0}function Zs(t,e){var r=t.length;if(r<=1)return[t];for(var i,n,o,a,s=[],u=0;u<r;u++){var l=function(t){for(var e,r,i=0,n=0,o=t.length,a=o-1;n<o;a=n++)i+=((r=t[a]).x-(e=t[n]).x)*(e.y+r.y);return i}(t[u]);0!==l&&(t[u].area=Math.abs(l),void 0===n&&(n=l<0),n===l<0?(i&&s.push(i),i=[t[u]]):i.push(t[u]))}if(i&&s.push(i),1<e)for(var c=0;c<s.length;c++)s[c].length<=e||(1,a=Ws,function t(e,r,i,n,o){for(;i<n;){var a,s,u,l;600<n-i&&(a=n-i+1,s=r-i+1,l=Math.log(a),u=.5*Math.exp(2*l/3),l=.5*Math.sqrt(l*u*(a-u)/a)*(s-a/2<0?-1:1),t(e,r,Math.max(i,Math.floor(r-s*u/a+l)),Math.min(n,Math.floor(r+(a-s)*u/a+l)),o));var c=e[r],p=i,h=n;for(Gs(e,i,r),0<o(e[n],c)&&Gs(e,i,n);p<h;){for(Gs(e,p,h),p++,h--;o(e[p],c)<0;)p++;for(;0<o(e[h],c);)h--}0===o(e[i],c)?Gs(e,i,h):Gs(e,++h,n),h<=r&&(i=h+1),r<=h&&(n=h-1)}}(o=s[c],e,1,s[c].length-1||o.length-1,a||Hs),s[c]=s[c].slice(0,e));return s}function Ws(t,e){return e.area-t.area}function Xs(t,e,r){for(var i=r.patternDependencies,n=!1,o=0,a=e;o<a.length;o+=1){var s=a[o].paint.get(t+"-pattern");s.isConstant()||(n=!0),(s=s.constantOr(null))&&(n=!0,i[s.to]=!0,i[s.from]=!0)}return n}function Ks(t,e,r,i,n){for(var o=n.patternDependencies,a=0,s=e;a<s.length;a+=1){var u,l,c=s[a],p=c.paint.get(t+"-pattern").value;"constant"!==p.kind&&(u=p.evaluate({zoom:i-1},r,{},n.availableImages),l=p.evaluate({zoom:i},r,{},n.availableImages),p=p.evaluate({zoom:i+1},r,{},n.availableImages),l=l&&l.name?l.name:l,p=p&&p.name?p.name:p,o[u=u&&u.name?u.name:u]=!0,o[l]=!0,o[p]=!0,r.patterns[c.id]={min:u,mid:l,max:p})}return r}function Js(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new In,this.indexArray=new fo,this.indexArray2=new Co,this.programConfigurations=new Fa(t.layers,t.zoom),this.segments=new ra,this.segments2=new ra,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))}As.deviation=function(t,e,r,i){var n=e&&e.length,o=Math.abs(qs(t,0,n?e[0]*r:t.length,r));if(n)for(var a=0,s=e.length;a<s;a++)o-=Math.abs(qs(t,e[a]*r,a<s-1?e[a+1]*r:t.length,r));var u=0;for(a=0;a<i.length;a+=3){var l=i[a]*r,c=i[a+1]*r,p=i[a+2]*r;u+=Math.abs((t[l]-t[p])*(t[1+c]-t[1+l])-(t[l]-t[c])*(t[1+p]-t[1+l]))}return 0===o&&0===u?0:Math.abs((u-o)/o)},As.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},i=0,n=0;n<t.length;n++){for(var o=0;o<t[n].length;o++)for(var a=0;a<e;a++)r.vertices.push(t[n][o][a]);0<n&&r.holes.push(i+=t[n-1].length)}return r},Ts.default=br,Js.prototype.populate=function(t,e,r){this.hasPattern=Xs("fill",this.layers,e);for(var i=this.layers[0].layout.get("fill-sort-key"),n=!i.isConstant(),o=[],a=0,s=t;a<s.length;a+=1){var u=s[a],l=u.feature,c=u.id,p=u.index,h=u.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,d=qa(l,f);this.layers[0]._featureFilter.filter(new tn(this.zoom),d,r)&&(u=n?i.evaluate(d,{},r,e.availableImages):void 0,u={id:c,properties:l.properties,type:l.type,sourceLayerIndex:h,index:p,geometry:f?d.geometry:Va(l),patterns:{},sortKey:u},o.push(u))}n&&o.sort((function(t,e){return t.sortKey-e.sortKey}));for(var m=0,y=o;m<y.length;m+=1){var g,_=y[m],v=_.geometry,x=_.index,b=_.sourceLayerIndex;this.hasPattern?(g=Ks("fill",this.layers,_,this.zoom,e),this.patternFeatures.push(g)):this.addFeature(_,v,x,r,{}),e.featureIndex.insert(t[x].feature,v,x,b,this.index)}},Js.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Js.prototype.addFeatures=function(t,e,r){for(var i=0,n=this.patternFeatures;i<n.length;i+=1){var o=n[i];this.addFeature(o,o.geometry,o.index,e,r)}},Js.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Js.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Js.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ss),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},Js.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},Js.prototype.addFeature=function(t,e,r,i,n){for(var o=0,a=Zs(e,500);o<a.length;o+=1){for(var s=a[o],u=0,l=0,c=s;l<c.length;l+=1)u+=c[l].length;for(var p=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray),h=p.vertexLength,f=[],d=[],m=0,y=s;m<y.length;m+=1){var g=y[m];if(0!==g.length){g!==s[0]&&d.push(f.length/2);var _=this.segments2.prepareSegment(g.length,this.layoutVertexArray,this.indexArray2),v=_.vertexLength;this.layoutVertexArray.emplaceBack(g[0].x,g[0].y),this.indexArray2.emplaceBack(v+g.length-1,v),f.push(g[0].x),f.push(g[0].y);for(var x=1;x<g.length;x++)this.layoutVertexArray.emplaceBack(g[x].x,g[x].y),this.indexArray2.emplaceBack(v+x-1,v+x),f.push(g[x].x),f.push(g[x].y);_.vertexLength+=g.length,_.primitiveLength+=g.length}}for(var b=Ts(f,d),w=0;w<b.length;w+=3)this.indexArray.emplaceBack(h+b[w],h+b[w+1],h+b[w+2]);p.vertexLength+=u,p.primitiveLength+=b.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n,i)},Oi("FillBucket",Js,{omit:["layers","patternFeatures"]});L=new gn({"fill-sort-key":new nc(Lt.layout_fill["fill-sort-key"])});var Ys,Qs={paint:new gn({"fill-antialias":new hn(Lt.paint_fill["fill-antialias"]),"fill-opacity":new nc(Lt.paint_fill["fill-opacity"]),"fill-color":new nc(Lt.paint_fill["fill-color"]),"fill-outline-color":new nc(Lt.paint_fill["fill-outline-color"]),"fill-translate":new hn(Lt.paint_fill["fill-translate"]),"fill-translate-anchor":new hn(Lt.paint_fill["fill-translate-anchor"]),"fill-pattern":new dn(Lt.paint_fill["fill-pattern"])}),layout:L},$s=((Ys=vn)&&(ru.__proto__=Ys),((ru.prototype=Object.create(Ys&&Ys.prototype)).constructor=ru).prototype.recalculate=function(t,e){Ys.prototype.recalculate.call(this,t,e),"constant"===(e=this.paint._values["fill-outline-color"]).value.kind&&void 0===e.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},ru.prototype.createBucket=function(t){return new Js(t)},ru.prototype.queryRadius=function(){return ts(this.paint.get("fill-translate"))},ru.prototype.queryIntersectsFeature=function(t,e,r,i,n,o,a){return Wa(es(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,a),i)},ru.prototype.isTileClipped=function(){return!0},ru),tu=Sn([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,eu=iu;function ru(t){Ys.call(this,t,Qs)}function iu(t,e,r,i,n){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=n,t.readFields(nu,this,e)}function nu(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var i=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[i]=n}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}iu.types=["Unknown","Point","LineString","Polygon"],iu.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r,i=t.readVarint()+t.pos,o=1,a=0,s=0,u=0,l=[];t.pos<i;)if(a<=0&&(o=7&(r=t.readVarint()),a=r>>3),a--,1===o||2===o)s+=t.readSVarint(),u+=t.readSVarint(),1===o&&(e&&l.push(e),e=[]),e.push(new n(s,u));else{if(7!==o)throw new Error("unknown command "+o);e&&e.push(e[0].clone())}return e&&l.push(e),l},iu.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,i=1,n=0,o=0,a=0,s=1/0,u=-1/0,l=1/0,c=-1/0;t.pos<r;)if(n<=0&&(i=7&(e=t.readVarint()),n=e>>3),n--,1===i||2===i)(o+=t.readSVarint())<s&&(s=o),u<o&&(u=o),(a+=t.readSVarint())<l&&(l=a),c<a&&(c=a);else if(7!==i)throw new Error("unknown command "+i);return[s,l,u,c]},iu.prototype.toGeoJSON=function(t,e,r){var i,n=this.extent*Math.pow(2,r),o=this.extent*t,a=this.extent*e,s=this.loadGeometry();e=iu.types[this.type];function u(t){for(var e=0;e<t.length;e++){var r=t[e];t[e]=[360*(r.x+o)/n-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+a)/n)*Math.PI/180))-90]}}switch(this.type){case 1:for(var l=[],c=0;c<s.length;c++)l[c]=s[c][0];u(s=l);break;case 2:for(c=0;c<s.length;c++)u(s[c]);break;case 3:for(s=function(t){var e=t.length;if(e<=1)return[t];for(var r,i,n=[],o=0;o<e;o++){var a=function(t){for(var e,r,i=0,n=0,o=t.length,a=o-1;n<o;a=n++)i+=((r=t[a]).x-(e=t[n]).x)*(e.y+r.y);return i}(t[o]);0!==a&&(void 0===i&&(i=a<0),i===a<0?(r&&n.push(r),r=[t[o]]):r.push(t[o]))}return r&&n.push(r),n}(s),c=0;c<s.length;c++)for(i=0;i<s[c].length;i++)u(s[c][i])}return 1===s.length?s=s[0]:e="Multi"+e,e={type:"Feature",geometry:{type:e,coordinates:s},properties:this.properties},"id"in this&&(e.id=this.id),e};var ou=au;function au(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(su,this,e),this.length=this._features.length}function su(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var i=t.readVarint()>>3;e=1==i?t.readString():2==i?t.readFloat():3==i?t.readDouble():4==i?t.readVarint64():5==i?t.readVarint():6==i?t.readSVarint():7==i?t.readBoolean():null}return e}(r))}function uu(t,e,r){3!==t||(r=new ou(r,r.readVarint()+r.pos)).length&&(e[r.name]=r)}au.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");return this._pbf.pos=this._features[t],t=this._pbf.readVarint()+this._pbf.pos,new eu(this._pbf,t,this.extent,this._keys,this._values)};var lu={VectorTile:function(t,e){this.layers=t.readFields(uu,{},e)},VectorTileFeature:eu,VectorTileLayer:ou},cu=lu.VectorTileFeature.types,pu=Math.pow(2,13);function hu(t,e,r,i,n,o,a,s){t.emplaceBack(e,r,2*Math.floor(i*pu)+a,n*pu*2,o*pu*2,Math.round(s))}function fu(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new zn,this.indexArray=new fo,this.programConfigurations=new Fa(t.layers,t.zoom),this.segments=new ra,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))}fu.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=Xs("fill-extrusion",this.layers,e);for(var i=0,n=t;i<n.length;i+=1){var o=(c=n[i]).feature,a=c.id,s=c.index,u=c.sourceLayerIndex,l=this.layers[0]._featureFilter.needGeometry,c=qa(o,l);this.layers[0]._featureFilter.filter(new tn(this.zoom),c,r)&&(c={id:a,sourceLayerIndex:u,index:s,geometry:l?c.geometry:Va(o),properties:o.properties,type:o.type,patterns:{}},this.hasPattern?this.features.push(Ks("fill-extrusion",this.layers,c,this.zoom,e)):this.addFeature(c,c.geometry,s,r,{}),e.featureIndex.insert(o,c.geometry,s,u,this.index,!0))}},fu.prototype.addFeatures=function(t,e,r){for(var i=0,n=this.features;i<n.length;i+=1){var o=n[i];this.addFeature(o,o.geometry,o.index,e,r)}},fu.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},fu.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},fu.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},fu.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,tu),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},fu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},fu.prototype.addFeature=function(t,e,r,i,n){for(var o,a=0,s=Zs(e,500);a<s.length;a+=1){for(var u=s[a],l=0,c=0,p=u;c<p.length;c+=1)l+=p[c].length;for(var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),f=0,d=u;f<d.length;f+=1){var m=d[f];if(0!==m.length&&!((o=m).every((function(t){return t.x<0}))||o.every((function(t){return 8192<t.x}))||o.every((function(t){return t.y<0}))||o.every((function(t){return 8192<t.y}))))for(var y=0,g=0;g<m.length;g++){var _,v,x,b=m[g];1<=g&&(x=_=m[g-1],(v=b).x===x.x&&(v.x<0||8192<v.x)||v.y===x.y&&(v.y<0||8192<v.y)||(h.vertexLength+4>ra.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)),x=b.sub(_)._perp()._unit(),32768<y+(v=_.dist(b))&&(y=0),hu(this.layoutVertexArray,b.x,b.y,x.x,x.y,0,0,y),hu(this.layoutVertexArray,b.x,b.y,x.x,x.y,0,1,y),hu(this.layoutVertexArray,_.x,_.y,x.x,x.y,0,0,y+=v),hu(this.layoutVertexArray,_.x,_.y,x.x,x.y,0,1,y),x=h.vertexLength,this.indexArray.emplaceBack(x,x+2,x+1),this.indexArray.emplaceBack(x+1,x+2,x+3),h.vertexLength+=4,h.primitiveLength+=2))}}if(h.vertexLength+l>ra.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===cu[t.type]){for(var w=[],S=[],T=h.vertexLength,E=0,I=u;E<I.length;E+=1){var A=I[E];if(0!==A.length){A!==u[0]&&S.push(w.length/2);for(var C=0;C<A.length;C++){var P=A[C];hu(this.layoutVertexArray,P.x,P.y,0,0,1,1,0),w.push(P.x),w.push(P.y)}}}for(var M=Ts(w,S),k=0;k<M.length;k+=3)this.indexArray.emplaceBack(T+M[k],T+M[k+2],T+M[k+1]);h.primitiveLength+=M.length/3,h.vertexLength+=l}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n,i)},Oi("FillExtrusionBucket",fu,{omit:["layers","features"]});var du,mu={paint:new gn({"fill-extrusion-opacity":new hn(Lt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new nc(Lt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new hn(Lt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new hn(Lt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new dn(Lt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new nc(Lt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new nc(Lt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new hn(Lt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};(du=vn)&&(yu.__proto__=du),((yu.prototype=Object.create(du&&du.prototype)).constructor=yu).prototype.createBucket=function(t){return new fu(t)},yu.prototype.queryRadius=function(){return ts(this.paint.get("fill-extrusion-translate"))},yu.prototype.is3D=function(){return!0},yu.prototype.queryIntersectsFeature=function(t,e,r,i,o,a,s,u){var l=es(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,s),c=this.paint.get("fill-extrusion-height").evaluate(e,r),p=this.paint.get("fill-extrusion-base").evaluate(e,r);r=function(t){for(var e=[],r=0,i=l;r<i.length;r+=1){var o;as(o=[(o=i[r]).x,o.y,0,1],o,t),e.push(new n(o[0]/o[3],o[1]/o[3]))}return e}(u);return function(t,e,r){var i=1/0;Wa(r,e)&&(i=_u(r,e[0]));for(var n=0;n<e.length;n++)for(var o=e[n],a=t[n],s=0;s<o.length-1;s++){var u;Za(r,u=[u=o[s],o[s+1],a[s+1],a[s],u])&&(i=Math.min(i,_u(r,u)))}return i!==1/0&&i}((u=function(t){for(var e=[],r=[],o=t[8]*p,a=t[9]*p,s=t[10]*p,u=t[11]*p,l=t[8]*c,h=t[9]*c,f=t[10]*c,d=t[11]*c,m=0,y=i;m<y.length;m+=1){for(var g=[],_=[],v=0,x=y[m];v<x.length;v+=1){var b=(I=x[v]).x,w=I.y,S=t[0]*b+t[4]*w+t[12],T=t[1]*b+t[5]*w+t[13],E=(A=t[2]*b+t[6]*w+t[14])+s,I=(C=t[3]*b+t[7]*w+t[15])+u,A=(b=S+l,w=T+h,A+f),C=C+d;(T=new n((S+o)/I,(T+a)/I)).z=E/I,g.push(T),(w=new n(b/C,w/C)).z=A/C,_.push(w)}e.push(g),r.push(_)}return[e,r]}(u))[0],u[1],r)},bn=yu;function yu(t){du.call(this,t,mu)}function gu(t,e){return t.x*e.x+t.y*e.y}function _u(t,e){if(1===t.length){for(var r,i=0,n=e[i++];!r||n.equals(r);)if(!(r=e[i++]))return 1/0;for(;i<e.length;i++){var o=e[i],a=t[0],s=r.sub(n),u=o.sub(n),l=a.sub(n),c=gu(s,s),p=gu(s,u);a=((a=gu(u,u))*(s=gu(l,s))-p*(l=gu(l,u)))/(u=c*a-p*p),u=(c*l-p*s)/u,u=n.z*(1-a-u)+r.z*a+o.z*u;if(isFinite(u))return u}return 1/0}for(var h=1/0,f=0,d=e;f<d.length;f+=1)h=Math.min(h,d[f].z);return h}function vu(t){var e=this;this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((function(t){e.gradients[t.id]={}})),this.layoutVertexArray=new Dn,this.layoutVertexArray2=new Fn,this.indexArray=new fo,this.programConfigurations=new Fa(t.layers,t.zoom),this.segments=new ra,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))}var xu=Sn([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,bu=Sn([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,wu=lu.VectorTileFeature.types,Su=Math.cos(Math.PI/180*37.5),Tu=Math.pow(2,14)/.5;vu.prototype.populate=function(t,e,r){this.hasPattern=Xs("line",this.layers,e);for(var i=this.layers[0].layout.get("line-sort-key"),n=!i.isConstant(),o=[],a=0,s=t;a<s.length;a+=1){var u=s[a],l=u.feature,c=u.id,p=u.index,h=u.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,d=qa(l,f);this.layers[0]._featureFilter.filter(new tn(this.zoom),d,r)&&(u=n?i.evaluate(d,{},r):void 0,u={id:c,properties:l.properties,type:l.type,sourceLayerIndex:h,index:p,geometry:f?d.geometry:Va(l),patterns:{},sortKey:u},o.push(u))}n&&o.sort((function(t,e){return t.sortKey-e.sortKey}));for(var m=0,y=o;m<y.length;m+=1){var g,_=y[m],v=_.geometry,x=_.index,b=_.sourceLayerIndex;this.hasPattern?(g=Ks("line",this.layers,_,this.zoom,e),this.patternFeatures.push(g)):this.addFeature(_,v,x,r,{}),e.featureIndex.insert(t[x].feature,v,x,b,this.index)}},vu.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},vu.prototype.addFeatures=function(t,e,r){for(var i=0,n=this.patternFeatures;i<n.length;i+=1){var o=n[i];this.addFeature(o,o.geometry,o.index,e,r)}},vu.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},vu.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},vu.prototype.upload=function(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,bu)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,xu),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},vu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},vu.prototype.lineFeatureClips=function(t){if(t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}},vu.prototype.addFeature=function(t,e,r,i,n){var o=this.layers[0].layout,a=o.get("line-join").evaluate(t,{}),s=o.get("line-cap"),u=o.get("line-miter-limit"),l=o.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(var c=0,p=e;c<p.length;c+=1)this.addLine(p[c],t,a,s,u,l);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n,i)},vu.prototype.addLine=function(t,e,r,i,n,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var a=0;a<t.length-1;a++)this.totalDistance+=t[a].dist(t[a+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var s="Polygon"===wu[e.type],u=t.length;2<=u&&t[u-1].equals(t[u-2]);)u--;for(var l=0;l<u-1&&t[l].equals(t[l+1]);)l++;if(!(u<(s?3:2))){"bevel"===r&&(n=1.05);var c,p=this.overscaling<=16?122880/(512*this.overscaling):0,h=this.segments.prepareSegment(10*u,this.layoutVertexArray,this.indexArray),f=void 0,d=void 0,m=void 0,y=void 0;this.e1=this.e2=-1,s&&(y=t[l].sub(c=t[u-2])._unit()._perp());for(var g=l;g<u;g++)if(!(d=g===u-1?s?t[l+1]:void 0:t[g+1])||!t[g].equals(d)){y&&(m=y),c&&(f=c),c=t[g],y=d?d.sub(c)._unit()._perp():m;var _=(m=m||y).add(y);0===_.x&&0===_.y||_._unit();var v=m.x*y.x+m.y*y.y,x=0!=(w=_.x*y.x+_.y*y.y)?1/w:1/0,b=2*Math.sqrt(2-2*w),w=w<Su&&f&&d,S=0<m.x*y.y-m.y*y.x;w&&l<g&&2*p<(T=c.dist(f))&&(E=c.sub(c.sub(f)._mult(p/T)._round()),this.updateDistance(f,E),this.addCurrentVertex(E,m,0,0,h),f=E);var T=f&&d,E=T?r:s?"butt":i;if(T&&"round"===E&&(x<o?E="miter":x<=2&&(E="fakeround")),"miter"===E&&n<x&&(E="bevel"),"bevel"===E&&(2<x&&(E="flipbevel"),x<n&&(E="miter")),f&&this.updateDistance(f,c),"miter"===E)_._mult(x),this.addCurrentVertex(c,_,0,0,h);else if("flipbevel"===E)100<x?_=y.mult(-1):(T=x*m.add(y).mag()/m.sub(y).mag(),_._perp()._mult(T*(S?-1:1))),this.addCurrentVertex(c,_,0,0,h),this.addCurrentVertex(c,_.mult(-1),0,0,h);else if("bevel"===E||"fakeround"===E){var I=-Math.sqrt(x*x-1);x=S?I:0,I=S?0:I;if(f&&this.addCurrentVertex(c,m,x,I,h),"fakeround"===E)for(var A=Math.round(180*b/Math.PI/20),C=1;C<A;C++){var P,M=C/A;.5!==M&&(M+=M*(P=M-.5)*(M-1)*((1.0904+v*(v*(3.55645-1.43519*v)-3.2452))*P*P+(.848013+v*(.215638*v-1.06021)))),M=y.sub(m)._mult(M)._add(m)._unit()._mult(S?-1:1),this.addHalfVertex(c,M.x,M.y,!1,S,0,h)}d&&this.addCurrentVertex(c,y,-x,-I,h)}else"butt"===E?this.addCurrentVertex(c,_,0,0,h):"square"===E?(I=f?1:-1,this.addCurrentVertex(c,_,I,I,h)):"round"===E&&(f&&(this.addCurrentVertex(c,m,0,0,h),this.addCurrentVertex(c,m,1,1,h,!0)),d&&(this.addCurrentVertex(c,y,-1,-1,h,!0),this.addCurrentVertex(c,y,0,0,h)));w&&g<u-1&&2*p<(w=c.dist(d))&&(w=c.add(d.sub(c)._mult(p/w)._round()),this.updateDistance(c,w),this.addCurrentVertex(w,y,0,0,h),c=w)}}},vu.prototype.addCurrentVertex=function(t,e,r,i,n,o){void 0===o&&(o=!1);var a=e.y*i-e.x,s=-e.y-e.x*i;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,o,!1,r,n),this.addHalfVertex(t,a,s,o,!0,-i,n),this.distance>Tu/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,i,n,o))},vu.prototype.addHalfVertex=function(t,e,r,i,n,o,a){var s=.5*(this.lineClips?this.scaledDistance*(Tu-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t.x<<1)+(i?1:0),(t.y<<1)+(n?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===o?0:o<0?-1:1)|(63&s)<<2,s>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length),s=a.vertexLength++,0<=this.e1&&0<=this.e2&&(this.indexArray.emplaceBack(this.e1,this.e2,s),a.primitiveLength++),n?this.e2=s:this.e1=s},vu.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},vu.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Oi("LineBucket",vu,{omit:["layers","patternFeatures"]});et=new gn({"line-cap":new hn(Lt.layout_line["line-cap"]),"line-join":new nc(Lt.layout_line["line-join"]),"line-miter-limit":new hn(Lt.layout_line["line-miter-limit"]),"line-round-limit":new hn(Lt.layout_line["line-round-limit"]),"line-sort-key":new nc(Lt.layout_line["line-sort-key"])});var Eu,Iu={paint:new gn({"line-opacity":new nc(Lt.paint_line["line-opacity"]),"line-color":new nc(Lt.paint_line["line-color"]),"line-translate":new hn(Lt.paint_line["line-translate"]),"line-translate-anchor":new hn(Lt.paint_line["line-translate-anchor"]),"line-width":new nc(Lt.paint_line["line-width"]),"line-gap-width":new nc(Lt.paint_line["line-gap-width"]),"line-offset":new nc(Lt.paint_line["line-offset"]),"line-blur":new nc(Lt.paint_line["line-blur"]),"line-dasharray":new sc(Lt.paint_line["line-dasharray"]),"line-pattern":new dn(Lt.paint_line["line-pattern"]),"line-gradient":new yn(Lt.paint_line["line-gradient"])}),layout:et},Au=((Eu=nc)&&(Cu.__proto__=Eu),((Cu.prototype=Object.create(Eu&&Eu.prototype)).constructor=Cu).prototype.possiblyEvaluate=function(t,e){return e=new tn(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),Eu.prototype.possiblyEvaluate.call(this,t,e)},Cu.prototype.evaluate=function(t,e,r,i){return e=h({},e,{zoom:Math.floor(e.zoom)}),Eu.prototype.evaluate.call(this,t,e,r,i)},new Cu(Iu.paint.properties["line-width"].specification));function Cu(){Eu.apply(this,arguments)}Au.useIntegerZoom=!0;var Pu;(Pu=vn)&&(Mu.__proto__=Pu),((Mu.prototype=Object.create(Pu&&Pu.prototype)).constructor=Mu).prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Ge,this.gradientVersion=(this.gradientVersion+1)%s)},Mu.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},Mu.prototype.recalculate=function(t,e){Pu.prototype.recalculate.call(this,t,e),this.paint._values["line-floorwidth"]=Au.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)},Mu.prototype.createBucket=function(t){return new vu(t)},Mu.prototype.queryRadius=function(t){t=ku($a("line-width",this,e=t),$a("line-gap-width",this,e));var e=$a("line-offset",this,e);return t/2+Math.abs(e)+ts(this.paint.get("line-translate"))},Mu.prototype.queryIntersectsFeature=function(t,e,r,i,o,a,s){return t=es(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),a=s/2*ku(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),(r=this.paint.get("line-offset").evaluate(e,r))&&(i=function(t,e){for(var r=[],i=new n(0,0),o=0;o<t.length;o++){for(var a=t[o],s=[],u=0;u<a.length;u++){var l=a[u],c=a[u+1],p=0===u?i:l.sub(a[u-1])._unit()._perp();c=u===a.length-1?i:c.sub(l)._unit()._perp();(p=p._add(c)._unit())._mult(1/(p.x*c.x+p.y*c.y)),s.push(p._mult(e)._add(l))}r.push(s)}return r}(i,r*s)),function(t,e,r){for(var i=0;i<e.length;i++){var n=e[i];if(3<=t.length)for(var o=0;o<n.length;o++)if(Qa(t,n[o]))return!0;if(function(t,e,r){if(1<t.length){if(Xa(t,e))return 1;for(var i=0;i<e.length;i++)if(Ka(e[i],t,r))return 1}for(var n=0;n<t.length;n++)if(Ka(t[n],e,r))return 1}(t,n,r))return!0}return!1}(t,i,a)},Mu.prototype.isTileClipped=function(){return!0},br=Mu;function Mu(t){Pu.call(this,t,Iu),this.gradientVersion=0}function ku(t,e){return 0<e?e+2*t:t}var zu=Sn([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Lu=Sn([{name:"a_projected_pos",components:3,type:"Float32"}],4),Bu=(Sn([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Sn([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Du=(Sn([{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"}]),Sn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4));L=Sn([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Ru(t,e,r,i,n){var o,a,s=8*n-i-1,u=(1<<s)-1,l=u>>1,c=-7,p=r?n-1:0,h=r?-1:1;r=t[e+p];for(p+=h,o=r&(1<<-c)-1,r>>=-c,c+=s;0<c;o=256*o+t[e+p],p+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=i;0<c;a=256*a+t[e+p],p+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(r?-1:1);a+=Math.pow(2,i),o-=l}return(r?-1:1)*a*Math.pow(2,o-i)}function Ou(t,e,r,i,n,o){var a,s,u=8*o-n-1,l=(1<<u)-1,c=l>>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:o-1,f=i?1:-1;o=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(i=Math.pow(2,-a))<1&&(a--,i*=2),2<=(e+=1<=a+c?p/i:p*Math.pow(2,1-c))*i&&(a++,i/=2),l<=a+c?(s=0,a=l):1<=a+c?(s=(e*i-1)*Math.pow(2,n),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;t[r+h]=255&s,h+=f,s/=256,n-=8);for(a=a<<n|s,u+=n;0<u;t[r+h]=255&a,h+=f,a/=256,u-=8);t[r+h-f]|=128*o}Sn([{name:"triangle",components:3,type:"Uint16"}]),Sn([{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"}]),Sn([{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"}]),Sn([{type:"Float32",name:"offsetX"}]),Sn([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Fu={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},ju=Uu;function Uu(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Uu.Varint=0,Uu.Fixed64=1,Uu.Bytes=2,Uu.Fixed32=5;var Nu="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Vu(t){return t.type===Uu.Bytes?t.readVarint()+t.pos:t.pos+1}function qu(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Gu(t,e,r){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;t<=n;n--)r.buf[n+i]=r.buf[n]}function Hu(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function Zu(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function Wu(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function Xu(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function Ku(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function Ju(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function Yu(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function Qu(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function $u(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function tl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function el(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function rl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function il(t,e,r){1===t&&r.readMessage(nl,e)}function nl(t,e,r){var i,n,o,a;3===t&&(n=(i=r.readMessage(ol,{})).width,o=i.height,a=i.left,t=i.top,r=i.advance,e.push({id:i.id,bitmap:new ys({width:n+6,height:o+6},i.bitmap),metrics:{width:n,height:o,left:a,top:t,advance:r}}))}function ol(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}function al(t){for(var e=0,r=0,i=0,n=t;i<n.length;i+=1){var o=n[i];e+=o.w*o.h,r=Math.max(r,o.w)}t.sort((function(t,e){return e.h-t.h}));for(var a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],s=0,u=0,l=0,c=t;l<c.length;l+=1)for(var p=c[l],h=a.length-1;0<=h;h--){var f,d=a[h];if(!(p.w>d.w||p.h>d.h)){p.x=d.x,p.y=d.y,u=Math.max(u,p.y+p.h),s=Math.max(s,p.x+p.w),p.w===d.w&&p.h===d.h?(f=a.pop(),h<a.length&&(a[h]=f)):p.h===d.h?(d.x+=p.w,d.w-=p.w):(p.w===d.w||a.push({x:d.x+p.w,y:d.y,w:d.w-p.w,h:p.h}),d.y+=p.h,d.h-=p.h);break}}return{w:s,h:u,fill:e/(s*u)||0}}function sl(t,e){var r=e.pixelRatio,i=e.version,n=e.stretchX,o=e.stretchY;e=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=n,this.stretchY=o,this.content=e,this.version=i}function ul(){this.scale=1,this.fontStack="",this.imageName=null}Uu.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var i=this.readVarint(),n=i>>3,o=this.pos;this.type=7&i,t(n,e,this),this.pos===o&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=tl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=rl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=tl(this.buf,this.pos)+4294967296*tl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=tl(this.buf,this.pos)+4294967296*rl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Ru(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ru(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r=this.buf,i=127&(e=r[this.pos++]);return e<128?i:(i|=(127&(e=r[this.pos++]))<<7,e<128?i:(i|=(127&(e=r[this.pos++]))<<14,e<128?i:(i|=(127&(e=r[this.pos++]))<<21,e<128?i:function(t,e,r){var i,n=r.buf,o=(112&(i=n[r.pos++]))>>4;if(i<128)return qu(t,o,e);if(o|=(127&(i=n[r.pos++]))<<3,i<128)return qu(t,o,e);if(o|=(127&(i=n[r.pos++]))<<10,i<128)return qu(t,o,e);if(o|=(127&(i=n[r.pos++]))<<17,i<128)return qu(t,o,e);if(o|=(127&(i=n[r.pos++]))<<24,i<128)return qu(t,o,e);if(o|=(1&(i=n[r.pos++]))<<31,i<128)return qu(t,o,e);throw new Error("Expected varint not more than 10 bytes")}(i|=(15&r[this.pos])<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t,e=this.readVarint()+this.pos,r=this.pos;return 12<=(this.pos=e)-r&&Nu?(t=this.buf,Nu.decode(t.subarray(r,e))):function(t,e){for(var i="",n=r;n<e;){var o,a,s,u=t[n],l=null,c=239<u?4:223<u?3:191<u?2:1;if(e<n+c)break;1===c?u<128&&(l=u):2===c?128==(192&(o=t[n+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===c?(a=t[n+2],128==(192&(o=t[n+1]))&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||55296<=l&&l<=57343)&&(l=null)):4===c&&(a=t[n+2],s=t[n+3],128==(192&(o=t[n+1]))&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||1114112<=l)&&(l=null)),null===l?(l=65533,c=1):65535<l&&(l-=65536,i+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),i+=String.fromCharCode(l),n+=c}return i}(this.buf,e)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Uu.Bytes)return t.push(this.readVarint(e));var r=Vu(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Uu.Bytes)return t.push(this.readSVarint());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Uu.Bytes)return t.push(this.readBoolean());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Uu.Bytes)return t.push(this.readFloat());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Uu.Bytes)return t.push(this.readDouble());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Uu.Bytes)return t.push(this.readFixed32());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Uu.Bytes)return t.push(this.readSFixed32());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Uu.Bytes)return t.push(this.readFixed64());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Uu.Bytes)return t.push(this.readSFixed64());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){if((t&=7)===Uu.Varint)for(;127<this.buf[this.pos++];);else if(t===Uu.Bytes)this.pos=this.readVarint()+this.pos;else if(t===Uu.Fixed32)this.pos+=4;else{if(t!==Uu.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e,r=this.length||16;r<this.pos+t;)r*=2;r!==this.length&&((e=new Uint8Array(r)).set(this.buf),this.buf=e,this.length=r)},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),el(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),el(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),el(this.buf,-1&t,this.pos),el(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),el(this.buf,-1&t,this.pos),el(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){268435455<(t=+t||0)||t<0?function(e){var r,i,n;if(0<=t?(n=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:r=r+1|(n=0)),0x10000000000000000<=t||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),i=n,(n=e).buf[n.pos++]=127&i|128,i>>>=7,n.buf[n.pos++]=127&i|128,i>>>=7,n.buf[n.pos++]=127&i|128,i>>>=7,n.buf[n.pos++]=127&i|128,n.buf[n.pos]=127&(i>>>=7),r=(7&(i=r))<<4,(e=e).buf[e.pos++]|=r|((i>>>=3)?128:0),i&&(e.buf[e.pos++]=127&i|((i>>>=7)?128:0),i&&(e.buf[e.pos++]=127&i|((i>>>=7)?128:0),i&&(e.buf[e.pos++]=127&i|((i>>>=7)?128:0),i&&(e.buf[e.pos++]=127&i|((i>>>=7)?128:0),i&&(e.buf[e.pos++]=127&i)))))}(this):(this.realloc(4),this.buf[this.pos++]=127&t|(127<t?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(127<t?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(127<t?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var i,n,o=0;o<e.length;o++){if(55295<(i=e.charCodeAt(o))&&i<57344){if(!n){56319<i||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):n=i;continue}if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,n=i;continue}i=n-55296<<10|i-56320|65536,n=null}else n&&(t[r++]=239,t[r++]=191,t[r++]=189,n=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=63&i|128)}return r}(this.buf,t,this.pos),128<=(t=this.pos-e)&&Gu(e,t,this),this.pos=e-1,this.writeVarint(t),this.pos+=t},writeFloat:function(t){this.realloc(4),Ou(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Ou(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this),128<=(e=this.pos-r)&&Gu(r,e,this),this.pos=r-1,this.writeVarint(e),this.pos+=e},writeMessage:function(t,e,r){this.writeTag(t,Uu.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Hu,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Zu,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Ku,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Wu,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Xu,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Ju,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Yu,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Qu,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,$u,e)},writeBytesField:function(t,e){this.writeTag(t,Uu.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Uu.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Uu.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Uu.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Uu.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Uu.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Uu.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Uu.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Uu.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Uu.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}},(dn={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}}).tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},dn.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},dn.tlbr.get=function(){return this.tl.concat(this.br)},dn.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(sl.prototype,dn),(yn=function(t,e){var r={},i={};this.haveRenderCallbacks=[];var n=[];this.addImages(t,r,n),this.addImages(e,i,n);var o,a,s=new gs({width:(n=al(n)).w||1,height:n.h||1});for(o in t){var u=t[o],l=r[o].paddedRect;gs.copy(u.data,s,{x:0,y:0},{x:l.x+1,y:l.y+1},u.data)}for(a in e){var c=e[a],p=(d=i[a].paddedRect).x+1,h=d.y+1,f=c.data.width,d=c.data.height;gs.copy(c.data,s,{x:0,y:0},{x:p,y:h},c.data),gs.copy(c.data,s,{x:0,y:d-1},{x:p,y:h-1},{width:f,height:1}),gs.copy(c.data,s,{x:0,y:0},{x:p,y:h+d},{width:f,height:1}),gs.copy(c.data,s,{x:f-1,y:0},{x:p-1,y:h},{width:1,height:d}),gs.copy(c.data,s,{x:0,y:0},{x:p+f,y:h},{width:1,height:d})}this.image=s,this.iconPositions=r,this.patternPositions=i}).prototype.addImages=function(t,e,r){for(var i in t){var n=t[i],o={x:0,y:0,w:n.data.width+2,h:n.data.height+2};r.push(o),e[i]=new sl(o,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(i)}},yn.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},yn.prototype.patchUpdatedImage=function(t,e,r){t&&e&&t.version!==e.version&&(t.version=e.version,t=t.tl,r.update(e.data,void 0,{x:t[0],y:t[1]}))},Oi("ImagePosition",sl),Oi("ImageAtlas",yn);var ll={horizontal:1,vertical:2,horizontalOnly:3};function cl(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}function pl(t,e,r,i,n,o,a,s,u,l,c,p,h,f,d,m){var y,g=cl.fromFeature(t,n);if(p===ll.vertical&&g.verticalizePunctuation(),t=rn.processBidirectionalText,n=rn.processStyledBidirectionalText,t&&1===g.sections.length){y=[];for(var _=0,v=t(g.toString(),gl(g,l,o,e,i,f,d));_<v.length;_+=1){var x=v[_],b=new cl;b.text=x,b.sections=g.sections;for(var w=0;w<x.length;w++)b.sectionIndex.push(0);y.push(b)}}else if(n){y=[];for(var S=0,T=n(g.text,g.sectionIndex,gl(g,l,o,e,i,f,d));S<T.length;S+=1){var E=T[S],I=new cl;I.text=E[0],I.sectionIndex=E[1],I.sections=g.sections,y.push(I)}}else y=function(t,e){for(var r=[],i=t.text,n=0,o=0,a=e;o<a.length;o+=1){var s=a[o];r.push(t.substring(n,s)),n=s}return n<i.length&&r.push(t.substring(n,i.length)),r}(g,gl(g,l,o,e,i,f,d));var A=[];return function(t,e,r,i,n,o,a,s,l,c,p){for(var h=0,f=-17,d=0,m=0,y="right"===u?1:"left"===u?0:.5,g=0,_=0,v=n;_<v.length;_+=1){var x=v[_];x.trim();var b=x.getMaxScale(),w=24*(b-1),S={positionedGlyphs:[],lineOffset:0},T=(t.positionedLines[g]=S).positionedGlyphs,E=0;if(x.length()){for(var I=0;I<x.length();I++){var A=x.getSection(I),C=x.getSectionIndex(I),P=x.getCharCode(I),M=0,k=null,z=null,L=null,B=24,D=!(s===ll.horizontal||!c&&!Hi(P)||c&&(hl[P]||(D=P,qi.Arabic(D)||qi["Arabic Supplement"](D)||qi["Arabic Extended-A"](D)||qi["Arabic Presentation Forms-A"](D)||qi["Arabic Presentation Forms-B"](D))));if(A.imageName){var R=i[A.imageName];if(!R)continue;L=A.imageName,t.iconsInText=t.iconsInText||!0,z=R.paddedRect,R=R.displaySize,A.scale=24*A.scale/p,M=w+(24-R[1]*A.scale),B=(k={width:R[0],height:R[1],left:1,top:-3,advance:D?R[1]:R[0]}).advance,0<(R=D?R[0]*A.scale-24*b:R[1]*A.scale-24*b)&&E<R&&(E=R)}else{if((R=(R=r[A.fontStack])&&R[P])&&R.rect)z=R.rect,k=R.metrics;else{if(!(R=(R=e[A.fontStack])&&R[P]))continue;k=R.metrics}M=24*(b-A.scale)}D?(t.verticalizable=!0,T.push({glyph:P,imageName:L,x:h,y:f+M,vertical:D,scale:A.scale,fontStack:A.fontStack,sectionIndex:C,metrics:k,rect:z}),h+=B*A.scale+l):(T.push({glyph:P,imageName:L,x:h,y:f+M,vertical:D,scale:A.scale,fontStack:A.fontStack,sectionIndex:C,metrics:k,rect:z}),h+=k.advance*A.scale+l)}0!==T.length&&(d=Math.max(h-l,d),function(t,e,r,i,n){if(i||n)for(var o=t[r],a=(t[r].x+o.metrics.advance*o.scale)*i,s=0;s<=r;s++)t[s].x-=a,t[s].y+=n}(T,0,T.length-1,y,E)),h=0;var O=o*b+E;S.lineOffset=Math.max(E,w),f+=O,m=Math.max(O,m),++g}else f+=o,++g}var F=f- -17,j=(a=_l(a)).horizontalAlign,U=a.verticalAlign;(function(t,e){for(var r=(y-j)*d,i=m!==o?-F*U+17:(-U*e+.5)*o,n=0,a=t;n<a.length;n+=1)for(var s=0,u=a[n].positionedGlyphs;s<u.length;s+=1){var l=u[s];l.x+=r,l.y+=i}})(t.positionedLines,n.length),t.top+=-U*F,t.bottom=t.top+F,t.left+=-j*d,t.right=t.left+d}(c={positionedLines:A,text:g.toString(),top:c[1],bottom:c[1],left:c[0],right:c[0],writingMode:p,iconsInText:!1,verticalizable:!1},e,r,i,y,a,s,p,l,h,m),!function(){for(var t=0,e=A;t<e.length;t+=1)if(0!==e[t].positionedGlyphs.length)return;return 1}()&&c}ul.forText=function(t,e){var r=new ul;return r.scale=t||1,r.fontStack=e,r},ul.forImage=function(t){var e=new ul;return e.imageName=t,e},cl.fromFeature=function(t,e){for(var r=new cl,i=0;i<t.sections.length;i++){var n=t.sections[i];n.image?r.addImageSection(n):r.addTextSection(n,e)}return r},cl.prototype.length=function(){return this.text.length},cl.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},cl.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},cl.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},cl.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",r=0;r<t.length;r++){var i=t.charCodeAt(r+1)||null,n=t.charCodeAt(r-1)||null;e+=i&&Zi(i)&&!Fu[t[r+1]]||n&&Zi(n)&&!Fu[t[r-1]]||!Fu[t[r]]?t[r]:Fu[t[r]]}return e}(this.text)},cl.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&hl[this.text.charCodeAt(e)];e++)t++;for(var r=this.text.length,i=this.text.length-1;0<=i&&t<=i&&hl[this.text.charCodeAt(i)];i--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},cl.prototype.substring=function(t,e){var r=new cl;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},cl.prototype.toString=function(){return this.text},cl.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},cl.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(ul.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,i=0;i<t.text.length;++i)this.sectionIndex.push(r)},cl.prototype.addImageSection=function(t){var e=t.image?t.image.name:"";0!==e.length?(t=this.getNextImageSectionCharCode())?(this.text+=String.fromCharCode(t),this.sections.push(ul.forImage(e)),this.sectionIndex.push(this.sections.length-1)):w("Reached maximum number of images 6401"):w("Can't add FormattedSection with an empty image.")},cl.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?63743<=this.imageSectionID?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var hl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},fl={};function dl(t,e,r,i,n,o){return e.imageName?(i=i[e.imageName])?i.displaySize[0]*e.scale*24/o+n:0:(t=(r=r[e.fontStack])&&r[t])?t.metrics.advance*e.scale+n:0}function ml(t,e,r,i){var n=Math.pow(t-e,2);return i?t<e?n/2:2*n:n+Math.abs(r)*r}function yl(t,e,r,i,n,o){for(var a=null,s=ml(e,r,n,o),u=0,l=i;u<l.length;u+=1){var c=l[u],p=ml(e-c.x,r,n,o)+c.badness;p<=s&&(a=c,s=p)}return{index:t,x:e,priorBreak:a,badness:s}}function gl(t,e,r,i,n,o,a){if("point"!==o)return[];if(!t)return[];for(var s,u=[],l=function(t,e,r,i,n,o){for(var a=0,s=0;s<t.length();s++){var u=t.getSection(s);a+=dl(t.getCharCode(s),u,i,n,e,o)}return a/Math.max(1,Math.ceil(a/r))}(t,e,r,i,n,a),c=0<=t.text.indexOf("​"),p=0,h=0;h<t.length();h++){var f,d=t.getSection(h),m=t.getCharCode(h);hl[m]||(p+=dl(m,d,i,n,e,a)),h<t.length()-1&&(f=!((s=m)<11904||!(qi["Bopomofo Extended"](s)||qi.Bopomofo(s)||qi["CJK Compatibility Forms"](s)||qi["CJK Compatibility Ideographs"](s)||qi["CJK Compatibility"](s)||qi["CJK Radicals Supplement"](s)||qi["CJK Strokes"](s)||qi["CJK Symbols and Punctuation"](s)||qi["CJK Unified Ideographs Extension A"](s)||qi["CJK Unified Ideographs"](s)||qi["Enclosed CJK Letters and Months"](s)||qi["Halfwidth and Fullwidth Forms"](s)||qi.Hiragana(s)||qi["Ideographic Description Characters"](s)||qi["Kangxi Radicals"](s)||qi["Katakana Phonetic Extensions"](s)||qi.Katakana(s)||qi["Vertical Forms"](s)||qi["Yi Radicals"](s)||qi["Yi Syllables"](s))),(fl[m]||f||d.imageName)&&u.push(yl(h+1,p,l,u,(s=m,m=void 0,m=0,10===s&&(m-=1e4),f&&c&&(m+=150),40!==s&&65288!==s||(m+=50),41!==(d=t.getCharCode(h+1))&&65289!==d||(m+=50),m),!1)))}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(yl(t.length(),p,l,u,0,!0))}function _l(t){var e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function vl(t,e,r,i,n,o){var a;(t=t.image).content&&(l=t.content,c=t.pixelRatio||1,a=[l[0]/c,l[1]/c,t.displaySize[0]-l[2]/c,t.displaySize[1]-l[3]/c]);var s,u,l=e.left*o,c=e.right*o;l="width"===r||"both"===r?(u=n[0]+l-i[3],n[0]+c+i[1]):(u=n[0]+(l+c-t.displaySize[0])/2)+t.displaySize[0],c=e.top*o,o=e.bottom*o,o="height"===r||"both"===r?(s=n[1]+c-i[0],n[1]+o+i[2]):(s=n[1]+(c+o-t.displaySize[1])/2)+t.displaySize[1];return{image:t,top:s,right:l,bottom:o,left:u,collisionPadding:a}}fl[10]=!0,fl[32]=!0,fl[38]=!0,fl[40]=!0,fl[41]=!0,fl[43]=!0,fl[45]=!0,fl[47]=!0,fl[173]=!0,fl[183]=!0,fl[8203]=!0,fl[8208]=!0,fl[8211]=!0,fl[8231]=!0;var xl,bl=((xl=n)&&(wl.__proto__=xl),((wl.prototype=Object.create(xl&&xl.prototype)).constructor=wl).prototype.clone=function(){return new wl(this.x,this.y,this.angle,this.segment)},wl);function wl(t,e,r,i){xl.call(this,t,e),this.angle=r,void 0!==i&&(this.segment=i)}function Sl(t,e){var r=e.expression;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new tn(t+1))};if("source"===r.kind)return{kind:"source"};for(var i=r.zoomStops,n=r.interpolationType,o=0;o<i.length&&i[o]<=t;)o++;for(var a=o=Math.max(0,o-1);a<i.length&&i[a]<t+1;)a++;a=Math.min(i.length-1,a);var s=i[o];e=i[a];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:e,interpolationType:n}:{kind:"camera",minZoom:s,maxZoom:e,minSize:r.evaluate(new tn(s)),maxSize:r.evaluate(new tn(e)),interpolationType:n}}function Tl(t,e,r){var i=e.uSize,n=r.lowerSize;return"source"===t.kind?n/128:"composite"===t.kind?He(n/128,r.upperSize/128,e.uSizeT):i}function El(t,e){var r,i=0,n=0;return"constant"===t.kind?n=t.layoutSize:"source"!==t.kind&&(e=(r=t.interpolationType)?c(or.interpolationFactor(r,e,t.minZoom,t.maxZoom),0,1):0,"camera"===t.kind?n=He(t.minSize,t.maxSize,e):i=e),{uSizeT:i,uSize:n}}function Il(t,e,r,i,n){if(void 0===e.segment)return 1;for(var o=e,a=e.segment+1,s=0;-r/2<s;){if(--a<0)return;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var u=[],l=0;s<r/2;){var c=t[a],p=t[a+1];if(!p)return;var h=t[a-1].angleTo(c)-c.angleTo(p);h=Math.abs((h+3*Math.PI)%(2*Math.PI)-Math.PI);for(u.push({distance:s,angleDelta:h}),l+=h;s-u[0].distance>i;)l-=u.shift().angleDelta;if(n<l)return;a++,s+=c.dist(p)}return 1}function Al(t){for(var e=0,r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function Cl(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Pl(t,e,r,i,o){for(var a=[],s=0;s<t.length;s++)for(var u=t[s],l=void 0,c=0;c<u.length-1;c++){var p=u[c],h=u[c+1];p.x<e&&h.x<e||(p.x<e?p=new n(e,p.y+(e-p.x)/(h.x-p.x)*(h.y-p.y))._round():h.x<e&&(h=new n(e,p.y+(e-p.x)/(h.x-p.x)*(h.y-p.y))._round()),p.y<r&&h.y<r||(p.y<r?p=new n(p.x+(r-p.y)/(h.y-p.y)*(h.x-p.x),r)._round():h.y<r&&(h=new n(p.x+(r-p.y)/(h.y-p.y)*(h.x-p.x),r)._round()),p.x>=i&&h.x>=i||(p.x>=i?p=new n(i,p.y+(i-p.x)/(h.x-p.x)*(h.y-p.y))._round():h.x>=i&&(h=new n(i,p.y+(i-p.x)/(h.x-p.x)*(h.y-p.y))._round()),p.y>=o&&h.y>=o||(p.y>=o?p=new n(p.x+(o-p.y)/(h.y-p.y)*(h.x-p.x),o)._round():h.y>=o&&(h=new n(p.x+(o-p.y)/(h.y-p.y)*(h.x-p.x),o)._round()),l&&p.equals(l[l.length-1])||a.push(l=[p]),l.push(h)))))}return a}function Ml(t,e,r,i){var o=[],a=t.image,s=a.pixelRatio,u=a.paddedRect.w-2,l=a.paddedRect.h-2,c=t.right-t.left,p=t.bottom-t.top,h=a.stretchX||[[0,u]],f=a.stretchY||[[0,l]],d=function(t,e){return t+e[1]-e[0]},m=h.reduce(d,0),y=f.reduce(d,0),g=u-m,_=l-y,v=0,x=m,b=0,w=y,S=0,T=g,E=0,I=_;function A(i,o,u,l){var h=(i.stretch-v)/x*c+t.left,f=i.fixed-S-T*i.stretch/m,d=(o.stretch-b)/w*p+t.top,g=o.fixed-E-I*o.stretch/y,_=(u.stretch-v)/x*c+t.left,A=u.fixed-S-T*u.stretch/m,C=(l.stretch-b)/w*p+t.top,P=l.fixed-E-I*l.stretch/y,M=new n(h,d);d=new n(_,d),_=new n(_,C),C=new n(h,C),f=new n(f/s,g/s),g=new n(A/s,P/s);return(A=e*Math.PI/180)&&(P=Math.sin(A),A=[A=Math.cos(A),-P,P,A],M._matMult(A),d._matMult(A),C._matMult(A),_._matMult(A)),i=i.stretch+i.fixed,o=o.stretch+o.fixed,{tl:M,tr:d,bl:C,br:_,tex:{x:a.paddedRect.x+1+i,y:a.paddedRect.y+1+o,w:u.stretch+u.fixed-i,h:l.stretch+l.fixed-o},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:f,pixelOffsetBR:g,minFontScaleX:T/s/c,minFontScaleY:I/s/p,isSDF:r}}if(a.content&&i&&(d=a.content,v=kl(h,0,d[0]),b=kl(f,0,d[1]),x=kl(h,d[0],d[2]),w=kl(f,d[1],d[3]),S=d[0]-v,E=d[1]-b,T=d[2]-d[0]-x,I=d[3]-d[1]-w),i&&(a.stretchX||a.stretchY))for(var C=zl(h,g,m),P=zl(f,_,y),M=0;M<C.length-1;M++)for(var k=C[M],z=C[M+1],L=0;L<P.length-1;L++)o.push(A(k,P[L],z,P[L+1]));else o.push(A({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:1+u},{fixed:0,stretch:1+l}));return o}function kl(t,e,r){for(var i=0,n=0,o=t;n<o.length;n+=1){var a=o[n];i+=Math.max(e,Math.min(r,a[1]))-Math.max(e,Math.min(r,a[0]))}return i}function zl(t,e,r){for(var i=[{fixed:-1,stretch:0}],n=0,o=t;n<o.length;n+=1){var a=(u=o[n])[0],s=u[1],u=i[i.length-1];i.push({fixed:a-u.stretch,stretch:u.stretch}),i.push({fixed:a-u.stretch,stretch:u.stretch+(s-a)})}return i.push({fixed:e+1,stretch:r}),i}function Ll(t,e,r,i,o,a,s,u,l,c){var p,h,f,d;this.boxStartIndex=t.length,l?(f=a.top,h=a.bottom,(p=a.collisionPadding)&&(f-=p[1],h+=p[3]),0<(d=h-f)&&(d=Math.max(10,d),this.circleDiameter=d)):(l=a.top*s-u,p=a.bottom*s+u,h=a.left*s-u,f=a.right*s+u,(d=a.collisionPadding)&&(h-=d[0]*s,l-=d[1]*s,f+=d[2]*s,p+=d[3]*s),c&&(u=new n(h,l),a=new n(f,l),d=new n(h,p),s=new n(f,p),c=c*Math.PI/180,u._rotate(c),a._rotate(c),d._rotate(c),s._rotate(c),h=Math.min(u.x,a.x,d.x,s.x),f=Math.max(u.x,a.x,d.x,s.x),l=Math.min(u.y,a.y,d.y,s.y),p=Math.max(u.y,a.y,d.y,s.y)),t.emplaceBack(e.x,e.y,h,l,f,p,r,i,o)),this.boxEndIndex=t.length}Oi("Anchor",bl),et=Object.freeze({__proto__:null,getSizeData:Sl,evaluateSizeForFeature:Tl,evaluateSizeForZoom:El,SIZE_PACK_FACTOR:128});var Bl=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=Dl),this.data=t,this.length=this.data.length,this.compare=e,0<this.length)for(var r=(this.length>>1)-1;0<=r;r--)this._down(r)};function Dl(t,e){return t<e?-1:e<t?1:0}function Rl(t,e){return e.max-t.max}function Ol(t,e,r,i){this.p=new n(t,e),this.h=r,this.d=function(t,e){for(var r=!1,i=1/0,n=0;n<e.length;n++)for(var o=e[n],a=0,s=o.length,u=s-1;a<s;u=a++){var l=o[a],c=o[u];l.y>t.y!=c.y>t.y&&t.x<(c.x-l.x)*(t.y-l.y)/(c.y-l.y)+l.x&&(r=!r),i=Math.min(i,Ja(t,l,c))}return(r?1:-1)*Math.sqrt(i)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}Bl.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},Bl.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,0<this.length&&(this.data[0]=e,this._down(0)),t}},Bl.prototype.peek=function(){return this.data[0]},Bl.prototype._up=function(t){for(var e=this.data,r=this.compare,i=e[t];0<t;){var n=t-1>>1,o=e[n];if(0<=r(i,o))break;e[t]=o,t=n}e[t]=i},Bl.prototype._down=function(t){for(var e=this.data,r=this.compare,i=this.length>>1,n=e[t];t<i;){var o=1+(t<<1),a=e[o],s=o+1;if(s<this.length&&r(e[s],a)<0&&(a=e[o=s]),0<=r(a,n))break;e[t]=a,t=o}e[t]=n};var Fl=Number.POSITIVE_INFINITY;function jl(t,e){return e[1]!==Fl?function(t,e,r){var i=0,n=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":n=r-7;break;case"bottom-right":case"bottom-left":case"bottom":n=7-r}switch(t){case"top-right":case"bottom-right":case"right":i=-e;break;case"top-left":case"bottom-left":case"left":i=e}return[i,n]}(t,e[0],e[1]):function(t,e){var r=0,i=0;e<0&&(e=0);var n=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":i=n-7;break;case"bottom-right":case"bottom-left":i=7-n;break;case"bottom":i=7-e;break;case"top":i=e-7}switch(t){case"top-right":case"bottom-right":r=-n;break;case"top-left":case"bottom-left":r=n;break;case"left":r=e;break;case"right":r=-e}return[r,i]}(t,e[0])}function Ul(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Nl(t,e,r,i,o,a,s,u,l,c,p,h,f,d,m){var y=function(t,e,r,i,a,s){for(var u=o.layout.get("text-rotate").evaluate(i,{})*Math.PI/180,l=[],c=0,p=t.positionedLines;c<p.length;c+=1)for(var h=p[c],f=0,d=h.positionedGlyphs;f<d.length;f+=1){var m,y,g,_,v,x,b,w,S,T,E,I,A,C=d[f];C.rect&&(m=C.rect||{},b=4,y=!0,_=1,v=0,S=(r||s)&&C.vertical,T=C.metrics.advance*C.scale/2,s&&t.verticalizable&&(v=h.lineOffset/2-(C.imageName?-(24-C.metrics.width*C.scale)/2:24*(C.scale-1))),C.imageName&&(y=(x=a[C.imageName]).sdf,b=1/(_=x.pixelRatio)),g=r?[C.x+T,C.y]:[0,0],w=r?[0,0]:[C.x+T+e[0],C.y+e[1]-v],E=[0,0],S&&(E=w,w=[0,0]),x=(C.metrics.left-b)*C.scale-T+w[0],v=(-C.metrics.top-b)*C.scale+w[1],b=x+m.w*C.scale/_,w=v+m.h*C.scale/_,_=new n(x,v),v=new n(b,v),x=new n(x,w),b=new n(b,w),S&&(w=new n(-T,T+17),S=-Math.PI/2,T=new n(22-(T=12-T),-(C.imageName?T:0)),E=new(Function.prototype.bind.apply(n,[null].concat(E))),_._rotateAround(S,w)._add(T)._add(E),v._rotateAround(S,w)._add(T)._add(E),x._rotateAround(S,w)._add(T)._add(E),b._rotateAround(S,w)._add(T)._add(E)),u&&(A=Math.sin(u),A=[I=Math.cos(u),-A,A,I],_._matMult(A),v._matMult(A),x._matMult(A),b._matMult(A)),I=new n(0,0),A=new n(0,0),l.push({tl:_,tr:v,bl:x,br:b,tex:m,writingMode:t.writingMode,glyphOffset:g,sectionIndex:C.sectionIndex,isSDF:y,pixelOffsetTL:I,pixelOffsetBR:A,minFontScaleX:0,minFontScaleY:0}))}return l}(r,u,a,s,i,t.allowVerticalPlacement);i=null;"source"===(r=t.textSizeData).kind?32640<(i=[128*o.layout.get("text-size").evaluate(s,{})])[0]&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===r.kind&&(32640<(i=[128*d.compositeTextSizes[0].evaluate(s,{},m),128*d.compositeTextSizes[1].evaluate(s,{},m)])[0]||32640<i[1])&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,y,i,u,a,s,c,e,l.lineStartIndex,l.lineLength,f,m);for(var g=0,_=p;g<_.length;g+=1)h[_[g]]=t.text.placedSymbolArray.length-1;return 4*y.length}function Vl(t){for(var e in t)return t[e];return null}var ql=lu.VectorTileFeature.types,Gl=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Hl(t,e,r,i,n,o,a,s,u,l,c,p,h){var f=s?Math.min(32640,Math.round(s[0])):0;s=s?Math.min(32640,Math.round(s[1])):0;t.emplaceBack(e,r,Math.round(32*i),Math.round(32*n),o,a,(f<<1)+(u?1:0),s,16*l,16*c,256*p,256*h)}function Zl(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}function Wl(t){for(var e=0,r=t.sections;e<r.length;e+=1)if(function(t){for(var e=0,r=t;e<r.length;e+=1)if(Wi(r[e].charCodeAt(0)))return 1}(r[e].text))return 1}function Xl(t){this.layoutVertexArray=new Gn,this.indexArray=new fo,this.programConfigurations=t,this.segments=new ra,this.dynamicLayoutVertexArray=new Wn,this.opacityVertexArray=new Yn,this.placedSymbolArray=new Uo}function Kl(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new ra,this.collisionVertexArray=new so}function Jl(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=ns([]),this.placementViewportMatrix=ns([]);var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Sl(this.zoom,e["text-size"]),this.iconSizeData=Sl(this.zoom,e["icon-size"]);var r=this.layers[0].layout,i=r.get("symbol-sort-key");e=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="viewport-y"!==e&&!i.isConstant(),this.sortFeaturesByY=("viewport-y"===e||"auto"===e&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((function(t){return ll[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID}function Yl(t){this.type=t.property.overrides?t.property.overrides.runtimeType:qt,this.defaultValue=t}Xl.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},Xl.prototype.upload=function(t,e,r,i){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,zu.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Lu.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,Gl,!0),this.opacityVertexBuffer.itemSize=1),(r||i)&&this.programConfigurations.upload(t))},Xl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Oi("SymbolBuffers",Xl),Kl.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Bu.members,!0)},Kl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Oi("CollisionBuffers",Kl),Jl.prototype.createArrays=function(){this.text=new Xl(new Fa(this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new Xl(new Fa(this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.glyphOffsetArray=new Wo,this.lineVertexArray=new Jo,this.symbolInstances=new Go},Jl.prototype.calculateGlyphDependencies=function(t,e,r,i,n){for(var o,a=0;a<t.length;a++)e[t.charCodeAt(a)]=!0,(r||i)&&n&&(o=Fu[t.charAt(a)])&&(e[o.charCodeAt(0)]=!0)},Jl.prototype.populate=function(t,e,r){var i=this.layers[0],n=i.layout,o=n.get("text-font"),a=n.get("text-field"),s=n.get("icon-image"),u=("constant"!==a.value.kind||a.value.value instanceof le&&!a.value.value.isEmpty()||0<a.value.value.toString().length)&&("constant"!==o.value.kind||0<o.value.value.length),l="constant"!==s.value.kind||!!s.value.value||0<Object.keys(s.parameters).length,c=n.get("symbol-sort-key");if(this.features=[],u||l){for(var p=e.iconDependencies,h=e.glyphDependencies,f=e.availableImages,d=new tn(this.zoom),m=0,y=t;m<y.length;m+=1){var g=(w=y[m]).feature,_=w.id,v=w.index,x=w.sourceLayerIndex,b=i._featureFilter.needGeometry,w=qa(g,b);if(i._featureFilter.filter(d,w,r)){b||(w.geometry=Va(g));var S=void 0;u&&(T=i.getValueAndResolveTokens("text-field",w,r,f),Wl(T=le.factory(T))&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===Ji||this.hasRTLText&&rn.isParsed())&&(S=function(t,e,r){return t.sections.forEach((function(t){t.text=function(t,r){return"uppercase"===(r=e.layout.get("text-transform").evaluate(r,{}))?t=t.toLocaleUpperCase():"lowercase"===r&&(t=t.toLocaleLowerCase()),rn.applyArabicShaping&&(t=rn.applyArabicShaping(t)),t}(t.text,r)})),t}(T,i,w)));var T=void 0;if(l&&(T=(E=i.getValueAndResolveTokens("icon-image",w,r,f))instanceof ce?E:ce.fromString(E)),S||T){var E=this.sortFeaturesByKey?c.evaluate(w,{},r):void 0;if(this.features.push({id:_,text:S,icon:T,index:v,sourceLayerIndex:x,geometry:w.geometry,properties:g.properties,type:ql[g.type],sortKey:E}),T&&(p[T.name]=!0),S){var I=o.evaluate(w,{},r).join(","),A="map"===n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&0<=this.writingModes.indexOf(ll.vertical);for(var C=0,P=S.sections;C<P.length;C+=1){var M,k,z=P[C];z.image?p[z.image.name]=!0:(M=Gi(S.toString()),k=h[k=z.fontStack||I]=h[k]||{},this.calculateGlyphDependencies(z.text,k,A,this.allowVerticalPlacement,M))}}}}}"line"===n.get("symbol-placement")&&(this.features=function(t){var e={},r={},i=[],n=0;function o(e){i.push(t[e]),n++}function a(t,e,n){var o=r[t];return delete r[t],r[e]=o,i[o].geometry[0].pop(),i[o].geometry[0]=i[o].geometry[0].concat(n[0]),o}function s(t,r,n){var o=e[r];return delete e[r],e[t]=o,i[o].geometry[0].shift(),i[o].geometry[0]=n[0].concat(i[o].geometry[0]),o}function u(t,e,r){return t+":"+(e=r?e[0][e[0].length-1]:e[0][0]).x+":"+e.y}for(var l=0;l<t.length;l++){var c,p,h,f=t[l],d=f.geometry,m=f.text?f.text.toString():null;m?(c=u(m,d),p=u(m,d,!0),c in r&&p in e&&r[c]!==e[p]?(h=s(c,p,d),f=a(c,p,i[h].geometry),delete e[c],delete r[p],r[u(m,i[f].geometry,!0)]=f,i[h].geometry=null):c in r?a(c,p,d):p in e?s(c,p,d):(o(l),e[c]=n-1,r[p]=n-1)):o(l)}return i.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}))}},Jl.prototype.update=function(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r))},Jl.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},Jl.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Jl.prototype.upload=function(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},Jl.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},Jl.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},Jl.prototype.addToLineVertexArray=function(t,e){var r=this.lineVertexArray.length;if(void 0!==t.segment){for(var i=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]),o={},a=t.segment+1;a<e.length;a++)o[a]={x:e[a].x,y:e[a].y,tileUnitDistanceFromAnchor:i},a<e.length-1&&(i+=e[a+1].dist(e[a]));for(var s=t.segment||0;0<=s;s--)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:n},0<s&&(n+=e[s-1].dist(e[s]));for(var u=0;u<e.length;u++){var l=o[u];this.lineVertexArray.emplaceBack(l.x,l.y,l.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},Jl.prototype.addSymbols=function(t,e,r,i,n,o,a,s,u,l,c,p){for(var h=t.indexArray,f=t.layoutVertexArray,d=t.segments.prepareSegment(4*e.length,f,h,this.canOverlap?o.sortKey:void 0),m=this.glyphOffsetArray.length,y=d.vertexLength,g=this.allowVerticalPlacement&&a===ll.vertical?Math.PI/2:0,_=o.text&&o.text.sections,v=0;v<e.length;v++){var x=(L=e[v]).tl,b=L.tr,w=L.bl,S=L.br,T=L.tex,E=L.pixelOffsetTL,I=L.pixelOffsetBR,A=L.minFontScaleX,C=L.minFontScaleY,P=L.glyphOffset,M=L.isSDF,k=L.sectionIndex,z=d.vertexLength,L=P[1];Hl(f,s.x,s.y,x.x,L+x.y,T.x,T.y,r,M,E.x,E.y,A,C),Hl(f,s.x,s.y,b.x,L+b.y,T.x+T.w,T.y,r,M,I.x,E.y,A,C),Hl(f,s.x,s.y,w.x,L+w.y,T.x,T.y+T.h,r,M,E.x,I.y,A,C),Hl(f,s.x,s.y,S.x,L+S.y,T.x+T.w,T.y+T.h,r,M,I.x,I.y,A,C),Zl(t.dynamicLayoutVertexArray,s,g),h.emplaceBack(z,z+1,z+2),h.emplaceBack(z+1,z+2,z+3),d.vertexLength+=4,d.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(P[0]),v!==e.length-1&&k===e[v+1].sectionIndex||t.programConfigurations.populatePaintArrays(f.length,o,o.index,{},p,_&&_[k])}t.placedSymbolArray.emplaceBack(s.x,s.y,m,this.glyphOffsetArray.length-m,y,u,l,s.segment,r?r[0]:0,r?r[1]:0,i[0],i[1],a,0,!1,0,c)},Jl.prototype._addCollisionDebugVertex=function(t,e,r,i,n,o){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,i,n,Math.round(o.x),Math.round(o.y))},Jl.prototype.addCollisionDebugVertices=function(t,e,r,i,o,a,s){var u=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),l=u.vertexLength,c=o.layoutVertexArray,p=o.collisionVertexArray,h=s.anchorX;s=s.anchorY;this._addCollisionDebugVertex(c,p,a,h,s,new n(t,e)),this._addCollisionDebugVertex(c,p,a,h,s,new n(r,e)),this._addCollisionDebugVertex(c,p,a,h,s,new n(r,i)),this._addCollisionDebugVertex(c,p,a,h,s,new n(t,i)),u.vertexLength+=4,(o=o.indexArray).emplaceBack(l,l+1),o.emplaceBack(l+1,l+2),o.emplaceBack(l+2,l+3),o.emplaceBack(l+3,l),u.primitiveLength+=4},Jl.prototype.addDebugCollisionBoxes=function(t,e,r,i){for(var n=t;n<e;n++){var o=this.collisionBoxArray.get(n);this.addCollisionDebugVertices(o.x1,o.y1,o.x2,o.y2,i?this.textCollisionBox:this.iconCollisionBox,o.anchorPoint,r)}},Jl.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Kl(eo,Du.members,Co),this.iconCollisionBox=new Kl(eo,Du.members,Co);for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}},Jl.prototype._deserializeCollisionBoxesForSymbol=function(t,e,r,i,n,o,a,s,u){for(var l={},c=e;c<r;c++){var p=t.get(c);l.textBox={x1:p.x1,y1:p.y1,x2:p.x2,y2:p.y2,anchorPointX:p.anchorPointX,anchorPointY:p.anchorPointY},l.textFeatureIndex=p.featureIndex;break}for(var h=i;h<n;h++){var f=t.get(h);l.verticalTextBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},l.verticalTextFeatureIndex=f.featureIndex;break}for(var d=o;d<a;d++){var m=t.get(d);l.iconBox={x1:m.x1,y1:m.y1,x2:m.x2,y2:m.y2,anchorPointX:m.anchorPointX,anchorPointY:m.anchorPointY},l.iconFeatureIndex=m.featureIndex;break}for(var y=s;y<u;y++){var g=t.get(y);l.verticalIconBox={x1:g.x1,y1:g.y1,x2:g.x2,y2:g.y2,anchorPointX:g.anchorPointX,anchorPointY:g.anchorPointY},l.verticalIconFeatureIndex=g.featureIndex;break}return l},Jl.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},Jl.prototype.hasTextData=function(){return 0<this.text.segments.get().length},Jl.prototype.hasIconData=function(){return 0<this.icon.segments.get().length},Jl.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Jl.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&0<this.textCollisionBox.segments.get().length},Jl.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&0<this.iconCollisionBox.segments.get().length},Jl.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=(e=t.placedSymbolArray.get(e)).vertexStartIndex+4*e.numGlyphs,i=e.vertexStartIndex;i<r;i+=4)t.indexArray.emplaceBack(i,i+1,i+2),t.indexArray.emplaceBack(i+1,i+2,i+3)},Jl.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),r=Math.cos(t),i=[],n=[],o=[],a=0;a<this.symbolInstances.length;++a){o.push(a);var s=this.symbolInstances.get(a);i.push(0|Math.round(e*s.anchorX+r*s.anchorY)),n.push(s.featureIndex)}return o.sort((function(t,e){return i[t]-i[e]||n[e]-n[t]})),o},Jl.prototype.addToSortKeyRanges=function(t,e){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})},Jl.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(1<this.text.segments.get().length||1<this.icon.segments.get().length)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,i=this.symbolInstanceIndexes;r<i.length;r+=1){var n=this.symbolInstances.get(i[r]);this.featureSortOrder.push(n.featureIndex),[n.rightJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.leftJustifiedTextSymbolIndex].forEach((function(t,r,i){0<=t&&i.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),0<=n.verticalPlacedTextSymbolIndex&&this.addIndicesForPlacedSymbol(this.text,n.verticalPlacedTextSymbolIndex),0<=n.placedIconSymbolIndex&&this.addIndicesForPlacedSymbol(this.icon,n.placedIconSymbolIndex),0<=n.verticalPlacedIconSymbolIndex&&this.addIndicesForPlacedSymbol(this.icon,n.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Oi("SymbolBucket",Jl,{omit:["layers","collisionBoxArray","features","compareText"]}),Jl.MAX_GLYPHS=65535,Jl.addDynamicAttributes=Zl;dn=new gn({"symbol-placement":new hn(Lt.layout_symbol["symbol-placement"]),"symbol-spacing":new hn(Lt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new hn(Lt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new nc(Lt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new hn(Lt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new hn(Lt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new hn(Lt.layout_symbol["icon-ignore-placement"]),"icon-optional":new hn(Lt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new hn(Lt.layout_symbol["icon-rotation-alignment"]),"icon-size":new nc(Lt.layout_symbol["icon-size"]),"icon-text-fit":new hn(Lt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new hn(Lt.layout_symbol["icon-text-fit-padding"]),"icon-image":new nc(Lt.layout_symbol["icon-image"]),"icon-rotate":new nc(Lt.layout_symbol["icon-rotate"]),"icon-padding":new hn(Lt.layout_symbol["icon-padding"]),"icon-keep-upright":new hn(Lt.layout_symbol["icon-keep-upright"]),"icon-offset":new nc(Lt.layout_symbol["icon-offset"]),"icon-anchor":new nc(Lt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new hn(Lt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new hn(Lt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new hn(Lt.layout_symbol["text-rotation-alignment"]),"text-field":new nc(Lt.layout_symbol["text-field"]),"text-font":new nc(Lt.layout_symbol["text-font"]),"text-size":new nc(Lt.layout_symbol["text-size"]),"text-max-width":new nc(Lt.layout_symbol["text-max-width"]),"text-line-height":new hn(Lt.layout_symbol["text-line-height"]),"text-letter-spacing":new nc(Lt.layout_symbol["text-letter-spacing"]),"text-justify":new nc(Lt.layout_symbol["text-justify"]),"text-radial-offset":new nc(Lt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new hn(Lt.layout_symbol["text-variable-anchor"]),"text-anchor":new nc(Lt.layout_symbol["text-anchor"]),"text-max-angle":new hn(Lt.layout_symbol["text-max-angle"]),"text-writing-mode":new hn(Lt.layout_symbol["text-writing-mode"]),"text-rotate":new nc(Lt.layout_symbol["text-rotate"]),"text-padding":new hn(Lt.layout_symbol["text-padding"]),"text-keep-upright":new hn(Lt.layout_symbol["text-keep-upright"]),"text-transform":new nc(Lt.layout_symbol["text-transform"]),"text-offset":new nc(Lt.layout_symbol["text-offset"]),"text-allow-overlap":new hn(Lt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new hn(Lt.layout_symbol["text-ignore-placement"]),"text-optional":new hn(Lt.layout_symbol["text-optional"])});var Ql={paint:new gn({"icon-opacity":new nc(Lt.paint_symbol["icon-opacity"]),"icon-color":new nc(Lt.paint_symbol["icon-color"]),"icon-halo-color":new nc(Lt.paint_symbol["icon-halo-color"]),"icon-halo-width":new nc(Lt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new nc(Lt.paint_symbol["icon-halo-blur"]),"icon-translate":new hn(Lt.paint_symbol["icon-translate"]),"icon-translate-anchor":new hn(Lt.paint_symbol["icon-translate-anchor"]),"text-opacity":new nc(Lt.paint_symbol["text-opacity"]),"text-color":new nc(Lt.paint_symbol["text-color"],{runtimeType:Wt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new nc(Lt.paint_symbol["text-halo-color"]),"text-halo-width":new nc(Lt.paint_symbol["text-halo-width"]),"text-halo-blur":new nc(Lt.paint_symbol["text-halo-blur"]),"text-translate":new hn(Lt.paint_symbol["text-translate"]),"text-translate-anchor":new hn(Lt.paint_symbol["text-translate-anchor"])}),layout:dn};function $l(t,e,r,i){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,i)}Yl.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},Yl.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},Yl.prototype.outputDefined=function(){return!1},Yl.prototype.serialize=function(){return null},Oi("FormatSectionOverride",Yl,{omit:["defaultValue"]});var tc,ec,rc,ic,nc=((ic=vn)&&(_c.__proto__=ic),((_c.prototype=Object.create(ic&&ic.prototype)).constructor=_c).prototype.recalculate=function(t,e){if(ic.prototype.recalculate.call(this,t,e),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement"))if(e=this.layout.get("text-writing-mode")){for(var r=[],i=0,n=e;i<n.length;i+=1){var o=n[i];r.indexOf(o)<0&&r.push(o)}this.layout._values["text-writing-mode"]=r}else this.layout._values["text-writing-mode"]=["horizontal"];this._setPaintOverrides()},_c.prototype.getValueAndResolveTokens=function(t,e,r,i){var n;i=this.layout.get(t).evaluate(e,{},r,i);return(t=this._unevaluatedLayout._values[t]).isDataDriven()||Gr(t.value)||!i?i:(n=e.properties,i.replace(/{([^{}]+)}/g,(function(t,e){return e in n?String(n[e]):""})))},_c.prototype.createBucket=function(t){return new Jl(t)},_c.prototype.queryRadius=function(){return 0},_c.prototype.queryIntersectsFeature=function(){return!1},_c.prototype._setPaintOverrides=function(){for(var t=0,e=Ql.paint.overridableProperties;t<e.length;t+=1){var r,i,n=e[t];_c.hasPaintOverride(this.layout,n)&&(i=new Yl(r=this.paint.get(n)),i=new qr(i,r.property.specification),i="constant"===r.value.kind||"source"===r.value.kind?new Zr("source",i):new Wr("composite",i,r.value.zoomStops,r.value._interpolationType),this.paint._values[n]=new cn(r.property,i,r.parameters))}},_c.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!(!this.layout||e.isDataDriven()||r.isDataDriven())&&_c.hasPaintOverride(this.layout,t)},_c.hasPaintOverride=function(t,e){function r(t){for(var e=0,r=t;e<r.length;e+=1)if(n.overrides&&n.overrides.hasOverride(r[e]))return o=!0,0}t=t.get("text-field");var i,n=Ql.paint.properties[e],o=!1;return"constant"===t.value.kind&&t.value.value instanceof le?r(t.value.value.sections):"source"===t.value.kind&&(i=function(t){o||(t instanceof me&&fe(t.value)===Yt?r(t.value.sections):t instanceof ve?r(t.sections):t.eachChild(i))},(t=t.value)._styleExpression&&i(t._styleExpression.expression)),o},_c),oc={paint:new gn({"background-color":new hn(Lt.paint_background["background-color"]),"background-pattern":new sc(Lt.paint_background["background-pattern"]),"background-opacity":new hn(Lt.paint_background["background-opacity"])})},ac=(dn=((rc=vn)&&(gc.__proto__=rc),(gc.prototype=Object.create(rc&&rc.prototype)).constructor=gc),{paint:new gn({"raster-opacity":new hn(Lt.paint_raster["raster-opacity"]),"raster-hue-rotate":new hn(Lt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new hn(Lt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new hn(Lt.paint_raster["raster-brightness-max"]),"raster-saturation":new hn(Lt.paint_raster["raster-saturation"]),"raster-contrast":new hn(Lt.paint_raster["raster-contrast"]),"raster-resampling":new hn(Lt.paint_raster["raster-resampling"]),"raster-fade-duration":new hn(Lt.paint_raster["raster-fade-duration"])})}),sc=((ec=vn)&&(yc.__proto__=ec),(yc.prototype=Object.create(ec&&ec.prototype)).constructor=yc),uc=((tc=vn)&&(mc.__proto__=tc),((mc.prototype=Object.create(tc&&tc.prototype)).constructor=mc).prototype.is3D=function(){return"3d"===this.implementation.renderingMode},mc.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},mc.prototype.recalculate=function(){},mc.prototype.updateTransitions=function(){},mc.prototype.hasTransition=function(){},mc.prototype.serialize=function(){},mc.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},mc.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},mc),lc={circle:xr,heatmap:vr,hillshade:wr,fill:$s,"fill-extrusion":bn,line:br,symbol:nc,background:dn,raster:sc},cc=a.HTMLImageElement,pc=a.HTMLCanvasElement,hc=a.HTMLVideoElement,fc=a.ImageData,dc=a.ImageBitmap;function mc(t){tc.call(this,t,{}),this.implementation=t}function yc(t){ec.call(this,t,ac)}function gc(t){rc.call(this,t,oc)}function _c(t){ic.call(this,t,Ql)}function vc(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})}function xc(t,e,r){return[t*(r=2*Math.PI*6378137/256/Math.pow(2,r))-2*Math.PI*6378137/2,e*r-2*Math.PI*6378137/2]}function bc(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))}$l.prototype.update=function(t,e,r){var i=t.width,n=t.height,o=!(this.size&&this.size[0]===i&&this.size[1]===n||r),a=this.context,s=a.gl;this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),a.pixelStoreUnpackFlipY.set(!1),a.pixelStoreUnpack.set(1),a.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!e||!1!==e.premultiply)),o?(this.size=[i,n],t instanceof cc||t instanceof pc||t instanceof hc||t instanceof fc||dc&&t instanceof dc?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,i,n,0,this.format,s.UNSIGNED_BYTE,t.data)):(r=(o=r||{x:0,y:0}).x,o=o.y,t instanceof cc||t instanceof pc||t instanceof hc||t instanceof fc||dc&&t instanceof dc?s.texSubImage2D(s.TEXTURE_2D,0,r,o,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,r,o,i,n,s.RGBA,s.UNSIGNED_BYTE,t.data)),this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},$l.prototype.bind=function(t,e,r){var i=this.context.gl;i.bindTexture(i.TEXTURE_2D,this.texture),r!==i.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=i.LINEAR),t!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,e),this.wrap=e)},$l.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},$l.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null},vc.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){t._triggered=!1,t._callback()}),0))},vc.prototype.remove=function(){delete this._channel,this._callback=function(){}},($s=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},y(["receive","process"],this),this.invoker=new vc(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=T()?t:a}).prototype.send=function(t,e,r,i,n){var o=this;void 0===n&&(n=!1);var a=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[a]=r);var s=A(this.globalScope)?void 0:[];return this.target.postMessage({id:a,type:t,hasCallback:!!r,targetMapId:i,mustQueue:n,sourceMapId:this.mapId,data:Ui(e,s)},s),{cancel:function(){r&&delete o.callbacks[a],o.target.postMessage({id:a,type:"<cancel>",targetMapId:i,sourceMapId:o.mapId})}}},$s.prototype.receive=function(t){var e=t.data,r=e.id;!r||e.targetMapId&&this.mapId!==e.targetMapId||("<cancel>"===e.type?(delete this.tasks[r],t=this.cancelCallbacks[r],delete this.cancelCallbacks[r],t&&t()):T()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e))},$s.prototype.process=function(){var t,e;this.taskQueue.length&&(t=this.taskQueue.shift(),e=this.tasks[t],delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e))},$s.prototype.processTask=function(t,e){var r,i,n,o,a,s,u=this;"<response>"===e.type?(a=this.callbacks[t],delete this.callbacks[t],a&&(e.error?a(Ni(e.error)):a(null,Ni(e.data)))):(r=!1,i=A(this.globalScope)?void 0:[],n=e.hasCallback?function(e,n){r=!0,delete u.cancelCallbacks[t],u.target.postMessage({id:t,type:"<response>",sourceMapId:u.mapId,error:e?Ui(e):null,data:Ui(n,i)},i)}:function(t){r=!0},s=null,o=Ni(e.data),this.parent[e.type]?s=this.parent[e.type](e.sourceMapId,o,n):this.parent.getWorkerSource?(a=e.type.split("."),s=this.parent.getWorkerSource(e.sourceMapId,a[0],o.source)[a[1]](o,n)):n(new Error("Could not find function "+e.type)),!r&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel))},$s.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)},bc.prototype.setNorthEast=function(t){return this._ne=t instanceof wc?new wc(t.lng,t.lat):wc.convert(t),this},bc.prototype.setSouthWest=function(t){return this._sw=t instanceof wc?new wc(t.lng,t.lat):wc.convert(t),this},bc.prototype.extend=function(t){var e,r,i=this._sw,n=this._ne;if(t instanceof wc)r=e=t;else{if(!(t instanceof bc))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(bc.convert(t)):this.extend(wc.convert(t)):this;if(r=t._ne,!(e=t._sw)||!r)return this}return i||n?(i.lng=Math.min(e.lng,i.lng),i.lat=Math.min(e.lat,i.lat),n.lng=Math.max(r.lng,n.lng),n.lat=Math.max(r.lat,n.lat)):(this._sw=new wc(e.lng,e.lat),this._ne=new wc(r.lng,r.lat)),this},bc.prototype.getCenter=function(){return new wc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},bc.prototype.getSouthWest=function(){return this._sw},bc.prototype.getNorthEast=function(){return this._ne},bc.prototype.getNorthWest=function(){return new wc(this.getWest(),this.getNorth())},bc.prototype.getSouthEast=function(){return new wc(this.getEast(),this.getSouth())},bc.prototype.getWest=function(){return this._sw.lng},bc.prototype.getSouth=function(){return this._sw.lat},bc.prototype.getEast=function(){return this._ne.lng},bc.prototype.getNorth=function(){return this._ne.lat},bc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},bc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},bc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},bc.prototype.contains=function(t){var e=(r=wc.convert(t)).lng,r=(t=r.lat,this._sw.lng<=e&&e<=this._ne.lng);return this._sw.lng>this._ne.lng&&(r=this._sw.lng>=e&&e>=this._ne.lng),this._sw.lat<=t&&t<=this._ne.lat&&r},bc.convert=function(t){return!t||t instanceof bc?t:new bc(t)};var wc=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,90<this.lat||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};wc.prototype.wrap=function(){return new wc(p(this.lng,-180,180),this.lat)},wc.prototype.toArray=function(){return[this.lng,this.lat]},wc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},wc.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,i=t.lat*e;e=Math.sin(r)*Math.sin(i)+Math.cos(r)*Math.cos(i)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(e,1))},wc.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017;t=e/Math.cos(Math.PI/180*this.lat);return new bc(new wc(this.lng-t,this.lat-e),new wc(this.lng+t,this.lat+e))},wc.convert=function(t){if(t instanceof wc)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new wc(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new wc(Number("lng"in t?t.lng:t.lon),Number(t.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 Sc=2*Math.PI*6371008.8;function Tc(t){return Sc*Math.cos(t*Math.PI/180)}function Ec(t){return(180+t)/360}function Ic(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Ac(t,e){return t/Tc(e)}function Cc(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}function Pc(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r}function Mc(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Lc(0,t,t,e,r)}function kc(t,e){this.wrap=t,this.canonical=e,this.key=Lc(t,e.z,e.z,e.x,e.y)}function zc(t,e,r,i,n){this.overscaledZ=t,this.wrap=e,this.canonical=new Mc(r,+i,+n),this.key=Lc(e,t,r,i,n)}function Lc(t,e,r,i,n){(t*=2)<0&&(t=-1*t-1);var o=1<<r;return(o*o*t+o*n+i).toString(36)+r.toString(36)+e.toString(36)}function Bc(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}}function Dc(t,e,r,i,n){this.type="Feature",(this._vectorTileFeature=t)._z=e,t._x=r,t._y=i,this.properties=t.properties,this.id=n}function Rc(t,e,r,i,n){return _(t,(function(t,o){return(o=e instanceof pn?e.get(o):null)&&o.evaluate?o.evaluate(r,i,n):o}))}function Oc(t){for(var e=1/0,r=1/0,i=-1/0,n=-1/0,o=0,a=t;o<a.length;o+=1){var s=a[o];e=Math.min(e,s.x),r=Math.min(r,s.y),i=Math.max(i,s.x),n=Math.max(n,s.y)}return{minX:e,minY:r,maxX:i,maxY:n}}function Fc(t,e){return e-t}Pc.fromLngLat=function(t,e){return void 0===e&&(e=0),new Pc(Ec((t=wc.convert(t)).lng),Ic(t.lat),Ac(e,t.lat))},Pc.prototype.toLngLat=function(){return new wc(360*this.x-180,Cc(this.y))},Pc.prototype.toAltitude=function(){return this.z*Tc(Cc(this.y))},Pc.prototype.meterInMercatorCoordinateUnits=function(){return 1/Sc*(t=Cc(this.y),1/Math.cos(t*Math.PI/180));var t},Mc.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Mc.prototype.url=function(t,e){var r,i,n=(i=this.y,o=this.z,n=xc(256*(r=this.x),256*(i=Math.pow(2,o)-i-1),o),o=xc(256*(r+1),256*(1+i),o),n[0]+","+n[1]+","+o[0]+","+o[1]),o=function(t,e,r){for(var i,n="",o=t;0<o;o--)n+=(e&(i=1<<o-1)?1:0)+(r&i?2:0);return n}(this.z,this.x,this.y);return t[(this.x+this.y)%t.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("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",o).replace("{bbox-epsg-3857}",n)},Mc.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new n(8192*(t.x*e-this.x),8192*(t.y*e-this.y))},Mc.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y},zc.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},zc.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new zc(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new zc(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},zc.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?Lc(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Lc(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},zc.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},zc.prototype.children=function(t){if(this.overscaledZ>=t)return[new zc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x;t=2*this.canonical.y;return[new zc(e,this.wrap,e,r,t),new zc(e,this.wrap,e,1+r,t),new zc(e,this.wrap,e,r,1+t),new zc(e,this.wrap,e,1+r,1+t)]},zc.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},zc.prototype.wrapped=function(){return new zc(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},zc.prototype.unwrapTo=function(t){return new zc(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},zc.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},zc.prototype.toUnwrapped=function(){return new kc(this.wrap,this.canonical)},zc.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},zc.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new Pc(t.x-this.wrap,t.y))},Oi("CanonicalTileID",Mc),Oi("OverscaledTileID",zc,{omit:["posMatrix"]}),(bn=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return w('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=e.height;var i=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=r||"mapbox";for(var n=0;n<i;n++)this.data[this._idx(-1,n)]=this.data[this._idx(0,n)],this.data[this._idx(i,n)]=this.data[this._idx(i-1,n)],this.data[this._idx(n,-1)]=this.data[this._idx(n,0)],this.data[this._idx(n,i)]=this.data[this._idx(n,i-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(i,-1)]=this.data[this._idx(i-1,0)],this.data[this._idx(-1,i)]=this.data[this._idx(0,i-1)],this.data[this._idx(i,i)]=this.data[this._idx(i-1,i-1)]}).prototype.get=function(t,e){var r=new Uint8Array(this.data.buffer);e=4*this._idx(t,e);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(r[e],r[1+e],r[2+e])},bn.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},bn.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},bn.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},bn.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},bn.prototype.getPixels=function(){return new gs({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},bn.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var i=e*this.dim,n=e*this.dim+this.dim,o=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:i=n-1;break;case 1:n=i+1}switch(r){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,u=-r*this.dim,l=o;l<a;l++)for(var c=i;c<n;c++)this.data[this._idx(c,l)]=t.data[this._idx(c+s,l+u)]},Oi("DEMData",bn),Bc.prototype.encode=function(t){return this._stringToNumber[t]},Bc.prototype.decode=function(t){return this._numberToString[t]},(br={geometry:{configurable:!0}}).geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},br.geometry.set=function(t){this._geometry=t},Dc.prototype.toJSON=function(){var t,e={geometry:this.geometry};for(t in this)"_geometry"!==t&&"_vectorTileFeature"!==t&&(e[t]=this[t]);return e},Object.defineProperties(Dc.prototype,br),(nc=function(){this.state={},this.stateChanges={},this.deletedStates={}}).prototype.updateState=function(t,e,r){var i=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][i]=this.stateChanges[t][i]||{},h(this.stateChanges[t][i],r),null===this.deletedStates[t])for(var n in this.deletedStates[t]={},this.state[t])n!==i&&(this.deletedStates[t][n]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][i])for(var o in this.deletedStates[t][i]={},this.state[t][i])r[o]||(this.deletedStates[t][i][o]=null);else for(var a in r)this.deletedStates[t]&&this.deletedStates[t][i]&&null===this.deletedStates[t][i][a]&&delete this.deletedStates[t][i][a]},nc.prototype.removeFeatureState=function(t,e,r){if(null!==this.deletedStates[t]){var i=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},r&&void 0!==e)null!==this.deletedStates[t][i]&&(this.deletedStates[t][i]=this.deletedStates[t][i]||{},this.deletedStates[t][i][r]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][i])for(r in this.deletedStates[t][i]={},this.stateChanges[t][i])this.deletedStates[t][i][r]=null;else this.deletedStates[t][i]=null;else this.deletedStates[t]=null}},nc.prototype.getState=function(t,e){var r=String(e),i=h({},(this.state[t]||{})[r],(this.stateChanges[t]||{})[r]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var n;if(null===(e=this.deletedStates[t][e]))return{};for(n in e)delete i[n]}return i},nc.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},nc.prototype.coalesceChanges=function(t,e){var r,i,n={};for(r in this.stateChanges){this.state[r]=this.state[r]||{};var o,a={};for(o in this.stateChanges[r])this.state[r][o]||(this.state[r][o]={}),h(this.state[r][o],this.stateChanges[r][o]),a[o]=this.state[r][o];n[r]=a}for(i in this.deletedStates){this.state[i]=this.state[i]||{};var s={};if(null===this.deletedStates[i])for(var u in this.state[i])s[u]={},this.state[i][u]={};else for(var l in this.deletedStates[i]){if(null===this.deletedStates[i][l])this.state[i][l]={};else for(var c=0,p=Object.keys(this.deletedStates[i][l]);c<p.length;c+=1)delete this.state[i][l][p[c]];s[l]=this.state[i][l]}n[i]=n[i]||{},h(n[i],s)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(n).length)for(var f in t)t[f].setFeatureState(n,e)},(dn=function(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new ki(8192,16,0),this.grid3D=new ki(8192,16,0),this.featureIndexArray=new ta,this.promoteId=e}).prototype.insert=function(t,e,r,i,n,o){var a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);for(var s=o?this.grid3D:this.grid,u=0;u<e.length;u++){for(var l=e[u],c=[1/0,1/0,-1/0,-1/0],p=0;p<l.length;p++){var h=l[p];c[0]=Math.min(c[0],h.x),c[1]=Math.min(c[1],h.y),c[2]=Math.max(c[2],h.x),c[3]=Math.max(c[3],h.y)}c[0]<8192&&c[1]<8192&&0<=c[2]&&0<=c[3]&&s.insert(a,c[0],c[1],c[2],c[3])}},dn.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new lu.VectorTile(new ju(this.rawTileData)).layers,this.sourceLayerCoder=new Bc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},dn.prototype.query=function(t,e,r,i){var o=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,u=ni(a.filter),l=t.queryGeometry,c=t.queryPadding*s,p=Oc(l),h=this.grid.query(p.minX-c,p.minY-c,p.maxX+c,p.maxY+c),f=(p=Oc(t.cameraQueryGeometry),0),d=this.grid3D.query(p.minX-c,p.minY-c,p.maxX+c,p.maxY+c,(function(e,r,i,o){return function(t,e,r,i,o){for(var a=0,s=t;a<s.length;a+=1){var u=s[a];if(e<=u.x&&r<=u.y&&i>=u.x&&o>=u.y)return!0}var l=[new n(e,r),new n(e,o),new n(i,o),new n(i,r)];if(2<t.length)for(var c=0,p=l;c<p.length;c+=1)if(Qa(t,p[c]))return!0;for(var h=0;h<t.length-1;h++)if(function(t,e,r){var i=r[0],n=r[2];if(!(t.x<i.x&&e.x<i.x||t.x>n.x&&e.x>n.x||t.y<i.y&&e.y<i.y||t.y>n.y&&e.y>n.y))return(n=S(t,e,r[0]))!==S(t,e,r[1])||n!==S(t,e,r[2])||n!==S(t,e,r[3])}(t[h],t[h+1],l))return!0;return!1}(t.cameraQueryGeometry,e-c,r-c,i+c,o+c)}));f<d.length;f+=1)h.push(d[f]);h.sort(Fc);for(var m,y={},g=0;g<h.length;g++)!function(n){var c;(n=h[n])!==m&&(m=n,n=o.featureIndexArray.get(n),c=null,o.loadMatchingFeature(y,n.bucketIndex,n.sourceLayerIndex,n.featureIndex,u,a.layers,a.availableImages,e,r,i,(function(e,r,i){return c=c||Va(e),r.queryIntersectsFeature(l,e,i,c,o.z,t.transform,s,t.pixelPosMatrix)})))}(g);return y},dn.prototype.loadMatchingFeature=function(t,e,r,i,n,o,a,s,u,l,c){var p=this.bucketLayerIDs[e];if(!o||function(t,e){for(var r=0;r<t.length;r++)if(0<=e.indexOf(t[r]))return 1}(o,p)){e=this.sourceLayerCoder.decode(r);var f=this.vtLayers[e].feature(i);if(n.needGeometry){if(r=qa(f,!0),!n.filter(new tn(this.tileID.overscaledZ),r,this.tileID.canonical))return}else if(!n.filter(new tn(this.tileID.overscaledZ),f))return;for(var d=this.getId(f,e),m=0;m<p.length;m++){var y,g,_,v=p[m];o&&o.indexOf(v)<0||(y=s[v])&&(g={},void 0!==d&&l&&(g=l.getState(y.sourceLayer||"_geojsonTileLayer",d)),(_=h({},u[v])).paint=Rc(_.paint,y.paint,f,g,a),_.layout=Rc(_.layout,y.layout,f,g,a),(y=!c||c(f,y,g))&&((g=new Dc(f,this.z,this.x,this.y,d)).layer=_,void 0===(_=t[v])&&(_=t[v]=[]),_.push({featureIndex:i,feature:g,intersectionZ:y})))}}},dn.prototype.lookupSymbolFeatures=function(t,e,r,i,n,o,a,s){var u={};this.loadVTLayers();for(var l=ni(n),c=0,p=t;c<p.length;c+=1)this.loadMatchingFeature(u,r,i,p[c],l,o,a,s,e);return u},dn.prototype.hasLayer=function(t){for(var e=0,r=this.bucketLayerIDs;e<r.length;e+=1)for(var i=0,n=r[e];i<n.length;i+=1)if(t===n[i])return!0;return!1},dn.prototype.getId=function(t,e){var r=t.id;return this.promoteId&&"boolean"==typeof(r=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]])&&(r=Number(r)),r},Oi("FeatureIndex",dn,{omit:["rawTileData","sourceLayerCoder"]}),(sc=function(t,e){this.tileID=t,this.uid=f++,this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"}).prototype.registerFadeDuration=function(t){(t+=this.timeAdded)<R.now()||this.fadeEndTime&&t<this.fadeEndTime||(this.fadeEndTime=t)},sc.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},sc.prototype.loadVectorData=function(t,e,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var i in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){var r={};if(!e)return r;for(var i=0,n=t;i<n.length;i+=1)!function(){var t=n[i],o=t.layerIds.map((function(t){return e.getLayer(t)})).filter(Boolean);if(0!==o.length){t.layers=o,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map((function(t){return o.filter((function(e){return e.id===t}))[0]})));for(var a=0,s=o;a<s.length;a+=1)r[s[a].id]=t}}();return r}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var n=this.buckets[i];if(n instanceof Jl){if(this.hasSymbolBuckets=!0,!r)break;n.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var o in this.buckets){var a=this.buckets[o];if(a instanceof Jl&&a.hasRTLText){this.hasRTLText=!0,rn.isLoading()||rn.isLoaded()||"deferred"!==Ji||$i();break}}for(var s in this.queryPadding=0,this.buckets){var u=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(s).queryRadius(u))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new Ro},sc.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},sc.prototype.getBucket=function(t){return this.buckets[t.id]},sc.prototype.upload=function(t){for(var e in this.buckets){var r=this.buckets[e];r.uploadPending()&&r.upload(t)}var i=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new $l(t,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new $l(t,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null)},sc.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},sc.prototype.queryRenderedFeatures=function(t,e,r,i,n,o,a,s,u,l){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:i,cameraQueryGeometry:n,scale:o,tileSize:this.tileSize,pixelPosMatrix:l,transform:s,params:a,queryPadding:this.queryPadding*u},t,e,r):{}},sc.prototype.querySourceFeatures=function(t,e){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var i=r.loadVTLayers(),n=e?e.sourceLayer:"",o=i._geojsonTileLayer||i[n];if(o)for(var a=ni(e&&e.filter),s=(e=this.tileID.canonical).z,u=e.x,l=e.y,c={z:s,x:u,y:l},p=0;p<o.length;p++){var h=o.feature(p);if(a.needGeometry){var f=qa(h,!0);if(!a.filter(new tn(this.tileID.overscaledZ),f,this.tileID.canonical))continue}else if(!a.filter(new tn(this.tileID.overscaledZ),h))continue;(f=new Dc(h,s,u,l,f=r.getId(h,n))).tile=c,t.push(f)}}},sc.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},sc.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},sc.prototype.setExpiryData=function(t){var e,r,i=this.expirationTime;t.cacheControl?(e=E(t.cacheControl))["max-age"]&&(this.expirationTime=Date.now()+1e3*e["max-age"]):t.expires&&(this.expirationTime=new Date(t.expires).getTime()),this.expirationTime&&(e=Date.now(),t=!1,this.expirationTime>e?t=!1:!i||this.expirationTime<i||!(r=this.expirationTime-i)?t=!0:this.expirationTime=e+Math.max(r,3e4),t?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0)},sc.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)},sc.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var r,i,n,o,a=this.latestFeatureIndex.loadVTLayers();for(r in this.buckets)e.style.hasLayer(r)&&(o=a[n=(i=this.buckets[r]).layers[0].sourceLayer||"_geojsonTileLayer"],n=t[n],o&&n&&0!==Object.keys(n).length&&(i.update(n,o,this.imageAtlas&&this.imageAtlas.patternPositions||{}),(o=e&&e.style&&e.style.getLayer(r))&&(this.queryPadding=Math.max(this.queryPadding,o.queryRadius(i)))))}},sc.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},sc.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<R.now()},sc.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},sc.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=R.now()+t},sc.prototype.setDependencies=function(t,e){for(var r={},i=0,n=e;i<n.length;i+=1)r[n[i]]=!0;this.dependencies[t]=r},sc.prototype.hasDependency=function(t,e){for(var r=0,i=t;r<i.length;r+=1){var n=this.dependencies[i[r]];if(n)for(var o=0,a=e;o<a.length;o+=1)if(n[a[o]])return!0}return!1};var jc=a.performance;(br=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},jc.mark(this._marks.start)}).prototype.finish=function(){jc.mark(this._marks.end);var t=jc.getEntriesByName(this._marks.measure);return 0===t.length&&(jc.measure(this._marks.measure,this._marks.start,this._marks.end),t=jc.getEntriesByName(this._marks.measure),jc.clearMarks(this._marks.start),jc.clearMarks(this._marks.end),jc.clearMeasures(this._marks.measure)),t},t.Actor=$s,t.AlphaImage=ys,t.CanonicalTileID=Mc,t.CollisionBoxArray=Ro,t.Color=ae,t.DEMData=bn,t.DataConstantProperty=hn,t.DictionaryCoder=Bc,t.EXTENT=8192,t.ErrorEvent=kt,t.EvaluationParameters=tn,t.Event=Ct,t.Evented=Pt,t.FeatureIndex=dn,t.FillBucket=Js,t.FillExtrusionBucket=fu,t.ImageAtlas=yn,t.ImagePosition=sl,t.LineBucket=vu,t.LngLat=wc,t.LngLatBounds=bc,t.MercatorCoordinate=Pc,t.ONE_EM=24,t.OverscaledTileID=zc,t.Point=n,t.Point$1=n,t.Properties=gn,t.Protobuf=ju,t.RGBAImage=gs,t.RequestManager=V,t.RequestPerformance=br,t.ResourceType=ft,t.SegmentVector=ra,t.SourceFeatureState=nc,t.StructArrayLayout1ui2=Ao,t.StructArrayLayout2f1f2i16=no,t.StructArrayLayout2i4=In,t.StructArrayLayout3ui6=fo,t.StructArrayLayout4i8=Pn,t.SymbolBucket=Jl,t.Texture=$l,t.Tile=sc,t.Transitionable=an,t.Uniform1f=_a,t.Uniform1i=Tr,t.Uniform2f=Sr,t.Uniform3f=va,t.Uniform4f=xa,t.UniformColor=ba,t.UniformMatrix4f=Sa,t.UnwrappedTileID=kc,t.ValidationError=Bt,t.WritingMode=ll,t.ZoomHistory=Vi,t.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t},t.addDynamicAttributes=Zl,t.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var i=t.length,n=new Array(t.length),o=null;t.forEach((function(t,a){e(t,(function(t,e){t&&(o=t),n[a]=e,0==--i&&r(o,n)}))}))},t.bezier=u,t.bindAll=y,t.browser=R,t.cacheEntryPossiblyAdded=function(t){++pt>ot&&(t.getActor().send("enforceCacheSizeLimit",nt),pt=0)},t.clamp=c,t.clearTileCache=function(t){var e=a.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=Pl,t.clone=function(t){var e=new is(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],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},t.clone$1=x,t.clone$2=function(t){var e=new is(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=L,t.config=O,t.create=function(){var t=new is(16);return is!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new is(9);return is!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new is(4);return is!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Hr,t.createLayout=Sn,t.createStyleLayer=function(t){return new("custom"===t.type?uc:lc[t.type])(t)},t.cross=function(t,e,r){var i=e[0],n=e[1],o=e[2],a=r[0];e=r[1],r=r[2];return t[0]=n*r-o*e,t[1]=o*a-i*r,t[2]=i*e-n*a,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var i=0;i<e.length;i++)if(!t(e[i],r[i]))return!1;return!0}if("object"!=typeof e||null===e||null===r)return e===r;if("object"!=typeof r)return!1;if(Object.keys(e).length!==Object.keys(r).length)return!1;for(var n in e)if(!t(e[n],r[n]))return!1;return!0},t.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},t.dot$1=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},t.ease=l,t.emitValidationErrors=Mi,t.endsWith=g,t.enforceCacheSizeLimit=function(t){ut(),Y&&Y.then((function(e){e.keys().then((function(r){for(var i=0;i<r.length-t;i++)e.delete(r[i])}))}))},t.evaluateSizeForFeature=Tl,t.evaluateSizeForZoom=El,t.evaluateVariableOffset=jl,t.evented=en,t.extend=h,t.featureFilter=ni,t.filterObject=v,t.fromRotation=function(t,e){var r=Math.sin(e);e=Math.cos(e);return t[0]=e,t[1]=r,t[2]=0,t[3]=-r,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.getAnchorAlignment=_l,t.getAnchorJustification=Ul,t.getArrayBuffer=xt,t.getImage=Et,t.getJSON=function(t,e){return vt(h(t,{type:"json"}),e)},t.getRTLTextPluginStatus=function(){return Ji},t.getReferrer=yt,t.getVideo=function(t,e){var r=a.document.createElement("video");r.muted=!0,r.onloadstart=function(){e(null,r)};for(var i=0;i<t.length;i++){var n=a.document.createElement("source"),o=t[i],s=void 0;(s=a.document.createElement("a")).href=o,s.protocol===a.document.location.protocol&&s.host===a.document.location.host||(r.crossOrigin="Anonymous"),n.src=t[i],r.appendChild(n)}return{cancel:function(){}}},t.identity=ns,t.invert=function(t,e){var r=e[0],i=e[1],n=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],p=e[9],h=e[10],f=e[11],d=e[12],m=e[13],y=e[14],g=e[15],_=r*s-i*a,v=r*u-n*a,x=r*l-o*a,b=i*u-n*s,w=i*l-o*s,S=n*l-o*u,T=c*m-p*d,E=c*y-h*d,I=c*g-f*d,A=p*y-h*m,C=p*g-f*m,P=h*g-f*y;return(e=_*P-v*C+x*A+b*I-w*E+S*T)?(t[0]=(s*P-u*C+l*A)*(e=1/e),t[1]=(n*C-i*P-o*A)*e,t[2]=(m*S-y*w+g*b)*e,t[3]=(h*w-p*S-f*b)*e,t[4]=(u*I-a*P-l*E)*e,t[5]=(r*P-n*I+o*E)*e,t[6]=(y*x-d*S-g*v)*e,t[7]=(c*S-h*x+f*v)*e,t[8]=(a*C-s*I+l*T)*e,t[9]=(i*I-r*C-o*T)*e,t[10]=(d*w-m*x+g*_)*e,t[11]=(p*x-c*w-f*_)*e,t[12]=(s*E-a*A-u*T)*e,t[13]=(r*A-i*E+n*T)*e,t[14]=(m*v-d*b-y*_)*e,t[15]=(c*b-p*v+h*_)*e,t):null},t.isChar=qi,t.isMapboxURL=G,t.keysDifference=function(t,e){var r,i=[];for(r in t)r in e||i.push(r);return i},t.makeRequest=vt,t.mapObject=_,t.mercatorXfromLng=Ec,t.mercatorYfromLat=Ic,t.mercatorZfromAltitude=Ac,t.mul=ho,t.multiply=os,t.mvt=lu,t.nextPowerOfTwo=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},t.normalize=function(t,e){var r,i=e[0],n=e[1];return 0<(r=i*i+n*n+(r=e[2])*r)&&(r=1/Math.sqrt(r)),t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t},t.number=He,t.offscreenCanvasSupported=ht,t.ortho=function(t,e,r,i,n,o,a){var s=1/(e-r),u=1/(i-n),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*s,t[13]=(n+i)*u,t[14]=(a+o)*l,t[15]=1,t},t.parseGlyphPBF=function(t){return new ju(t).readFields(il,[])},t.pbf=ju,t.performSymbolLayout=function(t,e,r,i,o,a,s){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var u,l,c=t.layers[0].layout,p=t.layers[0]._unevaluatedLayout._values,h={};"composite"===t.textSizeData.kind&&(l=(u=t.textSizeData).maxZoom,h.compositeTextSizes=[p["text-size"].possiblyEvaluate(new tn(u.minZoom),s),p["text-size"].possiblyEvaluate(new tn(l),s)]),"composite"===t.iconSizeData.kind&&(l=(u=t.iconSizeData).maxZoom,h.compositeIconSizes=[p["icon-size"].possiblyEvaluate(new tn(u.minZoom),s),p["icon-size"].possiblyEvaluate(new tn(l),s)]),h.layoutTextSize=p["text-size"].possiblyEvaluate(new tn(t.zoom+1),s),h.layoutIconSize=p["icon-size"].possiblyEvaluate(new tn(t.zoom+1),s),h.textMaxSize=p["text-size"].possiblyEvaluate(new tn(18));for(var f=24*c.get("text-line-height"),d="map"===c.get("text-rotation-alignment")&&"point"!==c.get("symbol-placement"),m=c.get("text-keep-upright"),y=c.get("text-size"),g=function(){var a=v[_],u=c.get("text-font").evaluate(a,{},s).join(","),l=y.evaluate(a,{},s),p=h.layoutTextSize.evaluate(a,{},s),g=h.layoutIconSize.evaluate(a,{},s),x={horizontal:{},vertical:void 0},b=a.text,S=[0,0];if(b){var T=b.toString(),E=24*c.get("text-letter-spacing").evaluate(a,{},s),I=function(){for(var t,e=0,r=T;e<r.length;e+=1)if(t=r[e].charCodeAt(0),qi.Arabic(t)||qi["Arabic Supplement"](t)||qi["Arabic Extended-A"](t)||qi["Arabic Presentation Forms-A"](t)||qi["Arabic Presentation Forms-B"](t))return;return 1}()?E:0,A=c.get("text-anchor").evaluate(a,{},s),C=c.get("text-variable-anchor");C||(j=c.get("text-radial-offset").evaluate(a,{},s),S=j?jl(A,[24*j,Fl]):c.get("text-offset").evaluate(a,{},s).map((function(t){return 24*t})));var P=d?"center":c.get("text-justify").evaluate(a,{},s),M=c.get("symbol-placement"),k="point"===M?24*c.get("text-max-width").evaluate(a,{},s):0,z=function(){t.allowVerticalPlacement&&Gi(T)&&(x.vertical=pl(b,e,r,o,u,k,f,A,"left",I,S,ll.vertical,!0,M,p,l))};if(!d&&C){for(var L="auto"===P?C.map(Ul):[P],B=!1,D=0;D<L.length;D++){var R,O=L[D];x.horizontal[O]||(B?x.horizontal[O]=x.horizontal[0]:(R=pl(b,e,r,o,u,k,f,"center",O,I,S,ll.horizontal,!1,M,p,l))&&(B=1===(x.horizontal[O]=R).positionedLines.length))}z()}else{"auto"===P&&(P=Ul(A));var F=pl(b,e,r,o,u,k,f,A,P,I,S,ll.horizontal,!1,M,p,l);F&&(x.horizontal[P]=F),z(),Gi(T)&&d&&m&&(x.vertical=pl(b,e,r,o,u,k,f,A,P,I,S,ll.vertical,!1,M,p,l))}}E=void 0;var j=!1;a.icon&&a.icon.name&&(U=i[a.icon.name])&&(C=o[a.icon.name],F=c.get("icon-offset").evaluate(a,{},s),z=_l(c.get("icon-anchor").evaluate(a,{},s)),P=F[0]-C.displaySize[0]*z.horizontalAlign,E={image:C,top:z=F[1]-C.displaySize[1]*z.verticalAlign,bottom:z+C.displaySize[1],left:P,right:P+C.displaySize[0]},j=U.sdf,void 0===t.sdfIcons?t.sdfIcons=U.sdf:t.sdfIcons!==U.sdf&&w("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),U.pixelRatio===t.pixelRatio&&0===c.get("icon-rotate").constantOr(1)||(t.iconsNeedLinear=!0));var U=Vl(x.horizontal)||x.vertical;t.iconsInText=!!U&&U.iconsInText,(U||E)&&function(t,e,r,i,o,a,s,u,l,c,p){void 0===(O=a.textMaxSize.evaluate(e,{}))&&(O=s);var h,f,d,m,y,g,_,v,x,b,S,T=t.layers[0].layout,E=T.get("icon-offset").evaluate(e,{},p),I=Vl(r.horizontal),A=s/24,C=t.tilePixelRatio*A,P=t.tilePixelRatio*O/24,M=t.tilePixelRatio*u,k=t.tilePixelRatio*T.get("symbol-spacing"),z=T.get("text-padding")*t.tilePixelRatio,L=T.get("icon-padding")*t.tilePixelRatio,B=T.get("text-max-angle")/180*Math.PI,D="map"===T.get("text-rotation-alignment")&&"point"!==T.get("symbol-placement"),R="map"===T.get("icon-rotation-alignment")&&"point"!==T.get("symbol-placement"),O=T.get("symbol-placement"),F=k/2;u=T.get("icon-text-fit");function j(n,u){u.x<0||8192<=u.x||u.y<0||8192<=u.y||function(t,e,r,i,o,a,s,u,l,c,p,h,f,d,m,y,g,_,v,x,b,S,T,E){var I,A,C,P,M,k=t.addToLineVertexArray(e,n),z=0,L=0,B=0,D=0,R=-1,O=-1,F={},j=aa(""),U=0,N=void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(U=(A=s.layout.get("text-offset").evaluate(x,{},T).map((function(t){return 24*t})))[0],A[1]):(U=24*s.layout.get("text-radial-offset").evaluate(x,{},T),Fl);for(M in t.allowVerticalPlacement&&r.vertical&&(A=s.layout.get("text-rotate").evaluate(x,{},T)+90,C=new Ll(u,e,l,c,p,r.vertical,h,f,d,A),a&&(I=new Ll(u,e,l,c,p,a,y,g,d,A))),i&&(W=Ml(i,H=s.layout.get("icon-rotate").evaluate(x,{}),S,Z="none"!==s.layout.get("icon-text-fit")),X=a?Ml(a,H,S,Z):void 0,P=new Ll(u,e,l,c,p,i,y,g,!1,H),z=4*W.length,K=null,"source"===(Z=t.iconSizeData).kind?32640<(K=[128*s.layout.get("icon-size").evaluate(x,{})])[0]&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===Z.kind&&(32640<(K=[128*b.compositeIconSizes[0].evaluate(x,{},T),128*b.compositeIconSizes[1].evaluate(x,{},T)])[0]||32640<K[1])&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,W,K,v,_,x,!1,e,k.lineStartIndex,k.lineLength,-1,T),R=t.icon.placedSymbolArray.length-1,X&&(L=4*X.length,t.addSymbols(t.icon,X,K,v,_,x,ll.vertical,e,k.lineStartIndex,k.lineLength,-1,T),O=t.icon.placedSymbolArray.length-1)),r.horizontal){var V,q=r.horizontal[M];V||(j=aa(q.text),V=new Ll(u,e,l,c,p,q,h,f,d,G=s.layout.get("text-rotate").evaluate(x,{},T)));var G=1===q.positionedLines.length;if(B+=Nl(t,e,q,o,s,d,x,m,k,r.vertical?ll.horizontal:ll.horizontalOnly,G?Object.keys(r.horizontal):[M],F,R,b,T),G)break}r.vertical&&(D+=Nl(t,e,r.vertical,o,s,d,x,m,k,ll.vertical,["vertical"],F,O,b,T));i=V?V.boxStartIndex:t.collisionBoxArray.length,y=V?V.boxEndIndex:t.collisionBoxArray.length,g=C?C.boxStartIndex:t.collisionBoxArray.length;var H=C?C.boxEndIndex:t.collisionBoxArray.length,Z=P?P.boxStartIndex:t.collisionBoxArray.length,W=P?P.boxEndIndex:t.collisionBoxArray.length,X=I?I.boxStartIndex:t.collisionBoxArray.length,K=I?I.boxEndIndex:t.collisionBoxArray.length;(_=-1<(v=(_=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e})(I,v=_(P,v=_(C,v=_(V,v=-1)))))?1:0)&&(v*=E/24),t.glyphOffsetArray.length>=Jl.MAX_GLYPHS&&w("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,x.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,0<=F.right?F.right:-1,0<=F.center?F.center:-1,0<=F.left?F.left:-1,F.vertical||-1,R,O,j,i,y,g,H,Z,W,X,K,l,B,D,z,L,_,0,h,U,N,v)}(t,u,r,i,o,h,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,C,z,D,l,M,L,R,E,e,a,c,p,s)}if(i&&"none"!==u&&(t.allowVerticalPlacement&&r.vertical&&(h=vl(i,r.vertical,u,T.get("icon-text-fit-padding"),E,A)),I&&(i=vl(i,I,u,T.get("icon-text-fit-padding"),E,A))),"line"===O)for(var U=0,N=Pl(e.geometry,0,0,8192,8192);U<N.length;U+=1)for(var V=N[U],q=0,G=(f=V,d=k,m=B,y=r.vertical||I,g=i,24,_=P,v=t.overscaling,x=8192,void 0,b=y?.6*24*_:0,d-(y=(S=Cl(y,g))*_)<d/4&&(d=y+d/4),function t(e,r,i,n,o,a,s,u,l){for(var c=a/2,p=Al(e),h=0,f=r-i,d=[],m=0;m<e.length-1;m++){for(var y=e[m],g=e[m+1],_=y.dist(g),v=g.angleTo(y);f+i<h+_;){var x=((f+=i)-h)/_,b=He(y.x,g.x,x);x=He(y.y,g.y,x);0<=b&&b<l&&0<=x&&x<l&&0<=f-c&&f+c<=p&&((x=new bl(b,x,v,m))._round(),n&&!Il(e,x,a,n,o)||d.push(x))}h+=_}return u||d.length||s||(d=t(e,h/2,i,n,o,a,s,!0,l)),d}(f,(g=0===f[0].x||f[0].x===x||0===f[0].y||f[0].y===x)?d/2*v%d:(S/2+48)*_*v%d,d,b,m,y,g,!1,x));q<G.length;q+=1){var H=G[q];I&&function(t,e,r,i){if(e in(t=t.compareText)){for(var n=t[e],o=n.length-1;0<=o;o--)if(i.dist(n[o])<r)return 1}else t[e]=[];return t[e].push(i),0}(t,I.text,F,H)||j(V,H)}else if("line-center"===O)for(var Z=0,W=e.geometry;Z<W.length;Z+=1){var X,K=W[Z];1<K.length&&(X=function(t,e,r,i,n,o){for(var a=r?.6*24*o:0,s=Cl(r,i)*o,u=0,l=Al(t)/2,c=0;c<t.length-1;c++){var p=t[c],h=t[c+1],f=p.dist(h);if(l<u+f){var d=(l-u)/f,m=He(p.x,h.x,d);d=He(p.y,h.y,d);return(p=new bl(m,d,h.angleTo(p),c))._round(),!a||Il(t,p,s,a,e)?p:void 0}u+=f}}(K,B,r.vertical||I,i,0,P))&&j(K,X)}else if("Polygon"===e.type)for(var J=0,Y=Zs(e.geometry,0);J<Y.length;J+=1){var Q=Y[J],$=function(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var i=1/0,o=1/0,a=-1/0,s=-1/0,u=t[0],l=0;l<u.length;l++){var c=u[l];(!l||c.x<i)&&(i=c.x),(!l||c.y<o)&&(o=c.y),(!l||c.x>a)&&(a=c.x),(!l||c.y>s)&&(s=c.y)}var p=Math.min(a-i,s-o),h=p/2,f=new Bl([],Rl);if(0===p)return new n(i,o);for(var d=i;d<a;d+=p)for(var m=o;m<s;m+=p)f.push(new Ol(d+h,m+h,h,t));for(var y=function(t){for(var e=0,r=0,i=0,n=t[0],o=0,a=n.length,s=a-1;o<a;s=o++){var u=n[o],l=n[s],c=u.x*l.y-l.x*u.y;r+=(u.x+l.x)*c,i+=(u.y+l.y)*c,e+=3*c}return new Ol(r/e,i/e,0,t)}(t),g=f.length;f.length;){var _=f.pop();(_.d>y.d||!y.d)&&(y=_,r&&console.log("found best %d after %d probes",Math.round(1e4*_.d)/1e4,g)),_.max-y.d<=e||(f.push(new Ol(_.p.x-(h=_.h/2),_.p.y-h,h,t)),f.push(new Ol(_.p.x+h,_.p.y-h,h,t)),f.push(new Ol(_.p.x-h,_.p.y+h,h,t)),f.push(new Ol(_.p.x+h,_.p.y+h,h,t)),g+=4)}return r&&(console.log("num probes: "+g),console.log("best distance: "+y.d)),y.p}(Q,16);j(Q[0],new bl($.x,$.y,0))}else if("LineString"===e.type)for(var tt=0,et=e.geometry;tt<et.length;tt+=1){var rt=et[tt];j(rt,new bl(rt[0].x,rt[0].y,0))}else if("Point"===e.type)for(var it=0,nt=e.geometry;it<nt.length;it+=1)for(var ot=0,at=nt[it];ot<at.length;ot+=1){var st=at[ot];j([st],new bl(st.x,st.y,0))}}(t,a,x,E,i,h,p,g,S,j,s)},_=0,v=t.features;_<v.length;_+=1)g();a&&t.generateCollisionDebugBuffers()},t.perspective=function(t,e,r,i,n){e=1/Math.tan(e/2);return t[0]=e/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=n&&n!==1/0?(t[10]=(n+i)*(e=1/(i-n)),t[14]=2*n*i*e):(t[10]=-1,t[14]=-2*i),t},t.pick=function(t,e){for(var r={},i=0;i<e.length;i++){var n=e[i];n in t&&(r[n]=t[n])}return r},t.plugin=rn,t.polygonIntersectsPolygon=Za,t.postMapLoadEvent=it,t.postTurnstileEvent=rt,t.potpack=al,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=Oi,t.registerForPluginStateChange=function(t){return t({pluginStatus:Ji,pluginURL:Yi}),en.on("pluginStateChange",t),t},t.renderColorRamp=vs,t.rotate=function(t,e,r){var i=e[0],n=e[1],o=e[2],a=e[3];e=Math.sin(r),r=Math.cos(r);return t[0]=i*r+o*e,t[1]=n*r+a*e,t[2]=i*-e+o*r,t[3]=n*-e+a*r,t},t.rotateX=function(t,e,r){var i=Math.sin(r),n=Math.cos(r),o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=e[9],p=e[10];r=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*n+l*i,t[5]=a*n+c*i,t[6]=s*n+p*i,t[7]=u*n+r*i,t[8]=l*n-o*i,t[9]=c*n-a*i,t[10]=p*n-s*i,t[11]=r*n-u*i,t},t.rotateZ=function(t,e,r){var i=Math.sin(r),n=Math.cos(r),o=e[0],a=e[1],s=e[2],u=e[3],l=e[4],c=e[5],p=e[6];r=e[7];return e!==t&&(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[0]=o*n+l*i,t[1]=a*n+c*i,t[2]=s*n+p*i,t[3]=u*n+r*i,t[4]=l*n-o*i,t[5]=c*n-a*i,t[6]=p*n-s*i,t[7]=r*n-u*i,t},t.scale=function(t,e,r){var i=r[0],n=r[1];r=r[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.scale$1=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},t.scale$2=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t},t.setCacheLimits=function(t,e){nt=t,ot=e},t.setRTLTextPlugin=function(t,e,r){if(void 0===r&&(r=!1),"deferred"===Ji||"loading"===Ji||"loaded"===Ji)throw new Error("setRTLTextPlugin cannot be called multiple times.");Yi=R.resolveURL(t),Ji="deferred",Ki=e,Qi(),r||$i()},t.sphericalToCartesian=function(t){var e=t[0],r=t[1];t=t[2];return r+=90,r*=Math.PI/180,t*=Math.PI/180,{x:e*Math.cos(r)*Math.sin(t),y:e*Math.sin(r)*Math.sin(t),z:e*Math.cos(t)}},t.sqrLen=function(t){var e=t[0];return e*e+(t=t[1])*t},t.styleSpec=Lt,t.sub=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t},t.symbolSize=et,t.transformMat3=function(t,e,r){var i=e[0],n=e[1];e=e[2];return t[0]=i*r[0]+n*r[3]+e*r[6],t[1]=i*r[1]+n*r[4]+e*r[7],t[2]=i*r[2]+n*r[5]+e*r[8],t},t.transformMat4=as,t.translate=function(t,e,r){var i,n,o,a,s,u,l,c,p,h,f,d=r[0],m=r[1],y=r[2];return e===t?(t[12]=e[0]*d+e[4]*m+e[8]*y+e[12],t[13]=e[1]*d+e[5]*m+e[9]*y+e[13],t[14]=e[2]*d+e[6]*m+e[10]*y+e[14],t[15]=e[3]*d+e[7]*m+e[11]*y+e[15]):(i=e[1],n=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],p=e[9],h=e[10],f=e[11],t[0]=r=e[0],t[1]=i,t[2]=n,t[3]=o,t[4]=a,t[5]=s,t[6]=u,t[7]=l,t[8]=c,t[9]=p,t[10]=h,t[11]=f,t[12]=r*d+a*m+c*y+e[12],t[13]=i*d+s*m+p*y+e[13],t[14]=n*d+u*m+h*y+e[14],t[15]=o*d+l*m+f*y+e[15]),t},t.triggerPluginCompletionEvent=Xi,t.uniqueId=function(){return f++},t.validateCustomStyleLayer=function(t){var e=[],r=t.id;return void 0===r&&e.push({message:"layers."+r+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+r+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),e},t.validateLight=Ai,t.validateStyle=Ii,t.values=function(t){var e,r=[];for(e in t)r.push(t[e]);return r},t.vectorTile=lu,t.version="1.15.2",t.warnOnce=w,t.webpSupported=F,t.window=a,t.wrap=p})),i(0,(function(t){function e(e){for(var r="",i=0,n=t.refProperties;i<n.length;i+=1)r+="/"+function t(e){var r=typeof e;if("number"==r||"boolean"==r||"string"==r||null==e)return JSON.stringify(e);if(Array.isArray(e)){for(var i="[",n=0,o=e;n<o.length;n+=1)i+=t(o[n])+",";return i+"]"}for(var a=Object.keys(e).sort(),s="{",u=0;u<a.length;u++)s+=JSON.stringify(a[u])+":"+t(e[a[u]])+",";return s+"}"}(e[n[i]]);return r}function r(t){this.keyCache={},t&&this.replace(t)}function i(e){var r,i={},n=[];for(r in e){var o,a=e[r],s=i[r]={};for(o in a){var u,l=a[+o];l&&0!==l.bitmap.width&&0!==l.bitmap.height&&(u={x:0,y:0,w:l.bitmap.width+2,h:l.bitmap.height+2},n.push(u),s[o]={rect:u,metrics:l.metrics})}}var c,p=t.potpack(n),h=new t.AlphaImage({width:p.w||1,height:p.h||1});for(c in e){var f,d=e[c];for(f in d){var m,y=d[+f];y&&0!==y.bitmap.width&&0!==y.bitmap.height&&(m=i[c][f].rect,t.AlphaImage.copy(y.bitmap,h,{x:0,y:0},{x:m.x+1,y:m.y+1},y.bitmap))}}this.image=h,this.positions=i}function n(e){this.tileID=new t.OverscaledTileID(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId}function o(e,r,i){for(var n=new t.EvaluationParameters(r),o=0,a=e;o<a.length;o+=1)a[o].recalculate(n,i)}function a(e,r){var i=t.getArrayBuffer(e.request,(function(e,i,n,o){e?r(e):i&&r(null,{vectorTile:new t.vectorTile.VectorTile(new t.pbf(i)),rawData:i,cacheControl:n,expires:o})}));return function(){i.cancel(),r()}}function s(t,e,r,i){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=i||a,this.loading={},this.loaded={}}function u(){this.loaded={}}r.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},r.prototype.update=function(r,i){for(var n=this,o=0,a=r;o<a.length;o+=1){var s=a[o];this._layerConfigs[s.id]=s;var u=this._layers[s.id]=t.createStyleLayer(s);u._featureFilter=t.featureFilter(u.filter),this.keyCache[s.id]&&delete this.keyCache[s.id]}for(var l=0,c=i;l<c.length;l+=1){var p=c[l];delete this.keyCache[p],delete this._layerConfigs[p],delete this._layers[p]}this.familiesBySource={};for(var h=0,f=function(t,r){for(var i={},n=0;n<t.length;n++){var o=r&&r[t[n].id]||e(t[n]);r&&(r[t[n].id]=o),(i[o]||(i[o]=[])).push(t[n])}var a,s=[];for(a in i)s.push(i[a]);return s}(t.values(this._layerConfigs),this.keyCache);h<f.length;h+=1){var d,m,y=f[h].map((function(t){return n._layers[t.id]})),g=y[0];"none"!==g.visibility&&(d=g.source||"",((m=(m=this.familiesBySource[d])||(this.familiesBySource[d]={}))[g=g.sourceLayer||"_geojsonTileLayer"]||(m[g]=[])).push(y))}},t.register("GlyphAtlas",i),n.prototype.parse=function(e,r,n,a,s){var u=this;this.status="parsing",this.data=e,this.collisionBoxArray=new t.CollisionBoxArray;var l=new t.DictionaryCoder(Object.keys(e.layers).sort()),c=new t.FeatureIndex(this.tileID,this.promoteId);c.bucketLayerIDs=[];var p,h,f,d,m,y={},g={featureIndex:c,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:n},_=r.familiesBySource[this.source];for(m in _){var v=e.layers[m];if(v){1===v.version&&t.warnOnce('Vector tile source "'+this.source+'" layer "'+m+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var x=l.encode(m),b=[],w=0;w<v.length;w++){var S=v.feature(w),T=c.getId(S,m);b.push({feature:S,id:T,index:w,sourceLayerIndex:x})}for(var E=0,I=_[m];E<I.length;E+=1){var A=I[E],C=A[0];C.minzoom&&this.zoom<Math.floor(C.minzoom)||C.maxzoom&&this.zoom>=C.maxzoom||"none"!==C.visibility&&(o(A,this.zoom,n),(y[C.id]=C.createBucket({index:c.bucketLayerIDs.length,layers:A,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:x,sourceID:this.source})).populate(b,g,this.tileID.canonical),c.bucketLayerIDs.push(A.map((function(t){return t.id}))))}}}function P(){if(p)return s(p);if(h&&f&&d){var e,r=new i(h),a=new t.ImageAtlas(f,d);for(e in y){var u=y[e];u instanceof t.SymbolBucket?(o(u.layers,this.zoom,n),t.performSymbolLayout(u,h,r.positions,f,a.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):u.hasPattern&&(u instanceof t.LineBucket||u instanceof t.FillBucket||u instanceof t.FillExtrusionBucket)&&(o(u.layers,this.zoom,n),u.addFeatures(g,this.tileID.canonical,a.patternPositions))}this.status="done",s(null,{buckets:t.values(y).filter((function(t){return!t.isEmpty()})),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:r.image,imageAtlas:a,glyphMap:this.returnDependencies?h:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?r.positions:null})}}r=t.mapObject(g.glyphDependencies,(function(t){return Object.keys(t).map(Number)})),Object.keys(r).length?a.send("getGlyphs",{uid:this.uid,stacks:r},(function(t,e){p||(p=t,h=e,P.call(u))})):h={},(r=Object.keys(g.iconDependencies)).length?a.send("getImages",{icons:r,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){p||(p=t,f=e,P.call(u))})):f={},(r=Object.keys(g.patternDependencies)).length?a.send("getImages",{icons:r,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){p||(p=t,d=e,P.call(u))})):d={},P.call(this)},s.prototype.loadTile=function(e,r){var i=this,o=e.uid;this.loading||(this.loading={});var a=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[o]=new n(e);s.abort=this.loadVectorData(e,(function(e,n){if(delete i.loading[o],e||!n)return s.status="done",i.loaded[o]=s,r(e);var u=n.rawData,l={};n.expires&&(l.expires=n.expires),n.cacheControl&&(l.cacheControl=n.cacheControl);var c={};!a||(e=a.finish())&&(c.resourceTiming=JSON.parse(JSON.stringify(e))),s.vectorTile=n.vectorTile,s.parse(n.vectorTile,i.layerIndex,i.availableImages,i.actor,(function(e,i){return e||!i?r(e):void r(null,t.extend({rawTileData:u.slice(0)},i,l,c))})),i.loaded=i.loaded||{},i.loaded[o]=s}))},s.prototype.reloadTile=function(t,e){var r,i=this,n=this.loaded,o=t.uid,a=this;n&&n[o]&&((r=n[o]).showCollisionBoxes=t.showCollisionBoxes,t=function(t,n){var o=r.reloadCallback;o&&(delete r.reloadCallback,r.parse(r.vectorTile,a.layerIndex,i.availableImages,a.actor,o)),e(t,n)},"parsing"===r.status?r.reloadCallback=t:"done"===r.status&&(r.vectorTile?r.parse(r.vectorTile,this.layerIndex,this.availableImages,this.actor,t):t()))},s.prototype.abortTile=function(t,e){var r=this.loading;t=t.uid;r&&r[t]&&r[t].abort&&(r[t].abort(),delete r[t]),e()},s.prototype.removeTile=function(t,e){var r=this.loaded;t=t.uid;r&&r[t]&&delete r[t],e()};var l=t.window.ImageBitmap;function c(t,e){if(0!==t.length){p(t[0],e);for(var r=1;r<t.length;r++)p(t[r],!e)}}function p(t,e){for(var r=0,i=0,n=t.length,o=n-1;i<n;o=i++)r+=(t[i][0]-t[o][0])*(t[o][1]+t[i][1]);0<=r!=!!e&&t.reverse()}function h(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))}u.prototype.loadTile=function(e,r){var i=e.uid,n=e.encoding;e=e.rawImageData,e=l&&e instanceof l?this.getImageData(e):e,n=new t.DEMData(i,e,n);this.loaded=this.loaded||{},r(null,this.loaded[i]=n)},u.prototype.getImageData=function(e){return this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height),e=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2),this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:e.width,height:e.height},e.data)},u.prototype.removeTile=function(t){var e=this.loaded;t=t.uid;e&&e[t]&&delete e[t]};var f=t.vectorTile.VectorTileFeature.prototype.toGeoJSON;h.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,i=this._feature.geometry;r<i.length;r+=1){var n=i[r];e.push([new t.Point$1(n[0],n[1])])}return e}for(var o=[],a=0,s=this._feature.geometry;a<s.length;a+=1){for(var u=[],l=0,c=s[a];l<c.length;l+=1){var p=c[l];u.push(new t.Point$1(p[0],p[1]))}o.push(u)}return o},h.prototype.toGeoJSON=function(t,e,r){return f.call(this,t,e,r)};var d=function(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=e.length,this._features=e};d.prototype.feature=function(t){return new h(this._features[t])};var m=t.vectorTile.VectorTileFeature,y=g;function g(t,e){this.options=e||{},this.features=t,this.length=t.length}function _(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}g.prototype.feature=function(t){return new _(this.features[t],this.options.extent)},_.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var r=0;r<e.length;r++){for(var i=e[r],n=[],o=0;o<i.length;o++)n.push(new t.Point$1(i[o][0],i[o][1]));this.geometry.push(n)}return this.geometry},_.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,i=1/0,n=-1/0,o=0;o<t.length;o++)for(var a=t[o],s=0;s<a.length;s++){var u=a[s];e=Math.min(e,u.x),r=Math.max(r,u.x),i=Math.min(i,u.y),n=Math.max(n,u.y)}return[e,i,r,n]},_.prototype.toGeoJSON=m.prototype.toGeoJSON;var v=x;m=y;function x(e){var r=new t.pbf;return function(t,e){for(var r in t.layers)e.writeMessage(3,b,t.layers[r])}(e,r),r.finish()}function b(t,e){e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);for(var r={keys:[],values:[],keycache:{},valuecache:{}},i=0;i<t.length;i++)r.feature=t.feature(i),e.writeMessage(2,w,r);var n=r.keys;for(i=0;i<n.length;i++)e.writeStringField(3,n[i]);var o=r.values;for(i=0;i<o.length;i++)e.writeMessage(4,A,o[i])}function w(t,e){var r=t.feature;void 0!==r.id&&e.writeVarintField(1,r.id),e.writeMessage(2,S,t),e.writeVarintField(3,r.type),e.writeMessage(4,I,r)}function S(t,e){var r,i=t.feature,n=t.keys,o=t.values,a=t.keycache,s=t.valuecache;for(r in i.properties){var u=a[r];void 0===u&&(n.push(r),a[r]=u=n.length-1),e.writeVarint(u);var l=i.properties[r],c=typeof l;"string"!=c&&"boolean"!=c&&"number"!=c&&(l=JSON.stringify(l)),void 0===(c=s[u=c+":"+l])&&(o.push(l),s[u]=c=o.length-1),e.writeVarint(c)}}function T(t,e){return(e<<3)+(7&t)}function E(t){return t<<1^t>>31}function I(t,e){for(var r=t.loadGeometry(),i=t.type,n=0,o=0,a=r.length,s=0;s<a;s++){var u=r[s],l=1;1===i&&(l=u.length),e.writeVarint(T(1,l));for(var c=3===i?u.length-1:u.length,p=0;p<c;p++){1===p&&1!==i&&e.writeVarint(T(2,c-1));var h=u[p].x-n,f=u[p].y-o;e.writeVarint(E(h)),e.writeVarint(E(f)),n+=h,o+=f}3===i&&e.writeVarint(15)}}function A(t,e){var r=typeof t;"string"==r?e.writeStringField(1,t):"boolean"==r?e.writeBooleanField(7,t):"number"==r&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}function C(t,e,r,i){P(t,r,i),P(e,2*r,2*i),P(e,2*r+1,2*i+1)}function P(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function M(t,e,r,i){return(r=t-r)*r+(i=e-i)*i}function k(t){return t[0]}function z(t){return t[1]}function L(t,e,r,i,n){void 0===e&&(e=k),void 0===r&&(r=z),void 0===i&&(i=64),void 0===n&&(n=Float64Array),this.nodeSize=i;for(var o=(this.points=t).length<65536?Uint16Array:Uint32Array,a=this.ids=new o(t.length),s=this.coords=new n(2*t.length),u=0;u<t.length;u++)s[2*(a[u]=u)]=e(t[u]),s[2*u+1]=r(t[u]);!function t(e,r,i,n,o,a){var s;o-n<=i||(function t(e,r,i,n,o,a){for(;n<o;){var s,u,l,c;600<o-n&&(s=o-n+1,u=i-n+1,c=Math.log(s),l=.5*Math.exp(2*c/3),c=.5*Math.sqrt(c*l*(s-l)/s)*(u-s/2<0?-1:1),t(e,r,i,Math.max(n,Math.floor(i-u*l/s+c)),Math.min(o,Math.floor(i+(s-u)*l/s+c)),a));var p=r[2*i+a],h=n,f=o;for(C(e,r,n,i),r[2*o+a]>p&&C(e,r,n,o);h<f;){for(C(e,r,h,f),h++,f--;r[2*h+a]<p;)h++;for(;r[2*f+a]>p;)f--}r[2*n+a]===p?C(e,r,n,f):C(e,r,++f,o),f<=i&&(n=f+1),i<=f&&(o=f-1)}}(e,r,s=n+o>>1,n,o,a%2),t(e,r,i,n,s-1,a+1),t(e,r,i,1+s,o,a+1))}(a,s,i,0,a.length-1,0)}function B(t){this.options=U(Object.create(D),t),this.trees=new Array(this.options.maxZoom+1)}v.fromVectorTileJs=x,v.fromGeojsonVt=function(t,e){e=e||{};var r,i={};for(r in t)i[r]=new y(t[r].features,e),i[r].name=r,i[r].version=e.version,i[r].extent=e.extent;return x({layers:i})},v.GeoJSONWrapper=m,L.prototype.range=function(t,e,r,i){return function(t,e,r,i,n,o,a){for(var s,u=[0,t.length-1,0],l=[];u.length;){var c=u.pop(),p=u.pop(),h=u.pop();if(p-h<=a)for(var f=h;f<=p;f++)m=e[2*f+1],(s=e[2*f])>=r&&s<=n&&i<=m&&m<=o&&l.push(t[f]);else{var d=Math.floor((h+p)/2),m=e[2*d+1];(s=e[2*d])>=r&&s<=n&&i<=m&&m<=o&&l.push(t[d]);var y=(c+1)%2;(0===c?r<=s:i<=m)&&(u.push(h),u.push(d-1),u.push(y)),(0===c?s<=n:m<=o)&&(u.push(d+1),u.push(p),u.push(y))}}return l}(this.ids,this.coords,t,e,r,i,this.nodeSize)};var D={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!(L.prototype.within=function(t,e,r){return function(t,e,r,i,n,o){for(var a=[0,t.length-1,0],s=[],u=n*n;a.length;){var l=a.pop(),c=a.pop(),p=a.pop();if(c-p<=o)for(var h=p;h<=c;h++)M(e[2*h],e[2*h+1],r,i)<=u&&s.push(t[h]);else{var f=Math.floor((p+c)/2),d=e[2*f],m=e[2*f+1];M(d,m,r,i)<=u&&s.push(t[f]);var y=(l+1)%2;(0===l?r-n<=d:i-n<=m)&&(a.push(p),a.push(f-1),a.push(y)),(0===l?d<=r+n:m<=i+n)&&(a.push(f+1),a.push(c),a.push(y))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)}),generateId:!1,reduce:null,map:function(t){return t}};function R(t){return{type:"Feature",id:t.id,properties:O(t),geometry:{type:"Point",coordinates:[360*(t.x-.5),(t=(180-360*t.y)*Math.PI/180,360*Math.atan(Math.exp(t))/Math.PI-90)]}}}function O(t){var e=t.numPoints,r=1e4<=e?Math.round(e/1e3)+"k":1e3<=e?Math.round(e/100)/10+"k":e;return U(U({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function F(t){return t/360+.5}function j(t){return t=Math.sin(t*Math.PI/180),(t=.5-.25*Math.log((1+t)/(1-t))/Math.PI)<0?0:1<t?1:t}function U(t,e){for(var r in e)t[r]=e[r];return t}function N(t){return t.x}function V(t){return t.y}function q(t,e,r,i){return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)G(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var i=0;i<e.length;i++)G(t,e[i]);else if("MultiPolygon"===r)for(i=0;i<e.length;i++)for(var n=0;n<e[i].length;n++)G(t,e[i][n])}(i={id:void 0===t?null:t,type:e,geometry:r,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}),i}function G(t,e){for(var r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function H(t,e,r,i){if(e.geometry){var n=e.geometry.coordinates,o=e.geometry.type,a=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],u=e.id;if(r.promoteId?u=e.properties[r.promoteId]:r.generateId&&(u=i||0),"Point"===o)Z(n,s);else if("MultiPoint"===o)for(var l=0;l<n.length;l++)Z(n[l],s);else if("LineString"===o)W(n,s,a,!1);else if("MultiLineString"===o){if(r.lineMetrics){for(l=0;l<n.length;l++)W(n[l],s=[],a,!1),t.push(q(u,"LineString",s,e.properties));return}X(n,s,a,!1)}else if("Polygon"===o)X(n,s,a,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"!==o)throw new Error("Input data is not a valid GeoJSON object.");for(l=0;l<e.geometry.geometries.length;l++)H(t,{id:u,geometry:e.geometry.geometries[l],properties:e.properties},r,i);return}for(l=0;l<n.length;l++){var c=[];X(n[l],c,a,!0),s.push(c)}}t.push(q(u,o,s,e.properties))}}function Z(t,e){e.push(K(t[0])),e.push(J(t[1])),e.push(0)}function W(t,e,r,i){for(var n,o,a=0,s=0;s<t.length;s++){var u=K(t[s][0]),l=J(t[s][1]);e.push(u),e.push(l),e.push(0),0<s&&(a+=i?(n*l-u*o)/2:Math.sqrt(Math.pow(u-n,2)+Math.pow(l-o,2))),n=u,o=l}var c=e.length-3;e[2]=1,function t(e,r,i,n){for(var o,a,s,u,l,c,p,h,f,d=n,m=i-r>>1,y=i-r,g=e[r],_=e[r+1],v=e[i],x=e[i+1],b=r+3;b<i;b+=3){var w=(a=e[b],s=e[b+1],w=f=h=void 0,w=(p=x)-(l=_),0==(f=(c=v)-(u=g))&&0===w||(1<(h=((a-u)*f+(s-l)*w)/(f*f+w*w))?(u=c,l=p):0<h&&(u+=f*h,l+=w*h)),(f=a-u)*f+(w=s-l)*w);d<w?(o=b,d=w):w!==d||(w=Math.abs(b-m))<y&&(o=b,y=w)}n<d&&(3<o-r&&t(e,r,o,n),e[o+2]=d,3<i-o&&t(e,o,i,n))}(e,0,c,r),e[2+c]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function X(t,e,r,i){for(var n=0;n<t.length;n++){var o=[];W(t[n],o,r,i),e.push(o)}}function K(t){return t/360+.5}function J(t){return t=Math.sin(t*Math.PI/180),(t=.5-.25*Math.log((1+t)/(1-t))/Math.PI)<0?0:1<t?1:t}function Y(t,e,r,i,n,o,a,s){if(i/=e,o>=(r/=e)&&a<i)return t;if(a<r||i<=o)return null;for(var u=[],l=0;l<t.length;l++){var c=t[l],p=c.geometry,h=c.type,f=0===n?c.minX:c.minY,d=0===n?c.maxX:c.maxY;if(r<=f&&d<i)u.push(c);else if(!(d<r||i<=f)){var m=[];if("Point"===h||"MultiPoint"===h)!function(t,e,r,i,n){for(var o=0;o<t.length;o+=3){var a=t[o+n];r<=a&&a<=i&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}(p,m,r,i,n);else if("LineString"===h)Q(p,m,r,i,n,!1,s.lineMetrics);else if("MultiLineString"===h)tt(p,m,r,i,n,!1);else if("Polygon"===h)tt(p,m,r,i,n,!0);else if("MultiPolygon"===h)for(var y=0;y<p.length;y++){var g=[];tt(p[y],g,r,i,n,!0),g.length&&m.push(g)}if(m.length)if(s.lineMetrics&&"LineString"===h)for(y=0;y<m.length;y++)u.push(q(c.id,h,m[y],c.tags));else"LineString"!==h&&"MultiLineString"!==h||(1===m.length?(h="LineString",m=m[0]):h="MultiLineString"),"Point"!==h&&"MultiPoint"!==h||(h=3===m.length?"Point":"MultiPoint"),u.push(q(c.id,h,m,c.tags))}}return u.length?u:null}function Q(t,e,r,i,n,o,a){for(var s,u,l=$(t),c=0===n?rt:it,p=t.start,h=0;h<t.length-3;h+=3){var f=t[h],d=t[h+1],m=t[h+2],y=t[h+3],g=t[h+4],_=0===n?f:d,v=0===n?y:g,x=!1;a&&(s=Math.sqrt(Math.pow(f-y,2)+Math.pow(d-g,2))),_<r?r<v&&(u=c(l,f,d,y,g,r),a&&(l.start=p+s*u)):i<_?v<i&&(u=c(l,f,d,y,g,i),a&&(l.start=p+s*u)):et(l,f,d,m),v<r&&r<=_&&(u=c(l,f,d,y,g,r),x=!0),i<v&&_<=i&&(u=c(l,f,d,y,g,i),x=!0),!o&&x&&(a&&(l.end=p+s*u),e.push(l),l=$(t)),a&&(p+=s)}var b=t.length-3;f=t[b],d=t[1+b],m=t[2+b];(_=0===n?f:d)>=r&&_<=i&&et(l,f,d,m),b=l.length-3,o&&3<=b&&(l[b]!==l[0]||l[1+b]!==l[1])&&et(l,l[0],l[1],l[2]),l.length&&e.push(l)}function $(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function tt(t,e,r,i,n,o){for(var a=0;a<t.length;a++)Q(t[a],e,r,i,n,o,!1)}function et(t,e,r,i){t.push(e),t.push(r),t.push(i)}function rt(t,e,r,i,n,o){return e=(o-e)/(i-e),t.push(o),t.push(r+(n-r)*e),t.push(1),e}function it(t,e,r,i,n,o){return r=(o-r)/(n-r),t.push(e+(i-e)*r),t.push(o),t.push(1),r}function nt(t,e){for(var r=[],i=0;i<t.length;i++){var n,o=t[i],a=o.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)n=ot(o.geometry,e);else if("MultiLineString"===a||"Polygon"===a){n=[];for(var s=0;s<o.geometry.length;s++)n.push(ot(o.geometry[s],e))}else if("MultiPolygon"===a)for(n=[],s=0;s<o.geometry.length;s++){for(var u=[],l=0;l<o.geometry[s].length;l++)u.push(ot(o.geometry[s][l],e));n.push(u)}r.push(q(o.id,a,n,o.tags))}return r}function ot(t,e){var r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);for(var i=0;i<t.length;i+=3)r.push(t[i]+e,t[i+1],t[i+2]);return r}function at(t,e){if(t.transformed)return t;for(var r,i=1<<t.z,n=t.x,o=t.y,a=0;a<t.features.length;a++){var s=t.features[a],u=s.geometry,l=s.type;if(s.geometry=[],1===l)for(r=0;r<u.length;r+=2)s.geometry.push(st(u[r],u[r+1],e,i,n,o));else for(r=0;r<u.length;r++){for(var c=[],p=0;p<u[r].length;p+=2)c.push(st(u[r][p],u[r][p+1],e,i,n,o));s.geometry.push(c)}}return t.transformed=!0,t}function st(t,e,r,i,n,o){return[Math.round(r*(t*i-n)),Math.round(r*(e*i-o))]}function ut(t,e,r,i,n){for(var o=e===n.maxZoom?0:n.tolerance/((1<<e)*n.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:i,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){a.numFeatures++,function(t,e,r,i){var n=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s<n.length;s+=3)a.push(n[s]),a.push(n[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)lt(a,n,t,r,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(s=0;s<n.length;s++)lt(a,n[s],t,r,"Polygon"===o,0===s);else if("MultiPolygon"===o)for(var u=0;u<n.length;u++){var l=n[u];for(s=0;s<l.length;s++)lt(a,l[s],t,r,!0,0===s)}if(a.length){var c=e.tags||null;if("LineString"===o&&i.lineMetrics){for(var p in c={},e.tags)c[p]=e.tags[p];c.mapbox_clip_start=n.start/n.size,c.mapbox_clip_end=n.end/n.size}i={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:c},null!==e.id&&(i.id=e.id),t.features.push(i)}}(a,t[s],o,n);var u=t[s].minX,l=t[s].minY,c=t[s].maxX,p=t[s].maxY;u<a.minX&&(a.minX=u),l<a.minY&&(a.minY=l),c>a.maxX&&(a.maxX=c),p>a.maxY&&(a.maxY=p)}return a}function lt(t,e,r,i,n,o){var a=i*i;if(0<i&&e.size<(n?a:i))r.numPoints+=e.length/3;else{for(var s=[],u=0;u<e.length;u+=3)(0===i||e[u+2]>a)&&(r.numSimplified++,s.push(e[u]),s.push(e[u+1])),r.numPoints++;n&&function(t,e){for(var r=0,i=0,n=t.length,o=n-2;i<n;o=i,i+=2)r+=(t[i]-t[o])*(t[i+1]+t[o+1]);if(0<r===e)for(i=0,n=t.length;i<n/2;i+=2){var a=t[i],s=t[i+1];t[i]=t[n-2-i],t[i+1]=t[n-1-i],t[n-2-i]=a,t[n-1-i]=s}}(s,o),t.push(s)}}function ct(t,e){var r=(e=this.options=function(t,e){for(var r in e)t[r]=e[r];return t}(Object.create(this.options),e)).debug;if(r&&console.time("preprocess data"),e.maxZoom<0||24<e.maxZoom)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var i,n,o,a,s=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var i=0;i<t.features.length;i++)H(r,t.features[i],e,i);else H(r,"Feature"===t.type?t:{geometry:t},e);return r}(t,e);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),t=Y(a=i=s,1,-1-(o=(n=e).buffer/n.extent),o,0,-1,2,n),e=Y(i,1,1-o,2+o,0,-1,2,n),(t||e)&&(a=Y(i,1,-o,1+o,0,-1,2,n)||[],t&&(a=nt(t,1).concat(a)),e&&(a=a.concat(nt(e,-1)))),(s=a).length&&this.splitTile(s,0,0,0),r&&(s.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 pt(t,e,r){return 32*((1<<t)*r+e)+t}function ht(t,e){var r=t.tileID.canonical;return this._geoJSONIndex&&(t=this._geoJSONIndex.getTile(r.z,r.x,r.y))?(r=new d(t.features),0===(t=v(r)).byteOffset&&t.byteLength===t.buffer.byteLength||(t=new Uint8Array(t)),void e(null,{vectorTile:r,rawData:t.buffer})):e(null,null)}B.prototype.load=function(t){var e=this.options,r=e.log,i=e.minZoom,n=e.maxZoom,o=e.nodeSize;r&&console.time("total time"),e="prepare "+t.length+" points",r&&console.time(e),this.points=t;for(var a,s,u,l=[],c=0;c<t.length;c++)t[c].geometry&&l.push((s=c,void 0,a=(u=(a=t[c]).geometry.coordinates)[1],{x:F(u[0]),y:j(a),zoom:1/0,index:s,parentId:-1}));this.trees[n+1]=new L(l,N,V,o,Float32Array),r&&console.timeEnd(e);for(var p=n;i<=p;p--){var h=+Date.now();l=this._cluster(l,p);this.trees[p]=new L(l,N,V,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",p,l.length,+Date.now()-h)}return r&&console.timeEnd("total time"),this},B.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[1])),n=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(360<=t[2]-t[0])r=-180,n=180;else if(n<r){var a=this.getClusters([r,i,180,o],e);t=this.getClusters([-180,i,n,o],e);return a.concat(t)}for(var s=this.trees[this._limitZoom(e)],u=[],l=0,c=s.range(F(r),j(o),F(n),j(i));l<c.length;l+=1){var p=s.points[c[l]];u.push(p.numPoints?R(p):this.points[p.index])}return u},B.prototype.getChildren=function(t){var e=this._getOriginId(t),r=this._getOriginZoom(t),i="No cluster with the specified id.",n=this.trees[r];if(!n)throw new Error(i);if(!(e=n.points[e]))throw new Error(i);r=this.options.radius/(this.options.extent*Math.pow(2,r-1));for(var o=[],a=0,s=n.within(e.x,e.y,r);a<s.length;a+=1){var u=n.points[s[a]];u.parentId===t&&o.push(u.numPoints?R(u):this.points[u.index])}if(0===o.length)throw new Error(i);return o},B.prototype.getLeaves=function(t,e,r){var i=[];return this._appendLeaves(i,t,e=e||10,r=r||0,0),i},B.prototype.getTile=function(t,e,r){var i=this.trees[this._limitZoom(t)],n=Math.pow(2,t),o=(s=this.options).radius/s.extent,a=(r-o)/n,s=(t=(r+1+o)/n,{features:[]});return this._addTileFeatures(i.range((e-o)/n,a,(e+1+o)/n,t),i.points,e,r,n,s),0===e&&this._addTileFeatures(i.range(1-o/n,a,1,t),i.points,n,r,n,s),e===n-1&&this._addTileFeatures(i.range(0,a,o/n,t),i.points,-1,r,n,s),s.features.length?s:null},B.prototype.getClusterExpansionZoom=function(t){for(var e=this._getOriginZoom(t)-1;e<=this.options.maxZoom;){var r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e},B.prototype._appendLeaves=function(t,e,r,i,n){for(var o=0,a=this.getChildren(e);o<a.length;o+=1){var s=a[o],u=s.properties;if(u&&u.cluster?n+u.point_count<=i?n+=u.point_count:n=this._appendLeaves(t,u.cluster_id,r,i,n):n<i?n++:t.push(s),t.length===r)break}return n},B.prototype._addTileFeatures=function(t,e,r,i,n,o){for(var a=0,s=t;a<s.length;a+=1){var u=e[s[a]],l=u.numPoints,c={type:1,geometry:[[Math.round(this.options.extent*(u.x*n-r)),Math.round(this.options.extent*(u.y*n-i))]],tags:l?O(u):this.points[u.index].properties},p=void 0;l?p=u.id:this.options.generateId?p=u.index:this.points[u.index].id&&(p=this.points[u.index].id),void 0!==p&&(c.id=p),o.features.push(c)}},B.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))},B.prototype._cluster=function(t,e){for(var r=[],i=this.options,n=i.reduce,o=i.minPoints,a=i.radius/(i.extent*Math.pow(2,e)),s=0;s<t.length;s++){var u=t[s];if(!(u.zoom<=e)){u.zoom=e;for(var l=this.trees[e+1],c=l.within(u.x,u.y,a),p=u.numPoints||1,h=p,f=0,d=c;f<d.length;f+=1){var m=l.points[d[f]];m.zoom>e&&(h+=m.numPoints||1)}if(o<=h){for(var y=u.x*p,g=u.y*p,_=n&&1<p?this._map(u,!0):null,v=(s<<5)+(e+1)+this.points.length,x=0,b=c;x<b.length;x+=1){var w,S=l.points[b[x]];S.zoom<=e||(S.zoom=e,w=S.numPoints||1,y+=S.x*w,g+=S.y*w,S.parentId=v,n&&n(_=_||this._map(u,!0),this._map(S)))}u.parentId=v,r.push({x:y/h,y:g/h,zoom:1/0,id:v,parentId:-1,numPoints:h,properties:_})}else if(r.push(u),1<h)for(var T=0,E=c;T<E.length;T+=1){var I=l.points[E[T]];I.zoom<=e||(I.zoom=e,r.push(I))}}}return r},B.prototype._getOriginId=function(t){return t-this.points.length>>5},B.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},ct.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!(B.prototype._map=function(t,e){if(t.numPoints)return e?U({},t.properties):t.properties;var r=this.points[t.index].properties;t=this.options.map(r);return e&&t===r?U({},t):t}),promoteId:null,generateId:!1,debug:0},ct.prototype.splitTile=function(t,e,r,i,n,o,a){for(var s=[t,e,r,i],u=this.options,l=u.debug;s.length;){i=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var c,p,h,f,d,m,y,g,_=1<<e,v=pt(e,r,i),x=this.tiles[v];if(!x&&(1<l&&console.time("creation"),x=this.tiles[v]=ut(t,e,r,i,u),this.tileCoords.push({z:e,x:r,y:i}),l)&&(1<l&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,i,x.numFeatures,x.numPoints,x.numSimplified),console.timeEnd("creation")),g="z"+e,this.stats[g]=(this.stats[g]||0)+1,this.total++),x.source=t,n){if(e===u.maxZoom||e===n)continue;var b=1<<n-e;if(r!==Math.floor(o/b)||i!==Math.floor(a/b))continue}else if(e===u.indexMaxZoom||x.numPoints<=u.indexMaxPoints)continue;x.source=null,0!==t.length&&(1<l&&console.time("clipping"),d=.5-(f=.5*u.buffer/u.extent),m=1+f,y=c=p=h=null,g=Y(t,_,r-f,r+(v=.5+f),0,x.minX,x.maxX,u),b=Y(t,_,r+d,r+m,0,x.minX,x.maxX,u),t=null,g&&(y=Y(g,_,i-f,i+v,1,x.minY,x.maxY,u),c=Y(g,_,i+d,i+m,1,x.minY,x.maxY,u),g=null),b&&(p=Y(b,_,i-f,i+v,1,x.minY,x.maxY,u),h=Y(b,_,i+d,i+m,1,x.minY,x.maxY,u),b=null),1<l&&console.timeEnd("clipping"),s.push(y||[],e+1,2*r,2*i),s.push(c||[],e+1,2*r,2*i+1),s.push(p||[],e+1,2*r+1,2*i),s.push(h||[],e+1,2*r+1,2*i+1))}},ct.prototype.getTile=function(t,e,r){var i=this.options,n=i.extent,o=i.debug;if(t<0||24<t)return null;if(i=pt(t,e=(e%(i=1<<t)+i)%i,r),this.tiles[i])return at(this.tiles[i],n);1<o&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var a,s=t,u=e,l=r;!a&&0<s;)s--,u=Math.floor(u/2),l=Math.floor(l/2),a=this.tiles[pt(s,u,l)];return a&&a.source?(1<o&&console.log("found parent tile z%d-%d-%d",s,u,l),1<o&&console.time("drilling down"),this.splitTile(a.source,s,u,l,t,e,r),1<o&&console.timeEnd("drilling down"),this.tiles[i]?at(this.tiles[i],n):null):null};var ft,dt=((ft=s)&&(mt.__proto__=ft),((mt.prototype=Object.create(ft&&ft.prototype)).constructor=mt).prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},mt.prototype._loadData=function(){var e,r,i,n=this;this._pendingCallback&&this._pendingLoadDataParams&&(e=this._pendingCallback,r=this._pendingLoadDataParams,delete this._pendingCallback,delete this._pendingLoadDataParams,i=!!(r&&r.request&&r.request.collectResourceTiming)&&new t.RequestPerformance(r.request),this.loadGeoJSON(r,(function(o,a){if(o||!a)return e(o);if("object"!=typeof a)return e(new Error("Input data given to '"+r.source+"' is not a valid GeoJSON object."));!function t(e,r){var i,n=e&&e.type;if("FeatureCollection"===n)for(i=0;i<e.features.length;i++)t(e.features[i],r);else if("GeometryCollection"===n)for(i=0;i<e.geometries.length;i++)t(e.geometries[i],r);else if("Feature"===n)t(e.geometry,r);else if("Polygon"===n)c(e.coordinates,r);else if("MultiPolygon"===n)for(i=0;i<e.coordinates.length;i++)c(e.coordinates[i],r);return e}(a,!0);try{if(r.filter){var s=t.createExpression(r.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===s.result)throw new Error(s.value.map((function(t){return t.key+": "+t.message})).join(", "));a={type:"FeatureCollection",features:a.features.filter((function(t){return s.value.evaluate({zoom:0},t)}))}}n._geoJSONIndex=r.cluster?new B(function(){var e=r.superclusterOptions,i=r.clusterProperties;if(!i||!e)return e;for(var n={},o={},a={accumulated:null,zoom:0},s={properties:null},u=Object.keys(i),l=0,c=u;l<c.length;l+=1){var p=c[l],h=(f=i[p])[0],f=t.createExpression(f[1]);h=t.createExpression("string"==typeof h?[h,["accumulated"],["get",p]]:h);n[p]=f.value,o[p]=h.value}return e.map=function(t){s.properties=t;for(var e={},r=0,i=u;r<i.length;r+=1){var o=i[r];e[o]=n[o].evaluate(a,s)}return e},e.reduce=function(t,e){s.properties=e;for(var r=0,i=u;r<i.length;r+=1){var n=i[r];a.accumulated=t[n],t[n]=o[n].evaluate(a,s)}},e}()).load(a.features):new ct(a,r.geojsonVtOptions)}catch(o){return e(o)}n.loaded={};var u,l={};!i||(u=i.finish())&&(l.resourceTiming={},l.resourceTiming[r.source]=JSON.parse(JSON.stringify(u))),e(null,l)})))},mt.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},mt.prototype.reloadTile=function(t,e){var r=this.loaded;return r&&r[t.uid]?ft.prototype.reloadTile.call(this,t,e):this.loadTile(t,e)},mt.prototype.loadGeoJSON=function(e,r){if(e.request)t.getJSON(e.request,r);else{if("string"!=typeof e.data)return r(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."));try{return r(null,JSON.parse(e.data))}catch(t){return r(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."))}}},mt.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},mt.prototype.getClusterExpansionZoom=function(t,e){try{e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))}catch(t){e(t)}},mt.prototype.getClusterChildren=function(t,e){try{e(null,this._geoJSONIndex.getChildren(t.clusterId))}catch(t){e(t)}},mt.prototype.getClusterLeaves=function(t,e){try{e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))}catch(t){e(t)}},mt);function mt(t,e,r,i){ft.call(this,t,e,r,ht),i&&(this.loadGeoJSON=i)}return(m=function(e){var r=this;this.self=e,this.actor=new t.Actor(e,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:s,geojson:dt},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,e){if(r.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');r.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=function(e){if(t.plugin.isParsed())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=e.applyArabicShaping,t.plugin.processBidirectionalText=e.processBidirectionalText,t.plugin.processStyledBidirectionalText=e.processStyledBidirectionalText}}).prototype.setReferrer=function(t,e){this.referrer=e},m.prototype.setImages=function(t,e,r){for(var i in this.availableImages[t]=e,this.workerSources[t]){var n,o=this.workerSources[t][i];for(n in o)o[n].availableImages=e}r()},m.prototype.setLayers=function(t,e,r){this.getLayerIndex(t).replace(e),r()},m.prototype.updateLayers=function(t,e,r){this.getLayerIndex(t).update(e.layers,e.removedIds),r()},m.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).loadTile(e,r)},m.prototype.loadDEMTile=function(t,e,r){this.getDEMWorkerSource(t,e.source).loadTile(e,r)},m.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).reloadTile(e,r)},m.prototype.abortTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).abortTile(e,r)},m.prototype.removeTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).removeTile(e,r)},m.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},m.prototype.removeSource=function(t,e,r){var i;this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]&&(i=this.workerSources[t][e.type][e.source],delete this.workerSources[t][e.type][e.source],void 0!==i.removeSource?i.removeSource(e,r):r())},m.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t.toString())}},m.prototype.syncRTLPluginState=function(e,r,i){try{t.plugin.setState(r);var n,o=t.plugin.getPluginURL();t.plugin.isLoaded()&&!t.plugin.isParsed()&&null!=o&&(this.self.importScripts(o),i((n=t.plugin.isParsed())?void 0:new Error("RTL Text Plugin failed to import scripts from "+o),n))}catch(e){i(e.toString())}},m.prototype.getAvailableImages=function(t){return this.availableImages[t]||[]},m.prototype.getLayerIndex=function(t){return this.layerIndexes[t]||(this.layerIndexes[t]=new r)},m.prototype.getWorkerSource=function(t,e,r){var i=this;return this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),this.workerSources[t][e][r]||(this.workerSources[t][e][r]=new this.workerSourceTypes[e]({send:function(e,r,n){i.actor.send(e,r,n,t)}},this.getLayerIndex(t),this.getAvailableImages(t))),this.workerSources[t][e][r]},m.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new u),this.demWorkerSources[t][e]},m.prototype.enforceCacheSizeLimit=function(e,r){t.enforceCacheSizeLimit(r)},"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new m(self)),m})),i(0,(function(t){var e=t.createCommonjsModule((function(t){function e(t){return!r(t)}function r(t){return"undefined"==typeof window||"undefined"==typeof document?"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){var t,e,r=new Blob([""],{type:"text/javascript"}),i=URL.createObjectURL(r);try{e=new Worker(i),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(i),t}}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(e)return(e=e.getImageData(0,0,1,1))&&e.width===t.width}()?(void 0===i[r=t&&t.failIfMajorPerformanceCaveat]&&(i[r]=function(){var t,i;if(!(i=(t=r,i=document.createElement("canvas"),(n=Object.create(e.webGLContextAttributes)).failIfMajorPerformanceCaveat=t,i.probablySupportsContext?i.probablySupportsContext("webgl",n)||i.probablySupportsContext("experimental-webgl",n):i.supportsContext?i.supportsContext("webgl",n)||i.supportsContext("experimental-webgl",n):i.getContext("webgl",n)||i.getContext("experimental-webgl",n))))return!1;var n=i.createShader(i.VERTEX_SHADER);return!(!n||i.isContextLost())&&(i.shaderSource(n,"void main() {}"),i.compileShader(n),!0===i.getShaderParameter(n,i.COMPILE_STATUS))}()),i[r]?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 r}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e,window.mapboxgl.notSupportedReason=r);var i={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),r={create:function(e,r,i){return e=t.window.document.createElement(e),void 0!==r&&(e.className=r),i&&i.appendChild(e),e},createNS:function(e,r){return t.window.document.createElementNS(e,r)}},i=t.window.document&&t.window.document.documentElement.style;function n(t){if(!i)return t[0];for(var e=0;e<t.length;e++)if(t[e]in i)return t[e];return t[0]}var o,a=n(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);r.disableDrag=function(){i&&a&&(o=i[a],i[a]="none")},r.enableDrag=function(){i&&a&&(i[a]=o)};var s=n(["transform","WebkitTransform"]),u=!(r.setTransform=function(t,e){t.style[s]=e});try{var l=Object.defineProperty({},"passive",{get:function(){u=!0}});t.window.addEventListener("test",l,l),t.window.removeEventListener("test",l,l)}catch(t){u=!1}r.addEventListener=function(t,e,r,i){void 0===i&&(i={}),t.addEventListener(e,r,"passive"in i&&u?i:i.capture)},r.removeEventListener=function(t,e,r,i){void 0===i&&(i={}),t.removeEventListener(e,r,"passive"in i&&u?i:i.capture)};var c=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",c,!0)};r.suppressClick=function(){t.window.addEventListener("click",c,!0),t.window.setTimeout((function(){t.window.removeEventListener("click",c,!0)}),0)},r.mousePos=function(e,r){var i=e.getBoundingClientRect();return new t.Point(r.clientX-i.left-e.clientLeft,r.clientY-i.top-e.clientTop)},r.touchPos=function(e,r){for(var i=e.getBoundingClientRect(),n=[],o=0;o<r.length;o++)n.push(new t.Point(r[o].clientX-i.left-e.clientLeft,r[o].clientY-i.top-e.clientTop));return n},r.mouseButton=function(e){return void 0!==t.window.InstallTrigger&&2===e.button&&e.ctrlKey&&0<=t.window.navigator.platform.toUpperCase().indexOf("MAC")?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var p,h=((p=t.Evented)&&(y.__proto__=p),((y.prototype=Object.create(p&&p.prototype)).constructor=y).prototype.isLoaded=function(){return this.loaded},y.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t)){for(var e=0,r=this.requestors;e<r.length;e+=1){var i=r[e];this._notify(i.ids,i.callback)}this.requestors=[]}},y.prototype.getImage=function(t){return this.images[t]},y.prototype.addImage=function(t,e){this._validate(t,e)&&(this.images[t]=e)},y.prototype._validate=function(e,r){var i=!0;return this._validateStretch(r.stretchX,r.data&&r.data.width)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchX" value'))),i=!1),this._validateStretch(r.stretchY,r.data&&r.data.height)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchY" value'))),i=!1),this._validateContent(r.content,r)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "content" value'))),i=!1),i},y.prototype._validateStretch=function(t,e){if(!t)return!0;for(var r=0,i=0,n=t;i<n.length;i+=1){var o=n[i];if(o[0]<r||o[1]<o[0]||e<o[1])return!1;r=o[1]}return!0},y.prototype._validateContent=function(t,e){return!(t&&(4!==t.length||t[0]<0||e.data.width<t[0]||t[1]<0||e.data.height<t[1]||t[2]<0||e.data.width<t[2]||t[3]<0||e.data.height<t[3]||t[2]<t[0]||t[3]<t[1]))},y.prototype.updateImage=function(t,e){e.version=this.images[t].version+1,this.images[t]=e,this.updatedImages[t]=!0},y.prototype.removeImage=function(t){var e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()},y.prototype.listImages=function(){return Object.keys(this.images)},y.prototype.getImages=function(t,e){var r=!0;if(!this.isLoaded())for(var i=0,n=t;i<n.length;i+=1)this.images[n[i]]||(r=!1);this.isLoaded()||r?this._notify(t,e):this.requestors.push({ids:t,callback:e})},y.prototype._notify=function(e,r){for(var i={},n=0,o=e;n<o.length;n+=1){var a=o[n];this.images[a]||this.fire(new t.Event("styleimagemissing",{id:a}));var s=this.images[a];s?i[a]={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,version:s.version,stretchX:s.stretchX,stretchY:s.stretchY,content:s.content,hasRenderCallback:Boolean(s.userImage&&s.userImage.render)}:t.warnOnce('Image "'+a+'" 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.')}r(null,i)},y.prototype.getPixelSize=function(){var t=this.atlasImage;return{width:t.width,height:t.height}},y.prototype.getPattern=function(e){var r=this.patterns[e],i=this.getImage(e);return i?r&&r.position.version===i.version?r.position:(r?r.position.version=i.version:(r={w:i.data.width+2,h:i.data.height+2,x:0,y:0},i=new t.ImagePosition(r,i),this.patterns[e]={bin:r,position:i}),this._updatePatternAtlas(),this.patterns[e].position):null},y.prototype.bind=function(e){var r=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,r.RGBA),this.atlasTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)},y.prototype._updatePatternAtlas=function(){var e,r=[];for(e in this.patterns)r.push(this.patterns[e].bin);var i,n=(o=t.potpack(r)).w,o=o.h,a=this.atlasImage;for(i in a.resize({width:n||1,height:o||1}),this.patterns){var s=(p=this.patterns[i].bin).x+1,u=p.y+1,l=this.images[i].data,c=l.width,p=l.height;t.RGBAImage.copy(l,a,{x:0,y:0},{x:s,y:u},{width:c,height:p}),t.RGBAImage.copy(l,a,{x:0,y:p-1},{x:s,y:u-1},{width:c,height:1}),t.RGBAImage.copy(l,a,{x:0,y:0},{x:s,y:u+p},{width:c,height:1}),t.RGBAImage.copy(l,a,{x:c-1,y:0},{x:s-1,y:u},{width:1,height:p}),t.RGBAImage.copy(l,a,{x:0,y:0},{x:s+c,y:u},{width:1,height:p})}this.dirty=!0},y.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},y.prototype.dispatchRenderCallbacks=function(t){for(var e,r,i=0,n=t;i<n.length;i+=1){var o,a=n[i];this.callbackDispatchedThisFrame[a]||(this.callbackDispatchedThisFrame[a]=!0,r=void 0,(r=(e=o=this.images[a]).userImage)&&r.render&&r.render()&&(e.data.replace(new Uint8Array(r.data.buffer)),1)&&this.updateImage(a,o))}},y),f=g,d=g,m=1e20;function y(){p.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}function g(t,e,r,i,n,o){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=i||.25,this.fontFamily=n||"sans-serif",this.fontWeight=o||"normal",this.radius=r||8,r=this.size=this.fontSize+2*this.buffer,this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=r,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(r*r),this.gridInner=new Float64Array(r*r),this.f=new Float64Array(r),this.d=new Float64Array(r),this.z=new Float64Array(r+1),this.v=new Int16Array(r),this.middle=Math.round(r/2*(0<=navigator.userAgent.indexOf("Gecko/")?1.2:1))}function _(t,e,r,i,n,o,a){for(var s=0;s<e;s++){for(var u=0;u<r;u++)i[u]=t[u*e+s];for(v(i,n,o,a,r),u=0;u<r;u++)t[u*e+s]=n[u]}for(u=0;u<r;u++){for(s=0;s<e;s++)i[s]=t[u*e+s];for(v(i,n,o,a,e),s=0;s<e;s++)t[u*e+s]=Math.sqrt(n[s])}}function v(t,e,r,i,n){i[r[0]=0]=-m,i[1]=+m;for(var o=1,a=0;o<n;o++){for(var s=(t[o]+o*o-(t[r[a]]+r[a]*r[a]))/(2*o-2*r[a]);s<=i[a];)a--,s=(t[o]+o*o-(t[r[a]]+r[a]*r[a]))/(2*o-2*r[a]);r[++a]=o,i[a]=s,i[a+1]=+m}for(a=o=0;o<n;o++){for(;i[a+1]<o;)a++;e[o]=(o-r[a])*(o-r[a])+t[r[a]]}}g.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),r=new Uint8ClampedArray(this.size*this.size),i=0;i<this.size*this.size;i++){var n=e.data[4*i+3]/255;this.gridOuter[i]=1==n?0:0==n?m:Math.pow(Math.max(0,.5-n),2),this.gridInner[i]=1==n?m:0==n?0:Math.pow(Math.max(0,n-.5),2)}for(_(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),_(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),i=0;i<this.size*this.size;i++)r[i]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[i]-this.gridInner[i])/this.radius+this.cutoff))));return r},f.default=d;var x=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}};x.prototype.setURL=function(t){this.url=t},x.prototype.getGlyphs=function(e,r){var i,n=this,o=[];for(i in e)for(var a=0,s=e[i];a<s.length;a+=1)o.push({stack:i,id:s[a]});t.asyncAll(o,(function(t,e){var r=t.stack,i=t.id,o=n.entries[r];if(void 0===(t=(o=o||(n.entries[r]={glyphs:{},requests:{},ranges:{}})).glyphs[i])){if(t=n._tinySDF(o,r,i))return o.glyphs[i]=t,void e(null,{stack:r,id:i,glyph:t});var a,s=Math.floor(i/256);65535<256*s?e(new Error("glyphs > 65535 not supported")):o.ranges[s]?e(null,{stack:r,id:i,glyph:t}):((a=o.requests[s])||(a=o.requests[s]=[],x.loadGlyphRange(r,s,n.url,n.requestManager,(function(t,e){if(e){for(var r in e)n._doesCharSupportLocalGlyph(+r)||(o.glyphs[+r]=e[+r]);o.ranges[s]=!0}for(var i=0,u=a;i<u.length;i+=1)(0,u[i])(t,e);delete o.requests[s]}))),a.push((function(t,n){t?e(t):n&&e(null,{stack:r,id:i,glyph:n[i]||null})})))}else e(null,{stack:r,id:i,glyph:t})}),(function(t,e){if(t)r(t);else if(e){for(var i={},n=0,o=e;n<o.length;n+=1){var a=(u=o[n]).stack,s=u.id,u=u.glyph;(i[a]||(i[a]={}))[s]=u&&{id:u.id,bitmap:u.bitmap.clone(),metrics:u.metrics}}r(null,i)}}))},x.prototype._doesCharSupportLocalGlyph=function(e){return!!this.localIdeographFontFamily&&(t.isChar["CJK Unified Ideographs"](e)||t.isChar["Hangul Syllables"](e)||t.isChar.Hiragana(e)||t.isChar.Katakana(e))},x.prototype._tinySDF=function(e,r,i){var n=this.localIdeographFontFamily;if(n&&this._doesCharSupportLocalGlyph(i)){var o,a=e.tinySDF;return a||(o="400",/bold/i.test(r)?o="900":/medium/i.test(r)?o="500":/light/i.test(r)&&(o="200"),a=e.tinySDF=new x.TinySDF(24,3,8,.25,n,o)),{id:i,bitmap:new t.AlphaImage({width:30,height:30},a.draw(String.fromCharCode(i))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},x.loadGlyphRange=function(e,r,i,n,o){var a=256*r;r=255+a,r=n.transformRequest(n.normalizeGlyphsURL(i).replace("{fontstack}",e).replace("{range}",a+"-"+r),t.ResourceType.Glyphs);t.getArrayBuffer(r,(function(e,r){if(e)o(e);else if(r){for(var i={},n=0,a=t.parseGlyphPBF(r);n<a.length;n+=1){var s=a[n];i[s.id]=s}o(null,i)}}))},x.TinySDF=f,(zi=function(){this.specification=t.styleSpec.light.position}).prototype.possiblyEvaluate=function(e,r){return t.sphericalToCartesian(e.expression.evaluate(r))},zi.prototype.interpolate=function(e,r,i){return{x:t.number(e.x,r.x,i),y:t.number(e.y,r.y,i),z:t.number(e.z,r.z,i)}};var b,w=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new zi,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),S=((b=t.Evented)&&(E.__proto__=b),((E.prototype=Object.create(b&&b.prototype)).constructor=E).prototype.getLight=function(){return this._transitionable.serialize()},E.prototype.setLight=function(e,r){if(void 0===r&&(r={}),!this._validate(t.validateLight,e,r))for(var i in e){var n=e[i];t.endsWith(i,"-transition")?this._transitionable.setTransition(i.slice(0,-"-transition".length),n):this._transitionable.setValue(i,n)}},E.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)},E.prototype.hasTransition=function(){return this._transitioning.hasTransition()},E.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t)},E.prototype._validate=function(e,r,i){return(!i||!1!==i.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:r,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},E),T=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};function E(e){b.call(this),this._transitionable=new t.Transitionable(w),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}T.prototype.getDash=function(t,e){var r=t.join(",")+String(e);return this.dashEntry[r]||(this.dashEntry[r]=this.addDash(t,e)),this.dashEntry[r]},T.prototype.getDashRanges=function(t,e,r){var i=[],n=t.length%2==1?-t[t.length-1]*r:0,o=t[0]*r,a=!0;i.push({left:n,right:o,isDash:a,zeroLength:0===t[0]});for(var s=t[0],u=1;u<t.length;u++){var l=t[u];i.push({left:s*r,right:(s+=l)*r,isDash:a=!a,zeroLength:0===l})}return i},T.prototype.addRoundDash=function(t,e,r){for(var i=e/2,n=-r;n<=r;n++)for(var o=this.width*(this.nextRow+r+n),a=0,s=t[a],u=0;u<this.width;u++){1<u/s.right&&(s=t[++a]);var l,c=Math.abs(u-s.left),p=Math.abs(u-s.right),h=Math.min(c,p);c=n/r*(1+i);l=s.isDash?(p=i-Math.abs(c),Math.sqrt(h*h+p*p)):i-Math.sqrt(h*h+c*c),this.data[o+u]=Math.max(0,Math.min(255,l+128))}},T.prototype.addRegularDash=function(t){for(var e=t.length-1;0<=e;--e){var r=t[e],i=t[e+1];r.zeroLength?t.splice(e,1):i&&i.isDash===r.isDash&&(i.left=r.left,t.splice(e,1))}var n=t[0],o=t[t.length-1];n.isDash===o.isDash&&(n.left=o.left-this.width,o.right=n.right+this.width);for(var a=this.width*this.nextRow,s=0,u=t[s],l=0;l<this.width;l++){1<l/u.right&&(u=t[++s]);var c=Math.abs(l-u.left),p=Math.abs(l-u.right);p=Math.min(c,p);this.data[a+l]=Math.max(0,Math.min(255,(u.isDash?p:-p)+128))}},T.prototype.addDash=function(e,r){var i=r?7:0,n=2*i+1;if(this.nextRow+n>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var o,a,s=0,u=0;u<e.length;u++)s+=e[u];return 0!==s&&(o=this.width/s,a=this.getDashRanges(e,this.width,o),r?this.addRoundDash(a,o,i):this.addRegularDash(a)),i={y:(this.nextRow+i+.5)/this.height,height:2*i/this.height,width:s},this.nextRow+=n,this.dirty=!0,i},T.prototype.bind=function(t){t=t.gl,this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,this.data))};var I=function e(r,i){this.workerPool=r,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var n=this.workerPool.acquire(this.id),o=0;o<n.length;o++){var a=new e.Actor(n[o],i,this.id);a.name="Worker "+o,this.actors.push(a)}};function A(e,r,i){function n(n,o){if(n)return i(n);o&&(n=t.pick(t.extend(o,e),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]),o.vector_layers&&(n.vectorLayers=o.vector_layers,n.vectorLayerIds=n.vectorLayers.map((function(t){return t.id}))),n.tiles=r.canonicalizeTileset(n,e.url),i(null,n))}return e.url?t.getJSON(r.transformRequest(r.normalizeSourceURL(e.url),t.ResourceType.Source),n):t.browser.frame((function(){return n(null,e)}))}function C(e,r,i){this.bounds=t.LngLatBounds.convert(this.validateBounds(e)),this.minzoom=r||0,this.maxzoom=i||24}I.prototype.broadcast=function(e,r,i){t.asyncAll(this.actors,(function(t,i){t.send(e,r,i)}),i=i||function(){})},I.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},I.prototype.remove=function(){this.actors.forEach((function(t){t.remove()})),this.actors=[],this.workerPool.release(this.id)},I.Actor=t.Actor,C.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},C.prototype.contains=function(e){var r=Math.pow(2,e.z),i=Math.floor(t.mercatorXfromLng(this.bounds.getWest())*r),n=Math.floor(t.mercatorYfromLat(this.bounds.getNorth())*r),o=Math.ceil(t.mercatorXfromLng(this.bounds.getEast())*r);r=Math.ceil(t.mercatorYfromLat(this.bounds.getSouth())*r);return e.x>=i&&e.x<o&&e.y>=n&&e.y<r};var P,M,k,z,L,B,D,R=((D=t.Evented)&&(Y.__proto__=D),((Y.prototype=Object.create(D&&D.prototype)).constructor=Y).prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=A(this._options,this.map._requestManager,(function(r,i){e._tileJSONRequest=null,e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):i&&(t.extend(e,i),i.bounds&&(e.tileBounds=new C(i.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(i.tiles,e.map._requestManager._customAccessToken),t.postMapLoadEvent(i.tiles,e.map._getMapId(),e.map._requestManager._skuToken,e.map._requestManager._customAccessToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},Y.prototype.loaded=function(){return this._loaded},Y.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},Y.prototype.onAdd=function(t){this.map=t,this.load()},Y.prototype.setSourceProperty=function(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},Y.prototype.setTiles=function(t){var e=this;return this.setSourceProperty((function(){e._options.tiles=t})),this},Y.prototype.setUrl=function(t){var e=this;return this.setSourceProperty((function(){e.url=t,e._options.url=t})),this},Y.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},Y.prototype.serialize=function(){return t.extend({},this._options)},Y.prototype.loadTile=function(e,r){var i=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme));function n(i,n){return delete e.request,e.aborted?r(null):i&&404!==i.status?r(i):(n&&n.resourceTiming&&(e.resourceTiming=n.resourceTiming),this.map._refreshExpiredTiles&&n&&e.setExpiryData(n),e.loadVectorData(n,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),r(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}(i={request:this.map._requestManager.transformRequest(i,t.ResourceType.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId}).request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state?"loading"===e.state?e.reloadCallback=r:e.request=e.actor.send("reloadTile",i,n.bind(this)):(e.actor=this.dispatcher.getActor(),e.request=e.actor.send("loadTile",i,n.bind(this)))},Y.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)},Y.prototype.unloadTile=function(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)},Y.prototype.hasTransition=function(){return!1},Y),O=((B=t.Evented)&&(J.__proto__=B),((J.prototype=Object.create(B&&B.prototype)).constructor=J).prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=A(this._options,this.map._requestManager,(function(r,i){e._tileJSONRequest=null,e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):i&&(t.extend(e,i),i.bounds&&(e.tileBounds=new C(i.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(i.tiles),t.postMapLoadEvent(i.tiles,e.map._getMapId(),e.map._requestManager._skuToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},J.prototype.loaded=function(){return this._loaded},J.prototype.onAdd=function(t){this.map=t,this.load()},J.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},J.prototype.serialize=function(){return t.extend({},this._options)},J.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},J.prototype.loadTile=function(e,r){var i=this,n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(n,t.ResourceType.Tile),(function(n,o){var a;delete e.request,e.aborted?(e.state="unloaded",r(null)):n?(e.state="errored",r(n)):o&&(i.map._refreshExpiredTiles&&e.setExpiryData(o),delete o.cacheControl,delete o.expires,n=(a=i.map.painter.context).gl,e.texture=i.map.painter.getTileTexture(o.width),e.texture?e.texture.update(o,{useMipmap:!0}):(e.texture=new t.Texture(a,o,n.RGBA,{useMipmap:!0}),e.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST),a.extTextureFilterAnisotropic&&n.texParameterf(n.TEXTURE_2D,a.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,a.extTextureFilterAnisotropicMax)),e.state="loaded",t.cacheEntryPossiblyAdded(i.dispatcher),r(null))}))},J.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e()},J.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()},J.prototype.hasTransition=function(){return!1},J),F=((L=O)&&(K.__proto__=L),((K.prototype=Object.create(L&&L.prototype)).constructor=K).prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},K.prototype.loadTile=function(e,r){var i=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(i,t.ResourceType.Tile),function(i,n){delete e.request,e.aborted?(e.state="unloaded",r(null)):i?(e.state="errored",r(i)):n&&(this.map._refreshExpiredTiles&&e.setExpiryData(n),delete n.cacheControl,delete n.expires,n=t.window.ImageBitmap&&n instanceof t.window.ImageBitmap&&t.offscreenCanvasSupported()?n:t.browser.getImageData(n,1),n={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:n,encoding:this.encoding},e.actor&&"expired"!==e.state||(e.actor=this.dispatcher.getActor(),e.actor.send("loadDEMTile",n,function(t,i){t&&(e.state="errored",r(t)),i&&(e.dem=i,e.needsHillshadePrepare=!0,e.state="loaded",r(null))}.bind(this))))}.bind(this)),e.neighboringTiles=this._getNeighboringTiles(e.tileID)},K.prototype._getNeighboringTiles=function(e){var r=e.canonical,i=Math.pow(2,r.z),n=(r.x-1+i)%i,o=0===r.x?e.wrap-1:e.wrap,a=(r.x+1+i)%i,s=r.x+1===i?e.wrap+1:e.wrap,u={};return u[new t.OverscaledTileID(e.overscaledZ,o,r.z,n,r.y).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y).key]={backfilled:!1},0<r.y&&(u[new t.OverscaledTileID(e.overscaledZ,o,r.z,n,r.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y-1).key]={backfilled:!1}),r.y+1<i&&(u[new t.OverscaledTileID(e.overscaledZ,o,r.z,n,r.y+1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y+1).key]={backfilled:!1}),u},K.prototype.unloadTile=function(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})},K),j=((z=t.Evented)&&(X.__proto__=z),((X.prototype=Object.create(z&&z.prototype)).constructor=X).prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(r){r?e.fire(new t.ErrorEvent(r)):(r={dataType:"source",sourceDataType:"metadata"},e._collectResourceTiming&&e._resourceTiming&&0<e._resourceTiming.length&&(r.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",r)))}))},X.prototype.onAdd=function(t){this.map=t,this.load()},X.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){e?r.fire(new t.ErrorEvent(e)):(e={dataType:"source",sourceDataType:"content"},r._collectResourceTiming&&r._resourceTiming&&0<r._resourceTiming.length&&(e.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",e)))})),this},X.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},X.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},X.prototype.getClusterLeaves=function(t,e,r,i){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},i),this},X.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var i=t.extend({},this.workerOptions),n=this._data;"string"==typeof n?(i.request=this.map._requestManager.transformRequest(t.browser.resolveURL(n),t.ResourceType.Source),i.request.collectResourceTiming=this._collectResourceTiming):i.data=JSON.stringify(n),this.actor.send(this.type+".loadData",i,(function(t,n){r._removed||n&&n.abandoned||(r._loaded=!0,n&&n.resourceTiming&&n.resourceTiming[r.id]&&(r._resourceTiming=n.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:i.source},null),e(t))}))},X.prototype.loaded=function(){return this._loaded},X.prototype.loadTile=function(e,r){var i=this,n=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(n,{type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(t,o){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(o,i.map.painter,"reloadTile"==n),r(null))}))},X.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},X.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},X.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},X.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},X.prototype.hasTransition=function(){return!1},X),U=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),N=((k=t.Evented)&&(W.__proto__=k),((W.prototype=Object.create(k&&k.prototype)).constructor=W).prototype.load=function(e,r){var i=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(n,o){i._loaded=!0,n?i.fire(new t.ErrorEvent(n)):o&&(i.image=o,e&&(i.coordinates=e),r&&r(),i._finishLoading())}))},W.prototype.loaded=function(){return this._loaded},W.prototype.updateImage=function(t){var e=this;return this.image&&t.url&&(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null}))),this},W.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},W.prototype.onAdd=function(t){this.map=t,this.load()},W.prototype.setCoordinates=function(e){var r=this,i=(this.coordinates=e).map(t.MercatorCoordinate.fromLngLat);return this.tileID=function(){for(var e=1/0,r=1/0,n=-1/0,o=-1/0,a=0,s=i;a<s.length;a+=1){var u=s[a];e=Math.min(e,u.x),r=Math.min(r,u.y),n=Math.max(n,u.x),o=Math.max(o,u.y)}var l=Math.max(n-e,o-r),c=Math.max(0,Math.floor(-Math.log(l)/Math.LN2));l=Math.pow(2,c);return new t.CanonicalTileID(c,Math.floor((e+n)/2*l),Math.floor((r+o)/2*l))}(),this.minzoom=this.maxzoom=this.tileID.z,e=i.map((function(t){return r.tileID.getTilePoint(t)._round()})),this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(e[0].x,e[0].y,0,0),this._boundsArray.emplaceBack(e[1].x,e[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(e[3].x,e[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(e[2].x,e[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},W.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e,r=this.map.painter.context,i=r.gl;for(e in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,U.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(r,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this.tiles){var n=this.tiles[e];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture)}}},W.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t).buckets={}:t.state="errored",e(null)},W.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},W.prototype.hasTransition=function(){return!1},W),V=((M=N)&&(Z.__proto__=M),((Z.prototype=Object.create(M&&M.prototype)).constructor=Z).prototype.load=function(){var e=this;this._loaded=!1;var r=this.options;this.urls=[];for(var i=0,n=r.urls;i<n.length;i+=1)this.urls.push(this.map._requestManager.transformRequest(n[i],t.ResourceType.Source).url);t.getVideo(this.urls,(function(r,i){e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):i&&(e.video=i,e.video.loop=!0,e.video.addEventListener("playing",(function(){e.map.triggerRepaint()})),e.map&&e.video.play(),e._finishLoading())}))},Z.prototype.pause=function(){this.video&&this.video.pause()},Z.prototype.play=function(){this.video&&this.video.play()},Z.prototype.seek=function(e){var r;this.video&&(e<(r=this.video.seekable).start(0)||e>r.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e)},Z.prototype.getVideo=function(){return this.video},Z.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},Z.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e,r=this.map.painter.context,i=r.gl;for(e in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,U.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(r,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this.tiles){var n=this.tiles[e];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture)}}},Z.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},Z.prototype.hasTransition=function(){return this.video&&!this.video.paused},Z),q=((P=N)&&(H.__proto__=P),((H.prototype=Object.create(P&&P.prototype)).constructor=H).prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.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())},H.prototype.getCanvas=function(){return this.canvas},H.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},H.prototype.onRemove=function(){this.pause()},H.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r,i=this.map.painter.context,n=i.gl;for(r in this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,U.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(i,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var o=this.tiles[r];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture)}}},H.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},H.prototype.hasTransition=function(){return this._playing},H.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var r=e[t];if(isNaN(r)||r<=0)return!0}return!1},H),G={vector:R,raster:O,"raster-dem":F,geojson:j,video:V,image:N,canvas:q};function H(e,r,i,n){P.call(this,e,r,i,n),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+e,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+e,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+e,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+e,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 t.ErrorEvent(new t.ValidationError("sources."+e,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate}function Z(t,e,r,i){M.call(this,t,e,r,i),this.roundZoom=!0,this.type="video",this.options=e}function W(t,e,r,i){k.call(this),this.id=t,this.dispatcher=r,this.coordinates=e.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=e}function X(e,r,i,n){z.call(this),this.id=e,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=i.getActor(),this.setEventedParent(n),this._data=r.data,this._options=t.extend({},r),this._collectResourceTiming=r.collectResourceTiming,this._resourceTiming=[],void 0!==r.maxzoom&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution),this.promoteId=r.promoteId,n=t.EXTENT/this.tileSize,this.workerOptions=t.extend({source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:(void 0!==r.buffer?r.buffer:128)*n,tolerance:(void 0!==r.tolerance?r.tolerance:.375)*n,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1},superclusterOptions:{maxZoom:void 0!==r.clusterMaxZoom?Math.min(r.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,r.clusterMinPoints||2),extent:t.EXTENT,radius:(r.clusterRadius||50)*n,log:!1,generateId:r.generateId||!1},clusterProperties:r.clusterProperties,filter:r.filter},r.workerOptions)}function K(e,r,i,n){L.call(this,e,r,i,n),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox"}function J(e,r,i,n){B.call(this),this.id=e,this.dispatcher=i,this.setEventedParent(n),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.extend({type:"raster"},r),t.extend(this,t.pick(r,["url","scheme","tileSize"]))}function Y(e,r,i,n){if(D.call(this),this.id=e,this.dispatcher=i,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.extend(this,t.pick(r,["url","scheme","tileSize","promoteId"])),this._options=t.extend({type:"vector"},r),this._collectResourceTiming=r.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(n)}function Q(e,r,i,n,o,a){var s=function(t,e,r){if(t)for(var i=0,n=t;i<n.length;i+=1){var o=e[n[i]];if(o&&o.source===r&&"fill-extrusion"===o.type)return!0}else for(var a in e){var s=e[a];if(s.source===r&&"fill-extrusion"===s.type)return!0}return!1}(o&&o.layers,r,e.id),u=a.maxPitchScaleFactor();(s=e.tilesIn(n,u,s)).sort($);for(var l,c,p=[],h=0,f=s;h<f.length;h+=1){var d=f[h];p.push({wrappedTileID:d.tileID.wrapped().key,queryResults:d.tile.queryRenderedFeatures(r,i,e._state,d.queryGeometry,d.cameraQueryGeometry,d.scale,o,a,u,(l=e.transform,c=d.tileID,d=void 0,d=t.identity([]),t.translate(d,d,[1,1,0]),t.scale(d,d,[.5*l.width,.5*l.height,1]),t.multiply(d,d,l.calculatePosMatrix(c.toUnwrapped()))))})}var m,y=function(){for(var t={},e={},r=0,i=p;r<i.length;r+=1){var n,o,a=(o=i[r]).queryResults,s=e[o=o.wrappedTileID]=e[o]||{};for(n in a)for(var u=a[n],l=s[n]=s[n]||{},c=t[n]=t[n]||[],h=0,f=u;h<f.length;h+=1){var d=f[h];l[d.featureIndex]||(l[d.featureIndex]=!0,c.push(d))}}return t}();for(m in y)y[m].forEach((function(t){var r=t.feature;t=e.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=t}));return y}function $(t,e){return t=t.tileID,e=e.tileID,t.overscaledZ-e.overscaledZ||t.canonical.y-e.canonical.y||t.wrap-e.wrap||t.canonical.x-e.canonical.x}function tt(t,e){this.max=t,this.onRemove=e,this.reset()}function et(t,e,r){var i=(this.context=t).gl;this.buffer=i.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}function rt(t,e,r,i){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=i,i=(this.context=t).gl,this.buffer=i.createBuffer(),t.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}tt.prototype.reset=function(){for(var t in this.data)for(var e=0,r=this.data[t];e<r.length;e+=1){var i=r[e];i.timeout&&clearTimeout(i.timeout),this.onRemove(i.value)}return this.data={},this.order=[],this},tt.prototype.add=function(t,e,r){var i=this,n=t.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);var o,a={value:e,timeout:void 0};return void 0!==r&&(a.timeout=setTimeout((function(){i.remove(t,a)}),r)),this.data[n].push(a),this.order.push(n),this.order.length>this.max&&(o=this._getAndRemoveByKey(this.order[0]))&&this.onRemove(o),this},tt.prototype.has=function(t){return t.wrapped().key in this.data},tt.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},tt.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},tt.prototype.getByKey=function(t){return(t=this.data[t])?t[0].value:null},tt.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},tt.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key;t=void 0===e?0:this.data[r].indexOf(e),e=this.data[r][t];return this.data[r].splice(t,1),e.timeout&&clearTimeout(e.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(e.value),this.order.splice(this.order.indexOf(r),1),this},tt.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},tt.prototype.filter=function(t){var e,r=[];for(e in this.data)for(var i=0,n=this.data[e];i<n.length;i+=1){var o=n[i];t(o.value)||r.push(o)}for(var a=0,s=r;a<s.length;a+=1){var u=s[a];this.remove(u.value.tileID,u)}},et.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},et.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},et.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var it={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};function nt(t,e,r,i){this.context=t,this.width=e,this.height=r,r=this.framebuffer=t.gl.createFramebuffer(),this.colorAttachment=new ge(t,r),i&&(this.depthAttachment=new _e(t,r))}rt.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},rt.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},rt.prototype.enableAttributes=function(t,e){for(var r=0;r<this.attributes.length;r++){var i=e.attributes[this.attributes[r].name];void 0!==i&&t.enableVertexAttribArray(i)}},rt.prototype.setVertexAttribPointers=function(t,e,r){for(var i=0;i<this.attributes.length;i++){var n=this.attributes[i],o=e.attributes[n.name];void 0!==o&&t.vertexAttribPointer(o,n.components,t[it[n.type]],!1,this.itemSize,n.offset+this.itemSize*(r||0))}},rt.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)},(Li=function(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}).prototype.get=function(){return this.current},Li.prototype.set=function(t){},Li.prototype.getDefault=function(){return this.default},Li.prototype.setDefault=function(){this.set(this.default)};var ot,at,st,ut,lt,ct,pt,ht,ft,dt,mt,yt,gt,_t,vt,xt,bt,wt,St,Tt,Et,It,At,Ct,Pt,Mt,kt,zt,Lt,Bt,Dt,Rt,Ot,Ft,jt=((Ft=Li)&&(Qe.__proto__=Ft),((Qe.prototype=Object.create(Ft&&Ft.prototype)).constructor=Qe).prototype.getDefault=function(){return t.Color.transparent},Qe.prototype.set=function(t){var e=this.current;t.r===e.r&&t.g===e.g&&t.b===e.b&&t.a===e.a&&!this.dirty||(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},Qe),Ut=((Ot=Li)&&(Ye.__proto__=Ot),((Ye.prototype=Object.create(Ot&&Ot.prototype)).constructor=Ye).prototype.getDefault=function(){return 1},Ye.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.clearDepth(t),this.current=t,this.dirty=!1)},Ye),Nt=((Rt=Li)&&(Je.__proto__=Rt),((Je.prototype=Object.create(Rt&&Rt.prototype)).constructor=Je).prototype.getDefault=function(){return 0},Je.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.clearStencil(t),this.current=t,this.dirty=!1)},Je),Vt=((Dt=Li)&&(Ke.__proto__=Dt),((Ke.prototype=Object.create(Dt&&Dt.prototype)).constructor=Ke).prototype.getDefault=function(){return[!0,!0,!0,!0]},Ke.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&!this.dirty||(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},Ke),qt=((Bt=Li)&&(Xe.__proto__=Bt),((Xe.prototype=Object.create(Bt&&Bt.prototype)).constructor=Xe).prototype.getDefault=function(){return!0},Xe.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.depthMask(t),this.current=t,this.dirty=!1)},Xe),Gt=((Lt=Li)&&(We.__proto__=Lt),((We.prototype=Object.create(Lt&&Lt.prototype)).constructor=We).prototype.getDefault=function(){return 255},We.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.stencilMask(t),this.current=t,this.dirty=!1)},We),Ht=((zt=Li)&&(Ze.__proto__=zt),((Ze.prototype=Object.create(zt&&zt.prototype)).constructor=Ze).prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},Ze.prototype.set=function(t){var e=this.current;t.func===e.func&&t.ref===e.ref&&t.mask===e.mask&&!this.dirty||(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)},Ze),Zt=((kt=Li)&&(He.__proto__=kt),((He.prototype=Object.create(kt&&kt.prototype)).constructor=He).prototype.getDefault=function(){var t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]},He.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&!this.dirty||(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)},He),Wt=((Mt=Li)&&(Ge.__proto__=Mt),((Ge.prototype=Object.create(Mt&&Mt.prototype)).constructor=Ge).prototype.getDefault=function(){return!1},Ge.prototype.set=function(t){var e;t===this.current&&!this.dirty||(e=this.gl,t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1)},Ge),Xt=((Pt=Li)&&(qe.__proto__=Pt),((qe.prototype=Object.create(Pt&&Pt.prototype)).constructor=qe).prototype.getDefault=function(){return[0,1]},qe.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&!this.dirty||(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)},qe),Kt=((Ct=Li)&&(Ve.__proto__=Ct),((Ve.prototype=Object.create(Ct&&Ct.prototype)).constructor=Ve).prototype.getDefault=function(){return!1},Ve.prototype.set=function(t){var e;t===this.current&&!this.dirty||(e=this.gl,t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1)},Ve),Jt=((At=Li)&&(Ne.__proto__=At),((Ne.prototype=Object.create(At&&At.prototype)).constructor=Ne).prototype.getDefault=function(){return this.gl.LESS},Ne.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.depthFunc(t),this.current=t,this.dirty=!1)},Ne),Yt=((It=Li)&&(Ue.__proto__=It),((Ue.prototype=Object.create(It&&It.prototype)).constructor=Ue).prototype.getDefault=function(){return!1},Ue.prototype.set=function(t){var e;t===this.current&&!this.dirty||(e=this.gl,t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1)},Ue),Qt=((Et=Li)&&(je.__proto__=Et),((je.prototype=Object.create(Et&&Et.prototype)).constructor=je).prototype.getDefault=function(){var t=this.gl;return[t.ONE,t.ZERO]},je.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&!this.dirty||(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)},je),$t=((Tt=Li)&&(Fe.__proto__=Tt),((Fe.prototype=Object.create(Tt&&Tt.prototype)).constructor=Fe).prototype.getDefault=function(){return t.Color.transparent},Fe.prototype.set=function(t){var e=this.current;t.r===e.r&&t.g===e.g&&t.b===e.b&&t.a===e.a&&!this.dirty||(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},Fe),te=((St=Li)&&(Oe.__proto__=St),((Oe.prototype=Object.create(St&&St.prototype)).constructor=Oe).prototype.getDefault=function(){return this.gl.FUNC_ADD},Oe.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.blendEquation(t),this.current=t,this.dirty=!1)},Oe),ee=((wt=Li)&&(Re.__proto__=wt),((Re.prototype=Object.create(wt&&wt.prototype)).constructor=Re).prototype.getDefault=function(){return!1},Re.prototype.set=function(t){var e;t===this.current&&!this.dirty||(e=this.gl,t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1)},Re),re=((bt=Li)&&(De.__proto__=bt),((De.prototype=Object.create(bt&&bt.prototype)).constructor=De).prototype.getDefault=function(){return this.gl.BACK},De.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.cullFace(t),this.current=t,this.dirty=!1)},De),ie=((xt=Li)&&(Be.__proto__=xt),((Be.prototype=Object.create(xt&&xt.prototype)).constructor=Be).prototype.getDefault=function(){return this.gl.CCW},Be.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.frontFace(t),this.current=t,this.dirty=!1)},Be),ne=((vt=Li)&&(Le.__proto__=vt),((Le.prototype=Object.create(vt&&vt.prototype)).constructor=Le).prototype.getDefault=function(){return null},Le.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.useProgram(t),this.current=t,this.dirty=!1)},Le),oe=((_t=Li)&&(ze.__proto__=_t),((ze.prototype=Object.create(_t&&_t.prototype)).constructor=ze).prototype.getDefault=function(){return this.gl.TEXTURE0},ze.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.activeTexture(t),this.current=t,this.dirty=!1)},ze),ae=((gt=Li)&&(ke.__proto__=gt),((ke.prototype=Object.create(gt&&gt.prototype)).constructor=ke).prototype.getDefault=function(){var t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]},ke.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&!this.dirty||(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},ke),se=((yt=Li)&&(Me.__proto__=yt),((Me.prototype=Object.create(yt&&yt.prototype)).constructor=Me).prototype.getDefault=function(){return null},Me.prototype.set=function(t){var e;t===this.current&&!this.dirty||((e=this.gl).bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1)},Me),ue=((mt=Li)&&(Pe.__proto__=mt),((Pe.prototype=Object.create(mt&&mt.prototype)).constructor=Pe).prototype.getDefault=function(){return null},Pe.prototype.set=function(t){var e;t===this.current&&!this.dirty||((e=this.gl).bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1)},Pe),le=((dt=Li)&&(Ce.__proto__=dt),((Ce.prototype=Object.create(dt&&dt.prototype)).constructor=Ce).prototype.getDefault=function(){return null},Ce.prototype.set=function(t){var e;t===this.current&&!this.dirty||((e=this.gl).bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1)},Ce),ce=((ft=Li)&&(Ae.__proto__=ft),((Ae.prototype=Object.create(ft&&ft.prototype)).constructor=Ae).prototype.getDefault=function(){return null},Ae.prototype.set=function(t){var e;t===this.current&&!this.dirty||((e=this.gl).bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1)},Ae),pe=((ht=Li)&&(Ie.__proto__=ht),((Ie.prototype=Object.create(ht&&ht.prototype)).constructor=Ie).prototype.getDefault=function(){return null},Ie.prototype.set=function(t){var e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1},Ie),he=((pt=Li)&&(Ee.__proto__=pt),((Ee.prototype=Object.create(pt&&pt.prototype)).constructor=Ee).prototype.getDefault=function(){return null},Ee.prototype.set=function(t){this.vao&&(t!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1)},Ee),fe=((ct=Li)&&(Te.__proto__=ct),((Te.prototype=Object.create(ct&&ct.prototype)).constructor=Te).prototype.getDefault=function(){return 4},Te.prototype.set=function(t){var e;t===this.current&&!this.dirty||((e=this.gl).pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1)},Te),de=((lt=Li)&&(Se.__proto__=lt),((Se.prototype=Object.create(lt&&lt.prototype)).constructor=Se).prototype.getDefault=function(){return!1},Se.prototype.set=function(t){var e;t===this.current&&!this.dirty||((e=this.gl).pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1)},Se),me=((ut=Li)&&(we.__proto__=ut),((we.prototype=Object.create(ut&&ut.prototype)).constructor=we).prototype.getDefault=function(){return!1},we.prototype.set=function(t){var e;t===this.current&&!this.dirty||((e=this.gl).pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1)},we),ye=((st=Li)&&(be.__proto__=st),((be.prototype=Object.create(st&&st.prototype)).constructor=be).prototype.getDefault=function(){return null},be),ge=((at=ye)&&(xe.__proto__=at),((xe.prototype=Object.create(at&&at.prototype)).constructor=xe).prototype.setDirty=function(){this.dirty=!0},xe.prototype.set=function(t){var e;t===this.current&&!this.dirty||(this.context.bindFramebuffer.set(this.parent),(e=this.gl).framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1)},xe),_e=((ot=ye)&&(ve.__proto__=ot),((ve.prototype=Object.create(ot&&ot.prototype)).constructor=ve).prototype.set=function(t){var e;t===this.current&&!this.dirty||(this.context.bindFramebuffer.set(this.parent),(e=this.gl).framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1)},ve);function ve(){ot.apply(this,arguments)}function xe(){at.apply(this,arguments)}function be(t,e){st.call(this,t),this.context=t,this.parent=e}function we(){ut.apply(this,arguments)}function Se(){lt.apply(this,arguments)}function Te(){ct.apply(this,arguments)}function Ee(t){pt.call(this,t),this.vao=t.extVertexArrayObject}function Ie(){ht.apply(this,arguments)}function Ae(){ft.apply(this,arguments)}function Ce(){dt.apply(this,arguments)}function Pe(){mt.apply(this,arguments)}function Me(){yt.apply(this,arguments)}function ke(){gt.apply(this,arguments)}function ze(){_t.apply(this,arguments)}function Le(){vt.apply(this,arguments)}function Be(){xt.apply(this,arguments)}function De(){bt.apply(this,arguments)}function Re(){wt.apply(this,arguments)}function Oe(){St.apply(this,arguments)}function Fe(){Tt.apply(this,arguments)}function je(){Et.apply(this,arguments)}function Ue(){It.apply(this,arguments)}function Ne(){At.apply(this,arguments)}function Ve(){Ct.apply(this,arguments)}function qe(){Pt.apply(this,arguments)}function Ge(){Mt.apply(this,arguments)}function He(){kt.apply(this,arguments)}function Ze(){zt.apply(this,arguments)}function We(){Lt.apply(this,arguments)}function Xe(){Bt.apply(this,arguments)}function Ke(){Dt.apply(this,arguments)}function Je(){Rt.apply(this,arguments)}function Ye(){Ot.apply(this,arguments)}function Qe(){Ft.apply(this,arguments)}nt.prototype.destroy=function(){var t,e=this.context.gl,r=this.colorAttachment.get();r&&e.deleteTexture(r),this.depthAttachment&&(t=this.depthAttachment.get())&&e.deleteRenderbuffer(t),e.deleteFramebuffer(this.framebuffer)};var $e=function(t,e,r){this.func=t,this.mask=e,this.range=r};$e.ReadOnly=!1,$e.ReadWrite=!0,$e.disabled=new $e(519,$e.ReadOnly,[0,1]);var tr=function(t,e,r,i,n,o){this.test=t,this.ref=e,this.mask=r,this.fail=i,this.depthFail=n,this.pass=o};tr.disabled=new tr({func:519,mask:0},0,0,7680,7680,7680);var er=function(t,e,r){this.blendFunction=t,this.blendColor=e,this.mask=r};er.disabled=new er(er.Replace=[1,0],t.Color.transparent,[!1,!1,!1,!1]),er.unblended=new er(er.Replace,t.Color.transparent,[!0,!0,!0,!0]),er.alphaBlended=new er([1,771],t.Color.transparent,[!0,!0,!0,!0]);var rr=function(t,e,r){this.enable=t,this.mode=e,this.frontFace=r};function ir(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new jt(this),this.clearDepth=new Ut(this),this.clearStencil=new Nt(this),this.colorMask=new Vt(this),this.depthMask=new qt(this),this.stencilMask=new Gt(this),this.stencilFunc=new Ht(this),this.stencilOp=new Zt(this),this.stencilTest=new Wt(this),this.depthRange=new Xt(this),this.depthTest=new Kt(this),this.depthFunc=new Jt(this),this.blend=new Yt(this),this.blendFunc=new Qt(this),this.blendColor=new $t(this),this.blendEquation=new te(this),this.cullFace=new ee(this),this.cullFaceSide=new re(this),this.frontFace=new ie(this),this.program=new ne(this),this.activeTexture=new oe(this),this.viewport=new ae(this),this.bindFramebuffer=new se(this),this.bindRenderbuffer=new ue(this),this.bindTexture=new le(this),this.bindVertexBuffer=new ce(this),this.bindElementBuffer=new pe(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new he(this),this.pixelStoreUnpack=new fe(this),this.pixelStoreUnpackPremultiplyAlpha=new de(this),this.pixelStoreUnpackFlipY=new me(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(t.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=t.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=t.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE)}rr.disabled=new rr(!1,1029,2305),rr.backCCW=new rr(!0,1029,2305),ir.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()},ir.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},ir.prototype.createIndexBuffer=function(t,e){return new et(this,t,e)},ir.prototype.createVertexBuffer=function(t,e,r){return new rt(this,t,e,r)},ir.prototype.createRenderbuffer=function(t,e,r){var i=this.gl,n=i.createRenderbuffer();return this.bindRenderbuffer.set(n),i.renderbufferStorage(i.RENDERBUFFER,t,e,r),this.bindRenderbuffer.set(null),n},ir.prototype.createFramebuffer=function(t,e,r){return new nt(this,t,e,r)},ir.prototype.clear=function(t){var e=t.color,r=t.depth,i=this.gl;t=0;e&&(t|=i.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==r&&(t|=i.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),i.clear(t)},ir.prototype.setCullFace=function(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))},ir.prototype.setDepthMode=function(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)},ir.prototype.setStencilMode=function(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)},ir.prototype.setColorMode=function(e){t.deepEqual(e.blendFunction,er.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)},ir.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var nr,or=((nr=t.Evented)&&(ar.__proto__=nr),((ar.prototype=Object.create(nr&&nr.prototype)).constructor=ar).prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)},ar.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t)},ar.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0},ar.prototype.getSource=function(){return this._source},ar.prototype.pause=function(){this._paused=!0},ar.prototype.resume=function(){var t;this._paused&&(t=this._shouldReloadOnResume,this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform))},ar.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},ar.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,(function(){}))},ar.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,(function(){}))},ar.prototype.serialize=function(){return this._source.serialize()},ar.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var r=this._tiles[e];r.upload(t),r.prepare(this.map.style.imageManager)}},ar.prototype.getIds=function(){return t.values(this._tiles).map((function(t){return t.tileID})).sort(sr).map((function(t){return t.key}))},ar.prototype.getRenderableIds=function(e){var r,i=this,n=[];for(r in this._tiles)this._isIdRenderable(r,e)&&n.push(this._tiles[r]);return e?n.sort((function(e,r){var n=e.tileID,o=r.tileID;e=new t.Point(n.canonical.x,n.canonical.y)._rotate(i.transform.angle),r=new t.Point(o.canonical.x,o.canonical.y)._rotate(i.transform.angle);return n.overscaledZ-o.overscaledZ||r.y-e.y||r.x-e.x})).map((function(t){return t.tileID.key})):n.map((function(t){return t.tileID})).sort(sr).map((function(t){return t.key}))},ar.prototype.hasRenderableParent=function(t){return!!(t=this.findLoadedParent(t,0))&&this._isIdRenderable(t.tileID.key)},ar.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},ar.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")},ar.prototype._reloadTile=function(t,e){var r=this._tiles[t];r&&("loading"!==r.state&&(r.state=e),this._loadTile(r,this._tileLoaded.bind(this,r,t,e)))},ar.prototype._tileLoaded=function(e,r,i,n){if(n)return e.state="errored",void(404!==n.status?this._source.fire(new t.ErrorEvent(n,{tile:e})):this.update(this.transform));e.timeAdded=t.browser.now(),"expired"===i&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:e,coord:e.tileID}))},ar.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),r=0;r<e.length;r++){var i=e[r];t.neighboringTiles&&t.neighboringTiles[i]&&(n(t,i=this.getTileByID(i)),n(i,t))}function n(t,e){t.needsHillshadePrepare=!0;var r=e.tileID.canonical.x-t.tileID.canonical.x,i=e.tileID.canonical.y-t.tileID.canonical.y,n=Math.pow(2,t.tileID.canonical.z),o=e.tileID.key;0===r&&0==i||1<Math.abs(i)||(1<Math.abs(r)&&(1===Math.abs(r+n)?r+=n:1===Math.abs(r-n)&&(r-=n)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,i),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}},ar.prototype.getTile=function(t){return this.getTileByID(t.key)},ar.prototype.getTileByID=function(t){return this._tiles[t]},ar.prototype._retainLoadedChildren=function(t,e,r,i){for(var n in this._tiles){var o=this._tiles[n];if(!(i[n]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>r)){for(var a=o.tileID;o&&o.tileID.overscaledZ>e+1;){var s=o.tileID.scaledTo(o.tileID.overscaledZ-1);(o=this._tiles[s.key])&&o.hasData()&&(a=s)}for(var u=a;u.overscaledZ>e;)if(t[(u=u.scaledTo(u.overscaledZ-1)).key]){i[a.key]=a;break}}}},ar.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var i=t.overscaledZ-1;e<=i;i--){var n=t.scaledTo(i);if(n=this._getLoadedTile(n))return n}},ar.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},ar.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1;t=Math.ceil(t.height/this._source.tileSize)+1,t=Math.floor(e*t*5),t="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,t):t;this._cache.setMaxSize(t)},ar.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var r,i,n,o={};for(r in this._tiles){var a=this._tiles[r];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+e),o[a.tileID.key]=a}for(i in this._tiles=o,this._timers)clearTimeout(this._timers[i]),delete this._timers[i];for(n in this._tiles)this._setTileReloadTimer(n,this._tiles[n])}},ar.prototype.update=function(e){var r,i=this;if(this.transform=e,this._sourceLoaded&&!this._paused){this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?r=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(r=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(r=r.filter((function(t){return i._source.hasTile(t)})))):r=[];var n,o=e.coveringZoomLevel(this._source),a=Math.max(o-ar.maxOverzooming,this._source.minzoom),s=(e=Math.max(o+ar.maxUnderzooming,this._source.minzoom),this._updateRetainedTiles(r,o));if(ur(this._source.type)){for(var u,l={},c={},p=0,h=Object.keys(s);p<h.length;p+=1){var f=h[p],d=s[f],m=this._tiles[f];!m||m.fadeEndTime&&m.fadeEndTime<=t.browser.now()||((m=this.findLoadedParent(d,a))&&(this._addTile(m.tileID),l[m.tileID.key]=m.tileID),c[f]=d)}for(u in this._retainLoadedChildren(c,o,e,s),l)s[u]||(this._coveredTiles[u]=!0,s[u]=l[u])}for(n in s)this._tiles[n].clearFadeHold();for(var y=0,g=t.keysDifference(this._tiles,s);y<g.length;y+=1){var _=g[y],v=this._tiles[_];v.hasSymbolBuckets&&!v.holdingForFade()?v.setHoldDuration(this.map._fadeDuration):v.hasSymbolBuckets&&!v.symbolFadeFinished()||this._removeTile(_)}this._updateLoadedParentTileCache()}},ar.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)},ar.prototype._updateRetainedTiles=function(t,e){for(var r={},i={},n=Math.max(e-ar.maxOverzooming,this._source.minzoom),o=Math.max(e+ar.maxUnderzooming,this._source.minzoom),a={},s=0,u=t;s<u.length;s+=1){var l=u[s],c=this._addTile(l);r[l.key]=l,c.hasData()||e<this._source.maxzoom&&(a[l.key]=l)}this._retainLoadedChildren(a,e,o,r);for(var p=0,h=t;p<h.length;p+=1){var f=h[p],d=this._tiles[f.key];if(!d.hasData()){if(e+1>this._source.maxzoom){var m=f.children(this._source.maxzoom)[0],y=this.getTile(m);if(y&&y.hasData()){r[m.key]=m;continue}}else if(r[(m=f.children(this._source.maxzoom))[0].key]&&r[m[1].key]&&r[m[2].key]&&r[m[3].key])continue;for(var g=d.wasRequested(),_=f.overscaledZ-1;n<=_;--_){var v=f.scaledTo(_);if(i[v.key])break;if(i[v.key]=!0,!(d=this.getTile(v))&&g&&(d=this._addTile(v)),d&&(r[v.key]=v,g=d.wasRequested(),d.hasData()))break}}}return r},ar.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,i=this._tiles[t].tileID;0<i.overscaledZ;){if(i.key in this._loadedParentTiles){r=this._loadedParentTiles[i.key];break}e.push(i.key);var n=i.scaledTo(i.overscaledZ-1);if(r=this._getLoadedTile(n))break;i=n}for(var o=0,a=e;o<a.length;o+=1)this._loadedParentTiles[a[o]]=r}},ar.prototype._addTile=function(e){var r=this._tiles[e.key];if(r)return r;(r=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));var i=Boolean(r);return i||(r=new t.Tile(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,this._tileLoaded.bind(this,r,e.key,r.state))),r?(r.uses++,this._tiles[e.key]=r,i||this._source.fire(new t.Event("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r):null},ar.prototype._setTileReloadTimer=function(t,e){var r=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]),(e=e.getExpiryTimeout())&&(this._timers[t]=setTimeout((function(){r._reloadTile(t,"expired"),delete r._timers[t]}),e))},ar.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),0<e.uses||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},ar.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},ar.prototype.tilesIn=function(e,r,i){var n=this,o=[],a=this.transform;if(!a)return o;i=i?a.getCameraQueryGeometry(e):e;for(var s=e.map((function(t){return a.pointCoordinate(t)})),u=i.map((function(t){return a.pointCoordinate(t)})),l=this.getIds(),c=1/0,p=1/0,h=-1/0,f=-1/0,d=0,m=u;d<m.length;d+=1){var y=m[d];c=Math.min(c,y.x),p=Math.min(p,y.y),h=Math.max(h,y.x),f=Math.max(f,y.y)}for(var g=0;g<l.length;g++)!function(e){var i,d,m,y=n._tiles[l[e]];y.holdingForFade()||(i=y.tileID,d=Math.pow(2,a.zoom-y.tileID.overscaledZ),m=r*y.queryPadding*t.EXTENT/y.tileSize/d,(e=[i.getTilePoint(new t.MercatorCoordinate(c,p)),i.getTilePoint(new t.MercatorCoordinate(h,f))])[0].x-m<t.EXTENT&&e[0].y-m<t.EXTENT&&0<=e[1].x+m&&0<=e[1].y+m&&(e=s.map((function(t){return i.getTilePoint(t)})),m=u.map((function(t){return i.getTilePoint(t)})),o.push({tile:y,tileID:i,queryGeometry:e,cameraQueryGeometry:m,scale:d})))}(g);return o},ar.prototype.getVisibleCoordinates=function(t){for(var e=this,r=0,i=t=this.getRenderableIds(t).map((function(t){return e._tiles[t].tileID}));r<i.length;r+=1){var n=i[r];n.posMatrix=this.transform.calculatePosMatrix(n.toUnwrapped())}return t},ar.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(ur(this._source.type))for(var e in this._tiles){var r=this._tiles[e];if(void 0!==r.fadeEndTime&&r.fadeEndTime>=t.browser.now())return!0}return!1},ar.prototype.setFeatureState=function(t,e,r){this._state.updateState(t=t||"_geojsonTileLayer",e,r)},ar.prototype.removeFeatureState=function(t,e,r){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,r)},ar.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},ar.prototype.setDependencies=function(t,e,r){(t=this._tiles[t])&&t.setDependencies(e,r)},ar.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(t,e)}))},ar);function ar(e,r,i){var n=this;nr.call(this),this.id=e,this.dispatcher=i,this.on("data",(function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(n._sourceLoaded=!0),n._sourceLoaded&&!n._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(n.reload(),n.transform&&n.update(n.transform))})),this.on("error",(function(){n._sourceErrored=!0})),this._source=function(e,n){if((n=new G[r.type](e,r,i,n)).id!==e)throw new Error("Expected Source id to be "+e+" instead of "+n.id);return t.bindAll(["load","abort","unload","serialize","prepare"],n),n}(e,this),this._tiles={},this._cache=new tt(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new t.SourceFeatureState}function sr(t,e){var r=Math.abs(2*t.wrap)-(t.wrap<0),i=Math.abs(2*e.wrap)-(e.wrap<0);return t.overscaledZ-e.overscaledZ||i-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function ur(t){return"raster"===t||"image"===t||"video"===t}function lr(){return new t.window.Worker(na.workerUrl)}or.maxOverzooming=10,or.maxUnderzooming=3;var cr="mapboxgl_preloaded_worker_pool",pr=function(){this.active={}};pr.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<pr.workerCount;)this.workers.push(new lr);return this.active[t]=!0,this.workers.slice()},pr.prototype.release=function(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach((function(t){t.terminate()})),this.workers=null)},pr.prototype.isPreloaded=function(){return!!this.active[cr]},pr.prototype.numActive=function(){return Object.keys(this.active).length};var hr,fr=Math.floor(t.browser.hardwareConcurrency/2);function dr(){return hr=hr||new pr}function mr(e){e=e.slice();for(var r=Object.create(null),i=0;i<e.length;i++)r[e[i].id]=e[i];for(var n=0;n<e.length;n++)"ref"in e[n]&&(e[n]=function(e,r){var i,n={};for(i in e)"ref"!==i&&(n[i]=e[i]);return t.refProperties.forEach((function(t){t in r&&(n[t]=r[t])})),n}(e[n],r[e[n].ref]));return e}pr.workerCount=Math.max(Math.min(fr,6),1);var yr={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 gr(t,e,r){r.push({command:yr.addSource,args:[t,e[t]]})}function _r(t,e,r){e.push({command:yr.removeSource,args:[t]}),r[t]=!0}function vr(e,r,i,n,o,a){for(var s in r=r||{},e=e||{})e.hasOwnProperty(s)&&(t.deepEqual(e[s],r[s])||i.push({command:a,args:[n,s,r[s],o]}));for(s in r)r.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(t.deepEqual(e[s],r[s])||i.push({command:a,args:[n,s,r[s],o]}))}function xr(t){return t.id}function br(t,e){return t[e.id]=e,t}function wr(t,e){this.reset(t,e)}function Sr(t,e,r){var i=this.boxCells=[],n=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var o=0;o<this.xCellCount*this.yCellCount;o++)i.push([]),n.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0}function Tr(e,r,i,n,o){var a=t.create();return r?(t.scale(a,a,[1/o,1/o,1]),i||t.rotateZ(a,a,n.angle)):t.multiply(a,n.labelPlaneMatrix,e),a}function Er(e,r,i,n,o){return r?(e=t.clone(e),t.scale(e,e,[o,o,1]),i||t.rotateZ(e,e,-n.angle),e):n.glCoordMatrix}function Ir(e,r){return Dr(e=[e.x,e.y,0,1],e,r),r=e[3],{point:new t.Point(e[0]/r,e[1]/r),signedDistanceFromCamera:r}}function Ar(t,e){return.5+t/e*.5}function Cr(t,e,r,i,n,o,a,s,u,l,c){var p=s.glyphStartIndex+s.numGlyphs,h=s.lineStartIndex,f=s.lineStartIndex+s.lineLength,d=e.getoffsetX(s.glyphStartIndex);p=e.getoffsetX(p-1);return(d=zr(t*d,r,i,n,o,a,s.segment,h,f,u,l,c))&&(c=zr(t*p,r,i,n,o,a,s.segment,h,f,u,l,c))?{first:d,last:c}:null}function Pr(e,r,i,n){return e===t.WritingMode.horizontal&&Math.abs(i.y-r.y)>Math.abs(i.x-r.x)*n?{useVertical:!0}:(e===t.WritingMode.vertical?r.y<i.y:r.x>i.x)?{needsFlipping:!0}:null}function Mr(e,r,i,n,o,a,s,u,l,c,p,h,f,d){var m,y=r/24,g=e.lineOffsetX*y,_=e.lineOffsetY*y;if(1<e.numGlyphs){var v=e.glyphStartIndex+e.numGlyphs,x=e.lineStartIndex,b=e.lineStartIndex+e.lineLength;if(!(S=Cr(y,u,g,_,i,p,h,e,l,a,f)))return{notEnoughRoom:!0};if(r=Ir(S.first.point,s).point,s=Ir(S.last.point,s).point,n&&!i&&(s=Pr(e.writingMode,r,s,d)))return s;m=[S.first];for(var w=e.glyphStartIndex+1;w<v-1;w++)m.push(zr(y*u.getoffsetX(w),g,_,i,p,h,e.segment,x,b,l,a,f));m.push(S.last)}else{if(n&&!i){var S=Ir(h,o).point,T=(n=e.lineStartIndex+e.segment+1,0<(n=Ir(T=new t.Point(l.getx(n),l.gety(n)),o)).signedDistanceFromCamera?n.point:kr(h,T,S,1,o));if(T=Pr(e.writingMode,S,T,d))return T}if(!(T=zr(y*u.getoffsetX(e.glyphStartIndex),g,_,i,p,h,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,l,a,f)))return{notEnoughRoom:!0};m=[T]}for(var E=0,I=m;E<I.length;E+=1){var A=I[E];t.addDynamicAttributes(c,A.point,A.angle)}return{}}function kr(t,e,r,i,n){return n=Ir(t.add(t.sub(e)._unit()),n).point,n=r.sub(n),r.add(n._mult(i/n.mag()))}function zr(e,r,i,n,o,a,s,u,l,c,p,h){var f=0<(e=n?e-r:e+r)?1:-1;r=0;n&&(f*=-1,r=Math.PI),f<0&&(r+=Math.PI);for(var d=0<f?u+s:u+s+1,m=o,y=o,g=0,_=0,v=Math.abs(e),x=[];g+_<=v;){if((d+=f)<u||l<=d)return null;var b,w;y=m;x.push(m),void 0===(m=h[d])&&(m=0<(w=Ir(b=new t.Point(c.getx(d),c.gety(d)),p)).signedDistanceFromCamera?h[d]=w.point:(w=d-f,kr(0===g?a:new t.Point(c.getx(w),c.gety(w)),b,y,v-g+1,p))),g+=_,_=y.dist(m)}return o=(v-g)/_,(o=(e=m.sub(y)).mult(o)._add(y))._add(e._unit()._perp()._mult(i*f)),r+=Math.atan2(m.y-y.y,m.x-y.x),x.push(o),{point:o,angle:r,path:x}}wr.prototype.reset=function(t,e){this.points=t||[],this._distances=[0];for(var r=1;r<this.points.length;r++)this._distances[r]=this._distances[r-1]+this.points[r].dist(this.points[r-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(e||0,.5*this.length),this.paddedLength=this.length-2*this.padding},wr.prototype.lerp=function(e){if(1===this.points.length)return this.points[0];e=t.clamp(e,0,1);for(var r=1,i=this._distances[r],n=e*this.paddedLength+this.padding;i<n&&r<this._distances.length;)i=this._distances[++r];var o=r-1,a=this._distances[o];e=0<(e=i-a)?(n-a)/e:0;return this.points[o].mult(1-e).add(this.points[r].mult(e))},Sr.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Sr.prototype.insert=function(t,e,r,i,n){this._forEachCell(e,r,i,n,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)},Sr.prototype.insertCircle=function(t,e,r,i){this._forEachCell(e-i,r-i,e+i,r+i,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(i)},Sr.prototype._insertBoxCell=function(t,e,r,i,n,o){this.boxCells[n].push(o)},Sr.prototype._insertCircleCell=function(t,e,r,i,n,o){this.circleCells[n].push(o)},Sr.prototype._query=function(t,e,r,i,n,o){if(r<0||t>this.width||i<0||e>this.height)return!n&&[];var a=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=i){if(n)return!0;for(var s=0;s<this.boxKeys.length;s++)a.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var u=0;u<this.circleKeys.length;u++){var l=this.circles[3*u],c=this.circles[3*u+1],p=this.circles[3*u+2];a.push({key:this.circleKeys[u],x1:l-p,y1:c-p,x2:l+p,y2:c+p})}return o?a.filter(o):a}return this._forEachCell(t,e,r,i,this._queryCell,a,{hitTest:n,seenUids:{box:{},circle:{}}},o),n?0<a.length:a},Sr.prototype._queryCircle=function(t,e,r,i,n){var o=t-r,a=t+r,s=e-r,u=e+r;if(a<0||o>this.width||u<0||s>this.height)return!i&&[];var l=[];return this._forEachCell(o,s,a,u,this._queryCellCircle,l,{hitTest:i,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}},n),i?0<l.length:l},Sr.prototype.query=function(t,e,r,i,n){return this._query(t,e,r,i,!1,n)},Sr.prototype.hitTest=function(t,e,r,i,n){return this._query(t,e,r,i,!0,n)},Sr.prototype.hitTestCircle=function(t,e,r,i){return this._queryCircle(t,e,r,!0,i)},Sr.prototype._queryCell=function(t,e,r,i,n,o,a,s){var u=a.seenUids,l=this.boxCells[n];if(null!==l)for(var c=this.bboxes,p=0,h=l;p<h.length;p+=1){var f=h[p];if(!u.box[f]){u.box[f]=!0;var d=4*f;if(t<=c[2+d]&&e<=c[3+d]&&r>=c[0+d]&&i>=c[1+d]&&(!s||s(this.boxKeys[f]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[f],x1:c[d],y1:c[1+d],x2:c[2+d],y2:c[3+d]})}}}if(null!==(n=this.circleCells[n]))for(var m=this.circles,y=0,g=n;y<g.length;y+=1){var _=g[y];if(!u.circle[_]){u.circle[_]=!0;var v=3*_;if(this._circleAndRectCollide(m[v],m[1+v],m[2+v],t,e,r,i)&&(!s||s(this.circleKeys[_]))){if(a.hitTest)return o.push(!0),!0;var x=m[v],b=m[1+v];v=m[2+v];o.push({key:this.circleKeys[_],x1:x-v,y1:b-v,x2:x+v,y2:b+v})}}}},Sr.prototype._queryCellCircle=function(t,e,r,i,n,o,a,s){var u=a.circle,l=a.seenUids;if(null!==(a=this.boxCells[n]))for(var c=this.bboxes,p=0,h=a;p<h.length;p+=1){var f=h[p];if(!l.box[f]){l.box[f]=!0;var d=4*f;if(this._circleAndRectCollide(u.x,u.y,u.radius,c[0+d],c[1+d],c[2+d],c[3+d])&&(!s||s(this.boxKeys[f])))return o.push(!0),!0}}if(null!==(n=this.circleCells[n]))for(var m=this.circles,y=0,g=n;y<g.length;y+=1){var _=g[y];if(!l.circle[_]){l.circle[_]=!0;var v=3*_;if(this._circlesCollide(m[v],m[1+v],m[2+v],u.x,u.y,u.radius)&&(!s||s(this.circleKeys[_])))return o.push(!0),!0}}},Sr.prototype._forEachCell=function(t,e,r,i,n,o,a,s){for(var u=this._convertToXCellCoord(t),l=this._convertToYCellCoord(e),c=this._convertToXCellCoord(r),p=this._convertToYCellCoord(i),h=u;h<=c;h++)for(var f=l;f<=p;f++)if(n.call(this,t,e,r,i,this.xCellCount*f+h,o,a,s))return},Sr.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},Sr.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},Sr.prototype._circlesCollide=function(t,e,r,i,n,o){return(t=i-t)*t+(e=n-e)*e<(o=r+o)*o},Sr.prototype._circleAndRectCollide=function(t,e,r,i,n,o,a){return!((o=(o-i)/2)+r<(i=Math.abs(t-(i+o))))&&(!((a=(a-n)/2)+r<(n=Math.abs(e-(n+a))))&&(i<=o||n<=a||(o=i-o)*o+(a=n-a)*a<=r*r))};var Lr=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Br(t,e){for(var r=0;r<t;r++){var i=e.length;e.resize(i+4),e.float32.set(Lr,3*i)}}function Dr(t,e,r){var i=e[0];e=e[1];return t[0]=r[0]*i+r[4]*e+r[12],t[1]=r[1]*i+r[5]*e+r[13],t[3]=r[3]*i+r[7]*e+r[15],t}function Rr(t,e,r){void 0===e&&(e=new Sr(t.width+200,t.height+200,25)),void 0===r&&(r=new Sr(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=r,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200}function Or(e,r,i){return r*(t.EXTENT/(e.tileSize*Math.pow(2,i-e.tileID.overscaledZ)))}function Fr(t,e,r,i){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):i&&r?1:0,this.placed=r}function jr(t,e,r,i,n){this.text=new Fr(t?t.text:null,e,r,n),this.icon=new Fr(t?t.icon:null,e,i,n)}function Ur(t,e,r){this.text=t,this.icon=e,this.skipFade=r}function Nr(){this.invProjMatrix=t.create(),this.viewportMatrix=t.create(),this.circles=[]}function Vr(t,e,r,i,n){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=r,this.bucketIndex=i,this.tileID=n}function qr(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}function Gr(e,r,i,n,o){var a=t.getAnchorAlignment(e);r=-(a.horizontalAlign-.5)*r,i=-(a.verticalAlign-.5)*i,n=t.evaluateVariableOffset(e,n);return new t.Point(r+n[0]*o,i+n[1]*o)}function Hr(e,r,i,n,o,a){var s=e.x1,u=e.x2,l=e.y1,c=e.y2,p=e.anchorPointX;e=e.anchorPointY,i=new t.Point(r,i);return n&&i._rotate(o?a:-a),{x1:s+i.x,y1:l+i.y,x2:u+i.x,y2:c+i.y,anchorPointX:p,anchorPointY:e}}function Zr(t,e,r,i){this.transform=t.clone(),this.collisionIndex=new Rr(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new qr(r),this.collisionCircleArrays={},(this.prevPlacement=i)&&(i.prevPlacement=void 0),this.placedOrientations={}}function Wr(t,e,r,i,n){t.emplaceBack(e?1:0,r?1:0,i||0,n||0),t.emplaceBack(e?1:0,r?1:0,i||0,n||0),t.emplaceBack(e?1:0,r?1:0,i||0,n||0),t.emplaceBack(e?1:0,r?1:0,i||0,n||0)}Rr.prototype.placeCollisionBox=function(t,e,r,i,n){var o=r*(s=this.projectAndGetPerspectiveRatio(i,t.anchorPointX,t.anchorPointY)).perspectiveRatio,a=t.x1*o+s.point.x,s=(i=t.y1*o+s.point.y,r=t.x2*o+s.point.x,t.y2*o+s.point.y);return!this.isInsideGrid(a,i,r,s)||!e&&this.grid.hitTest(a,i,r,s,n)?{box:[],offscreen:!1}:{box:[a,i,r,s],offscreen:this.isOffscreen(a,i,r,s)}},Rr.prototype.placeCollisionCircles=function(e,r,i,n,o,a,s,u,l,c,p,h,f){var d=[],m=new t.Point(r.anchorX,r.anchorY),y=(a=Ir(m,a),a=Ar(this.transform.cameraToCenterDistance,a.signedDistanceFromCamera),c=(c?o/a:o*a)/t.ONE_EM,o=Ir(m,s).point,!1),g=!1,_=!0;if(s=Cr(c,n,r.lineOffsetX*c,r.lineOffsetY*c,!1,o,m,r,i,s,{})){for(var v=.5*h*a+f,x=(a=new t.Point(-100,-100),f=new t.Point(this.screenRightBoundary,this.screenBottomBoundary),new wr),b=s.first,w=s.last,S=[],T=b.path.length-1;1<=T;T--)S.push(b.path[T]);for(var E=1;E<w.path.length;E++)S.push(w.path[E]);var I=2.5*v;u&&(S=(A=S.map((function(t){return Ir(t,u)}))).some((function(t){return t.signedDistanceFromCamera<=0}))?[]:A.map((function(t){return t.point})));var A=[];if(0<S.length){for(var C=S[0].clone(),P=S[0].clone(),M=1;M<S.length;M++)C.x=Math.min(C.x,S[M].x),C.y=Math.min(C.y,S[M].y),P.x=Math.max(P.x,S[M].x),P.y=Math.max(P.y,S[M].y);A=C.x>=a.x&&P.x<=f.x&&C.y>=a.y&&P.y<=f.y?[S]:P.x<a.x||C.x>f.x||P.y<a.y||C.y>f.y?[]:t.clipLine([S],a.x,a.y,f.x,f.y)}for(var k,z=0,L=A;z<L.length;z+=1){x.reset(L[z],.25*v),k=x.length<=.5*v?1:Math.ceil(x.paddedLength/I)+1;for(var B=0;B<k;B++){var D=B/Math.max(k-1,1),R=(U=x.lerp(D)).x+100,O=U.y+100;d.push(R,O,v,0);var F=R-v,j=O-v,U=(D=R+v,O+v);_=_&&this.isOffscreen(F,j,D,U),g=g||this.isInsideGrid(F,j,D,U);if(!e&&this.grid.hitTestCircle(R,O,v,p)&&(y=!0,!l))return{circles:[],offscreen:!1,collisionDetected:y}}}}return{circles:!l&&y||!g?[]:d,offscreen:_,collisionDetected:y}},Rr.prototype.queryRenderedSymbols=function(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var r=[],i=1/0,n=1/0,o=-1/0,a=-1/0,s=0,u=e;s<u.length;s+=1){var l=u[s];l=new t.Point(l.x+100,l.y+100),i=Math.min(i,l.x),n=Math.min(n,l.y),o=Math.max(o,l.x),a=Math.max(a,l.y);r.push(l)}for(var c={},p={},h=0,f=this.grid.query(i,n,o,a).concat(this.ignoredGrid.query(i,n,o,a));h<f.length;h+=1){var d=f[h],m=d.key;void 0===c[m.bucketInstanceId]&&(c[m.bucketInstanceId]={}),c[m.bucketInstanceId][m.featureIndex]||(d=[new t.Point(d.x1,d.y1),new t.Point(d.x2,d.y1),new t.Point(d.x2,d.y2),new t.Point(d.x1,d.y2)],t.polygonIntersectsPolygon(r,d)&&(c[m.bucketInstanceId][m.featureIndex]=!0,void 0===p[m.bucketInstanceId]&&(p[m.bucketInstanceId]=[]),p[m.bucketInstanceId].push(m.featureIndex)))}return p},Rr.prototype.insertCollisionBox=function(t,e,r,i,n){(e?this.ignoredGrid:this.grid).insert({bucketInstanceId:r,featureIndex:i,collisionGroupID:n},t[0],t[1],t[2],t[3])},Rr.prototype.insertCollisionCircles=function(t,e,r,i,n){for(var o=e?this.ignoredGrid:this.grid,a={bucketInstanceId:r,featureIndex:i,collisionGroupID:n},s=0;s<t.length;s+=4)o.insertCircle(a,t[s],t[s+1],t[s+2])},Rr.prototype.projectAndGetPerspectiveRatio=function(e,r,i){return Dr(i=[r,i,0,1],i,e),{point:new t.Point((i[0]/i[3]+1)/2*this.transform.width+100,(-i[1]/i[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/i[3]*.5}},Rr.prototype.isOffscreen=function(t,e,r,i){return r<100||t>=this.screenRightBoundary||i<100||e>this.screenBottomBoundary},Rr.prototype.isInsideGrid=function(t,e,r,i){return 0<=r&&t<this.gridRightBoundary&&0<=i&&e<this.gridBottomBoundary},Rr.prototype.getViewportMatrix=function(){var e=t.identity([]);return t.translate(e,e,[-100,-100,0]),e},Fr.prototype.isHidden=function(){return 0===this.opacity&&!this.placed},jr.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()},qr.prototype.get=function(t){return this.crossSourceCollisions?{ID:0,predicate:null}:(this.collisionGroups[t]||(e=++this.maxGroupID,this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}}),this.collisionGroups[t]);var e},Zr.prototype.getBucketParts=function(e,r,i,n){var o=i.getBucket(r),a=i.latestFeatureIndex;if(o&&a&&r.id===o.layerIds[0]){var s=i.collisionBoxArray,u=o.layers[0].layout,l=Math.pow(2,this.transform.zoom-i.tileID.overscaledZ),c=i.tileSize/t.EXTENT,p=this.transform.calculatePosMatrix(i.tileID.toUnwrapped()),h="map"===u.get("text-pitch-alignment"),f="map"===u.get("text-rotation-alignment"),d=Or(i,1,this.transform.zoom),m=Tr(p,h,f,this.transform,d);r=null;h&&(d=Er(p,h,f,this.transform,d),r=t.multiply([],this.transform.labelPlaneMatrix,d)),this.retainedQueryData[o.bucketInstanceId]=new Vr(o.bucketInstanceId,a,o.sourceLayerIndex,o.index,i.tileID);var y={bucket:o,layout:u,posMatrix:p,textLabelPlaneMatrix:m,labelToScreenMatrix:r,scale:l,textPixelRatio:c,holdingForFade:i.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(o.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(o.sourceID)};if(n)for(var g=0,_=o.sortKeyRanges;g<_.length;g+=1){var v=_[g];e.push({sortKey:v.sortKey,symbolInstanceStart:v.symbolInstanceStart,symbolInstanceEnd:v.symbolInstanceEnd,parameters:y})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:o.symbolInstances.length,parameters:y})}},Zr.prototype.attemptAnchorPlacement=function(t,e,r,i,n,o,a,s,u,l,c,p,h,f,d){var m,y=[p.textOffset0,p.textOffset1],g=Gr(t,r,i,y,n);e=this.collisionIndex.placeCollisionBox(Hr(e,g.x,g.y,o,a,this.transform.angle),c,s,u,l.predicate);if(!d||0!==this.collisionIndex.placeCollisionBox(Hr(d,g.x,g.y,o,a,this.transform.angle),c,s,u,l.predicate).box.length)return 0<e.box.length?(this.prevPlacement&&this.prevPlacement.variableOffsets[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID].text&&(m=this.prevPlacement.variableOffsets[p.crossTileID].anchor),this.variableOffsets[p.crossTileID]={textOffset:y,width:r,height:i,anchor:t,textBoxScale:n,prevAnchor:m},this.markUsedJustification(h,t,p,f),h.allowVerticalPlacement&&(this.markUsedOrientation(h,f,p),this.placedOrientations[p.crossTileID]=f),{shift:g,placedGlyphBoxes:e}):void 0},Zr.prototype.placeLayerBucketPart=function(e,r,i){var n=this,o=(w=e.parameters).bucket,a=w.layout,s=w.posMatrix,u=w.textLabelPlaneMatrix,l=w.labelToScreenMatrix,c=w.textPixelRatio,p=w.holdingForFade,h=w.collisionBoxArray,f=w.partiallyEvaluatedTextSize,d=w.collisionGroup,m=a.get("text-optional"),y=a.get("icon-optional"),g=a.get("text-allow-overlap"),_=a.get("icon-allow-overlap"),v="map"===a.get("text-rotation-alignment"),x="map"===a.get("text-pitch-alignment"),b="none"!==a.get("icon-text-fit"),w="viewport-y"===a.get("symbol-z-order"),S=g&&(_||!o.hasIconData()||y),T=_&&(g||!o.hasTextData()||m);function E(e,h){if(!r[e.crossTileID])if(p)n.placements[e.crossTileID]=new Ur(!1,!1,!1);else{var w=!1,E=!1,I=!0,A=null,C={box:null,offscreen:null},P={box:null,offscreen:null},M=null,k=null,z=0,L=0,B=0;h.textFeatureIndex?z=h.textFeatureIndex:e.useRuntimeCollisionCircles&&(z=e.featureIndex),h.verticalTextFeatureIndex&&(L=h.verticalTextFeatureIndex);var D,R,O,F,j,U,N,V,q=h.textBox;q&&(V=function(r){var i=t.WritingMode.horizontal;return!o.allowVerticalPlacement||r||!n.prevPlacement||(r=n.prevPlacement.placedOrientations[e.crossTileID])&&(n.placedOrientations[e.crossTileID]=r,n.markUsedOrientation(o,i=r,e)),i},N=function(r,i){if(o.allowVerticalPlacement&&0<e.numVerticalGlyphVertices&&h.verticalTextBox)for(var n=0,a=o.writingModes;n<a.length&&(a[n]===t.WritingMode.vertical?(C=i(),P=C):C=r(),!(C&&C.box&&C.box.length));n+=1);else C=r()},a.get("text-variable-anchor")?(D=a.get("text-variable-anchor"),n.prevPlacement&&n.prevPlacement.variableOffsets[e.crossTileID]&&(R=n.prevPlacement.variableOffsets[e.crossTileID],0<D.indexOf(R.anchor)&&(D=D.filter((function(t){return t!==R.anchor}))).unshift(R.anchor)),O=function(t,r,i){for(var a=t.x2-t.x1,u=t.y2-t.y1,l=e.textBoxScale,p=b&&!_?r:null,h={box:[],offscreen:!1},f=g?2*D.length:D.length,m=0;m<f;++m){var y=n.attemptAnchorPlacement(D[m%D.length],t,a,u,l,v,x,c,s,d,m>=D.length,e,o,i,p);if(y&&(h=y.placedGlyphBoxes)&&h.box&&h.box.length){w=!0,A=y.shift;break}}return h},N((function(){return O(q,h.iconBox,t.WritingMode.horizontal)}),(function(){var r=h.verticalTextBox;return o.allowVerticalPlacement&&!(C&&C.box&&C.box.length)&&0<e.numVerticalGlyphVertices&&r?O(r,h.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),C&&(w=C.box,I=C.offscreen),F=V(C&&C.box),w||!n.prevPlacement||(j=n.prevPlacement.variableOffsets[e.crossTileID])&&(n.variableOffsets[e.crossTileID]=j,n.markUsedJustification(o,j.anchor,e,F))):(U=function(t,r){return(t=n.collisionIndex.placeCollisionBox(t,g,c,s,d.predicate))&&t.box&&t.box.length&&(n.markUsedOrientation(o,r,e),n.placedOrientations[e.crossTileID]=r),t},N((function(){return U(q,t.WritingMode.horizontal)}),(function(){var r=h.verticalTextBox;return o.allowVerticalPlacement&&0<e.numVerticalGlyphVertices&&r?U(r,t.WritingMode.vertical):{box:null,offscreen:null}})),V(C&&C.box&&C.box.length))),w=(F=C)&&F.box&&0<F.box.length,I=F&&F.offscreen,e.useRuntimeCollisionCircles&&(N=o.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),V=t.evaluateSizeForFeature(o.textSizeData,f,N),G=a.get("text-padding"),M=n.collisionIndex.placeCollisionCircles(g,N,o.lineVertexArray,o.glyphOffsetArray,V,s,u,l,i,x,d.predicate,e.collisionCircleDiameter,G),w=g||0<M.circles.length&&!M.collisionDetected,I=I&&M.offscreen),h.iconFeatureIndex&&(B=h.iconFeatureIndex),h.iconBox&&(H=function(t){return t=b&&A?Hr(t,A.x,A.y,v,x,n.transform.angle):t,n.collisionIndex.placeCollisionBox(t,_,c,s,d.predicate)},E=P&&P.box&&P.box.length&&h.verticalIconBox?0<(k=H(h.verticalIconBox)).box.length:0<(k=H(h.iconBox)).box.length,I=I&&k.offscreen);var G=m||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,H=y||0===e.numIconVertices;if(G||H?H?G||(E=E&&w):w=E&&w:E=w=E&&w,w&&F&&F.box&&n.collisionIndex.insertCollisionBox(F.box,a.get("text-ignore-placement"),o.bucketInstanceId,P&&P.box&&L?L:z,d.ID),E&&k&&n.collisionIndex.insertCollisionBox(k.box,a.get("icon-ignore-placement"),o.bucketInstanceId,B,d.ID),M&&(w&&n.collisionIndex.insertCollisionCircles(M.circles,a.get("text-ignore-placement"),o.bucketInstanceId,z,d.ID),i)){z=o.bucketInstanceId;var Z=n.collisionCircleArrays[z];void 0===Z&&(Z=n.collisionCircleArrays[z]=new Nr);for(var W=0;W<M.circles.length;W+=4)Z.circles.push(M.circles[W+0]),Z.circles.push(M.circles[W+1]),Z.circles.push(M.circles[W+2]),Z.circles.push(M.collisionDetected?1:0)}n.placements[e.crossTileID]=new Ur(w||S,E||T,I||o.justReloaded),r[e.crossTileID]=!0}}if(!o.collisionArrays&&h&&o.deserializeCollisionBoxes(h),w)for(var I=o.getSortedSymbolIndexes(this.transform.angle),A=I.length-1;0<=A;--A){var C=I[A];E(o.symbolInstances.get(C),o.collisionArrays[C])}else for(var P=e.symbolInstanceStart;P<e.symbolInstanceEnd;P++)E(o.symbolInstances.get(P),o.collisionArrays[P]);i&&o.bucketInstanceId in this.collisionCircleArrays&&(w=this.collisionCircleArrays[o.bucketInstanceId],t.invert(w.invProjMatrix,s),w.viewportMatrix=this.collisionIndex.getViewportMatrix()),o.justReloaded=!1},Zr.prototype.markUsedJustification=function(e,r,i,n){for(var o=n===t.WritingMode.vertical?i.verticalPlacedTextSymbolIndex:{left:i.leftJustifiedTextSymbolIndex,center:i.centerJustifiedTextSymbolIndex,right:i.rightJustifiedTextSymbolIndex}[t.getAnchorJustification(r)],a=0,s=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex,i.verticalPlacedTextSymbolIndex];a<s.length;a+=1){var u=s[a];0<=u&&(e.text.placedSymbolArray.get(u).crossTileID=0<=o&&u!==o?0:i.crossTileID)}},Zr.prototype.markUsedOrientation=function(e,r,i){for(var n=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,o=(r=r===t.WritingMode.vertical?r:0,0),a=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex];o<a.length;o+=1)e.text.placedSymbolArray.get(a[o]).placedOrientation=n;i.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).placedOrientation=r)},Zr.prototype.commit=function(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;var e=this.prevPlacement,r=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;var i,n,o,a,s=e?e.symbolFadeChange(t):1,u=e?e.opacities:{},l=e?e.variableOffsets:{},c=e?e.placedOrientations:{};for(i in this.placements){var p=this.placements[i],h=u[i];r=h?(this.opacities[i]=new jr(h,s,p.text,p.icon),r||p.text!==h.text.placed||p.icon!==h.icon.placed):(this.opacities[i]=new jr(null,s,p.text,p.icon,p.skipFade),r||p.text||p.icon)}for(n in u){var f,d=u[n];this.opacities[n]||(f=new jr(d,s,!1,!1)).isHidden()||(this.opacities[n]=f,r=r||d.text.placed||d.icon.placed)}for(o in l)this.variableOffsets[o]||!this.opacities[o]||this.opacities[o].isHidden()||(this.variableOffsets[o]=l[o]);for(a in c)this.placedOrientations[a]||!this.opacities[a]||this.opacities[a].isHidden()||(this.placedOrientations[a]=c[a]);r?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)},Zr.prototype.updateLayerOpacities=function(t,e){for(var r={},i=0,n=e;i<n.length;i+=1){var o=n[i],a=o.getBucket(t);a&&o.latestFeatureIndex&&t.id===a.layerIds[0]&&this.updateBucketOpacities(a,r,o.collisionBoxArray)}},Zr.prototype.updateBucketOpacities=function(e,r,i){var n=this;e.hasTextData()&&e.text.opacityVertexArray.clear(),e.hasIconData()&&e.icon.opacityVertexArray.clear(),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();var o=e.layers[0].layout,a=new jr(null,0,!1,!1,!0),s=o.get("text-allow-overlap"),u=o.get("icon-allow-overlap"),l=o.get("text-variable-anchor"),c="map"===o.get("text-rotation-alignment"),p="map"===o.get("text-pitch-alignment"),h="none"!==o.get("icon-text-fit"),f=new jr(null,0,s&&(u||!e.hasIconData()||o.get("icon-optional")),u&&(s||!e.hasTextData()||o.get("text-optional")),!0);!e.collisionArrays&&i&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(i);for(var d=function(t,e,r){for(var i=0;i<e/4;i++)t.opacityVertexArray.emplaceBack(r)},m=0;m<e.symbolInstances.length;m++)!function(i){var o=e.symbolInstances.get(i),s=o.numHorizontalGlyphVertices,u=o.numVerticalGlyphVertices,m=o.crossTileID,y=n.opacities[m];r[m]?y=a:y||(n.opacities[m]=y=f),r[m]=!0;var g,_,v,x=0<o.numIconVertices,b=n.placedOrientations[o.crossTileID],w=b===t.WritingMode.vertical,S=b===t.WritingMode.horizontal||b===t.WritingMode.horizontalOnly;(0<s||0<u)&&(_=ei(y.text),d(e.text,s,w?ii:_),d(e.text,u,S?ii:_),g=y.text.isHidden(),[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t){0<=t&&(e.text.placedSymbolArray.get(t).hidden=g||w?1:0)})),0<=o.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=g||S?1:0),(_=n.variableOffsets[o.crossTileID])&&n.markUsedJustification(e,_.anchor,o,b),(b=n.placedOrientations[o.crossTileID])&&(n.markUsedJustification(e,"left",o,b),n.markUsedOrientation(e,b,o))),x&&(v=ei(y.icon),x=!(h&&o.verticalPlacedIconSymbolIndex&&w),0<=o.placedIconSymbolIndex&&(d(e.icon,o.numIconVertices,x?v:ii),e.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=y.icon.isHidden()),0<=o.verticalPlacedIconSymbolIndex&&(d(e.icon,o.numVerticalIconVertices,x?ii:v),e.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=y.icon.isHidden())),!e.hasIconCollisionBoxData()&&!e.hasTextCollisionBoxData()||(v=e.collisionArrays[i])&&(o=new t.Point(0,0),(v.textBox||v.verticalTextBox)&&(i=!0,l&&((m=n.variableOffsets[m])?(o=Gr(m.anchor,m.width,m.height,m.textOffset,m.textBoxScale),c&&o._rotate(p?n.transform.angle:-n.transform.angle)):i=!1),v.textBox&&Wr(e.textCollisionBox.collisionVertexArray,y.text.placed,!i||w,o.x,o.y),v.verticalTextBox&&Wr(e.textCollisionBox.collisionVertexArray,y.text.placed,!i||S,o.x,o.y)),S=Boolean(!S&&v.verticalIconBox),v.iconBox&&Wr(e.iconCollisionBox.collisionVertexArray,y.icon.placed,S,h?o.x:0,h?o.y:0),v.verticalIconBox&&Wr(e.iconCollisionBox.collisionVertexArray,y.icon.placed,!S,h?o.x:0,h?o.y:0))}(m);e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.bucketInstanceId in this.collisionCircleArrays&&(i=this.collisionCircleArrays[e.bucketInstanceId],e.placementInvProjMatrix=i.invProjMatrix,e.placementViewportMatrix=i.viewportMatrix,e.collisionCircleArray=i.circles,delete this.collisionCircleArrays[e.bucketInstanceId])},Zr.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},Zr.prototype.zoomAdjustment=function(t){return Math.max(0,(this.transform.zoom-t)/1.5)},Zr.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},Zr.prototype.stillRecent=function(t,e){var r=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*r>t},Zr.prototype.setStale=function(){this.stale=!0};var Xr=Math.pow(2,25),Kr=Math.pow(2,24),Jr=Math.pow(2,17),Yr=Math.pow(2,16),Qr=Math.pow(2,9),$r=Math.pow(2,8),ti=Math.pow(2,1);function ei(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0;return(t=Math.floor(127*t.opacity))*Xr+e*Kr+t*Jr+e*Yr+t*Qr+e*$r+t*ti+e}function ri(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}var ii=0;function ni(t,e,r,i,n,o,a){this.placement=new Zr(t,n,o,a),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=i,this._done=!1}function oi(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var i=0;i<e.length;i++){var n=e.get(i),o=n.key;this.indexedSymbolInstances[o]||(this.indexedSymbolInstances[o]=[]),this.indexedSymbolInstances[o].push({crossTileID:n.crossTileID,coord:this.getScaledCoordinates(n,t)})}}ri.prototype.continuePlacement=function(t,e,r,i,n){for(var o=this._bucketParts;this._currentTileIndex<t.length;)if(e.getBucketParts(o,i,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,n())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,o.sort((function(t,e){return t.sortKey-e.sortKey})));this._currentPartIndex<o.length;)if(e.placeLayerBucketPart(o[this._currentPartIndex],this._seenCrossTileIDs,r),this._currentPartIndex++,n())return!0;return!1},ni.prototype.isDone=function(){return this._done},ni.prototype.continuePlacement=function(e,r,i){for(var n=this,o=t.browser.now(),a=function(){var e=t.browser.now()-o;return!n._forceFullPlacement&&2<e};0<=this._currentPlacementIndex;){var s=r[e[this._currentPlacementIndex]],u=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=u)&&(!s.maxzoom||s.maxzoom>u)){if(this._inProgressLayer||(this._inProgressLayer=new ri(s)),this._inProgressLayer.continuePlacement(i[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},ni.prototype.commit=function(t){return this.placement.commit(t),this.placement};var ai=512/t.EXTENT/2;function si(){this.maxCrossTileID=0}function ui(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}oi.prototype.getScaledCoordinates=function(e,r){var i=ai/Math.pow(2,r.canonical.z-this.tileID.canonical.z);return{x:Math.floor((r.canonical.x*t.EXTENT+e.anchorX)*i),y:Math.floor((r.canonical.y*t.EXTENT+e.anchorY)*i)}},oi.prototype.findMatches=function(t,e,r){for(var i=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),n=0;n<t.length;n++){var o=t.get(n);if(!o.crossTileID){var a=this.indexedSymbolInstances[o.key];if(a)for(var s=this.getScaledCoordinates(o,e),u=0,l=a;u<l.length;u+=1){var c=l[u];if(Math.abs(c.coord.x-s.x)<=i&&Math.abs(c.coord.y-s.y)<=i&&!r[c.crossTileID]){r[c.crossTileID]=!0,o.crossTileID=c.crossTileID;break}}}}},si.prototype.generate=function(){return++this.maxCrossTileID},ui.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var r in this.indexes){var i,n=this.indexes[r],o={};for(i in n){var a=n[i];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+e),o[a.tileID.key]=a}this.indexes[r]=o}this.lng=t},ui.prototype.addBucket=function(t,e,r){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(var i=0;i<e.symbolInstances.length;i++)e.symbolInstances.get(i).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var n,o=this.usedCrossTileIDs[t.overscaledZ];for(n in this.indexes){var a=this.indexes[n];if(Number(n)>t.overscaledZ)for(var s in a){var u=a[s];u.tileID.isChildOf(t)&&u.findMatches(e.symbolInstances,t,o)}else{var l=a[t.scaledTo(Number(n)).key];l&&l.findMatches(e.symbolInstances,t,o)}}for(var c=0;c<e.symbolInstances.length;c++){var p=e.symbolInstances.get(c);p.crossTileID||(p.crossTileID=r.generate(),o[p.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new oi(t,e.symbolInstances,e.bucketInstanceId),!0},ui.prototype.removeBucketCrossTileIDs=function(t,e){for(var r in e.indexedSymbolInstances)for(var i=0,n=e.indexedSymbolInstances[r];i<n.length;i+=1)delete this.usedCrossTileIDs[t][n[i].crossTileID]},ui.prototype.removeStaleBuckets=function(t){var e,r=!1;for(e in this.indexes){var i,n=this.indexes[e];for(i in n)t[n[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(e,n[i]),delete n[i],r=!0)}return r};var li=function(){this.layerIndexes={},this.crossTileIDs=new si,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};function ci(e,r){return t.emitValidationErrors(e,r&&r.filter((function(t){return"source.canvas"!==t.identifier})))}li.prototype.addLayer=function(t,e,r){var i=this.layerIndexes[t.id];void 0===i&&(i=this.layerIndexes[t.id]=new ui);var n=!1,o={};i.handleWrapJump(r);for(var a=0,s=e;a<s.length;a+=1){var u=s[a],l=u.getBucket(t);l&&t.id===l.layerIds[0]&&(l.bucketInstanceId||(l.bucketInstanceId=++this.maxBucketInstanceId),i.addBucket(u.tileID,l,this.crossTileIDs)&&(n=!0),o[l.bucketInstanceId]=!0)}return i.removeStaleBuckets(o)&&(n=!0),n},li.prototype.pruneUnusedLayers=function(t){var e,r={};for(e in t.forEach((function(t){r[t]=!0})),this.layerIndexes)r[e]||delete this.layerIndexes[e]};var pi,hi=t.pick(yr,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),fi=t.pick(yr,["setCenter","setZoom","setBearing","setPitch"]),di=function(){var e,r={},i=t.styleSpec.$version;for(e in t.styleSpec.$root){var n,o=t.styleSpec.$root[e];o.required&&null!=(n="version"===e?i:"array"===o.type?[]:{})&&(r[e]=n)}return r}(),mi=((pi=t.Evented)&&(yi.__proto__=pi),((yi.prototype=Object.create(pi&&pi.prototype)).constructor=yi).prototype.loadURL=function(e,r){var i=this;void 0===r&&(r={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var n="boolean"==typeof r.validate?r.validate:!t.isMapboxURL(e);e=this.map._requestManager.normalizeStyleURL(e,r.accessToken),e=this.map._requestManager.transformRequest(e,t.ResourceType.Style),this._request=t.getJSON(e,(function(e,r){i._request=null,e?i.fire(new t.ErrorEvent(e)):r&&i._load(r,n)}))},yi.prototype.loadJSON=function(e,r){var i=this;void 0===r&&(r={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame((function(){i._request=null,i._load(e,!1!==r.validate)}))},yi.prototype.loadEmpty=function(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(di,!1)},yi.prototype._load=function(e,r){if(!r||!ci(this,t.validateStyle(e))){for(var i in this._loaded=!0,(this.stylesheet=e).sources)this.addSource(i,e.sources[i],{validate:!1});e.sprite?this._loadSprite(e.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs),r=mr(this.stylesheet.layers),this._order=r.map((function(t){return t.id})),this._layers={},this._serializedLayers={};for(var n=0,o=r;n<o.length;n+=1){var a=o[n];(a=t.createStyleLayer(a)).setEventedParent(this,{layer:{id:a.id}}),this._layers[a.id]=a,this._serializedLayers[a.id]=a.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new S(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"))}},yi.prototype._loadSprite=function(e){var r,i,n,o,a,s,u,l,c=this;function p(){if(s)n(s);else if(o&&a){var e,r=t.browser.getImageData(a),i={};for(e in o){var u=(g=o[e]).width,l=g.height,c=g.x,p=g.y,h=g.sdf,f=g.pixelRatio,d=g.stretchX,m=g.stretchY,y=g.content,g=new t.RGBAImage({width:u,height:l});t.RGBAImage.copy(r,g,{x:c,y:p},{x:0,y:0},{width:u,height:l}),i[e]={data:g,pixelRatio:f,sdf:h,stretchX:d,stretchY:m,content:y}}n(null,i)}}this._spriteRequest=(r=e,i=this.map._requestManager,n=function(e,r){if(c._spriteRequest=null,e)c.fire(new t.ErrorEvent(e));else if(r)for(var i in r)c.imageManager.addImage(i,r[i]);c.imageManager.setLoaded(!0),c._availableImages=c.imageManager.listImages(),c.dispatcher.broadcast("setImages",c._availableImages),c.fire(new t.Event("data",{dataType:"style"}))},e=1<t.browser.devicePixelRatio?"@2x":"",u=t.getJSON(i.transformRequest(i.normalizeSpriteURL(r,e,".json"),t.ResourceType.SpriteJSON),(function(t,e){u=null,s||(s=t,o=e,p())})),l=t.getImage(i.transformRequest(i.normalizeSpriteURL(r,e,".png"),t.ResourceType.SpriteImage),(function(t,e){l=null,s||(s=t,a=e,p())})),{cancel:function(){u&&(u.cancel(),u=null),l&&(l.cancel(),l=null)}})},yi.prototype._validateLayer=function(e){var r,i=this.sourceCaches[e.source];i&&(!(r=e.sourceLayer)||("geojson"===(i=i.getSource()).type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(r))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+r+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"'))))},yi.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},yi.prototype._serializeLayers=function(t){for(var e=[],r=0,i=t;r<i.length;r+=1){var n=this._layers[i[r]];"custom"!==n.type&&e.push(n.serialize())}return e},yi.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(var e in this._layers)if(this._layers[e].hasTransition())return!0;return!1},yi.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},yi.prototype.update=function(e){if(this._loaded){var r=this._changed;if(this._changed){var i,n,o=Object.keys(this._updatedLayers),a=Object.keys(this._removedLayers);for(i in(o.length||a.length)&&this._updateWorkerLayers(o,a),this._updatedSources){var s=this._updatedSources[i];"reload"===s?this._reloadSource(i):"clear"===s&&this._clearSource(i)}for(n in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[n].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates()}var u,l={};for(u in this.sourceCaches){var c=this.sourceCaches[u];l[u]=c.used,c.used=!1}for(var p,h=0,f=this._order;h<f.length;h+=1){var d=this._layers[f[h]];d.recalculate(e,this._availableImages),!d.isHidden(e.zoom)&&d.source&&(this.sourceCaches[d.source].used=!0)}for(p in l){var m=this.sourceCaches[p];l[p]!==m.used&&m.fire(new t.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:p}))}this.light.recalculate(e),this.z=e.zoom,r&&this.fire(new t.Event("data",{dataType:"style"}))}},yi.prototype._updateTilesForChangedImages=function(){var t=Object.keys(this._changedImages);if(t.length){for(var e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}},yi.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})},yi.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},yi.prototype.setState=function(e){var r=this;if(this._checkLoaded(),ci(this,t.validateStyle(e)))return!1;(e=t.clone$1(e)).layers=mr(e.layers);var i=function(e,r){if(!e)return[{command:yr.setStyle,args:[r]}];var i=[];try{if(!t.deepEqual(e.version,r.version))return[{command:yr.setStyle,args:[r]}];t.deepEqual(e.center,r.center)||i.push({command:yr.setCenter,args:[r.center]}),t.deepEqual(e.zoom,r.zoom)||i.push({command:yr.setZoom,args:[r.zoom]}),t.deepEqual(e.bearing,r.bearing)||i.push({command:yr.setBearing,args:[r.bearing]}),t.deepEqual(e.pitch,r.pitch)||i.push({command:yr.setPitch,args:[r.pitch]}),t.deepEqual(e.sprite,r.sprite)||i.push({command:yr.setSprite,args:[r.sprite]}),t.deepEqual(e.glyphs,r.glyphs)||i.push({command:yr.setGlyphs,args:[r.glyphs]}),t.deepEqual(e.transition,r.transition)||i.push({command:yr.setTransition,args:[r.transition]}),t.deepEqual(e.light,r.light)||i.push({command:yr.setLight,args:[r.light]});var n={},o=[];!function(e,r,i,n){var o,a,s,u;for(o in r=r||{},e=e||{})e.hasOwnProperty(o)&&(r.hasOwnProperty(o)||_r(o,i,n));for(o in r)r.hasOwnProperty(o)&&(e.hasOwnProperty(o)?t.deepEqual(e[o],r[o])||("geojson"===e[o].type&&"geojson"===r[o].type&&function(e,r,i){for(var n in e[i])if(e[i].hasOwnProperty(n)&&"data"!==n&&!t.deepEqual(e[i][n],r[i][n]))return;for(n in r[i])if(r[i].hasOwnProperty(n)&&"data"!==n&&!t.deepEqual(e[i][n],r[i][n]))return;return 1}(e,r,o)?i.push({command:yr.setGeoJSONSourceData,args:[o,r[o].data]}):(s=r,_r(a=o,u=i,n),gr(a,s,u))):gr(o,r,i))}(e.sources,r.sources,o,n);var a=[];e.layers&&e.layers.forEach((function(t){n[t.source]?i.push({command:yr.removeLayer,args:[t.id]}):a.push(t)})),i=i.concat(o),function(e,r,i){r=r||[];for(var n,o,a,s,u,l=(e=e||[]).map(xr),c=r.map(xr),p=e.reduce(br,{}),h=r.reduce(br,{}),f=l.slice(),d=Object.create(null),m=0,y=0;m<l.length;m++)h.hasOwnProperty(n=l[m])?y++:(i.push({command:yr.removeLayer,args:[n]}),f.splice(f.indexOf(n,y),1));for(y=m=0;m<c.length;m++)f[f.length-1-m]!==(n=c[c.length-1-m])&&(p.hasOwnProperty(n)?(i.push({command:yr.removeLayer,args:[n]}),f.splice(f.lastIndexOf(n,f.length-y),1)):y++,i.push({command:yr.addLayer,args:[h[n],s=f[f.length-m]]}),f.splice(f.length-m,0,n),d[n]=!0);for(m=0;m<c.length;m++)if(o=p[n=c[m]],a=h[n],!d[n]&&!t.deepEqual(o,a))if(t.deepEqual(o.source,a.source)&&t.deepEqual(o["source-layer"],a["source-layer"])&&t.deepEqual(o.type,a.type)){for(u in vr(o.layout,a.layout,i,n,null,yr.setLayoutProperty),vr(o.paint,a.paint,i,n,null,yr.setPaintProperty),t.deepEqual(o.filter,a.filter)||i.push({command:yr.setFilter,args:[n,a.filter]}),t.deepEqual(o.minzoom,a.minzoom)&&t.deepEqual(o.maxzoom,a.maxzoom)||i.push({command:yr.setLayerZoomRange,args:[n,a.minzoom,a.maxzoom]}),o)o.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?vr(o[u],a[u],i,n,u.slice(6),yr.setPaintProperty):t.deepEqual(o[u],a[u])||i.push({command:yr.setLayerProperty,args:[n,u,a[u]]}));for(u in a)a.hasOwnProperty(u)&&!o.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?vr(o[u],a[u],i,n,u.slice(6),yr.setPaintProperty):t.deepEqual(o[u],a[u])||i.push({command:yr.setLayerProperty,args:[n,u,a[u]]}))}else i.push({command:yr.removeLayer,args:[n]}),s=f[f.lastIndexOf(n)+1],i.push({command:yr.addLayer,args:[a,s]})}(a,r.layers,i)}catch(e){console.warn("Unable to compute style diff:",e),i=[{command:yr.setStyle,args:[r]}]}return i}(this.serialize(),e).filter((function(t){return!(t.command in fi)}));if(0===i.length)return!1;var n=i.filter((function(t){return!(t.command in hi)}));if(0<n.length)throw new Error("Unimplemented: "+n.map((function(t){return t.command})).join(", ")+".");return i.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},yi.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._afterImageUpdated(e)},yi.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},yi.prototype.getImage=function(t){return this.imageManager.getImage(t)},yi.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._afterImageUpdated(e)},yi.prototype._afterImageUpdated=function(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},yi.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},yi.prototype.addSource=function(e,r,i){var n,o=this;if(void 0===i&&(i={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(r).join(", ")+".");0<=["vector","raster","geojson","video","image"].indexOf(r.type)&&this._validate(t.validateStyle.source,"sources."+e,r,null,i)||(this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0),(n=this.sourceCaches[e]=new or(e,r,this.dispatcher)).style=this,n.setEventedParent(this,(function(){return{isSourceLoaded:o.loaded(),source:n.serialize(),sourceId:e}})),n.onAdd(this.map),this._changed=!0)},yi.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var i=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],i.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),i.setEventedParent(null),i.clearTiles(),i.onRemove&&i.onRemove(this.map),this._changed=!0},yi.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},yi.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},yi.prototype.addLayer=function(e,r,i){void 0===i&&(i={}),this._checkLoaded();var n,o=e.id;if(this.getLayer(o))this.fire(new t.ErrorEvent(new Error('Layer with id "'+o+'" already exists on this map')));else{if("custom"===e.type){if(ci(this,t.validateCustomStyleLayer(e)))return;n=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(o,e.source),e=t.clone$1(e),e=t.extend(e,{source:o})),this._validate(t.validateStyle.layer,"layers."+o,e,{arrayIndex:-1},i))return;n=t.createStyleLayer(e),this._validateLayer(n),n.setEventedParent(this,{layer:{id:o}}),this._serializedLayers[n.id]=n.serialize()}e=r?this._order.indexOf(r):this._order.length,r&&-1===e?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(e,0,o),this._layerOrderChanged=!0,this._layers[o]=n,this._removedLayers[o]&&n.source&&"custom"!==n.type&&(e=this._removedLayers[o],delete this._removedLayers[o],e.type!==n.type?this._updatedSources[n.source]="clear":(this._updatedSources[n.source]="reload",this.sourceCaches[n.source].pause())),this._updateLayer(n),n.onAdd&&n.onAdd(this.map))}},yi.prototype.moveLayer=function(e,r){var i;this._checkLoaded(),this._changed=!0,this._layers[e]?e!==r&&(i=this._order.indexOf(e),this._order.splice(i,1),i=r?this._order.indexOf(r):this._order.length,r&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},yi.prototype.removeLayer=function(e){this._checkLoaded();var r,i=this._layers[e];i?(i.setEventedParent(null),r=this._order.indexOf(e),this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=i,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],i.onRemove&&i.onRemove(this.map)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},yi.prototype.getLayer=function(t){return this._layers[t]},yi.prototype.hasLayer=function(t){return t in this._layers},yi.prototype.setLayerZoomRange=function(e,r,i){this._checkLoaded();var n=this.getLayer(e);n?n.minzoom===r&&n.maxzoom===i||(null!=r&&(n.minzoom=r),null!=i&&(n.maxzoom=i),this._updateLayer(n)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},yi.prototype.setFilter=function(e,r,i){void 0===i&&(i={}),this._checkLoaded();var n=this.getLayer(e);if(n){if(!t.deepEqual(n.filter,r))return null==r?(n.filter=void 0,void this._updateLayer(n)):void(this._validate(t.validateStyle.filter,"layers."+n.id+".filter",r,null,i)||(n.filter=t.clone$1(r),this._updateLayer(n)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},yi.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},yi.prototype.setLayoutProperty=function(e,r,i,n){void 0===n&&(n={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getLayoutProperty(r),i)||(o.setLayoutProperty(r,i,n),this._updateLayer(o)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},yi.prototype.getLayoutProperty=function(e,r){var i=this.getLayer(e);if(i)return i.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},yi.prototype.setPaintProperty=function(e,r,i,n){void 0===n&&(n={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getPaintProperty(r),i)||(o.setPaintProperty(r,i,n)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},yi.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},yi.prototype.setFeatureState=function(e,r){this._checkLoaded();var i,n=e.source,o=e.sourceLayer,a=this.sourceCaches[n];void 0!==a?"geojson"===(i=a.getSource().type)&&o?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==i||o?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),a.setFeatureState(o,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types."))):this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},yi.prototype.removeFeatureState=function(e,r){this._checkLoaded();var i,n,o=e.source,a=this.sourceCaches[o];void 0!==a?(n="vector"===(i=a.getSource().type)?e.sourceLayer:void 0,"vector"!==i||n?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):a.removeFeatureState(n,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))):this.fire(new t.ErrorEvent(new Error("The source '"+o+"' does not exist in the map's style.")))},yi.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,i=e.sourceLayer,n=this.sourceCaches[r];if(void 0!==n){if("vector"!==n.getSource().type||i)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),n.getFeatureState(i,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},yi.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},yi.prototype.serialize=function(){return t.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:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},yi.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},yi.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},i={},n=[],o=this._order.length-1;0<=o;o--){var a=this._order[o];if(r(a)){i[a]=o;for(var s=0,u=t;s<u.length;s+=1){var l=u[s][a];if(l)for(var c=0,p=l;c<p.length;c+=1)n.push(p[c])}}}n.sort((function(t,e){return e.intersectionZ-t.intersectionZ}));for(var h=[],f=this._order.length-1;0<=f;f--){var d=this._order[f];if(r(d))for(var m=n.length-1;0<=m;m--){var y=n[m].feature;if(i[y.layer.id]<f)break;h.push(y),n.pop()}else for(var g=0,_=t;g<_.length;g+=1){var v=_[g][d];if(v)for(var x=0,b=v;x<b.length;x+=1)h.push(b[x].feature)}}return h},yi.prototype.queryRenderedFeatures=function(e,r,i){r&&r.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",r.filter,null,r);var n={};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var o=0,a=r.layers;o<a.length;o+=1){var s=a[o],u=this._layers[s];if(!u)return this.fire(new t.ErrorEvent(new Error("The layer '"+s+"' does not exist in the map's style and cannot be queried for features."))),[];n[u.source]=!0}}var l,c=[];for(l in r.availableImages=this._availableImages,this.sourceCaches)r.layers&&!n[l]||c.push(Q(this.sourceCaches[l],this._layers,this._serializedLayers,e,r,i));return this.placement&&c.push(function(t,r,i,n,o,a){for(var s={},u=o.queryRenderedSymbols(e),l=[],c=0,p=Object.keys(u).map(Number);c<p.length;c+=1)l.push(a[p[c]]);l.sort($);for(var h=0,f=l;h<f.length;h+=1)!function(){var e,i=f[h],o=i.featureIndex.lookupSymbolFeatures(u[i.bucketInstanceId],r,i.bucketIndex,i.sourceLayerIndex,n.filter,n.layers,n.availableImages,t);for(e in o){var a=s[e]=s[e]||[],l=o[e];l.sort((function(t,e){var r=i.featureSortOrder;if(r){var n=r.indexOf(t.featureIndex);return r.indexOf(e.featureIndex)-n}return e.featureIndex-t.featureIndex}));for(var c=0,p=l;c<p.length;c+=1)a.push(p[c])}}();for(var d in s)!function(e){s[e].forEach((function(r){var n=r.feature;r=i[t[e].source].getFeatureState(n.layer["source-layer"],n.id);n.source=n.layer.source,n.layer["source-layer"]&&(n.sourceLayer=n.layer["source-layer"]),n.state=r}))}(d);return s}(this._layers,this._serializedLayers,this.sourceCaches,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(c)},yi.prototype.querySourceFeatures=function(e,r){return r&&r.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",r.filter,null,r),(e=this.sourceCaches[e])?function(t,e){for(var r=t.getRenderableIds().map((function(e){return t.getTileByID(e)})),i=[],n={},o=0;o<r.length;o++){var a=r[o],s=a.tileID.canonical.key;n[s]||(n[s]=!0,a.querySourceFeatures(i,e))}return i}(e,r):[]},yi.prototype.addSourceType=function(t,e,r){return yi.getSourceType(t)?r(new Error('A source type called "'+t+'" already exists.')):(yi.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},r):r(null,null))},yi.prototype.getLight=function(){return this.light.getLight()},yi.prototype.setLight=function(e,r){void 0===r&&(r={}),this._checkLoaded();var i,n,o=this.light.getLight(),a=!1;for(i in e)if(!t.deepEqual(e[i],o[i])){a=!0;break}a&&(n={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)},this.light.setLight(e,r),this.light.updateTransitions(n))},yi.prototype._validate=function(e,r,i,n,o){return void 0===o&&(o={}),(!o||!1!==o.validate)&&ci(this,e.call(t.validateStyle,t.extend({key:r,style:this.serialize(),value:i,styleSpec:t.styleSpec},n)))},yi.prototype._remove=function(){for(var e in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[e].setEventedParent(null);for(var r in this.sourceCaches)this.sourceCaches[r].clearTiles(),this.sourceCaches[r].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},yi.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},yi.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()},yi.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t)},yi.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t)},yi.prototype._updatePlacement=function(e,r,i,n,o){void 0===o&&(o=!1);for(var a=!1,s=!1,u={},l=0,c=this._order;l<c.length;l+=1){var p,h=this._layers[c[l]];"symbol"===h.type&&(u[h.source]||(p=this.sourceCaches[h.source],u[h.source]=p.getRenderableIds(!0).map((function(t){return p.getTileByID(t)})).sort((function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)}))),h=this.crossTileSymbolIndex.addLayer(h,u[h.source],e.center.lng),a=a||h)}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((o=o||this._layerOrderChanged||0===i)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now(),e.zoom))&&(this.pauseablePlacement=new ni(e,this._order,o,r,i,n,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,u),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),s=!0),a&&this.pauseablePlacement.placement.setStale()),s||a)for(var f=0,d=this._order;f<d.length;f+=1){var m=this._layers[d[f]];"symbol"===m.type&&this.placement.updateLayerOpacities(m,u[m.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now())},yi.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()},yi.prototype.getImages=function(t,e,r){this.imageManager.getImages(e.icons,r),this._updateTilesForChangedImages(),(r=this.sourceCaches[e.source])&&r.setDependencies(e.tileID.key,e.type,e.icons)},yi.prototype.getGlyphs=function(t,e,r){this.glyphManager.getGlyphs(e.stacks,r)},yi.prototype.getResource=function(e,r,i){return t.makeRequest(r,i)},yi);function yi(e,r){var i=this;void 0===r&&(r={}),pi.call(this),this.map=e,this.dispatcher=new I(dr(),this),this.imageManager=new h,this.imageManager.setEventedParent(this),this.glyphManager=new x(e._requestManager,r.localIdeographFontFamily),this.lineAtlas=new T(256,512),this.crossTileSymbolIndex=new li,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",t.getReferrer());var n=this;this._rtlTextPluginCallback=yi.registerForPluginStateChange((function(e){n.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:e.pluginStatus,pluginURL:e.pluginURL},(function(e,r){if(t.triggerPluginCompletionEvent(e),r&&r.every((function(t){return t})))for(var i in n.sourceCaches)n.sourceCaches[i].reload()}))})),this.on("data",(function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType&&(t=i.sourceCaches[t.sourceId])){var e=t.getSource();if(e&&e.vectorLayerIds)for(var r in i._layers){var n=i._layers[r];n.source===e.id&&i._validateLayer(n)}}}))}mi.getSourceType=function(t){return G[t]},mi.setSourceType=function(t,e){G[t]=e},mi.registerForPluginStateChange=t.registerForPluginStateChange;var gi=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),_i=Bi("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 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\n);}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;}"),vi=Bi("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),xi=Bi("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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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);}"),bi=Bi("varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 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);}"),wi=Bi("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);}"),Si=Bi("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 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;}"),Ti=Bi("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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","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;}"),Ei=Bi("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;}"),Ii=Bi("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);}"),Ai=Bi("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);}"),Ci=Bi("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),Pi=Bi("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),Mi=Bi("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;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 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;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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;}"),ki=Bi("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 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;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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);}"),zi=(d=Bi("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 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;}"),f=Bi("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;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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\n? a_pos\n: 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;}"),Bi("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}")),Li=(R=Bi("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;\n#define PI 3.141592653589793\nvoid 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),O=Bi("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat 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);}"),F=Bi("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;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat 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);}"),j=Bi("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;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 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;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat 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;}"),V=Bi("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;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat 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);}"),q=Bi("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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),Bi("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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));}"));ye=Bi("#define SDF_PX 8.0\nuniform 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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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);}"),fr=Bi("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform 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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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 Bi(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,i=e.match(/attribute ([\w]+) ([\w]+)/g),n=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=(n=o?o.concat(n):n,{});return{fragmentSource:t=t.replace(r,(function(t,e,r,i,n){return a[n]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nvarying "+r+" "+i+" "+n+";\n#else\nuniform "+r+" "+i+" u_"+n+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+n+"\n "+r+" "+i+" "+n+" = u_"+n+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,i,n){var o="float"===i?"vec2":"vec4",s=n.match(/color/)?"color":o;return a[n]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nuniform lowp float u_"+n+"_t;\nattribute "+r+" "+o+" a_"+n+";\nvarying "+r+" "+i+" "+n+";\n#else\nuniform "+r+" "+i+" u_"+n+";\n#endif\n":"vec4"==s?"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+n+" = a_"+n+";\n#else\n "+r+" "+i+" "+n+" = u_"+n+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+n+" = unpack_mix_"+s+"(a_"+n+", u_"+n+"_t);\n#else\n "+r+" "+i+" "+n+" = u_"+n+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nuniform lowp float u_"+n+"_t;\nattribute "+r+" "+o+" a_"+n+";\n#else\nuniform "+r+" "+i+" u_"+n+";\n#endif\n":"vec4"==s?"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+r+" "+i+" "+n+" = a_"+n+";\n#else\n "+r+" "+i+" "+n+" = u_"+n+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+r+" "+i+" "+n+" = unpack_mix_"+s+"(a_"+n+", u_"+n+"_t);\n#else\n "+r+" "+i+" "+n+" = u_"+n+";\n#endif\n"})),staticAttributes:i,staticUniforms:n}}function Di(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}var Ri=Object.freeze({__proto__:null,prelude:_i,background:vi,backgroundPattern:xi,circle:bi,clippingMask:wi,heatmap:Si,heatmapTexture:Ti,collisionBox:Ei,collisionCircle:Ii,debug:Ai,fill:Ci,fillOutline:Pi,fillOutlinePattern:Mi,fillPattern:ki,fillExtrusion:d,fillExtrusionPattern:f,hillshadePrepare:zi,hillshade:R,line:O,lineGradient:F,linePattern:j,lineSDF:V,raster:q,symbolIcon:Li,symbolSDF:ye,symbolTextAndIcon:fr});function Oi(t){for(var e,r=[],i=0;i<t.length;i++)null!==t[i]&&(e=t[i].split(" "),r.push(e.pop()));return r}function Fi(t,e,r,i,n,o){var a=t.gl;this.program=a.createProgram();for(var s=Oi(r.staticAttributes),u=i?i.getBinderAttributes():[],l=s.concat(u),c=(s=r.staticUniforms?Oi(r.staticUniforms):[],u=i?i.getBinderUniforms():[],[]),p=0,h=s.concat(u);p<h.length;p+=1){var f=h[p];c.indexOf(f)<0&&c.push(f)}if(u=i?i.defines():[],o&&u.push("#define OVERDRAW_INSPECTOR;"),o=u.concat(_i.fragmentSource,r.fragmentSource).join("\n"),u=u.concat(_i.vertexSource,r.vertexSource).join("\n"),r=a.createShader(a.FRAGMENT_SHADER),a.isContextLost())this.failedToCreate=!0;else if(a.shaderSource(r,o),a.compileShader(r),a.attachShader(this.program,r),o=a.createShader(a.VERTEX_SHADER),a.isContextLost())this.failedToCreate=!0;else{a.shaderSource(o,u),a.compileShader(o),a.attachShader(this.program,o),this.attributes={};var d={};this.numAttributes=l.length;for(var m=0;m<this.numAttributes;m++)l[m]&&(a.bindAttribLocation(this.program,m,l[m]),this.attributes[l[m]]=m);a.linkProgram(this.program),a.deleteShader(o),a.deleteShader(r);for(var y=0;y<c.length;y++){var g,_=c[y];!_||d[_]||(g=a.getUniformLocation(this.program,_))&&(d[_]=g)}this.fixedUniforms=n(t,d),this.binderUniforms=i?i.getUniforms(t,d):[]}}function ji(t,e,r){var i=1/Or(r,1,e.transform.tileZoom),n=Math.pow(2,r.tileID.overscaledZ);n=(e=r.tileSize*Math.pow(2,e.transform.tileZoom)/n)*(r.tileID.canonical.x+r.tileID.wrap*n),e*=r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[i,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[n>>16,e>>16],u_pixel_coord_lower:[65535&n,65535&e]}}function Ui(e,r,i,n){var o=r.style.light,a=[(s=o.properties.get("position")).x,s.y,s.z],s=t.create$1();return"viewport"===o.properties.get("anchor")&&t.fromRotation(s,-r.transform.angle),t.transformMat3(a,a,s),s=o.properties.get("color"),{u_matrix:e,u_lightpos:a,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[s.r,s.g,s.b],u_vertical_gradient:+i,u_opacity:n}}function Ni(t){return{u_matrix:t}}function Vi(e,r,i,n){return t.extend(Ni(e),ji(i,r,n))}function qi(t){return{u_matrix:t}}function Gi(e,r,i){var n=e.transform;return{u_matrix:Wi(e,r,i),u_ratio:1/Or(r,1,n.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/n.pixelsToGLUnits[0],1/n.pixelsToGLUnits[1]]}}Di.prototype.bind=function(t,e,r,i,n,o,a,s){this.context=t;for(var u=this.boundPaintVertexBuffers.length!==i.length,l=0;!u&&l<i.length;l++)this.boundPaintVertexBuffers[l]!==i[l]&&(u=!0);t.extVertexArrayObject&&this.vao&&this.boundProgram===e&&this.boundLayoutVertexBuffer===r&&!u&&this.boundIndexBuffer===n&&this.boundVertexOffset===o&&this.boundDynamicVertexBuffer===a&&this.boundDynamicVertexBuffer2===s?(t.bindVertexArrayOES.set(this.vao),a&&a.bind(),n&&n.dynamicDraw&&n.bind(),s&&s.bind()):this.freshBind(e,r,i,n,o,a,s)},Di.prototype.freshBind=function(t,e,r,i,n,o,a){var s,u=t.numAttributes,l=this.context,c=l.gl;if(l.extVertexArrayObject)this.vao&&this.destroy(),this.vao=l.extVertexArrayObject.createVertexArrayOES(),l.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=i,this.boundVertexOffset=n,this.boundDynamicVertexBuffer=o,this.boundDynamicVertexBuffer2=a;else{s=l.currentNumAttributes||0;for(var p=u;p<s;p++)c.disableVertexAttribArray(p)}e.enableAttributes(c,t);for(var h=0,f=r;h<f.length;h+=1)f[h].enableAttributes(c,t);o&&o.enableAttributes(c,t),a&&a.enableAttributes(c,t),e.bind(),e.setVertexAttribPointers(c,t,n);for(var d=0,m=r;d<m.length;d+=1){var y=m[d];y.bind(),y.setVertexAttribPointers(c,t,n)}o&&(o.bind(),o.setVertexAttribPointers(c,t,n)),i&&i.bind(),a&&(a.bind(),a.setVertexAttribPointers(c,t,n)),l.currentNumAttributes=u},Di.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)},Fi.prototype.draw=function(t,e,r,i,n,o,a,s,u,l,c,p,h,f,d,m){var y=t.gl;if(!this.failedToCreate){for(var g in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(i),t.setColorMode(n),t.setCullFace(o),this.fixedUniforms)this.fixedUniforms[g].set(a[g]);f&&f.setUniforms(t,this.binderUniforms,p,{zoom:h});for(var _=((h={})[y.LINES]=2,h[y.TRIANGLES]=3,h[y.LINE_STRIP]=1,h[e]),v=0,x=c.get();v<x.length;v+=1){var b=x[v],w=b.vaos||(b.vaos={});(w[s]||(w[s]=new Di)).bind(t,this,u,f?f.getPaintVertexBuffers():[],l,b.vertexOffset,d,m),y.drawElements(e,b.primitiveLength*_,y.UNSIGNED_SHORT,b.primitiveOffset*_*2)}}};var Hi=function(t,e,r){return void 0===r&&(r=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:r}};function Zi(t,e){return 1/Or(t,1,e.tileZoom)}function Wi(t,e,r){return t.translatePosMatrix(e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}function Xi(t,e,r,i,n){return{u_matrix:t,u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_fade_t:i.mix,u_opacity:i.opacity*n.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:n.paint.get("raster-brightness-min"),u_brightness_high:n.paint.get("raster-brightness-max"),u_saturation_factor:0<(i=n.paint.get("raster-saturation"))?1-1/(1.001-i):-i,u_contrast_factor:0<(i=n.paint.get("raster-contrast"))?1/(1-i):1+i,u_spin_weights:function(t){t*=Math.PI/180;var e=Math.sin(t);return[(2*(t=Math.cos(t))+1)/3,(-Math.sqrt(3)*e-t+1)/3,(Math.sqrt(3)*e-t+1)/3]}(n.paint.get("raster-hue-rotate"))}}function Ki(t,e,r,i,n,o,a,s,u,l){var c=n.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:c.width/c.height,u_fade_change:n.options.fadeDuration?n.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+u,u_pitch_with_map:+i,u_texsize:l,u_texture:0}}function Ji(e,r,i,n,o,a,s,u,l,c,p){var h=o.transform;return t.extend(Ki(e,r,i,n,o,a,s,u,l,c),{u_gamma_scale:n?Math.cos(h._pitch)*h.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+p})}var Yi,Qi={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image),u_image_height:new t.Uniform1f(e,r.u_image_height)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function $i(e,r,i,n,o,a,s){for(var u=e.context,l=u.gl,c=e.useProgram("collisionBox"),p=[],h=0,f=0,d=0;d<n.length;d++){var m,y,g,_,v=n[d],x=r.getTile(v),b=x.getBucket(i);b&&(m=v.posMatrix,0===o[0]&&0===o[1]||(m=e.translatePosMatrix(v.posMatrix,x,o,a)),y=s?b.textCollisionBox:b.iconCollisionBox,0<(v=b.collisionCircleArray).length&&(g=t.create(),_=m,t.mul(g,b.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(g,g,b.placementViewportMatrix),p.push({circleArray:v,circleOffset:f,transform:_,invTransform:g}),f=h+=v.length/4),y&&c.draw(u,l.LINES,$e.disabled,tr.disabled,e.colorModeForRenderPass(),rr.disabled,(_=m,m=v=void 0,v=Or(x=x,1,(g=e.transform).zoom),m=Math.pow(2,g.zoom-x.tileID.overscaledZ),x=x.tileID.overscaleFactor(),{u_matrix:_,u_camera_to_center_distance:g.cameraToCenterDistance,u_pixels_to_tile_units:v,u_extrude_scale:[g.pixelsToGLUnits[0]/(v*m),g.pixelsToGLUnits[1]/(v*m)],u_overscale_factor:x}),i.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,null,e.transform.zoom,null,null,y.collisionVertexBuffer))}if(s&&p.length){var w=e.useProgram("collisionCircle"),S=new t.StructArrayLayout2f1f2i16;S.resize(4*h),S._trim();for(var T=0,E=0,I=p;E<I.length;E+=1)for(var A=I[E],C=0;C<A.circleArray.length/4;C++){var P=4*C,M=A.circleArray[0+P],k=A.circleArray[1+P],z=A.circleArray[2+P];P=A.circleArray[3+P];S.emplace(T++,M,k,z,P,0),S.emplace(T++,M,k,z,P,1),S.emplace(T++,M,k,z,P,2),S.emplace(T++,M,k,z,P,3)}(!Yi||Yi.length<2*h)&&(Yi=function(){var e=2*h,r=new t.StructArrayLayout3ui6;r.resize(e),r._trim();for(var i=0;i<e;i++){var n=6*i;r.uint16[0+n]=4*i+0,r.uint16[1+n]=4*i+1,r.uint16[2+n]=4*i+2,r.uint16[3+n]=4*i+2,r.uint16[4+n]=4*i+3,r.uint16[5+n]=4*i+0}return r}());for(var L=u.createIndexBuffer(Yi,!0),B=u.createVertexBuffer(S,t.collisionCircleLayout.members,!0),D=0,R=p;D<R.length;D+=1){var O=R[D],F={u_matrix:O.transform,u_inv_matrix:O.invTransform,u_camera_to_center_distance:(F=e.transform).cameraToCenterDistance,u_viewport_size:[F.width,F.height]};w.draw(u,l.TRIANGLES,$e.disabled,tr.disabled,e.colorModeForRenderPass(),rr.disabled,F,i.id,B,L,t.SegmentVector.simpleSegment(0,2*O.circleOffset,O.circleArray.length,O.circleArray.length/2),null,e.transform.zoom,null,null,null)}B.destroy(),L.destroy()}}var tn=t.identity(new Float32Array(16));function en(e,r,i,n,o,a,s,u,l,c,p){var h=e.text.placedSymbolArray,f=e.text.dynamicLayoutVertexArray,d=e.icon.dynamicLayoutVertexArray,m={};f.clear();for(var y,g,_,v,x=0;x<h.length;x++){var b=h.get(x);if(I=b.hidden||!b.crossTileID||e.allowVerticalPlacement&&!b.placedOrientation?null:n[b.crossTileID]){var w=new t.Point(b.anchorX,b.anchorY),S=Ir(w,i?u:s),T=Ar(a.cameraToCenterDistance,S.signedDistanceFromCamera),E=o.evaluateSizeForFeature(e.textSizeData,c,b)*T/t.ONE_EM;i&&(E*=e.tilePixelRatio/l);for(var I=(y=I.anchor,g=I.width,_=I.height,v=I.textOffset,T=I.textBoxScale,I=E,E=void 0,g=-((E=t.getAnchorAlignment(y)).horizontalAlign-.5)*g,_=-(E.verticalAlign-.5)*_,v=t.evaluateVariableOffset(y,v),new t.Point((g/T+v[0])*I,(_/T+v[1])*I)),A=i?Ir(w.add(I),s).point:S.point.add(r?I.rotate(-a.angle):I),C=e.allowVerticalPlacement&&b.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,P=0;P<b.numGlyphs;P++)t.addDynamicAttributes(f,A,C);p&&0<=b.associatedIconIndex&&(m[b.associatedIconIndex]={shiftedAnchor:A,angle:C})}else Br(b.numGlyphs,f)}if(p){d.clear();for(var M=e.icon.placedSymbolArray,k=0;k<M.length;k++){var z=M.get(k);if(z.hidden)Br(z.numGlyphs,d);else{var L=m[k];if(L)for(var B=0;B<z.numGlyphs;B++)t.addDynamicAttributes(d,L.shiftedAnchor,L.angle);else Br(z.numGlyphs,d)}}e.icon.dynamicLayoutVertexBuffer.updateData(d)}e.text.dynamicLayoutVertexBuffer.updateData(f)}function rn(e,r,i,n,o,a,s,u,l,c,p,h){for(var f=e.context,d=f.gl,m=e.transform,y="map"===u,g="map"===l,_=y&&"point"!==i.layout.get("symbol-placement"),v=y&&!g&&!_,x=!i.layout.get("symbol-sort-key").isConstant(),b=!1,w=e.depthModeForSublayer(0,$e.ReadOnly),S=i.layout.get("text-variable-anchor"),T=[],E=0,I=n;E<I.length;E+=1){var A=I[E],C=r.getTile(A),P=C.getBucket(i);if(P){var M=o?P.text:P.icon;if(M&&M.segments.get().length){var k=M.programConfigurations.get(i.id),z=o||P.sdfIcons,L=o?P.textSizeData:P.iconSizeData,B=g||0!==m.pitch,D=e.useProgram((K=z,X=o,P.iconsInText&&X?"symbolTextAndIcon":K?"symbolSDF":"symbolIcon"),k),R=t.evaluateSizeForZoom(L,m.zoom),O=void 0,F=[0,0],j=void 0,U=void 0,N=null,V=void 0;o?(j=C.glyphAtlasTexture,U=d.LINEAR,O=C.glyphAtlasTexture.size,P.iconsInText&&(F=C.imageAtlasTexture.size,N=C.imageAtlasTexture,V=B||e.options.rotating||e.options.zooming||"composite"===L.kind||"camera"===L.kind?d.LINEAR:d.NEAREST)):(J=1!==i.layout.get("icon-size").constantOr(0)||P.iconsNeedLinear,j=C.imageAtlasTexture,U=z||e.options.rotating||e.options.zooming||J||B?d.LINEAR:d.NEAREST,O=C.imageAtlasTexture.size);var q=Or(C,1,e.transform.zoom),G=Tr(A.posMatrix,g,y,e.transform,q),H=Er(A.posMatrix,g,y,e.transform,q),Z=S&&P.hasTextData(),W="none"!==i.layout.get("icon-text-fit")&&Z&&P.hasIconData();_&&function(e,r,i,n,o,a,s,u){var l=n?e.textSizeData:e.iconSizeData,c=t.evaluateSizeForZoom(l,i.transform.zoom),p=[256/i.width*2+1,256/i.height*2+1],h=(n?e.text:e.icon).dynamicLayoutVertexArray;h.clear();for(var f=e.lineVertexArray,d=(n?e.text:e.icon).placedSymbolArray,m=i.transform.width/i.transform.height,y=!1,g=0;g<d.length;g++){var _,v,x,b,w,S=d.get(g);S.hidden||S.writingMode===t.WritingMode.vertical&&!y?Br(S.numGlyphs,h):(y=!1,x=[S.anchorX,S.anchorY,0,1],t.transformMat4(x,x,r),v=p,b=void 0,b=(_=x)[0]/_[3],_=_[1]/_[3],b>=-v[0]&&b<=v[0]&&_>=-v[1]&&_<=v[1]?(w=Ar(i.transform.cameraToCenterDistance,x[3]),b=t.evaluateSizeForFeature(l,c,S),_=s?b/w:b*w,x=Ir(v=new t.Point(S.anchorX,S.anchorY),o).point,y=(w=Mr(S,_,!(b={}),u,r,o,a,e.glyphOffsetArray,f,h,x,v,b,m)).useVertical,(w.notEnoughRoom||y||w.needsFlipping&&Mr(S,_,!0,u,r,o,a,e.glyphOffsetArray,f,h,x,v,b,m).notEnoughRoom)&&Br(S.numGlyphs,h)):Br(S.numGlyphs,h))}(n?e.text:e.icon).dynamicLayoutVertexBuffer.updateData(h)}(P,A.posMatrix,e,o,G,H,g,c);var X=e.translatePosMatrix(A.posMatrix,C,a,s),K=_||o&&S||W?tn:G,J=(k=e.translatePosMatrix(H,C,a,s,!0),z&&0!==i.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1)),Y={program:D,buffers:M,uniformValues:z?P.iconsInText?(B=L.kind,q=R,Z=v,A=g,W=e,G=X,H=K,C=k,D=O,F=F,t.extend(Ji(B,q,Z,A,W,G,H,C,!0,D,!0),{u_texsize_icon:F,u_texture_icon:1})):Ji(L.kind,R,v,g,e,X,K,k,o,O,!0):Ki(L.kind,R,v,g,e,X,K,k,o,O),atlasTexture:j,atlasTextureIcon:N,atlasInterpolation:U,atlasInterpolationIcon:V,isSDF:z,hasHalo:J};if(x&&P.canOverlap){b=!0;for(var Q=0,$=M.segments.get();Q<$.length;Q+=1){var tt=$[Q];T.push({segments:new t.SegmentVector([tt]),sortKey:tt.sortKey,state:Y})}}else T.push({segments:M.segments,sortKey:0,state:Y})}}}b&&T.sort((function(t,e){return t.sortKey-e.sortKey}));for(var et=0,rt=T;et<rt.length;et+=1){var it,nt=rt[et],ot=nt.state;f.activeTexture.set(d.TEXTURE0),ot.atlasTexture.bind(ot.atlasInterpolation,d.CLAMP_TO_EDGE),ot.atlasTextureIcon&&(f.activeTexture.set(d.TEXTURE1),ot.atlasTextureIcon&&ot.atlasTextureIcon.bind(ot.atlasInterpolationIcon,d.CLAMP_TO_EDGE)),ot.isSDF&&(it=ot.uniformValues,ot.hasHalo&&(it.u_is_halo=1,nn(ot.buffers,nt.segments,i,e,ot.program,w,p,h,it)),it.u_is_halo=0),nn(ot.buffers,nt.segments,i,e,ot.program,w,p,h,ot.uniformValues)}}function nn(t,e,r,i,n,o,a,s,u){var l=i.context;n.draw(l,l.gl.TRIANGLES,o,a,s,rr.disabled,u,r.id,t.layoutVertexBuffer,t.indexBuffer,e,r.paint,i.transform.zoom,t.programConfigurations.get(r.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function on(e,r,i,n,o,a,s){for(var u,l,c,p,h=e.context.gl,f=i.paint.get("fill-pattern"),d=f&&f.constantOr(1),m=i.getCrossfadeParameters(),y=s?(u=d&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",h.LINES):(u=d?"fillPattern":"fill",h.TRIANGLES),g=0,_=n;g<_.length;g+=1){var v,x,b,w,S,T,E,I,A,C=_[g],P=r.getTile(C);d&&!P.patternsLoaded()||(v=P.getBucket(i))&&(x=v.programConfigurations.get(i.id),b=e.useProgram(u,x),d&&(e.context.activeTexture.set(h.TEXTURE0),P.imageAtlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),x.updatePaintBuffers(m)),(w=f.constantOr(null))&&P.imageAtlas&&(T=(S=P.imageAtlas).patternPositions[w.to.toString()],E=S.patternPositions[w.from.toString()],T&&E&&x.setConstantPatternPositions(T,E)),A=e.translatePosMatrix(C.posMatrix,P,i.paint.get("fill-translate"),i.paint.get("fill-translate-anchor")),A=s?(l=v.indexBuffer2,c=v.segments2,I=[h.drawingBufferWidth,h.drawingBufferHeight],"fillOutlinePattern"===u&&d?(p=A,S=e,w=m,T=P,E=I,t.extend(Vi(p,S,w,T),{u_world:E})):{u_matrix:A,u_world:I}):(l=v.indexBuffer,c=v.segments,d?Vi(A,e,m,P):Ni(A)),b.draw(e.context,y,o,e.stencilModeForClipping(C),a,rr.disabled,A,i.id,v.layoutVertexBuffer,l,c,i.paint,e.transform.zoom,x))}}function an(e,r,i,n,o,a,s){for(var u,l=e.context,c=l.gl,p=i.paint.get("fill-extrusion-pattern"),h=p.constantOr(1),f=i.getCrossfadeParameters(),d=i.paint.get("fill-extrusion-opacity"),m=0,y=n;m<y.length;m+=1){var g,_,v,x,b,w,S,T,E=y[m],I=r.getTile(E),A=I.getBucket(i);A&&(g=A.programConfigurations.get(i.id),_=e.useProgram(h?"fillExtrusionPattern":"fillExtrusion",g),h&&(e.context.activeTexture.set(c.TEXTURE0),I.imageAtlasTexture.bind(c.LINEAR,c.CLAMP_TO_EDGE),g.updatePaintBuffers(f)),(v=p.constantOr(null))&&I.imageAtlas&&(b=(x=I.imageAtlas).patternPositions[v.to.toString()],w=x.patternPositions[v.from.toString()],b&&w&&g.setConstantPatternPositions(b,w)),S=e.translatePosMatrix(E.posMatrix,I,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),T=i.paint.get("fill-extrusion-vertical-gradient"),T=h?(u=S,x=e,v=T,b=d,w=E,E=f,I=I,t.extend(Ui(u,x,v,b),ji(E,x,I),{u_height_factor:-Math.pow(2,w.overscaledZ)/I.tileSize/8})):Ui(S,e,T,d),_.draw(l,l.gl.TRIANGLES,o,a,s,rr.backCCW,T,i.id,A.layoutVertexBuffer,A.indexBuffer,A.segments,i.paint,e.transform.zoom,g))}}var sn=new t.Color(1,0,0,1),un=new t.Color(0,1,0,1),ln=new t.Color(0,0,1,1),cn=new t.Color(1,0,1,1),pn=new t.Color(0,1,1,1);function hn(t,e,r,i){dn(t,0,e+r/2,t.transform.width,r,i)}function fn(t,e,r,i){dn(t,e-r/2,0,r,t.transform.height,i)}function dn(e,r,i,n,o,a){var s=e.context;(e=s.gl).enable(e.SCISSOR_TEST),e.scissor(r*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio),s.clear({color:a}),e.disable(e.SCISSOR_TEST)}function mn(e,r,i){var n=e.context,o=n.gl,a=i.posMatrix,s=e.useProgram("debug"),u=$e.disabled,l=tr.disabled,c=e.colorModeForRenderPass();n.activeTexture.set(o.TEXTURE0),e.emptyTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),s.draw(n,o.LINE_STRIP,u,l,c,rr.disabled,Hi(a,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var p=r.getTileByID(i.key).latestRawTileData;c=Math.floor((p&&p.byteLength||0)/1024),p=r.getTile(i).tileSize,r=512/Math.min(p,512)*(i.overscaledZ/e.transform.zoom)*.5,p=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(p+=" => "+i.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,i=t.context.gl,n=t.debugOverlayCanvas.getContext("2d");n.clearRect(0,0,r.width,r.height),n.shadowColor="white",n.shadowBlur=2,n.lineWidth=1.5,n.strokeStyle="white",n.textBaseline="top",n.font="bold 36px Open Sans, sans-serif",n.fillText(e,5,5),n.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}(e,p+" "+c+"kb"),s.draw(n,o.TRIANGLES,u,l,er.alphaBlended,rr.disabled,Hi(a,t.Color.transparent,r),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}function yn(t,e){this.context=new ir(t),this.transform=e,this._tileTextures={},this.setup(),this.numSublayers=or.maxUnderzooming+or.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new li,this.gpuTimers={}}var gn={symbol:function(e,r,i,n,o){var a,s;"translucent"===e.renderPass&&(a=tr.disabled,s=e.colorModeForRenderPass(),i.layout.get("text-variable-anchor")&&function(e,r,i,n,o,a,s){for(var u=r.transform,l="map"===o,c="map"===a,p=0,h=e;p<h.length;p+=1){var f,d,m,y=h[p],g=n.getTile(y),_=g.getBucket(i);_&&_.text&&_.text.segments.get().length&&(f=t.evaluateSizeForZoom(_.textSizeData,u.zoom),m=Or(g,1,r.transform.zoom),d=Tr(y.posMatrix,c,l,r.transform,m),m="none"!==i.layout.get("icon-text-fit")&&_.hasIconData(),f&&(g=Math.pow(2,u.zoom-g.tileID.overscaledZ),en(_,l,c,s,t.symbolSize,u,d,y.posMatrix,g,f,m)))}}(n,e,i,r,i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),o),0!==i.paint.get("icon-opacity").constantOr(1)&&rn(e,r,i,n,!1,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),i.layout.get("icon-rotation-alignment"),i.layout.get("icon-pitch-alignment"),i.layout.get("icon-keep-upright"),a,s),0!==i.paint.get("text-opacity").constantOr(1)&&rn(e,r,i,n,!0,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.layout.get("text-keep-upright"),a,s),r.map.showCollisionBoxes&&($i(e,r,i,n,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),!0),$i(e,r,i,n,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),!1)))},circle:function(e,r,i,n){if("translucent"===e.renderPass){var o=i.paint.get("circle-opacity"),a=i.paint.get("circle-stroke-width"),s=i.paint.get("circle-stroke-opacity"),u=!i.layout.get("circle-sort-key").isConstant();if(0!==o.constantOr(1)||0!==a.constantOr(1)&&0!==s.constantOr(1)){for(var l=e.context,c=l.gl,p=e.depthModeForSublayer(0,$e.ReadOnly),h=tr.disabled,f=e.colorModeForRenderPass(),d=[],m=0;m<n.length;m++){var y=n[m],g=r.getTile(y),_=g.getBucket(i);if(_){var v=_.programConfigurations.get(i.id),x={programConfiguration:v,program:e.useProgram("circle",v),layoutVertexBuffer:_.layoutVertexBuffer,indexBuffer:_.indexBuffer,uniformValues:(C=y,P=g,M=i,y=v=k=void 0,y=(g=e).transform,v="map"===M.paint.get("circle-pitch-alignment")?(k=!0,[v=Or(P,1,y.zoom),v]):(k=!1,y.pixelsToGLUnits),{u_camera_to_center_distance:y.cameraToCenterDistance,u_scale_with_map:+("map"===M.paint.get("circle-pitch-scale")),u_matrix:g.translatePosMatrix(C.posMatrix,P,M.paint.get("circle-translate"),M.paint.get("circle-translate-anchor")),u_pitch_with_map:+k,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:v})};if(u)for(var b=0,w=_.segments.get();b<w.length;b+=1){var S=w[b];d.push({segments:new t.SegmentVector([S]),sortKey:S.sortKey,state:x})}else d.push({segments:_.segments,sortKey:0,state:x})}}u&&d.sort((function(t,e){return t.sortKey-e.sortKey}));for(var T=0,E=d;T<E.length;T+=1){var I=E[T],A=I.state;A.program.draw(l,c.TRIANGLES,p,h,f,rr.disabled,A.uniformValues,i.id,A.layoutVertexBuffer,A.indexBuffer,I.segments,i.paint,e.transform.zoom,A.programConfiguration)}}}var C,P,M,k},heatmap:function(e,r,i,n){if(0!==i.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var o=e.context,a=o.gl,s=tr.disabled,u=new er([a.ONE,a.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,r){var i=t.gl;t.activeTexture.set(i.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var n,o=r.heatmapFbo;o?(i.bindTexture(i.TEXTURE_2D,o.colorAttachment.get()),t.bindFramebuffer.set(o.framebuffer)):(n=i.createTexture(),i.bindTexture(i.TEXTURE_2D,n),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),o=r.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4,!1),r=n,n=o,(o=t.gl).texImage2D(o.TEXTURE_2D,0,o.RGBA,e.width/4,e.height/4,0,o.RGBA,t.extRenderToTextureHalfFloat?t.extTextureHalfFloat.HALF_FLOAT_OES:o.UNSIGNED_BYTE,null),n.colorAttachment.set(r))}(o,e,i),o.clear({color:t.Color.transparent});for(var l=0;l<n.length;l++){var c,p,h=n[l];r.hasRenderableParent(h)||(c=(x=r.getTile(h)).getBucket(i))&&(p=c.programConfigurations.get(i.id),e.useProgram("heatmap",p).draw(o,a.TRIANGLES,$e.disabled,s,u,rr.disabled,(_=h.posMatrix,v=x,h=e.transform.zoom,x=i.paint.get("heatmap-intensity"),{u_matrix:_,u_extrude_scale:Or(v,1,h),u_intensity:x}),i.id,c.layoutVertexBuffer,c.indexBuffer,c.segments,i.paint,e.transform.zoom,p))}o.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),d=i,y=(m=(f=e).context).gl,(g=d.heatmapFbo)&&(m.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,g.colorAttachment.get()),m.activeTexture.set(y.TEXTURE1),(d.colorRampTexture||(d.colorRampTexture=new t.Texture(m,d.colorRamp,y.RGBA))).bind(y.LINEAR,y.CLAMP_TO_EDGE),f.useProgram("heatmapTexture").draw(m,y.TRIANGLES,$e.disabled,tr.disabled,f.colorModeForRenderPass(),rr.disabled,function(e,r){var i=t.create();return t.ortho(i,0,e.width,e.height,0,0,1),{u_matrix:i,u_world:[(e=e.context.gl).drawingBufferWidth,e.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:r.paint.get("heatmap-opacity")}}(f,d),d.id,f.viewportBuffer,f.quadTriangleIndexBuffer,f.viewportSegments,d.paint,f.transform.zoom)));var f,d,m,y,g,_,v,x},line:function(e,r,i,n){if("translucent"===e.renderPass){var o=i.paint.get("line-opacity"),a=i.paint.get("line-width");if(0!==o.constantOr(1)&&0!==a.constantOr(1))for(var s=e.depthModeForSublayer(0,$e.ReadOnly),u=e.colorModeForRenderPass(),l=i.paint.get("line-dasharray"),c=i.paint.get("line-pattern"),p=c.constantOr(1),h=i.paint.get("line-gradient"),f=i.getCrossfadeParameters(),d=p?"linePattern":l?"lineSDF":h?"lineGradient":"line",m=e.context,y=m.gl,g=!0,_=0,v=n;_<v.length;_+=1){var x,b,w,S,T=v[_],E=r.getTile(T);p&&!E.patternsLoaded()||(x=E.getBucket(i))&&(b=x.programConfigurations.get(i.id),P=e.context.program.get(),w=e.useProgram(d,b),S=g||w.program!==P,(P=c.constantOr(null))&&E.imageAtlas&&(M=(k=E.imageAtlas).patternPositions[P.to.toString()],k=k.patternPositions[P.from.toString()],M&&k&&b.setConstantPatternPositions(M,k)),I=p?(D=i,R=f,F=O=void 0,F=Zi(B=E,O=(L=e).transform),{u_matrix:Wi(L,B,D),u_texsize:B.imageAtlasTexture.size,u_ratio:1/Or(B,1,O.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[F,R.fromScale,R.toScale],u_fade:R.t,u_units_to_pixels:[1/O.pixelsToGLUnits[0],1/O.pixelsToGLUnits[1]]}):l?(P=E,M=i,k=l,z=f,B=R=F=B=D=L=void 0,L=(O=e).lineAtlas,D=Zi(P,O.transform),B="round"===M.layout.get("line-cap"),F=L.getDash(k.from,B),R=L.getDash(k.to,B),k=F.width*z.fromScale,B=R.width*z.toScale,t.extend(Gi(O,P,M),{u_patternscale_a:[D/k,-F.height/2],u_patternscale_b:[D/B,-R.height/2],u_sdfgamma:L.width/(256*Math.min(k,B)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:F.y,u_tex_y_b:R.y,u_mix:z.t})):h?(z=e,I=E,A=i,C=x.lineClipsArray.length,t.extend(Gi(z,I,A),{u_image:0,u_image_height:C})):Gi(e,E,i),p?(m.activeTexture.set(y.TEXTURE0),E.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),b.updatePaintBuffers(f)):l&&(S||e.lineAtlas.dirty)?(m.activeTexture.set(y.TEXTURE0),e.lineAtlas.bind(m)):h&&(C=(A=x.gradients[i.id]).texture,i.gradientVersion!==A.version&&(E=256,i.stepInterpolant&&(S=r.getSource().maxzoom,S=T.canonical.z===S?Math.ceil(1<<e.transform.maxZoom-T.canonical.z):1,E=t.clamp(t.nextPowerOfTwo(x.maxLineLength/t.EXTENT*1024*S),256,m.maxTextureSize)),A.gradient=t.renderColorRamp({expression:i.gradientExpression(),evaluationKey:"lineProgress",resolution:E,image:A.gradient||void 0,clips:x.lineClipsArray}),A.texture?A.texture.update(A.gradient):A.texture=new t.Texture(m,A.gradient,y.RGBA),A.version=i.gradientVersion,C=A.texture),m.activeTexture.set(y.TEXTURE0),C.bind(i.stepInterpolant?y.NEAREST:y.LINEAR,y.CLAMP_TO_EDGE)),w.draw(m,y.TRIANGLES,s,e.stencilModeForClipping(T),u,rr.disabled,I,i.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,i.paint,e.transform.zoom,b,x.layoutVertexBuffer2),g=!1)}}var I,A,C,P,M,k,z,L,B,D,R,O,F},fill:function(e,r,i,n){var o,a,s,u=i.paint.get("fill-color"),l=i.paint.get("fill-opacity");0!==l.constantOr(1)&&(o=e.colorModeForRenderPass(),a=i.paint.get("fill-pattern"),l=e.opaquePassEnabledForLayer()&&!a.constantOr(1)&&1===u.constantOr(t.Color.transparent).a&&1===l.constantOr(0)?"opaque":"translucent",e.renderPass===l&&(s=e.depthModeForSublayer(1,"opaque"===e.renderPass?$e.ReadWrite:$e.ReadOnly),on(e,r,i,n,s,o,!1)),"translucent"===e.renderPass&&i.paint.get("fill-antialias")&&(s=e.depthModeForSublayer(i.getPaintProperty("fill-outline-color")?2:0,$e.ReadOnly),on(e,r,i,n,s,o,!0)))},"fill-extrusion":function(t,e,r,i){var n,o=r.paint.get("fill-extrusion-opacity");0!==o&&"translucent"===t.renderPass&&(n=new $e(t.context.gl.LEQUAL,$e.ReadWrite,t.depthRangeFor3D),1!==o||r.paint.get("fill-extrusion-pattern").constantOr(1)?(an(t,e,r,i,n,tr.disabled,er.disabled),an(t,e,r,i,n,t.stencilModeFor3D(),t.colorModeForRenderPass())):(o=t.colorModeForRenderPass(),an(t,e,r,i,n,tr.disabled,o)))},hillshade:function(e,r,i,n){if("offscreen"===e.renderPass||"translucent"===e.renderPass){for(var o=e.context,a=e.depthModeForSublayer(0,$e.ReadOnly),s=e.colorModeForRenderPass(),u=(n="translucent"===e.renderPass?e.stencilConfigForOverlap(n):[{},n])[0],l=0,c=n[1];l<c.length;l+=1){var p=c[l],h=r.getTile(p);h.needsHillshadePrepare&&"offscreen"===e.renderPass?(d=h,m=i,y=a,g=tr.disabled,_=s,E=T=S=w=b=x=v=void 0,T=(S=(f=e).context).gl,(E=d.dem)&&E.data&&(v=E.dim,x=E.stride,w=E.getPixels(),S.activeTexture.set(T.TEXTURE1),S.pixelStoreUnpackPremultiplyAlpha.set(!1),d.demTexture=d.demTexture||f.getTileTexture(x),d.demTexture?((b=d.demTexture).update(w,{premultiply:!1}),b.bind(T.NEAREST,T.CLAMP_TO_EDGE)):(d.demTexture=new t.Texture(S,w,T.RGBA,{premultiply:!1}),d.demTexture.bind(T.NEAREST,T.CLAMP_TO_EDGE)),S.activeTexture.set(T.TEXTURE0),(b=d.fbo)||((w=new t.Texture(S,{width:v,height:v,data:null},T.RGBA)).bind(T.LINEAR,T.CLAMP_TO_EDGE),(b=d.fbo=S.createFramebuffer(v,v,!0)).colorAttachment.set(w.texture)),S.bindFramebuffer.set(b.framebuffer),S.viewport.set([0,0,v,v]),f.useProgram("hillshadePrepare").draw(S,T.TRIANGLES,y,g,_,rr.disabled,(y=d.tileID,_=(g=E).stride,E=t.create(),t.ortho(E,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(E,E,[0,-t.EXTENT,0]),{u_matrix:E,u_image:1,u_dimension:[_,_],u_zoom:y.overscaledZ,u_unpack:g.getUnpackVector()}),m.id,f.rasterBoundsBuffer,f.quadTriangleIndexBuffer,f.rasterBoundsSegments),d.needsHillshadePrepare=!1)):"translucent"===e.renderPass&&(T=e,E=h,_=i,y=a,g=u[p.overscaledZ],m=s,p=h=d=f=void 0,h=(d=T.context).gl,(p=E.fbo)&&(f=T.useProgram("hillshade"),d.activeTexture.set(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,p.colorAttachment.get()),E=function(e,r,i){var n=i.paint.get("hillshade-shadow-color"),o=i.paint.get("hillshade-highlight-color"),a=i.paint.get("hillshade-accent-color"),s=i.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===i.paint.get("hillshade-illumination-anchor")&&(s-=e.transform.angle);var u=!e.options.moving;return{u_matrix:e.transform.calculatePosMatrix(r.tileID.toUnwrapped(),u),u_image:0,u_latrange:(u=r.tileID,r=Math.pow(2,u.canonical.z),u=u.canonical.y,[new t.MercatorCoordinate(0,u/r).toLngLat().lat,new t.MercatorCoordinate(0,(u+1)/r).toLngLat().lat]),u_light:[i.paint.get("hillshade-exaggeration"),s],u_shadow:n,u_highlight:o,u_accent:a}}(T,E,_),f.draw(d,h.TRIANGLES,y,g,m,rr.disabled,E,_.id,T.rasterBoundsBuffer,T.quadTriangleIndexBuffer,T.rasterBoundsSegments)))}o.viewport.set([0,0,e.width,e.height])}var f,d,m,y,g,_,v,x,b,w,S,T,E},raster:function(e,r,i,n){if("translucent"===e.renderPass&&0!==i.paint.get("raster-opacity")&&n.length)for(var o=e.context,a=o.gl,s=r.getSource(),u=e.useProgram("raster"),l=e.colorModeForRenderPass(),c=(n=s instanceof N?[{},n]:e.stencilConfigForOverlap(n))[0],p=(n=n[1])[n.length-1].overscaledZ,h=!e.options.moving,f=0,d=n;f<d.length;f+=1){var m=d[f],y=e.depthModeForSublayer(m.overscaledZ-p,1===i.paint.get("raster-opacity")?$e.ReadWrite:$e.ReadOnly,a.LESS),g=r.getTile(m),_=e.transform.calculatePosMatrix(m.toUnwrapped(),h);g.registerFadeDuration(i.paint.get("raster-fade-duration"));var v=r.findLoadedParent(m,0),x=function(e,r,i,n,o){if(0<(s=n.paint.get("raster-fade-duration"))){var a=t.browser.now(),s=(n=(a-e.timeAdded)/s,r?(a-r.timeAdded)/s:-1);i=i.getSource(),i=o.coveringZoomLevel({tileSize:i.tileSize,roundZoom:i.roundZoom}),s=(i=!r||Math.abs(r.tileID.overscaledZ-i)>Math.abs(e.tileID.overscaledZ-i))&&e.refreshedUponExpiration?1:t.clamp(i?n:1-s,0,1);return e.refreshedUponExpiration&&1<=n&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-s}:{opacity:s,mix:0}}return{opacity:1,mix:0}}(g,v,r,i,e.transform),b=void 0,w=void 0,S="nearest"===i.paint.get("raster-resampling")?a.NEAREST:a.LINEAR;o.activeTexture.set(a.TEXTURE0),g.texture.bind(S,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),o.activeTexture.set(a.TEXTURE1),v?(v.texture.bind(S,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),b=Math.pow(2,v.tileID.overscaledZ-g.tileID.overscaledZ),w=[g.tileID.canonical.x*b%1,g.tileID.canonical.y*b%1]):g.texture.bind(S,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),x=Xi(_,w||[0,0],b||1,x,i),s instanceof N?u.draw(o,a.TRIANGLES,y,tr.disabled,l,rr.disabled,x,i.id,s.boundsBuffer,e.quadTriangleIndexBuffer,s.boundsSegments):u.draw(o,a.TRIANGLES,y,c[m.overscaledZ],l,rr.disabled,x,i.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}},background:function(e,r,i){var n,o,a,s,u,l,c,p,h,f,d=i.paint.get("background-color"),m=i.paint.get("background-opacity");if(0!==m){var y=e.context,g=y.gl,_=(E=e.transform).tileSize,v=i.paint.get("background-pattern");if(!e.isPatternMissing(v)){var x=!v&&1===d.a&&1===m&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass===x){var b=tr.disabled,w=e.depthModeForSublayer(0,"opaque"==x?$e.ReadWrite:$e.ReadOnly),S=e.colorModeForRenderPass(),T=e.useProgram(v?"backgroundPattern":"background"),E=E.coveringTiles({tileSize:_});v&&(y.activeTexture.set(g.TEXTURE0),e.imageManager.bind(e.context));for(var I=i.getCrossfadeParameters(),A=0,C=E;A<C.length;A+=1){var P=C[A],M=e.transform.calculatePosMatrix(P.toUnwrapped());M=v?(n=M,o=m,a=e,s=v,u={tileID:P,tileSize:_},l=I,P=h=c=void 0,t.extend((c=s,p=l,f=u,P=(h=a).imageManager.getPattern(c.from.toString()),s=h.imageManager.getPattern(c.to.toString()),u=(l=h.imageManager.getPixelSize()).width,a=l.height,c=Math.pow(2,f.tileID.overscaledZ),c=(l=f.tileSize*Math.pow(2,h.transform.tileZoom)/c)*(f.tileID.canonical.x+f.tileID.wrap*c),l*=f.tileID.canonical.y,{u_image:0,u_pattern_tl_a:P.tl,u_pattern_br_a:P.br,u_pattern_tl_b:s.tl,u_pattern_br_b:s.br,u_texsize:[u,a],u_mix:p.t,u_pattern_size_a:P.displaySize,u_pattern_size_b:s.displaySize,u_scale_a:p.fromScale,u_scale_b:p.toScale,u_tile_units_to_pixels:1/Or(f,1,h.transform.tileZoom),u_pixel_coord_upper:[c>>16,l>>16],u_pixel_coord_lower:[65535&c,65535&l]}),{u_matrix:n,u_opacity:o})):{u_matrix:M,u_opacity:m,u_color:d};T.draw(y,g.TRIANGLES,w,b,S,rr.disabled,M,i.id,e.tileExtentBuffer,e.quadTriangleIndexBuffer,e.tileExtentSegments)}}}}},debug:function(t,e,r){for(var i=0;i<r.length;i++)mn(t,e,r[i])},custom:function(t,e,r){var i,n=t.context;r=r.implementation;"offscreen"===t.renderPass?(i=r.prerender)&&(t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),i.call(r,n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState()):"translucent"===t.renderPass&&(t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),n.setStencilMode(tr.disabled),i="3d"===r.renderingMode?new $e(t.context.gl.LEQUAL,$e.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,$e.ReadOnly),n.setDepthMode(i),r.render(n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState(),n.bindFramebuffer.set(null))}};function _n(t,e){this.points=t,this.planes=e}function vn(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)}function xn(t,e,r,i){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(i)||i<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=i}function bn(e,r,i,n,o){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===o||o,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==i?0:i,this._maxPitch=null==n?60:n,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new xn,this._posMatrixCache={},this._alignedPosMatrixCache={}}function wn(e){var r,i,n,o;this._hashName=e&&encodeURIComponent(e),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(r=this._updateHashUnthrottled.bind(this),i=!1,n=null,o=function(){n=null,i&&(r(),n=setTimeout(o,300),i=!1)},function(){return i=!0,n||o(),n})}function Sn(t){this._map=t,this.clear()}yn.prototype.resize=function(e,r){if(this.width=e*t.browser.devicePixelRatio,this.height=r*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var i=0,n=this.style._order;i<n.length;i+=1)this.style._layers[n[i]].resize()},yn.prototype.setup=function(){var e=this.context,r=new t.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(t.EXTENT,0),r.emplaceBack(0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=e.createVertexBuffer(r,gi.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2),(r=new t.StructArrayLayout2i4).emplaceBack(0,0),r.emplaceBack(t.EXTENT,0),r.emplaceBack(0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=e.createVertexBuffer(r,gi.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5),(r=new t.StructArrayLayout4i8).emplaceBack(0,0,0,0),r.emplaceBack(t.EXTENT,0,t.EXTENT,0),r.emplaceBack(0,t.EXTENT,0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=e.createVertexBuffer(r,U.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2),(r=new t.StructArrayLayout2i4).emplaceBack(0,0),r.emplaceBack(1,0),r.emplaceBack(0,1),r.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(r,gi.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2),(r=new t.StructArrayLayout1ui2).emplaceBack(0),r.emplaceBack(1),r.emplaceBack(3),r.emplaceBack(2),r.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(r),(r=new t.StructArrayLayout3ui6).emplaceBack(0,1,2),r.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(r),this.emptyTexture=new t.Texture(e,{width:1,height:1,data:new Uint8Array([0,0,0,0])},e.gl.RGBA),e=this.context.gl,this.stencilClearMode=new tr({func:e.ALWAYS,mask:0},0,255,e.ZERO,e.ZERO,e.ZERO)},yn.prototype.clearStencil=function(){var e=this.context,r=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var i=t.create();t.ortho(i,0,this.width,this.height,0,0,1),t.scale(i,i,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,r.TRIANGLES,$e.disabled,this.stencilClearMode,er.disabled,rr.disabled,qi(i),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},yn.prototype._renderTileClippingMasks=function(t,e){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var r=this.context,i=r.gl;256<this.nextStencilID+e.length&&this.clearStencil(),r.setColorMode(er.disabled),r.setDepthMode($e.disabled);var n=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,a=e;o<a.length;o+=1){var s=a[o],u=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;n.draw(r,i.TRIANGLES,$e.disabled,new tr({func:i.ALWAYS,mask:0},u,255,i.KEEP,i.KEEP,i.REPLACE),er.disabled,rr.disabled,qi(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},yn.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,256<this.nextStencilID+1&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new tr({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},yn.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new tr({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},yn.prototype.stencilConfigForOverlap=function(t){var e=this.context.gl,r=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),i=r[r.length-1].overscaledZ,n=r[0].overscaledZ-i+1;if(1<n){this.currentStencilSource=void 0,256<this.nextStencilID+n&&this.clearStencil();for(var o={},a=0;a<n;a++)o[a+i]=new tr({func:e.GEQUAL,mask:255},a+this.nextStencilID,255,e.KEEP,e.KEEP,e.REPLACE);return this.nextStencilID+=n,[o,r]}return[((t={})[i]=tr.disabled,t),r]},yn.prototype.colorModeForRenderPass=function(){var e=this.context.gl;return this._showOverdrawInspector?new er([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?er.unblended:er.alphaBlended},yn.prototype.depthModeForSublayer=function(t,e,r){return this.opaquePassEnabledForLayer()?(t=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon,new $e(r||this.context.gl.LEQUAL,e,[t,t])):$e.disabled},yn.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},yn.prototype.render=function(e,r){var i=this;this.style=e,this.options=r,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(t.browser.now()),this.imageManager.beginFrame();var n,o=this.style._order,a=this.style.sourceCaches;for(n in a){var s=a[n];s.used&&s.prepare(this.context)}var u,l,c,p={},h={},f={};for(c in a){var d=a[c];p[c]=d.getVisibleCoordinates(),h[c]=p[c].slice().reverse(),f[c]=d.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var m=0;m<o.length;m++)if(this.style._layers[o[m]].is3D()){this.opaquePassCutoff=m;break}this.renderPass="offscreen";for(var y=0,g=o;y<g.length;y+=1){var _,v=this.style._layers[g[y]];v.hasOffscreenPass()&&!v.isHidden(this.transform.zoom)&&(_=h[v.source],"custom"!==v.type&&!_.length||this.renderLayer(this,a[v.source],v,_))}for(this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=o.length-1;0<=this.currentLayer;this.currentLayer--){var x=this.style._layers[o[this.currentLayer]],b=a[x.source],w=p[x.source];this._renderTileClippingMasks(x,w),this.renderLayer(this,b,x,w)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<o.length;this.currentLayer++){var S=this.style._layers[o[this.currentLayer]],T=a[S.source],E=("symbol"===S.type?f:h)[S.source];this._renderTileClippingMasks(S,p[S.source]),this.renderLayer(this,T,S,E)}this.options.showTileBoundaries&&(t.values(this.style._layers).forEach((function(t){t.source&&!t.isHidden(i.transform.zoom)&&(t.source!==(l&&l.id)&&(l=i.style.sourceCaches[t.source]),(!u||u.getSource().maxzoom<l.getSource().maxzoom)&&(u=l))})),u&&gn.debug(this,u,u.getVisibleCoordinates())),this.options.showPadding&&function(t){var e=t.transform.padding;hn(t,t.transform.height-(e.top||0),3,sn),hn(t,e.bottom||0,3,un),fn(t,e.left||0,3,ln),fn(t,t.transform.width-(e.right||0),3,cn);var r,i=t.transform.centerPoint;dn(r=t,(e=i.x)-1,(t=t.transform.height-i.y)-10,2,20,i=pn),dn(r,e-10,t-1,20,2,i)}(this),this.context.setDefault()},yn.prototype.renderLayer=function(t,e,r,i){r.isHidden(this.transform.zoom)||"background"!==r.type&&"custom"!==r.type&&!i.length||(this.id=r.id,this.gpuTimingStart(r),gn[r.type](t,e,r,i,this.style.placement.variableOffsets),this.gpuTimingEnd())},yn.prototype.gpuTimingStart=function(t){var e,r;this.options.gpuTiming&&(e=this.context.extTimerQuery,(r=(r=this.gpuTimers[t.id])||(this.gpuTimers[t.id]={calls:0,cpuTime:0,query:e.createQueryEXT()})).calls++,e.beginQueryEXT(e.TIME_ELAPSED_EXT,r.query))},yn.prototype.gpuTimingEnd=function(){var t;this.options.gpuTiming&&(t=this.context.extTimerQuery).endQueryEXT(t.TIME_ELAPSED_EXT)},yn.prototype.collectGpuTimers=function(){var t=this.gpuTimers;return this.gpuTimers={},t},yn.prototype.queryGpuTimers=function(t){var e,r={};for(e in t){var i=t[e],n=this.context.extTimerQuery,o=n.getQueryObjectEXT(i.query,n.QUERY_RESULT_EXT)/1e6;n.deleteQueryEXT(i.query),r[e]=o}return r},yn.prototype.translatePosMatrix=function(e,r,i,n,o){if(!i[0]&&!i[1])return e;var a=o?"map"===n?this.transform.angle:0:"viewport"===n?-this.transform.angle:0;return a&&(n=Math.sin(a),a=Math.cos(a),i=[i[0]*a-i[1]*n,i[0]*n+i[1]*a]),r=[o?i[0]:Or(r,i[0],this.transform.zoom),o?i[1]:Or(r,i[1],this.transform.zoom),0],i=new Float32Array(16),t.translate(i,e,r),i},yn.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},yn.prototype.getTileTexture=function(t){return(t=this._tileTextures[t])&&0<t.length?t.pop():null},yn.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString());t=this.imageManager.getPattern(t.to.toString());return!e||!t},yn.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new Fi(this.context,0,Ri[t],e,Qi[t],this._showOverdrawInspector)),this.cache[r]},yn.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()},yn.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)},yn.prototype.initDebugOverlayCanvas=function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},yn.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()},_n.fromInvProjectionMatrix=function(e,r,i){var n=Math.pow(2,i),o=[[-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(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*n)}));i=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],o[e[0]],o[e[1]]),i=t.sub([],o[e[2]],o[e[1]]);i=t.normalize([],t.cross([],r,i)),e=-t.dot(i,o[e[1]]);return i.concat(e)}));return new _n(o,i)},vn.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],i=t.clone$2(this.min),n=t.clone$2(this.max),o=0;o<r.length;o++)i[o]=(r[o]?this.min:this.center)[o],n[o]=(r[o]?this.center:this.max)[o];return n[2]=this.max[2],new vn(i,n)},vn.prototype.distanceX=function(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]},vn.prototype.distanceY=function(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]},vn.prototype.intersects=function(e){for(var r=[[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]],i=!0,n=0;n<e.planes.length;n++){for(var o=e.planes[n],a=0,s=0;s<r.length;s++)a+=0<=t.dot$1(o,r[s]);if(0===a)return 0;a!==r.length&&(i=!1)}if(i)return 2;for(var u=0;u<3;u++){for(var l=Number.MAX_VALUE,c=-Number.MAX_VALUE,p=0;p<e.points.length;p++){var h=e.points[p][u]-this.min[u];l=Math.min(l,h),c=Math.max(c,h)}if(c<0||l>this.max[u]-this.min[u])return 0}return 1},xn.prototype.interpolate=function(e,r,i){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,i)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,i)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,i)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,i)),this},xn.prototype.getCenter=function(e,r){return e=t.clamp((this.left+e-this.right)/2,0,e),r=t.clamp((this.top+r-this.bottom)/2,0,r),new t.Point(e,r)},xn.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},xn.prototype.clone=function(){return new xn(this.top,this.bottom,this.left,this.right)},xn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}},j={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}},bn.prototype.clone=function(){var t=new bn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},j.minZoom.get=function(){return this._minZoom},j.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},j.maxZoom.get=function(){return this._maxZoom},j.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},j.minPitch.get=function(){return this._minPitch},j.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},j.maxPitch.get=function(){return this._maxPitch},j.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},j.renderWorldCopies.get=function(){return this._renderWorldCopies},j.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},j.worldSize.get=function(){return this.tileSize*this.scale},j.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},j.size.get=function(){return new t.Point(this.width,this.height)},j.bearing.get=function(){return-this.angle/Math.PI*180},j.bearing.set=function(e){e=-t.wrap(e,-180,180)*Math.PI/180,this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},j.pitch.get=function(){return this._pitch/Math.PI*180},j.pitch.set=function(e){e=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI,this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},j.fov.get=function(){return this._fov/Math.PI*180},j.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},j.zoom.get=function(){return this._zoom},j.zoom.set=function(t){t=Math.min(Math.max(t,this.minZoom),this.maxZoom),this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom,this._constrain(),this._calcMatrices())},j.center.get=function(){return this._center},j.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},j.padding.get=function(){return this._edgeInsets.toJSON()},j.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},j.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},bn.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},bn.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},bn.prototype.coveringZoomLevel=function(t){return t=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize)),Math.max(0,t)},bn.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var i=this.pointCoordinate(new t.Point(0,0)),n=this.pointCoordinate(new t.Point(this.width,0)),o=this.pointCoordinate(new t.Point(this.width,this.height)),a=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(i.x,n.x,o.x,a.x)),u=Math.floor(Math.max(i.x,n.x,o.x,a.x)),l=s-1;l<=u+1;l++)0!==l&&r.push(new t.UnwrappedTileID(l,e));return r},bn.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),i=r;if(void 0!==e.minzoom&&r<e.minzoom)return[];void 0!==e.maxzoom&&r>e.maxzoom&&(r=e.maxzoom);var n=t.MercatorCoordinate.fromLngLat(this.center),o=Math.pow(2,r),a=[o*n.x,o*n.y,0],s=_n.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),u=e.minzoom||0;function l(t){return{aabb:new vn([t*o,0,0],[(t+1)*o,o,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}}this.pitch<=60&&this._edgeInsets.top<.1&&(u=r);var c=[],p=[],h=r,f=e.reparseOverscaled?i:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)c.push(l(-d)),c.push(l(d));for(c.push(l(0));0<c.length;){var m=c.pop(),y=m.x,g=m.y,_=m.fullyVisible;if(!_){if(0===(x=m.aabb.intersects(s)))continue;_=2===x}var v=m.aabb.distanceX(a),x=m.aabb.distanceY(a);x=Math.max(Math.abs(v),Math.abs(x));if(m.zoom===h||x>3+(1<<h-m.zoom)-2&&m.zoom>=u)p.push({tileID:new t.OverscaledTileID(m.zoom===h?f:m.zoom,m.wrap,m.zoom,y,g),distanceSq:t.sqrLen([a[0]-.5-y,a[1]-.5-g])});else for(var b=0;b<4;b++){var w=(y<<1)+b%2,S=(g<<1)+(b>>1);c.push({aabb:m.aabb.quadrant(b),zoom:m.zoom+1,x:w,y:S,wrap:m.wrap,fullyVisible:_})}}return p.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},bn.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},j.unmodified.get=function(){return this._unmodified},bn.prototype.zoomScale=function(t){return Math.pow(2,t)},bn.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},bn.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},bn.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},j.point.get=function(){return this.project(this.center)},bn.prototype.setLocationAtPoint=function(e,r){var i=this.pointCoordinate(r);r=this.pointCoordinate(this.centerPoint),e=this.locationCoordinate(e),r=new t.MercatorCoordinate(e.x-(i.x-r.x),e.y-(i.y-r.y));this.center=this.coordinateLocation(r),this._renderWorldCopies&&(this.center=this.center.wrap())},bn.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},bn.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},bn.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},bn.prototype.coordinateLocation=function(t){return t.toLngLat()},bn.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],i=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(i,i,this.pixelMatrixInverse);var n=r[3],o=i[3],a=r[1]/n,s=i[1]/o,u=(u=r[2]/n)==(e=i[2]/o)?0:(0-u)/(e-u);return new t.MercatorCoordinate(t.number(r[0]/n,i[0]/o,u)/this.worldSize,t.number(a,s,u)/this.worldSize)},bn.prototype.coordinatePoint=function(e){return e=[e.x*this.worldSize,e.y*this.worldSize,0,1],t.transformMat4(e,e,this.pixelMatrix),new t.Point(e[0]/e[3],e[1]/e[3])},bn.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},bn.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},bn.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},bn.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var i=e.key,n=r?this._alignedPosMatrixCache:this._posMatrixCache;if(n[i])return n[i];var o=e.canonical,a=this.worldSize/this.zoomScale(o.z),s=o.x+Math.pow(2,o.z)*e.wrap;e=t.identity(new Float64Array(16));return t.translate(e,e,[s*a,o.y*a,0]),t.scale(e,e,[a/t.EXTENT,a/t.EXTENT,1]),t.multiply(e,r?this.alignedProjMatrix:this.projMatrix,e),n[i]=new Float32Array(e),n[i]},bn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},bn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,i,n,o=-90,a=90,s=-180,u=180,l=this.size,c=this._unmodified;this.latRange&&(h=this.latRange,o=t.mercatorYfromLat(h[1])*this.worldSize,i=(a=t.mercatorYfromLat(h[0])*this.worldSize)-o<l.y?l.y/(a-o):0),this.lngRange&&(f=this.lngRange,s=t.mercatorXfromLng(f[0])*this.worldSize,n=(u=t.mercatorXfromLng(f[1])*this.worldSize)-s<l.x?l.x/(u-s):0);var p,h=this.point,f=Math.max(n||0,i||0);if(f)return this.center=this.unproject(new t.Point(n?(u+s)/2:h.x,i?(a+o)/2:h.y)),this.zoom+=this.scaleZoom(f),this._unmodified=c,void(this._constraining=!1);this.latRange&&((f=h.y)-(p=l.y/2)<o&&(r=o+p),a<f+p&&(r=a-p)),this.lngRange&&((p=h.x)-(l=l.x/2)<s&&(e=s+l),u<p+l&&(e=u-l)),void 0===e&&void 0===r||(this.center=this.unproject(new t.Point(void 0!==e?e:h.x,void 0!==r?r:h.y))),this._unmodified=c,this._constraining=!1}},bn.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var r=Math.PI/2+this._pitch,i=this._fov*(.5+e.y/this.height),n=Math.sin(i)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-r-i,.01,Math.PI-.01)),o=(s=this.point).x,a=s.y,s=(r=1.01*(Math.cos(Math.PI/2-this._pitch)*n+this.cameraToCenterDistance),i=this.height/50,new Float64Array(16));if(t.perspective(s,this._fov,this.width/this.height,i,r),s[8]=2*-e.x/this.width,s[9]=2*e.y/this.height,t.scale(s,s,[1,-1,1]),t.translate(s,s,[0,0,-this.cameraToCenterDistance]),t.rotateX(s,s,this._pitch),t.rotateZ(s,s,this.angle),t.translate(s,s,[-o,-a,0]),this.mercatorMatrix=t.scale([],s,[this.worldSize,this.worldSize,this.worldSize]),t.scale(s,s,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=s,this.invProjMatrix=t.invert([],this.projMatrix),n=this.width%2/2,i=this.height%2/2,r=Math.cos(this.angle),e=Math.sin(this.angle),o=o-Math.round(o)+r*n+e*i,e=a-Math.round(a)+r*i+e*n,n=new Float64Array(s),t.translate(n,n,[.5<o?o-1:o,.5<e?e-1:e,0]),this.alignedProjMatrix=n,s=t.create(),t.scale(s,s,[this.width/2,-this.height/2,1]),t.translate(s,s,[1,-1,0]),this.labelPlaneMatrix=s,s=t.create(),t.scale(s,s,[1,-1,1]),t.translate(s,s,[-1,-1,0]),t.scale(s,s,[2/this.width,2/this.height,1]),this.glCoordMatrix=s,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(s=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=s,this._posMatrixCache={},this._alignedPosMatrixCache={}}},bn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=[(e=this.pointCoordinate(new t.Point(0,0))).x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(e,e,this.pixelMatrix)[3]/this.cameraToCenterDistance},bn.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},bn.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var i=r.x,n=r.y,o=r.x,a=r.y,s=0,u=e;s<u.length;s+=1){var l=u[s];i=Math.min(i,l.x),n=Math.min(n,l.y),o=Math.max(o,l.x),a=Math.max(a,l.y)}return[new t.Point(i,n),new t.Point(o,n),new t.Point(o,a),new t.Point(i,a),new t.Point(i,n)]},Object.defineProperties(bn.prototype,j),wn.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},wn.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},wn.prototype.getHashString=function(e){var r=this._map.getCenter(),i=Math.round(100*this._map.getZoom())/100,n=Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,n),a=Math.round(r.lng*o)/o,s=(n=Math.round(r.lat*o)/o,r=this._map.getBearing(),o=this._map.getPitch(),"");if(s+=e?"/"+a+"/"+n+"/"+i:i+"/"+n+"/"+a,(r||o)&&(s+="/"+Math.round(10*r)/10),o&&(s+="/"+Math.round(o)),this._hashName){var u=this._hashName,l=!1;o=t.window.location.hash.slice(1).split("&").map((function(t){var e=t.split("=")[0];return e===u?(l=!0,e+"="+s):t})).filter((function(t){return t}));return l||o.push(u+"="+s),"#"+o.join("&")}return"#"+s},wn.prototype._getCurrentHash=function(){var e,r=this,i=t.window.location.hash.replace("#","");return this._hashName?(i.split("&").map((function(t){return t.split("=")})).forEach((function(t){t[0]===r._hashName&&(e=t)})),(e&&e[1]||"").split("/")):i.split("/")},wn.prototype._onHashChange=function(){var t=this._getCurrentHash();if(3<=t.length&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},wn.prototype._updateHashUnthrottled=function(){var e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,e)}catch(e){}};V={linearity:.3,easing:t.bezier(0,0,.3,1)};var Tn=t.extend({deceleration:2500,maxSpeed:1400},V),En=t.extend({deceleration:20,maxSpeed:1400},V),In=t.extend({deceleration:1e3,maxSpeed:360},V),An=t.extend({deceleration:1e3,maxSpeed:90},V);function Cn(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function Pn(e,r,i){var n=i.maxSpeed,o=i.linearity,a=i.deceleration;n=t.clamp(e*o/(r/1e3),-n,n),o=Math.abs(n)/(a*o);return{easing:i.easing,duration:1e3*o,amount:n*(o/2)}}function Mn(t,e){this._map=t,this._clickTolerance=e.clickTolerance}Sn.prototype.clear=function(){this._inertiaBuffer=[]},Sn.prototype.record=function(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.browser.now(),settings:e})},Sn.prototype._drainInertiaBuffer=function(){for(var e=this._inertiaBuffer,r=t.browser.now();0<e.length&&160<r-e[0].time;)e.shift()},Sn.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},i=0,n=this._inertiaBuffer;i<n.length;i+=1){var o=n[i].settings;r.zoom+=o.zoomDelta||0,r.bearing+=o.bearingDelta||0,r.pitch+=o.pitchDelta||0,o.panDelta&&r.pan._add(o.panDelta),o.around&&(r.around=o.around),o.pinchAround&&(r.pinchAround=o.pinchAround)}var a,s,u=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,l={};return r.pan.mag()&&(e=Pn(r.pan.mag(),u,t.extend({},Tn,e||{})),l.offset=r.pan.mult(e.amount/r.pan.mag()),l.center=this._map.transform.center,Cn(l,e)),r.zoom&&(a=Pn(r.zoom,u,En),l.zoom=this._map.transform.zoom+a.amount,Cn(l,a)),r.bearing&&(a=Pn(r.bearing,u,In),l.bearing=this._map.transform.bearing+t.clamp(a.amount,-179,179),Cn(l,a)),r.pitch&&(s=Pn(r.pitch,u,An),l.pitch=this._map.transform.pitch+s.amount,Cn(l,s)),(l.zoom||l.bearing)&&(s=void 0===r.pinchAround?r.around:r.pinchAround,l.around=s?this._map.unproject(s):this._map.getCenter()),this.clear(),t.extend(l,{noMoveStart:!0})}};var kn=function(e){function i(i,n,o,a){void 0===a&&(a={});var s=r.mousePos(n.getCanvasContainer(),o),u=n.unproject(s);e.call(this,i,t.extend({point:s,lngLat:u,originalEvent:o},a)),this._defaultPrevented=!1,this.target=n}e&&(i.__proto__=e);var n={defaultPrevented:{configurable:!0}};return((i.prototype=Object.create(e&&e.prototype)).constructor=i).prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(i.prototype,n),i}(t.Event),zn=function(e){function i(i,n,o){var a="touchend"===i?o.changedTouches:o.touches,s=r.touchPos(n.getCanvasContainer(),a),u=s.map((function(t){return n.unproject(t)})),l=s.reduce((function(t,e,r,i){return t.add(e.div(i.length))}),new t.Point(0,0));a=n.unproject(l);e.call(this,i,{points:s,point:l,lngLats:u,lngLat:a,originalEvent:o}),this._defaultPrevented=!1}e&&(i.__proto__=e);var n={defaultPrevented:{configurable:!0}};return((i.prototype=Object.create(e&&e.prototype)).constructor=i).prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(i.prototype,n),i}(t.Event),Ln=function(t){function e(e,r,i){t.call(this,e,{originalEvent:i}),this._defaultPrevented=!1}t&&(e.__proto__=t);var r={defaultPrevented:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,r),e}(t.Event);function Bn(t){this._map=t}function Dn(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1}function Rn(t,e){for(var r={},i=0;i<t.length;i++)r[t[i].identifier]=e[i];return r}function On(t){this.reset(),this.numTouches=t.numTouches}function Fn(t){this.singleTap=new On(t),this.numTaps=t.numTaps,this.reset()}function jn(){this._zoomIn=new Fn({numTouches:1,numTaps:2}),this._zoomOut=new Fn({numTouches:2,numTaps:1}),this.reset()}Mn.prototype.reset=function(){delete this._mousedownPos},Mn.prototype.wheel=function(t){return this._firePreventable(new Ln(t.type,this._map,t))},Mn.prototype.mousedown=function(t,e){return this._mousedownPos=e,this._firePreventable(new kn(t.type,this._map,t))},Mn.prototype.mouseup=function(t){this._map.fire(new kn(t.type,this._map,t))},Mn.prototype.click=function(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new kn(t.type,this._map,t))},Mn.prototype.dblclick=function(t){return this._firePreventable(new kn(t.type,this._map,t))},Mn.prototype.mouseover=function(t){this._map.fire(new kn(t.type,this._map,t))},Mn.prototype.mouseout=function(t){this._map.fire(new kn(t.type,this._map,t))},Mn.prototype.touchstart=function(t){return this._firePreventable(new zn(t.type,this._map,t))},Mn.prototype.touchmove=function(t){this._map.fire(new zn(t.type,this._map,t))},Mn.prototype.touchend=function(t){this._map.fire(new zn(t.type,this._map,t))},Mn.prototype.touchcancel=function(t){this._map.fire(new zn(t.type,this._map,t))},Mn.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Mn.prototype.isEnabled=function(){return!0},Mn.prototype.isActive=function(){return!1},Mn.prototype.enable=function(){},Mn.prototype.disable=function(){},Bn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Bn.prototype.mousemove=function(t){this._map.fire(new kn(t.type,this._map,t))},Bn.prototype.mousedown=function(){this._delayContextMenu=!0},Bn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new kn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Bn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new kn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},Bn.prototype.isEnabled=function(){return!0},Bn.prototype.isActive=function(){return!1},Bn.prototype.enable=function(){},Bn.prototype.disable=function(){},Dn.prototype.isEnabled=function(){return!!this._enabled},Dn.prototype.isActive=function(){return!!this._active},Dn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Dn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Dn.prototype.mousedown=function(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(r.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)},Dn.prototype.mousemoveWindow=function(t,e){var i,n,o;this._active&&(o=e,this._lastPos.equals(o)||!this._box&&o.dist(this._startPos)<this._clickTolerance||(i=this._startPos,this._lastPos=o,this._box||(this._box=r.create("div","maplibregl-boxzoom mapboxgl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair","mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t)),n=Math.min(i.x,o.x),e=Math.max(i.x,o.x),t=Math.min(i.y,o.y),o=Math.max(i.y,o.y),r.setTransform(this._box,"translate("+n+"px,"+t+"px)"),this._box.style.width=e-n+"px",this._box.style.height=o-t+"px"))},Dn.prototype.mouseupWindow=function(e,i){var n=this;if(this._active&&0===e.button){var o=this._startPos,a=i;if(this.reset(),r.suppressClick(),o.x!==a.x||o.y!==a.y)return this._map.fire(new t.Event("boxzoomend",{originalEvent:e})),{cameraAnimation:function(t){return t.fitScreenCoordinates(o,a,n._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",e)}},Dn.prototype.keydown=function(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))},Dn.prototype.reset=function(){this._active=!1,this._container.classList.remove("maplibregl-crosshair","mapboxgl-crosshair"),this._box&&(r.remove(this._box),this._box=null),r.enableDrag(),delete this._startPos,delete this._lastPos},Dn.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,{originalEvent:r}))},On.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},On.prototype.touchstart=function(e,r,i){(this.centroid||i.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),i.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),i=0,n=e;i<n.length;i+=1)r._add(n[i]);return r.div(e.length)}(r),this.touches=Rn(i,r)))},On.prototype.touchmove=function(t,e,r){if(!this.aborted&&this.centroid){var i,n=Rn(r,e);for(i in this.touches){var o=n[i];(!o||30<o.dist(this.touches[i]))&&(this.aborted=!0)}}},On.prototype.touchend=function(t,e,r){if((!this.centroid||500<t.timeStamp-this.startTime)&&(this.aborted=!0),0===r.length&&(r=!this.aborted&&this.centroid,this.reset(),r))return r},Fn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Fn.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},Fn.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},Fn.prototype.touchend=function(t,e,r){var i=this.singleTap.touchend(t,e,r);if(i&&(e=t.timeStamp-this.lastTime<500,r=!this.lastTap||this.lastTap.dist(i)<30,e&&r||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=i,this.count===this.numTaps))return this.reset(),i},jn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},jn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},jn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},jn.prototype.touchend=function(t,e,r){var i=this,n=this._zoomIn.touchend(t,e,r),o=this._zoomOut.touchend(t,e,r);return n?(this._active=!0,t.preventDefault(),setTimeout((function(){return i.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(n)},{originalEvent:t})}}):o?(this._active=!0,t.preventDefault(),setTimeout((function(){return i.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(o)},{originalEvent:t})}}):void 0},jn.prototype.touchcancel=function(){this.reset()},jn.prototype.enable=function(){this._enabled=!0},jn.prototype.disable=function(){this._enabled=!1,this.reset()},jn.prototype.isEnabled=function(){return this._enabled},jn.prototype.isActive=function(){return this._active};var Un={0:1,2:2};function Nn(t){this._minTouches=1,this._clickTolerance=t.clickTolerance||1,this.reset()}(q=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1}).prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},q.prototype._correctButton=function(t,e){return!1},q.prototype._move=function(t,e){return{}},q.prototype.mousedown=function(t,e){var i;this._lastPoint||(i=r.mouseButton(t),this._correctButton(t,i)&&(this._lastPoint=e,this._eventButton=i))},q.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r)if(t.preventDefault(),function(e){return e=Un[e],void 0===t.buttons||(t.buttons&e)!==e}(this._eventButton))this.reset();else if(this._moved||!(e.dist(r)<this._clickTolerance))return this._moved=!0,this._lastPoint=e,this._move(r,e)},q.prototype.mouseupWindow=function(t){this._lastPoint&&r.mouseButton(t)===this._eventButton&&(this._moved&&r.suppressClick(),this.reset())},q.prototype.enable=function(){this._enabled=!0},q.prototype.disable=function(){this._enabled=!1,this.reset()},q.prototype.isEnabled=function(){return this._enabled},q.prototype.isActive=function(){return this._active};var Vn,qn,Gn,Hn=((Gn=q)&&(Jn.__proto__=Gn),((Jn.prototype=Object.create(Gn&&Gn.prototype)).constructor=Jn).prototype.mousedown=function(t,e){Gn.prototype.mousedown.call(this,t,e),this._lastPoint&&(this._active=!0)},Jn.prototype._correctButton=function(t,e){return 0===e&&!t.ctrlKey},Jn.prototype._move=function(t,e){return{around:e,panDelta:e.sub(t)}},Jn),Zn=((qn=q)&&(Kn.__proto__=qn),((Kn.prototype=Object.create(qn&&qn.prototype)).constructor=Kn).prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},Kn.prototype._move=function(t,e){if(t=.8*(e.x-t.x))return this._active=!0,{bearingDelta:t}},Kn.prototype.contextmenu=function(t){t.preventDefault()},Kn),Wn=((Vn=q)&&(Xn.__proto__=Vn),((Xn.prototype=Object.create(Vn&&Vn.prototype)).constructor=Xn).prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},Xn.prototype._move=function(t,e){if(t=-.5*(e.y-t.y))return this._active=!0,{pitchDelta:t}},Xn.prototype.contextmenu=function(t){t.preventDefault()},Xn);function Xn(){Vn.apply(this,arguments)}function Kn(){qn.apply(this,arguments)}function Jn(){Gn.apply(this,arguments)}function Yn(t,e,r){for(var i=0;i<t.length;i++)if(t[i].identifier===r)return e[i]}function Qn(t,e){return Math.log(t/e)/Math.LN2}Nn.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new t.Point(0,0)},Nn.prototype.touchstart=function(t,e,r){return this._calculateTransform(t,e,r)},Nn.prototype.touchmove=function(t,e,r){if(this._active&&!(r.length<this._minTouches))return t.preventDefault(),this._calculateTransform(t,e,r)},Nn.prototype.touchend=function(t,e,r){this._calculateTransform(t,e,r),this._active&&r.length<this._minTouches&&this.reset()},Nn.prototype.touchcancel=function(){this.reset()},Nn.prototype._calculateTransform=function(e,r,i){0<i.length&&(this._active=!0);var n,o=Rn(i,r),a=new t.Point(0,0),s=new t.Point(0,0),u=0;for(n in o){var l=o[n],c=this._touches[n];c&&(a._add(l),s._add(l.sub(c)),u++,o[n]=l)}if(this._touches=o,!(u<this._minTouches)&&s.mag()&&(r=s.div(u),this._sum._add(r),!(this._sum.mag()<this._clickTolerance)))return{around:a.div(u),panDelta:r}},Nn.prototype.enable=function(){this._enabled=!0},Nn.prototype.disable=function(){this._enabled=!1,this.reset()},Nn.prototype.isEnabled=function(){return this._enabled},Nn.prototype.isActive=function(){return this._active},(Li=function(){this.reset()}).prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},Li.prototype._start=function(t){},Li.prototype._move=function(t,e,r){return{}},Li.prototype.touchstart=function(t,e,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([e[0],e[1]]))},Li.prototype.touchmove=function(t,e,r){if(this._firstTwoTouches){t.preventDefault();var i=(n=this._firstTwoTouches)[1],n=Yn(r,e,n[0]);e=Yn(r,e,i);if(n&&e)return i=this._aroundCenter?null:n.add(e).div(2),this._move([n,e],i,t)}},Li.prototype.touchend=function(t,e,i){var n,o;this._firstTwoTouches&&(o=(n=this._firstTwoTouches)[1],n=Yn(i,e,n[0]),o=Yn(i,e,o),n&&o||(this._active&&r.suppressClick(),this.reset()))},Li.prototype.touchcancel=function(){this.reset()},Li.prototype.enable=function(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around},Li.prototype.disable=function(){this._enabled=!1,this.reset()},Li.prototype.isEnabled=function(){return this._enabled},Li.prototype.isActive=function(){return this._active};var $n,to=(($n=Li)&&(eo.__proto__=$n),((eo.prototype=Object.create($n&&$n.prototype)).constructor=eo).prototype.reset=function(){$n.prototype.reset.call(this),delete this._distance,delete this._startDistance},eo.prototype._start=function(t){this._startDistance=this._distance=t[0].dist(t[1])},eo.prototype._move=function(t,e){var r=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Qn(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Qn(this._distance,r),pinchAround:e}},eo);function eo(){$n.apply(this,arguments)}function ro(t,e){return 180*t.angleWith(e)/Math.PI}var io,no=((io=Li)&&(oo.__proto__=io),((oo.prototype=Object.create(io&&io.prototype)).constructor=oo).prototype.reset=function(){io.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},oo.prototype._start=function(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])},oo.prototype._move=function(t,e){var r=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ro(this._vector,r),pinchAround:e}},oo.prototype._isBelowThreshold=function(t){this._minDiameter=Math.min(this._minDiameter,t.mag());var e=25/(Math.PI*this._minDiameter)*360;t=ro(t,this._startVector);return Math.abs(t)<e},oo);function oo(){io.apply(this,arguments)}function ao(t){return Math.abs(t.y)>Math.abs(t.x)}function so(){var t=co;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1}var uo,lo=((uo=Li)&&(po.__proto__=uo),((po.prototype=Object.create(uo&&uo.prototype)).constructor=po).prototype.reset=function(){uo.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},po.prototype._start=function(t){ao((this._lastPoints=t)[0].sub(t[1]))&&(this._valid=!1)},po.prototype._move=function(t,e,r){var i=t[0].sub(this._lastPoints[0]),n=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(i,n,r.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(i.y+n.y)/2*-.5}},po.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var i=2<=t.mag(),n=2<=e.mag();return i||n?i&&n?(r=0<t.y==0<e.y,ao(t)&&ao(e)&&r):(void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0):void 0},po),co={panStep:100,bearingStep:15,pitchStep:10};function po(){uo.apply(this,arguments)}function ho(t){return t*(2-t)}function fo(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onTimeout"],this)}function mo(t,e){this._clickZoom=t,this._tapZoom=e}function yo(){this.reset()}function go(){this._tap=new Fn({numTouches:1,numTaps:1}),this.reset()}function _o(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r}function vo(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r}function xo(t,e,r,i){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=i,this._rotationDisabled=!1,this._enabled=!0}function bo(t){return t.zoom||t.drag||t.pitch||t.rotate}so.prototype.reset=function(){this._active=!1},so.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,i=0,n=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?i=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?n=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(n=i=0),{cameraAnimation:function(s){var u=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:ho,zoom:r?Math.round(u)+r*(t.shiftKey?2:1):u,bearing:s.getBearing()+i*e._bearingStep,pitch:s.getPitch()+n*e._pitchStep,offset:[-o*e._panStep,-a*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},so.prototype.enable=function(){this._enabled=!0},so.prototype.disable=function(){this._enabled=!1,this.reset()},so.prototype.isEnabled=function(){return this._enabled},so.prototype.isActive=function(){return this._active},so.prototype.disableRotation=function(){this._rotationDisabled=!0},so.prototype.enableRotation=function(){this._rotationDisabled=!1},fo.prototype.setZoomRate=function(t){this._defaultZoomRate=t},fo.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},fo.prototype.isEnabled=function(){return!!this._enabled},fo.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},fo.prototype.isZooming=function(){return!!this._zooming},fo.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},fo.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},fo.prototype.wheel=function(e){var r,i,n;this.isEnabled()&&(r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=(i=t.browser.now())-(this._lastWheelEventTime||0),this._lastWheelEventTime=i,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":400<n?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(n*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault())},fo.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},fo.prototype._start=function(e){this._delta&&(this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout),e=r.mousePos(this._el,e),this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(e)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame()))},fo.prototype.renderFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;0!==this._delta&&(o="wheel"===this._type&&4.000244140625<Math.abs(this._delta)?this._wheelZoomRate:this._defaultZoomRate,s=2/(1+Math.exp(-Math.abs(this._delta*o))),this._delta<0&&0!==s&&(s=1/s),a="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale,this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(a*s))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0);var i,n="number"==typeof this._targetZoom?this._targetZoom:r.zoom,o=this._startZoom,a=this._easing,s=!1;return"wheel"===this._type&&o&&a?(i=a(a=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1)),i=t.number(o,n,i),a<1?this._frameId||(this._frameId=!0):s=!0):(i=n,s=!0),this._active=!0,s&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!s,zoomDelta:i-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},fo.prototype._smoothOutEasing=function(e){var r,i,n=t.ease;return this._prevEase&&(i=this._prevEase,r=(t.browser.now()-i.start)/i.duration,i=i.easing(.01+r)-i.easing(r),r=.27/Math.sqrt(i*i+1e-4)*.01,i=Math.sqrt(.0729-r*r),n=t.bezier(r,i,.25,1)),this._prevEase={start:t.browser.now(),duration:e,easing:n},n},fo.prototype.reset=function(){this._active=!1},mo.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},mo.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},mo.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},mo.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()},yo.prototype.reset=function(){this._active=!1},yo.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},yo.prototype.enable=function(){this._enabled=!0},yo.prototype.disable=function(){this._enabled=!1,this.reset()},yo.prototype.isEnabled=function(){return this._enabled},yo.prototype.isActive=function(){return this._active},go.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},go.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&500<t.timeStamp-this._tapTime&&this.reset(),this._tapTime?0<r.length&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},go.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint&&r[0].identifier===this._swipeTouch){var i=e[0],n=i.y-this._swipePoint.y;return this._swipePoint=i,t.preventDefault(),this._active=!0,{zoomDelta:n/128}}}else this._tap.touchmove(t,e,r)},go.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},go.prototype.touchcancel=function(){this.reset()},go.prototype.enable=function(){this._enabled=!0},go.prototype.disable=function(){this._enabled=!1,this.reset()},go.prototype.isEnabled=function(){return this._enabled},go.prototype.isActive=function(){return this._active},_o.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")},_o.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")},_o.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},_o.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()},vo.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},vo.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},vo.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},vo.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()},xo.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")},xo.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")},xo.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},xo.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},xo.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},xo.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var wo,So=((wo=t.Event)&&(To.__proto__=wo),(To.prototype=Object.create(wo&&wo.prototype)).constructor=To);function To(){wo.apply(this,arguments)}function Eo(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}function Io(e,i){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Sn(e),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(i),t.bindAll(["handleEvent","handleWindowEvent"],this),i=this._el,this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[t.window,"blur",void 0]];for(var n=0,o=this._listeners;n<o.length;n+=1){var a=o[n],s=a[0];r.addEventListener(s,a[1],s===t.window.document?this.handleWindowEvent:this.handleEvent,a[2])}}function Ao(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}Io.prototype.destroy=function(){for(var e=0,i=this._listeners;e<i.length;e+=1){var n=i[e],o=n[0];r.removeEventListener(o,n[1],o===t.window.document?this.handleWindowEvent:this.handleEvent,n[2])}},Io.prototype._addDefaultHandlers=function(t){var e=this._map,r=e.getCanvasContainer();this._add("mapEvent",new Mn(e,t));var i=e.boxZoom=new Dn(e,t);this._add("boxZoom",i);var n=new jn,o=new yo;e.doubleClickZoom=new mo(o,n),this._add("tapZoom",n),this._add("clickZoom",o),i=new go,this._add("tapDragZoom",i),n=e.touchPitch=new lo,this._add("touchPitch",n),o=new Zn(t),n=new Wn(t),e.dragRotate=new vo(t,o,n),this._add("mouseRotate",o,["mousePitch"]),this._add("mousePitch",n,["mouseRotate"]),o=new Hn(t),n=new Nn(t),e.dragPan=new _o(r,o,n),this._add("mousePan",o),this._add("touchPan",n,["touchZoom","touchRotate"]),o=new no,n=new to,e.touchZoomRotate=new xo(r,n,o,i),this._add("touchRotate",o,["touchPan","touchZoom"]),this._add("touchZoom",n,["touchPan","touchRotate"]),n=e.scrollZoom=new fo(e,this),this._add("scrollZoom",n,["mousePan"]),n=e.keyboard=new so,this._add("keyboard",n),this._add("blockableMapEvent",new Bn(e));for(var a=0,s=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];a<s.length;a+=1){var u=s[a];t.interactive&&t[u]&&e[u].enable(t[u])}},Io.prototype._add=function(t,e,r){this._handlers.push({handlerName:t,handler:e,allowed:r}),this._handlersById[t]=e},Io.prototype.stop=function(t){if(!this._updatingCamera){for(var e=0,r=this._handlers;e<r.length;e+=1)r[e].handler.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}},Io.prototype.isActive=function(){for(var t=0,e=this._handlers;t<e.length;t+=1)if(e[t].handler.isActive())return!0;return!1},Io.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},Io.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},Io.prototype.isMoving=function(){return Boolean(bo(this._eventsInProgress))||this.isZooming()},Io.prototype._blockedByActive=function(t,e,r){for(var i in t)if(i!==r&&(!e||e.indexOf(i)<0))return!0;return!1},Io.prototype.handleWindowEvent=function(t){this.handleEvent(t,t.type+"Window")},Io.prototype._getMapTouches=function(t){for(var e=[],r=0,i=t;r<i.length;r+=1){var n=i[r];this._el.contains(n.target)&&e.push(n)}return e},Io.prototype.handleEvent=function(t,e){if("blur"!==t.type){this._updatingCamera=!0;for(var i="renderFrame"===t.type?void 0:t,n={needsRenderFrame:!1},o={},a={},s=t.touches?this._getMapTouches(t.touches):void 0,u=s?r.touchPos(this._el,s):r.mousePos(this._el,t),l=0,c=this._handlers;l<c.length;l+=1){var p=c[l],h=p.handlerName,f=p.handler,d=p.allowed;f.isEnabled()&&(p=void 0,this._blockedByActive(a,d,h)?f.reset():f[e||t.type]&&(p=f[e||t.type](t,u,s),this.mergeHandlerResult(n,o,p,h,i),p&&p.needsRenderFrame&&this._triggerRenderFrame()),(p||f.isActive())&&(a[h]=f))}var m,y={};for(m in this._previousActiveHandlers)a[m]||(y[m]=i);this._previousActiveHandlers=a,(Object.keys(y).length||Eo(n))&&(this._changes.push([n,o,y]),this._triggerRenderFrame()),(Object.keys(a).length||Eo(n))&&this._map._stop(!0),this._updatingCamera=!1;var g=n.cameraAnimation;g&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],g(this._map))}else this.stop(!0)},Io.prototype.mergeHandlerResult=function(e,r,i,n,o){i&&(t.extend(e,i),o={handlerName:n,originalEvent:i.originalEvent||o},void 0!==i.zoomDelta&&(r.zoom=o),void 0!==i.panDelta&&(r.drag=o),void 0!==i.pitchDelta&&(r.pitch=o),void 0!==i.bearingDelta&&(r.rotate=o))},Io.prototype._applyChanges=function(){for(var e={},r={},i={},n=0,o=this._changes;n<o.length;n+=1){var a=(u=o[n])[0],s=u[1],u=u[2];a.panDelta&&(e.panDelta=(e.panDelta||new t.Point(0,0))._add(a.panDelta)),a.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+a.zoomDelta),a.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+a.bearingDelta),a.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+a.pitchDelta),void 0!==a.around&&(e.around=a.around),void 0!==a.pinchAround&&(e.pinchAround=a.pinchAround),a.noInertia&&(e.noInertia=a.noInertia),t.extend(r,s),t.extend(i,u)}this._updateMapTransform(e,r,i),this._changes=[]},Io.prototype._updateMapTransform=function(t,e,r){var i=this._map,n=i.transform;if(!Eo(t))return this._fireEvents(e,r,!0);var o=t.panDelta,a=t.zoomDelta,s=t.bearingDelta,u=t.pitchDelta,l=t.around,c=t.pinchAround;void 0!==c&&(l=c),i._stop(!0),l=l||i.transform.centerPoint,o=n.pointLocation(o?l.sub(o):l),s&&(n.bearing+=s),u&&(n.pitch+=u),a&&(n.zoom+=a),n.setLocationAtPoint(o,l),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,r,!0)},Io.prototype._fireEvents=function(e,r,i){var n,o,a,s=this,u=bo(this._eventsInProgress),l=bo(e),c={};for(n in e)this._eventsInProgress[n]||(c[n+"start"]=e[n].originalEvent),this._eventsInProgress[n]=e[n];for(o in!u&&l&&this._fireEvent("movestart",l.originalEvent),c)this._fireEvent(o,c[o]);for(a in l&&this._fireEvent("move",l.originalEvent),e)this._fireEvent(a,e[a].originalEvent);var p,h,f,d={};for(h in this._eventsInProgress){var m=(y=this._eventsInProgress[h]).handlerName,y=y.originalEvent;this._handlersById[m].isActive()||(delete this._eventsInProgress[h],d[h+"end"]=p=r[m]||y)}for(f in d)this._fireEvent(f,d[f]);var g=bo(this._eventsInProgress);i&&(u||l)&&!g&&(this._updatingCamera=!0,l=function(t){return 0!==t&&-s._bearingSnap<t&&t<s._bearingSnap},(g=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions))?(l(g.bearing||this._map.getBearing())&&(g.bearing=0),this._map.easeTo(g,{originalEvent:p})):(this._map.fire(new t.Event("moveend",{originalEvent:p})),l(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1)},Io.prototype._fireEvent=function(e,r){this._map.fire(new t.Event(e,r?{originalEvent:r}:{}))},Io.prototype._requestFrame=function(){var t=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add((function(e){delete t._frameId,t.handleEvent(new So("renderFrame",{timeStamp:e})),t._applyChanges()}))},Io.prototype._triggerRenderFrame=function(){void 0===this._frameId&&(this._frameId=this._requestFrame())};var Co;(Co=t.Evented)&&(Po.__proto__=Co),((Po.prototype=Object.create(Co&&Co.prototype)).constructor=Po).prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},Po.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},Po.prototype.panBy=function(e,r,i){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},r),i)},Po.prototype.panTo=function(e,r,i){return this.easeTo(t.extend({center:e},r),i)},Po.prototype.getZoom=function(){return this.transform.zoom},Po.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},Po.prototype.zoomTo=function(e,r,i){return this.easeTo(t.extend({zoom:e},r),i)},Po.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},Po.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},Po.prototype.getBearing=function(){return this.transform.bearing},Po.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},Po.prototype.getPadding=function(){return this.transform.padding},Po.prototype.setPadding=function(t,e){return this.jumpTo({padding:t},e),this},Po.prototype.rotateTo=function(e,r,i){return this.easeTo(t.extend({bearing:e},r),i)},Po.prototype.resetNorth=function(e,r){return this.rotateTo(0,t.extend({duration:1e3},e),r),this},Po.prototype.resetNorthPitch=function(e,r){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),r),this},Po.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},Po.prototype.getPitch=function(){return this.transform.pitch},Po.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},Po.prototype.cameraForBounds=function(e,r){e=t.LngLatBounds.convert(e);var i=r&&r.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),i,r)},Po.prototype._cameraForBoxAndBearing=function(e,r,i,n){var o={top:0,bottom:0,right:0,left:0};"number"==typeof(n=t.extend({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},n)).padding&&(l=n.padding,n.padding={top:l,bottom:l,right:l,left:l}),n.padding=t.extend(o,n.padding);var a=this.transform,s=a.padding,u=a.project(t.LngLat.convert(e)),l=a.project(t.LngLat.convert(r));o=u.rotate(-i*Math.PI/180),e=l.rotate(-i*Math.PI/180),r=new t.Point(Math.max(o.x,e.x),Math.max(o.y,e.y)),e=new t.Point(Math.min(o.x,e.x),Math.min(o.y,e.y)),r=r.sub(e),e=(a.width-(s.left+s.right+n.padding.left+n.padding.right))/r.x;if(!((r=(a.height-(s.top+s.bottom+n.padding.top+n.padding.bottom))/r.y)<0||e<0))return e=Math.min(a.scaleZoom(a.scale*Math.min(e,r)),n.maxZoom),r="number"==typeof n.offset.x?new t.Point(n.offset.x,n.offset.y):t.Point.convert(n.offset),n=new t.Point((n.padding.left-n.padding.right)/2,(n.padding.top-n.padding.bottom)/2).rotate(i*Math.PI/180),n=r.add(n).mult(a.scale/a.zoomScale(e)),{center:a.unproject(u.add(l).div(2).sub(n)),zoom:e,bearing:i};t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},Po.prototype.fitBounds=function(t,e,r){return this._fitInternal(this.cameraForBounds(t,e),e,r)},Po.prototype.fitScreenCoordinates=function(e,r,i,n,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(r)),i,n),n,o)},Po.prototype._fitInternal=function(e,r,i){return e?(delete(r=t.extend(e,r)).padding,r.linear?this.easeTo(r,i):this.flyTo(r,i)):this},Po.prototype.jumpTo=function(e,r){this.stop();var i=this.transform,n=!1,o=!1,a=!1;return"zoom"in e&&i.zoom!==+e.zoom&&(n=!0,i.zoom=+e.zoom),void 0!==e.center&&(i.center=t.LngLat.convert(e.center)),"bearing"in e&&i.bearing!==+e.bearing&&(o=!0,i.bearing=+e.bearing),"pitch"in e&&i.pitch!==+e.pitch&&(a=!0,i.pitch=+e.pitch),null==e.padding||i.isPaddingEqual(e.padding)||(i.padding=e.padding),this.fire(new t.Event("movestart",r)).fire(new t.Event("move",r)),n&&this.fire(new t.Event("zoomstart",r)).fire(new t.Event("zoom",r)).fire(new t.Event("zoomend",r)),o&&this.fire(new t.Event("rotatestart",r)).fire(new t.Event("rotate",r)).fire(new t.Event("rotateend",r)),a&&this.fire(new t.Event("pitchstart",r)).fire(new t.Event("pitch",r)).fire(new t.Event("pitchend",r)),this.fire(new t.Event("moveend",r))},Po.prototype.easeTo=function(e,r){var i=this;this._stop(!1,e.easeId),(!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate||!e.essential&&t.browser.prefersReducedMotion)&&(e.duration=0);var n=this.transform,o=this.getZoom(),a=this.getBearing(),s=this.getPitch(),u=this.getPadding(),l="zoom"in e?+e.zoom:o,c="bearing"in e?this._normalizeBearing(e.bearing,a):a,p="pitch"in e?+e.pitch:s,h=("padding"in e?e:n).padding,f=t.Point.convert(e.offset),d=n.centerPoint.add(f),m=n.pointLocation(d),y=t.LngLat.convert(e.center||m);this._normalizeCenter(y);var g,_,v=n.project(m),x=n.project(y).sub(v),b=n.zoomScale(l-o);return e.around&&(g=t.LngLat.convert(e.around),_=n.locationPoint(g)),y={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching},this._zooming=this._zooming||l!==o,this._rotating=this._rotating||a!==c,this._pitching=this._pitching||p!==s,this._padding=!n.isPaddingEqual(h),this._easeId=e.easeId,this._prepareEase(r,e.noMoveStart,y),this._ease((function(e){var m,y;i._zooming&&(n.zoom=t.number(o,l,e)),i._rotating&&(n.bearing=t.number(a,c,e)),i._pitching&&(n.pitch=t.number(s,p,e)),i._padding&&(n.interpolatePadding(u,h,e),d=n.centerPoint.add(f)),g?n.setLocationAtPoint(g,_):(y=n.zoomScale(n.zoom-o),m=o<l?Math.min(2,b):Math.max(.5,b),m=Math.pow(m,1-e),y=n.unproject(v.add(x.mult(e*m)).mult(y)),n.setLocationAtPoint(n.renderWorldCopies?y.wrap():y,d)),i._fireMoveEvents(r)}),(function(t){i._afterEase(r,t)}),e),this},Po.prototype._prepareEase=function(e,r,i){void 0===i&&(i={}),this._moving=!0,r||i.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!i.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!i.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!i.pitching&&this.fire(new t.Event("pitchstart",e))},Po.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},Po.prototype._afterEase=function(e,r){var i,n;this._easeId&&r&&this._easeId===r||(delete this._easeId,i=this._zooming,n=this._rotating,r=this._pitching,this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,i&&this.fire(new t.Event("zoomend",e)),n&&this.fire(new t.Event("rotateend",e)),r&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e)))},Po.prototype.flyTo=function(e,r){var i=this;if(!e.essential&&t.browser.prefersReducedMotion){var n=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(n,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var o=this.transform,a=this.getZoom(),s=this.getBearing(),u=this.getPitch(),l=this.getPadding(),c="zoom"in e?t.clamp(+e.zoom,o.minZoom,o.maxZoom):a,p="bearing"in e?this._normalizeBearing(e.bearing,s):s,h="pitch"in e?+e.pitch:u,f=("padding"in e?e:o).padding,d=o.zoomScale(c-a),m=t.Point.convert(e.offset),y=o.centerPoint.add(m),g=(n=o.pointLocation(y),t.LngLat.convert(e.center||n));this._normalizeCenter(g);var _=o.project(n),v=o.project(g).sub(_),x=e.curve,b=Math.max(o.width,o.height),w=b/d,S=v.mag();"minZoom"in e&&(d=t.clamp(Math.min(e.minZoom,a,c),o.minZoom,o.maxZoom),d=b/o.zoomScale(d-a),x=Math.sqrt(d/S*2));var T=x*x;function E(t){return t=(w*w-b*b+(t?-1:1)*T*T*S*S)/(2*(t?w:b)*T*S),Math.log(Math.sqrt(t*t+1)-t)}function I(t){return(Math.exp(t)-Math.exp(-t))/2}function A(t){return(Math.exp(t)+Math.exp(-t))/2}var C=E(0),P=function(t){return A(C)/A(C+x*t)},M=function(t){return b*((A(C)*(I(t=C+x*t)/A(t))-I(C))/T)/S},k=(E(1)-C)/x;if(Math.abs(S)<1e-6||!isFinite(k)){if(Math.abs(b-w)<1e-6)return this.easeTo(e,r);var z=w<b?-1:1;k=Math.abs(Math.log(w/b))/x,M=function(){return 0},P=function(t){return Math.exp(z*x*t)}}return e.duration="duration"in e?+e.duration:1e3*k/("screenSpeed"in e?+e.screenSpeed/x:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==p,this._pitching=h!==u,this._padding=!o.isPaddingEqual(f),this._prepareEase(r,!1),this._ease((function(e){var n=e*k,d=1/P(n);o.zoom=1===e?c:a+o.scaleZoom(d),i._rotating&&(o.bearing=t.number(s,p,e)),i._pitching&&(o.pitch=t.number(u,h,e)),i._padding&&(o.interpolatePadding(l,f,e),y=o.centerPoint.add(m)),d=1===e?g:o.unproject(_.add(v.mult(M(n))).mult(d)),o.setLocationAtPoint(o.renderWorldCopies?d.wrap():d,y),i._fireMoveEvents(r)}),(function(){return i._afterEase(r)}),e),this},Po.prototype.isEasing=function(){return!!this._easeFrameId},Po.prototype.stop=function(){return this._stop()},Po.prototype._stop=function(t,e){var r;return this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd&&(r=this._onEaseEnd,delete this._onEaseEnd,r.call(this,e)),t||(t=this.handlers)&&t.stop(!1),this},Po.prototype._ease=function(e,r,i){!1===i.animate||0===i.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=i,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},Po.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},Po.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var i=Math.abs(e-r);return Math.abs(e-360-r)<i&&(e-=360),Math.abs(e+360-r)<i&&(e+=360),e},Po.prototype._normalizeCenter=function(t){var e=this.transform;e.renderWorldCopies&&!e.lngRange&&(e=t.lng-e.center.lng,t.lng+=180<e?-360:e<-180?360:0)},ye=Po;function Po(e,r){Co.call(this),this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=r.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}function Mo(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)}function ko(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}Ao.prototype.getDefaultPosition=function(){return"bottom-right"},Ao.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-attrib mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","maplibregl-ctrl-attrib-button mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._compactButton.type="button",this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","maplibregl-ctrl-attrib-inner mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),e&&this._container.classList.add("maplibregl-compact","mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Ao.prototype.onRemove=function(){r.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},Ao.prototype._setElementTitle=function(t,e){e=this._map._getUIString("AttributionControl."+e),t.title=e,t.setAttribute("aria-label",e)},Ao.prototype._toggleAttribution=function(){this._container.classList.contains("maplibregl-compact-show")||this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("maplibregl-compact-show","mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Ao.prototype._updateEditLink=function(){var e,r=(r=this._editLink)||(this._editLink=this._container.querySelector(".mapbox-improve-map")),i=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];r&&(e=i.reduce((function(t,e,r){return e.value&&(t+=e.key+"="+e.value+(r<i.length-1?"&":"")),t}),"?"),r.href=t.config.FEEDBACK_URL+"/"+e+(this._map._hash?this._map._hash.getHashString(!0):""),r.rel="noopener nofollow",this._setElementTitle(r,"MapFeedback"))},Ao.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())},Ao.prototype._updateAttributions=function(){if(this._map.style){var t=[];this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((function(t){return"string"!=typeof t?"":t}))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet&&(n=this._map.style.stylesheet,this.styleOwner=n.owner,this.styleId=n.id);var e,r=this._map.style.sourceCaches;for(e in r){var i=r[e];!i.used||(i=i.getSource()).attribution&&t.indexOf(i.attribution)<0&&t.push(i.attribution)}t.sort((function(t,e){return t.length-e.length}));var n=(t=t.filter((function(e,r){for(var i=r+1;i<t.length;i++)if(0<=t[i].indexOf(e))return!1;return!0}))).join(" | ");n!==this._attribHTML&&(this._attribHTML=n,t.length?(this._innerContainer.innerHTML=n,this._container.classList.remove("maplibregl-attrib-empty","mapboxgl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty","mapboxgl-attrib-empty"),this._editLink=null)}},Ao.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("maplibregl-compact","mapboxgl-compact"):this._container.classList.remove("maplibregl-compact","maplibregl-compact-show","mapboxgl-compact","mapboxgl-compact-show")},Mo.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","maplibregl-ctrl mapboxgl-ctrl"),(t=r.create("a","maplibregl-ctrl-logo mapboxgl-ctrl-logo")).target="_blank",t.rel="noopener nofollow",t.href="https://maplibre.org/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Mo.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Mo.prototype.getDefaultPosition=function(){return"bottom-left"},Mo.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},Mo.prototype._logoRequired=function(){if(this._map.style){var t,e=this._map.style.sourceCaches;for(t in e)if(e[t].getSource().mapbox_logo)return!0;return!1}},Mo.prototype._updateCompact=function(){var t=this._container.children;t.length&&(t=t[0],this._map.getCanvasContainer().offsetWidth<250?t.classList.add("maplibregl-compact","mapboxgl-compact"):t.classList.remove("maplibregl-compact","mapboxgl-compact"))},ko.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},ko.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,i=e?this._queue.concat(e):this._queue;r<i.length;r+=1){var n=i[r];if(n.id===t)return void(n.cancelled=!0)}},ko.prototype.run=function(t){void 0===t&&(t=0);var e=this._currentlyRunning=this._queue;this._queue=[];for(var r=0,i=e;r<i.length;r+=1){var n=i[r];if(!n.cancelled&&(n.callback(t),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},ko.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var zo={"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"},Lo=t.window.HTMLImageElement,Bo=t.window.HTMLElement,Do=t.window.ImageBitmap,Ro={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};fr=function(i){function n(e){var r=this;if(null!=(e=t.extend({},Ro,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&60<e.maxPitch)throw new Error("maxPitch must be less than or equal to 60");var n=new bn(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(i.call(this,n,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new ko,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},zo,e.locale),this._clickTolerance=e.clickTolerance,this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Bo))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Io(this,e),this._hash=e.hash&&new wn("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new Ao({customAttribution:e.customAttribution})),this.addControl(new Mo,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}i&&(n.__proto__=i);var o={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return((n.prototype=Object.create(i&&i.prototype)).constructor=n).prototype._getMapId=function(){return this._mapId},n.prototype.addControl=function(e,r){if(void 0===r&&(r=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var i=e.onAdd(this);return this._controls.push(e),e=this._controlPositions[r],-1!==r.indexOf("bottom")?e.insertBefore(i,e.firstChild):e.appendChild(i),this},n.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return-1<r&&this._controls.splice(r,1),e.onRemove(this),this},n.prototype.hasControl=function(t){return-1<this._controls.indexOf(t)},n.prototype.resize=function(e){var r=(i=this._containerDimensions())[0],i=i[1];return this._resizeCanvas(r,i),this.transform.resize(r,i),this.painter.resize(r,i),(i=!this._moving)&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),i&&this.fire(new t.Event("moveend",e)),this},n.prototype.getBounds=function(){return this.transform.getBounds()},n.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},n.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},n.prototype.setMinZoom=function(t){if(-2<=(t=null==t?-2:t)&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},n.prototype.getMinZoom=function(){return this.transform.minZoom},n.prototype.setMaxZoom=function(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},n.prototype.getMaxZoom=function(){return this.transform.maxZoom},n.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(0<=t&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},n.prototype.getMinPitch=function(){return this.transform.minPitch},n.prototype.setMaxPitch=function(t){if(60<(t=null==t?60:t))throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},n.prototype.getMaxPitch=function(){return this.transform.maxPitch},n.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},n.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},n.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},n.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},n.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},n.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},n.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},n.prototype._createDelegatedListener=function(t,e,r){var i,n=this;if("mouseenter"===t||"mouseover"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(i){var a=n.getLayer(e)?n.queryRenderedFeatures(i.point,{layers:[e]}):[];a.length?o||(o=!0,r.call(n,new kn(t,n,i.originalEvent,{features:a}))):o=!1},mouseout:function(){o=!1}}}}if("mouseleave"!==t&&"mouseout"!==t)return{layer:e,listener:r,delegates:((i={})[t]=function(t){var i=n.getLayer(e)?n.queryRenderedFeatures(t.point,{layers:[e]}):[];i.length&&(t.features=i,r.call(n,t),delete t.features)},i)};var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(i){(n.getLayer(e)?n.queryRenderedFeatures(i.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,r.call(n,new kn(t,n,i.originalEvent)))},mouseout:function(e){a&&(a=!1,r.call(n,new kn(t,n,e.originalEvent)))}}}},n.prototype.on=function(t,e,r){if(void 0===r)return i.prototype.on.call(this,t,e);var n,o=this._createDelegatedListener(t,e,r);for(n in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(o),o.delegates)this.on(n,o.delegates[n]);return this},n.prototype.once=function(t,e,r){if(void 0===r)return i.prototype.once.call(this,t,e);var n,o=this._createDelegatedListener(t,e,r);for(n in o.delegates)this.once(n,o.delegates[n]);return this},n.prototype.off=function(t,e,r){var n=this;return void 0===r?i.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(i){for(var o=i[t],a=0;a<o.length;a++){var s=o[a];if(s.layer===e&&s.listener===r){for(var u in s.delegates)n.off(u,s.delegates[u]);return o.splice(a,1)}}}(this._delegatedListeners),this)},n.prototype.queryRenderedFeatures=function(e,r){return this.style?(void 0!==r||void 0===e||e instanceof t.Point||Array.isArray(e)||(r=e,e=void 0),r=r||{},i=(e=e||[[0,0],[this.transform.width,this.transform.height]])instanceof t.Point||"number"==typeof e[0]?[t.Point.convert(e)]:(i=t.Point.convert(e[0]),e=t.Point.convert(e[1]),[i,new t.Point(e.x,i.y),e,new t.Point(i.x,e.y),i]),this.style.queryRenderedFeatures(i,r,this.transform)):[];var i},n.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},n.prototype.setStyle=function(e,r){return!1!==(r=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(e,r))},n.prototype.setTransformRequest=function(t){return this._requestManager.setTransformRequest(t),this},n.prototype._getUIString=function(t){var e=this._locale[t];if(null==e)throw new Error("Missing UI string '"+t+"'");return e},n.prototype._updateStyle=function(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove()),t?(this.style=new mi(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t)):delete this.style,this},n.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new mi(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},n.prototype._diffStyle=function(e,r){var i,n=this;"string"==typeof e?(i=this._requestManager.normalizeStyleURL(e),i=this._requestManager.transformRequest(i,t.ResourceType.Style),t.getJSON(i,(function(e,i){e?n.fire(new t.ErrorEvent(e)):i&&n._updateDiff(i,r)}))):"object"==typeof e&&this._updateDiff(e,r)},n.prototype._updateDiff=function(e,r){try{this.style.setState(e)&&this._update(!0)}catch(i){t.warnOnce("Unable to perform style diff: "+(i.message||i.error||i)+". Rebuilding the style from scratch."),this._updateStyle(e,r)}},n.prototype.getStyle=function(){if(this.style)return this.style.serialize()},n.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},n.prototype.addSource=function(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)},n.prototype.isSourceLoaded=function(e){var r=this.style&&this.style.sourceCaches[e];if(void 0!==r)return r.loaded();this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+e+"'")))},n.prototype.areTilesLoaded=function(){var t,e=this.style&&this.style.sourceCaches;for(t in e){var r,i=e[t]._tiles;for(r in i){var n=i[r];if("loaded"!==n.state&&"errored"!==n.state)return!1}}return!0},n.prototype.addSourceType=function(t,e,r){return this._lazyInitEmptyStyle(),this.style.addSourceType(t,e,r)},n.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},n.prototype.getSource=function(t){return this.style.getSource(t)},n.prototype.addImage=function(e,r,i){void 0===i&&(i={});var n=i.pixelRatio;void 0===n&&(n=1);var o=i.sdf;void 0===o&&(o=!1);var a=i.stretchX,s=i.stretchY;i=i.content;if(this._lazyInitEmptyStyle(),r instanceof Lo||Do&&r instanceof Do){var u=t.browser.getImageData(r);this.style.addImage(e,{data:new t.RGBAImage({width:u.width,height:u.height},u.data),pixelRatio:n,stretchX:a,stretchY:s,content:i,sdf:o,version:0})}else{if(void 0===r.width||void 0===r.height)return this.fire(new t.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`")));u=r,this.style.addImage(e,{data:new t.RGBAImage({width:r.width,height:r.height},new Uint8Array(r.data)),pixelRatio:n,stretchX:a,stretchY:s,content:i,sdf:o,version:0,userImage:u}),u.onAdd&&u.onAdd(this,e)}},n.prototype.updateImage=function(e,r){var i=this.style.getImage(e);if(!i)return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var n=(a=r instanceof Lo||Do&&r instanceof Do?t.browser.getImageData(r):r).width,o=a.height,a=a.data;return void 0===n||void 0===o?this.fire(new t.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`"))):n!==i.data.width||o!==i.data.height?this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(i.data.replace(a,!(r instanceof Lo||Do&&r instanceof Do)),void this.style.updateImage(e,i))},n.prototype.hasImage=function(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},n.prototype.removeImage=function(t){this.style.removeImage(t)},n.prototype.loadImage=function(e,r){t.getImage(this._requestManager.transformRequest(e,t.ResourceType.Image),r)},n.prototype.listImages=function(){return this.style.listImages()},n.prototype.addLayer=function(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)},n.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0)},n.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0)},n.prototype.getLayer=function(t){return this.style.getLayer(t)},n.prototype.setLayerZoomRange=function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0)},n.prototype.setFilter=function(t,e,r){return void 0===r&&(r={}),this.style.setFilter(t,e,r),this._update(!0)},n.prototype.getFilter=function(t){return this.style.getFilter(t)},n.prototype.setPaintProperty=function(t,e,r,i){return void 0===i&&(i={}),this.style.setPaintProperty(t,e,r,i),this._update(!0)},n.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},n.prototype.setLayoutProperty=function(t,e,r,i){return void 0===i&&(i={}),this.style.setLayoutProperty(t,e,r,i),this._update(!0)},n.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},n.prototype.setLight=function(t,e){return void 0===e&&(e={}),this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)},n.prototype.getLight=function(){return this.style.getLight()},n.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},n.prototype.removeFeatureState=function(t,e){return this.style.removeFeatureState(t,e),this._update()},n.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},n.prototype.getContainer=function(){return this._container},n.prototype.getCanvasContainer=function(){return this._canvasContainer},n.prototype.getCanvas=function(){return this._canvas},n.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},n.prototype._setupContainer=function(){var t=this._container;t.classList.add("maplibregl-map","mapboxgl-map");var e=this._canvasContainer=r.create("div","maplibregl-canvas-container mapboxgl-canvas-container",t);this._interactive&&e.classList.add("maplibregl-interactive","mapboxgl-interactive"),this._canvas=r.create("canvas","maplibregl-canvas mapboxgl-canvas",e),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"),e=this._containerDimensions(),this._resizeCanvas(e[0],e[1]);var i=this._controlContainer=r.create("div","maplibregl-control-container mapboxgl-control-container",t),n=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(t){n[t]=r.create("div","maplibregl-ctrl-"+t+" mapboxgl-ctrl-"+t,i)})),this._container.addEventListener("scroll",this._onMapScroll,!1)},n.prototype._resizeCanvas=function(e,r){var i=t.browser.devicePixelRatio||1;this._canvas.width=i*e,this._canvas.height=i*r,this._canvas.style.width=e+"px",this._canvas.style.height=r+"px"},n.prototype._setupPainter=function(){var r=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1});(r=this._canvas.getContext("webgl",r)||this._canvas.getContext("experimental-webgl",r))?(this.painter=new yn(r,this.transform),t.webpSupported.testSupport(r)):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")))},n.prototype._contextLost=function(e){e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}))},n.prototype._contextRestored=function(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}))},n.prototype._onMapScroll=function(t){if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},n.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},n.prototype._update=function(t){return this.style&&(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint()),this},n.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},n.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t)},n.prototype._render=function(e){var r,i=this,n=0,o=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(r=o.createQueryEXT(),o.beginQueryEXT(o.TIME_ELAPSED_EXT,r),n=t.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),!this._removed){var a,s,u,l=!1;return this.style&&this._styleDirty&&(this._styleDirty=!1,a=this.transform.zoom,e=t.browser.now(),this.style.zoomHistory.update(a,e),1===(e=(a=new t.EvaluationParameters(a,{now:e,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()})).crossFadingFactor())&&e===this._crossFadingFactor||(l=!0,this._crossFadingFactor=e),this.style.update(a)),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 t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||l)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")&&(s=t.browser.now()-n,o.endQueryEXT(o.TIME_ELAPSED_EXT,r),setTimeout((function(){var e=o.getQueryObjectEXT(r,o.QUERY_RESULT_EXT)/1e6;o.deleteQueryEXT(r),i.fire(new t.Event("gpu-timing-frame",{cpuTime:s,gpuTime:e}))}),50)),this.listens("gpu-timing-layer")&&(u=this.painter.collectGpuTimers(),setTimeout((function(){var e=i.painter.queryGpuTimers(u);i.fire(new t.Event("gpu-timing-layer",{layerTimes:e}))}),50)),(n=this._sourcesDirty||this._styleDirty||this._placementDirty)||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.Event("idle")),!this._loaded||this._fullyLoaded||n||(this._fullyLoaded=!0),this}},n.prototype.remove=function(){this._hash&&this._hash.remove();for(var e=0,r=this._controls;e<r.length;e+=1)r[e].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),void 0!==t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("orientationchange",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));var i=this.painter.context.gl.getExtension("WEBGL_lose_context");i&&i.loseContext(),Oo(this._canvasContainer),Oo(this._controlContainer),this._container.classList.remove("maplibregl-map","mapboxgl-map"),this._removed=!0,this.fire(new t.Event("remove"))},n.prototype.triggerRepaint=function(){var e=this;this.style&&!this._frame&&(this._frame=t.browser.frame((function(t){e._frame=null,e._render(t)})))},n.prototype._onWindowOnline=function(){this._update()},n.prototype._onWindowResize=function(t){this._trackResize&&this.resize({originalEvent:t})._update()},o.showTileBoundaries.get=function(){return!!this._showTileBoundaries},o.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},o.showPadding.get=function(){return!!this._showPadding},o.showPadding.set=function(t){this._showPadding!==t&&(this._showPadding=t,this._update())},o.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},o.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&((this._showCollisionBoxes=t)?this.style._generateCollisionBoxes():this._update())},o.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},o.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},o.repaint.get=function(){return!!this._repaint},o.repaint.set=function(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())},o.vertices.get=function(){return!!this._vertices},o.vertices.set=function(t){this._vertices=t,this._update()},n.prototype._setCacheLimits=function(e,r){t.setCacheLimits(e,r)},o.version.get=function(){return t.version},Object.defineProperties(n.prototype,o),n}(ye);function Oo(t){t.parentNode&&t.parentNode.removeChild(t)}var Fo={showCompass:!0,showZoom:!0,visualizePitch:!1};(j=function(e){var i=this;this.options=t.extend({},Fo,e),this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in mapboxgl-ctrl-zoom-in",(function(t){return i._map.zoomIn({},{originalEvent:t})})),r.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out mapboxgl-ctrl-zoom-out",(function(t){return i._map.zoomOut({},{originalEvent:t})})),r.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("maplibregl-ctrl-compass mapboxgl-ctrl-compass",(function(t){i.options.visualizePitch?i._map.resetNorthPitch({},{originalEvent:t}):i._map.resetNorth({},{originalEvent:t})})),this._compassIcon=r.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))}).prototype._updateZoomButtons=function(){var t=(e=this._map.getZoom())===this._map.getMaxZoom(),e=e===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=e,this._zoomInButton.setAttribute("aria-disabled",t.toString()),this._zoomOutButton.setAttribute("aria-disabled",e.toString())},j.prototype._rotateCompassArrow=function(){var t=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=t},j.prototype.onAdd=function(t){return this._map=t,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 jo(this._map,this._compass,this.options.visualizePitch)),this._container},j.prototype.onRemove=function(){r.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},j.prototype._createButton=function(t,e){return(t=r.create("button",t,this._container)).type="button",t.addEventListener("click",e),t},j.prototype._setButtonTitle=function(t,e){e=this._map._getUIString("NavigationControl."+e),t.title=e,t.setAttribute("aria-label",e)};var jo=function(e,i,n){void 0===n&&(n=!1),this._clickTolerance=10,this.element=i,this.mouseRotate=new Zn({clickTolerance:e.dragRotate._mouseRotate._clickTolerance}),this.map=e,n&&(this.mousePitch=new Wn({clickTolerance:e.dragRotate._mousePitch._clickTolerance})),t.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),r.addEventListener(i,"mousedown",this.mousedown),r.addEventListener(i,"touchstart",this.touchstart,{passive:!1}),r.addEventListener(i,"touchmove",this.touchmove),r.addEventListener(i,"touchend",this.touchend),r.addEventListener(i,"touchcancel",this.reset)};function Uo(e,r,i){var n,o,a;for(e=new t.LngLat(e.lng,e.lat),r&&(n=new t.LngLat(e.lng-360,e.lat),o=new t.LngLat(e.lng+360,e.lat),a=i.locationPoint(e).distSqr(r),i.locationPoint(n).distSqr(r)<a?e=n:i.locationPoint(o).distSqr(r)<a&&(e=o));180<Math.abs(e.lng-i.center.lng);){var s=i.locationPoint(e);if(0<=s.x&&0<=s.y&&s.x<=i.width&&s.y<=i.height)break;e.lng>i.center.lng?e.lng-=360:e.lng+=360}return e}jo.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},jo.prototype.move=function(t,e){var r,i=this.map,n=this.mouseRotate.mousemoveWindow(t,e);n&&n.bearingDelta&&i.setBearing(i.getBearing()+n.bearingDelta),this.mousePitch&&(r=this.mousePitch.mousemoveWindow(t,e))&&r.pitchDelta&&i.setPitch(i.getPitch()+r.pitchDelta)},jo.prototype.off=function(){var t=this.element;r.removeEventListener(t,"mousedown",this.mousedown),r.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(t,"touchmove",this.touchmove),r.removeEventListener(t,"touchend",this.touchend),r.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},jo.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},jo.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),r.mousePos(this.element,e)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},jo.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},jo.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},jo.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},jo.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},jo.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},jo.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var No={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 Vo(t,e,r){var i,n=t.classList;for(i in No)n.remove("maplibregl-"+r+"-anchor-"+i,"mapboxgl-"+r+"-anchor-"+i);n.add("maplibregl-"+r+"-anchor-"+e,"mapboxgl-"+r+"-anchor-"+e)}var qo,Go,Ho,Zo=((Ho=t.Evented)&&(Qo.__proto__=Ho),((Qo.prototype=Object.create(Ho&&Ho.prototype)).constructor=Qo).prototype.addTo=function(t){return this.remove(),(this._map=t).getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},Qo.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),r.remove(this._element),this._popup&&this._popup.remove(),this},Qo.prototype.getLngLat=function(){return this._lngLat},Qo.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},Qo.prototype.getElement=function(){return this._element},Qo.prototype.setPopup=function(t){var e;return this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t&&("offset"in t.options||(e=Math.sqrt(Math.pow(13.5,2)/2),t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset),this._popup=t,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)),this},Qo.prototype._onKeyPress=function(t){var e=t.code;t=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==t&&13!==t||this.togglePopup()},Qo.prototype._onMapClick=function(t){var e=t.originalEvent.target;t=this._element;this._popup&&(e===t||t.contains(e))&&this.togglePopup()},Qo.prototype.getPopup=function(){return this._popup},Qo.prototype.togglePopup=function(){var t=this._popup;return t&&(t.isOpen()?t.remove():t.addTo(this._map)),this},Qo.prototype._update=function(t){var e,i;this._map&&(this._map.transform.renderWorldCopies&&(this._lngLat=Uo(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset),e="","viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?e="rotateZ("+this._rotation+"deg)":"map"===this._rotationAlignment&&(e="rotateZ("+(this._rotation-this._map.getBearing())+"deg)"),i="","viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?i="rotateX(0deg)":"map"===this._pitchAlignment&&(i="rotateX("+this._map.getPitch()+"deg)"),t&&"moveend"!==t.type||(this._pos=this._pos.round()),r.setTransform(this._element,No[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+i+" "+e))},Qo.prototype.getOffset=function(){return this._offset},Qo.prototype.setOffset=function(e){return this._offset=t.Point.convert(e),this._update(),this},Qo.prototype._onMove=function(e){var r;this._isDragging||(r=this._clickTolerance||this._map._clickTolerance,this._isDragging=e.point.dist(this._pointerdownPos)>=r),this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))},Qo.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),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},Qo.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.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))},Qo.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(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},Qo.prototype.isDraggable=function(){return this._draggable},Qo.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},Qo.prototype.getRotation=function(){return this._rotation},Qo.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},Qo.prototype.getRotationAlignment=function(){return this._rotationAlignment},Qo.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},Qo.prototype.getPitchAlignment=function(){return this._pitchAlignment},Qo),Wo={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Xo=0,Ko=!1,Jo=(V=((Go=t.Evented)&&(Yo.__proto__=Go),((Yo.prototype=Object.create(Go&&Go.prototype)).constructor=Yo).prototype.onAdd=function(e){var i;return this._map=e,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),i=this._setupUI,void 0!==qo?i(qo):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){i(qo="denied"!==t.state)})):i(qo=!!t.window.navigator.geolocation),this._container},Yo.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.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(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Xo=0,Ko=!1},Yo.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds();t=t.coords;return e&&(t.longitude<e.getWest()||t.longitude>e.getEast()||t.latitude<e.getSouth()||t.latitude>e.getNorth())},Yo.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting")}},Yo.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},Yo.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),i=e.coords.accuracy;e=this._map.getBearing(),e=t.extend({bearing:e},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(i),e,{geolocateSource:!0})},Yo.prototype._updateMarker=function(e){var r;e?(r=new t.LngLat(e.coords.longitude,e.coords.latitude),this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()):(this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove())},Yo.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]);t=this._map.unproject([1,t]),t=e.distanceTo(t),t=Math.ceil(2*this._accuracy/t);this._circleElement.style.width=t+"px",this._circleElement.style.height=t+"px"},Yo.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},Yo.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Ko)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},Yo.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},Yo.prototype._setupUI=function(e){var i,n=this;this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","maplibregl-ctrl-geolocate mapboxgl-ctrl-geolocate",this._container),r.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),!(this._geolocateButton.type="button")===e?(t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled."),i=this._map._getUIString("GeolocateControl.LocationNotAvailable"),this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)):(i=this._map._getUIString("GeolocateControl.FindMyLocation"),this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)),this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","maplibregl-user-location-dot mapboxgl-user-location-dot"),this._userLocationDotMarker=new Zo(this._dotElement),this._circleElement=r.create("div","maplibregl-user-location-accuracy-circle mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Zo({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(e){e.geolocateSource||"ACTIVE_LOCK"!==n._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))},Yo.prototype.trigger=function(){if(!this._setup)return t.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 t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Xo--,Ko=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error")}var e;"OFF"===this._watchState&&void 0!==this._geolocationWatchID?this._clearWatch():void 0===this._geolocationWatchID&&(this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Ko=1<++Xo?(e={maximumAge:6e5,timeout:0},!0):(e=this.options.positionOptions,!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e))}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},Yo.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},Yo),{maxWidth:100,unit:"metric"});function Yo(e){Go.call(this),this.options=t.extend({},Wo,e),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}function Qo(e,i){if(Ho.call(this),(e instanceof t.window.HTMLElement||i)&&(e=t.extend({element:e},i)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&"auto"!==e.pitchAlignment?e.pitchAlignment:this._rotationAlignment,e&&e.element)this._element=e.element,this._offset=t.Point.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var n=r.createNS("http://www.w3.org/2000/svg","svg");n.setAttributeNS(null,"display","block"),n.setAttributeNS(null,"height","41px"),n.setAttributeNS(null,"width","27px"),n.setAttributeNS(null,"viewBox","0 0 27 41");var o=r.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"stroke","none"),o.setAttributeNS(null,"stroke-width","1"),o.setAttributeNS(null,"fill","none"),o.setAttributeNS(null,"fill-rule","evenodd");var a=r.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"fill-rule","nonzero");var s=r.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"transform","translate(3.0, 29.0)"),s.setAttributeNS(null,"fill","#000000");for(var u=0,l=[{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"}];u<l.length;u+=1){var c=l[u],p=r.createNS("http://www.w3.org/2000/svg","ellipse");p.setAttributeNS(null,"opacity","0.04"),p.setAttributeNS(null,"cx","10.5"),p.setAttributeNS(null,"cy","5.80029008"),p.setAttributeNS(null,"rx",c.rx),p.setAttributeNS(null,"ry",c.ry),s.appendChild(p)}var h=r.createNS("http://www.w3.org/2000/svg","g");h.setAttributeNS(null,"fill",this._color);var f=r.createNS("http://www.w3.org/2000/svg","path");f.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"),h.appendChild(f);var d=r.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"opacity","0.25"),d.setAttributeNS(null,"fill","#000000");var m=r.createNS("http://www.w3.org/2000/svg","path");m.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"),d.appendChild(m),(i=r.createNS("http://www.w3.org/2000/svg","g")).setAttributeNS(null,"transform","translate(6.0, 7.0)"),i.setAttributeNS(null,"fill","#FFFFFF"),(o=r.createNS("http://www.w3.org/2000/svg","g")).setAttributeNS(null,"transform","translate(8.0, 8.0)"),(f=r.createNS("http://www.w3.org/2000/svg","circle")).setAttributeNS(null,"fill","#000000"),f.setAttributeNS(null,"opacity","0.25"),f.setAttributeNS(null,"cx","5.5"),f.setAttributeNS(null,"cy","5.5"),f.setAttributeNS(null,"r","5.4999962"),(m=r.createNS("http://www.w3.org/2000/svg","circle")).setAttributeNS(null,"fill","#FFFFFF"),m.setAttributeNS(null,"cx","5.5"),m.setAttributeNS(null,"cy","5.5"),m.setAttributeNS(null,"r","5.4999962"),o.appendChild(f),o.appendChild(m),a.appendChild(s),a.appendChild(h),a.appendChild(d),a.appendChild(i),a.appendChild(o),n.appendChild(a),n.setAttributeNS(null,"height",41*this._scale+"px"),n.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(n),this._offset=t.Point.convert(e&&e.offset||[0,-14])}this._element.classList.add("maplibregl-marker","mapboxgl-marker"),this._element.addEventListener("dragstart",(function(t){t.preventDefault()})),this._element.addEventListener("mousedown",(function(t){t.preventDefault()})),Vo(this._element,this._anchor,"marker"),this._popup=null}function $o(t,e,r){var i=r&&r.maxWidth||100,n=t._container.clientHeight/2,o=t.unproject([0,n]);n=t.unproject([i,n]),o=o.distanceTo(n);r&&"imperial"===r.unit?5280<(n=3.2808*o)?ta(e,i,n/5280,t._getUIString("ScaleControl.Miles")):ta(e,i,n,t._getUIString("ScaleControl.Feet")):r&&"nautical"===r.unit?ta(e,i,o/1852,t._getUIString("ScaleControl.NauticalMiles")):1e3<=o?ta(e,i,o/1e3,t._getUIString("ScaleControl.Kilometers")):ta(e,i,o,t._getUIString("ScaleControl.Meters"))}function ta(t,e,r,i){var n,o,a=(n=r,(o=Math.pow(10,(""+Math.floor(n)).length-1))*(a=10<=(a=n/o)?10:5<=a?5:3<=a?3:2<=a?2:1<=a?1:(n=a,o=Math.pow(10,Math.ceil(-Math.log(n)/Math.LN10)),Math.round(n*o)/o)));t.style.width=e*(a/r)+"px",t.innerHTML=a+"&nbsp;"+i}(q=function(e){this.options=t.extend({},Jo,e),t.bindAll(["_onMove","setUnit"],this)}).prototype.getDefaultPosition=function(){return"bottom-left"},q.prototype._onMove=function(){$o(this._map,this._container,this.options)},q.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-scale mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},q.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},q.prototype.setUnit=function(t){this.options.unit=t,$o(this._map,this._container,this.options)},(Li=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")}).prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Li.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Li.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Li.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","maplibregl-ctrl-fullscreen mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Li.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Li.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Li.prototype._isFullscreen=function(){return this._fullscreen},Li.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Li.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.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 ea,ra={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},ia=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),na=(ye=((ea=t.Evented)&&(oa.__proto__=ea),((oa.prototype=Object.create(ea&&ea.prototype)).constructor=oa).prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,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("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},oa.prototype.isOpen=function(){return!!this._map},oa.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.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 t.Event("close")),this},oa.prototype.getLngLat=function(){return this._lngLat},oa.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),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("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer","mapboxgl-track-pointer")),this},oa.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("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")),this},oa.prototype.getElement=function(){return this._container},oa.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},oa.prototype.setHTML=function(e){var r,i=t.window.document.createDocumentFragment(),n=t.window.document.createElement("body");for(n.innerHTML=e;r=n.firstChild;)i.appendChild(r);return this.setDOMContent(i)},oa.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},oa.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},oa.prototype.setDOMContent=function(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","maplibregl-popup-content mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this},oa.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},oa.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},oa.prototype.setOffset=function(t){return this.options.offset=t,this._update(),this},oa.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},oa.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","maplibregl-popup-close-button mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))},oa.prototype._onMouseUp=function(t){this._update(t.point)},oa.prototype._onMouseMove=function(t){this._update(t.point)},oa.prototype._onDrag=function(t){this._update(t.point)},oa.prototype._update=function(e){var i,n,o,a,s=this;this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=r.create("div","maplibregl-popup mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","maplibregl-popup-tip mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return s._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer","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=Uo(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)&&(i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),n=this.options.anchor,a=function e(r){if(r){if("number"==typeof r){var i=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(i,i),"top-right":new t.Point(-i,i),bottom:new t.Point(0,-r),"bottom-left":new t.Point(i,-i),"bottom-right":new t.Point(-i,-i),left:new t.Point(r,0),right:new t.Point(-r,0)}}return r instanceof t.Point||Array.isArray(r)?{center:i=t.Point.convert(r),top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}:{center:t.Point.convert(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset),n||(o=this._container.offsetWidth,e=this._container.offsetHeight,e=i.y+a.bottom.y<e?["top"]:i.y>this._map.transform.height-e?["bottom"]:[],i.x<o/2?e.push("left"):i.x>this._map.transform.width-o/2&&e.push("right"),n=0===e.length?"bottom":e.join("-")),a=i.add(a[n]).round(),r.setTransform(this._container,No[n]+" translate("+a.x+"px,"+a.y+"px)"),Vo(this._container,n,"popup"))},oa.prototype._focusFirstElement=function(){var t;this.options.focusAfterOpen&&this._container&&(t=this._container.querySelector(ia))&&t.focus()},oa.prototype._onClose=function(){this.remove()},oa),{version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:fr,NavigationControl:j,GeolocateControl:V,AttributionControl:Ao,ScaleControl:q,FullscreenControl:Li,Popup:ye,Marker:Zo,Style:mi,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){dr().acquire(cr)},clearPrewarmedResources:function(){var t=hr;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(cr),hr=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 t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return pr.workerCount},set workerCount(t){pr.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:"",addProtocol:function(e,r){t.config.REGISTERED_PROTOCOLS[e]=r},removeProtocol:function(e){delete t.config.REGISTERED_PROTOCOLS[e]}});function oa(e){ea.call(this),this.options=t.extend(Object.create(ra),e),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return na})),r}()},function(t,e){var r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){var i=r(66);"string"==typeof i&&(i=[[t.i,i,""]]);r(9)(i,{transform:void 0}),i.locals&&(t.exports=i.locals)},function(t,e,r){var i=r(16);(t.exports=r(8)(!1)).push([t.i,".mapxus-floor-selector-layout {\n -moz-box-shadow: 0 1px 1px 0 rgba(0,0,0,0.5);\n -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,0.5);\n box-shadow: 0 1px 1px 0 rgba(0,0,0,0.5);\n width: 30px;\n visibility: visible;\n}\n.mapxus-floor-selector-layout.hide {\n visibility: hidden;\n}\n.mapxus-floor-selector-outer {\n position: relative;\n width: 30px;\n z-index: 100;\n overflow: hidden;\n}\n.mapxus-floor-selector-inner {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: -20px;\n overflow-y: auto;\n overflow-x: hidden\n}\n.mapxus-floor-selector-inner > .floor {\n outline: none;\n font-family: Helvetica, Arial, sans-serif;\n cursor: pointer;\n width: 30px;\n border: 0;\n background: #fff;\n font-weight: bold;\n font-size: 12px;\n padding: inherit;\n height: 34px;\n overflow-x: auto;\n overflow-y: hidden\n}\n.mapxus-floor-selector-inner > .floor:not(:disabled):hover {\n background-color: rgba(0,0,0,.05) !important;\n}\n.mapxus-floor-selector-inner > .floor::-webkit-scrollbar {\n height: 4px;\n}\n.mapxus-floor-selector-inner > .floor::-webkit-scrollbar-track {\n background-color: white;\n -webkit-border-radius: 2em;\n -moz-border-radius: 2em;\n border-radius:2em;\n}\n.mapxus-floor-selector-inner > .floor::-webkit-scrollbar-thumb {\n background-color: rgb(83, 177, 207);\n -webkit-border-radius: 2em;\n -moz-border-radius: 2em;\n border-radius:2em;\n}\n.mapxus-floor-selector-up {\n margin-top: -4px;\n z-index: 102;\n position: absolute;\n width: 30px;\n height: 26px;\n cursor: pointer;\n background-size: 38px;\n background-position-x: center;\n background-repeat: no-repeat;\n background-image:url("+i(r(67))+");\n}\n.mapxus-floor-selector-up.hide {\n visibility: hidden;\n}\n.mapxus-floor-selector-down {\n z-index: 101;\n position: absolute;\n width: 30px;\n height: 26px;\n cursor: pointer;\n background-size: 38px;\n background-position-x: center;\n background-repeat: no-repeat;\n background-image:url("+i(r(68))+");\n}\n.mapxus-floor-selector-down.hide {\n visibility: hidden;\n}\n",""])},function(t,e){t.exports="\"data:image/svg+xml,%3C?xml version='1.0' encoding='utf-8'?%3E %3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' height='41.409260218957115' width='51.409260218957115'%3E %3Cdefs%3E %3Crect id='rect-0' opacity='1' x='4.704630109478558' y='4.704630109478558' width='42' height='32'/%3E %3ClinearGradient id='linearGradient-1' x1='0.5' y1='0' x2='0.5' y2='1'%3E %3Cstop offset='0' stop-color='rgb(255,255,255)' stop-opacity='0'/%3E %3Cstop offset='0.41' stop-color='rgb(255,255,255)' stop-opacity='0.8'/%3E %3Cstop offset='1' stop-color='rgb(200,200,200)' stop-opacity='1'/%3E %3C/linearGradient%3E %3Cpath id='path-2' opacity='1' fill-rule='evenodd' d='M18.02605868090714,23.704630109478558 L25.70463010947857,30.704630109478558 L33.38320153805,23.704630109478558 '/%3E %3C/defs%3E %3Cg transform='translate(25.704630109478558, 20.704630109478558) rotate(180.00006436155007) translate(-25.704630109478558, -20.704630109478558)' opacity='1'%3E %3Cg opacity='1'%3E %3Cuse xlink:href='%23rect-0' fill='url(%23linearGradient-1)'/%3E %3C/g%3E %3Cg opacity='1'%3E %3Cuse xlink:href='%23path-2' fill-opacity='0' stroke='rgb(187,187,189)' stroke-opacity='1' stroke-width='2'/%3E %3C/g%3E %3C/g%3E %3C/svg%3E\""},function(t,e){t.exports="\"data:image/svg+xml,%3C?xml version='1.0' encoding='utf-8'?%3E %3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' height='41.409260218957115' width='51.409260218957115'%3E %3Cdefs%3E %3Crect id='rect-0' opacity='1' x='4.704630109478558' y='4.704630109478558' width='42' height='32'/%3E %3ClinearGradient id='linearGradient-1' x1='0.5' y1='0' x2='0.5' y2='1'%3E %3Cstop offset='0' stop-color='rgb(255,255,255)' stop-opacity='0'/%3E %3Cstop offset='0.41' stop-color='rgb(255,255,255)' stop-opacity='0.8'/%3E %3Cstop offset='1' stop-color='rgb(200,200,200)' stop-opacity='1'/%3E %3C/linearGradient%3E %3Cpath id='path-2' opacity='1' fill-rule='evenodd' d='M18.02605868090714,23.704630109478558 L25.70463010947857,30.704630109478558 L33.38320153805,23.704630109478558 '/%3E %3C/defs%3E %3Cg opacity='1'%3E %3Cg opacity='1'%3E %3Cuse xlink:href='%23rect-0' fill='url(%23linearGradient-1)'/%3E %3C/g%3E %3Cg opacity='1'%3E %3Cuse xlink:href='%23path-2' fill-opacity='0' stroke='rgb(187,187,189)' stroke-opacity='1' stroke-width='2'/%3E %3C/g%3E %3C/g%3E %3C/svg%3E\""},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var r=e.protocol+"//"+e.host,i=r+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){return e=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e})),/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(e)?t:(e=0===e.indexOf("//")?e:0===e.indexOf("/")?r+e:i+e.replace(/^\.\//,""),"url("+JSON.stringify(e)+")")}))}},function(t,e,r){var i=r(71);"string"==typeof i&&(i=[[t.i,i,""]]);r(9)(i,{transform:void 0}),i.locals&&(t.exports=i.locals)},function(t,e,r){var i=r(16);(t.exports=r(8)(!1)).push([t.i,".maplibregl-ctrl-building-filter.hide {\n visibility: hidden;\n}\n.mapxus-building-filter-icon {\n width: 30px;\n height: 30px;\n background-image: url("+i(r(72))+");\n background-size: 30px;\n background-color: white;\n border-radius: 4px;\n -moz-box-shadow: 0 0 2px rgba(0,0,0,0.1);\n -webkit-box-shadow: 0 0 2px rgba(0,0,0,0.1);\n box-shadow: 0 0 0 2px rgba(0,0,0,0.1);\n cursor: pointer;\n}\n.mapxus-building-name-layout {\n width: 125px;\n right: 45px;\n margin-top: -30px;\n position: absolute;\n overflow: hidden;\n}\n.mapxus-building-name-list {\n width: 140px;\n position: absolute;\n overflow-y: auto;\n}\n.mapxus-building-name {\n width: 115px;\n color: white;\n background: red;\n border-radius: 3px;\n padding: 2px 4px;\n margin: 2px;\n cursor: pointer;\n word-wrap: break-word;\n}\n.mapxus-building-name.active {\n background: cornflowerblue;\n}\n.mapxus-building-name:hover {\n background: rgba(0,0,0,0.5);\n}\n",""])},function(t,e){t.exports="\"data:image/svg+xml,%3C?xml version='1.0' encoding='utf-8'?%3E %3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E %3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0' y='0' width='15' height='15' viewBox='0, 0, 15, 15'%3E %3Cg%3E %3Cpath d='M13.639 4H12V1.361A.361.361 0 0 0 11.639 1h-.278a.361.361 0 0 0-.361.361V4H9.361A.361.361 0 0 0 9 4.361V10H5.363a.363.363 0 0 0-.363.363v3.275a.363.363 0 0 0 .363.362h8.276a.361.361 0 0 0 .361-.361V4.361A.361.361 0 0 0 13.639 4zM7 12H6v-1h1zm2 0H8v-1h1zm2 0h-1v-1h1zm0-2h-1V9h1zm0-2h-1V7h1zm0-2h-1V5h1zm2 6h-1v-1h1zm0-2h-1V9h1zm0-2h-1V7h1zm0-2h-1V5h1zM8 1.361A.361.361 0 0 0 7.639 1H5.361A.361.361 0 0 0 5 1.361V3H3.361A.361.361 0 0 0 3 3.361V4H1.361A.361.361 0 0 0 1 4.361v9.278a.361.361 0 0 0 .361.361H4V9h4zM3 12H2v-1h1zm0-2H2V9h1zm0-2H2V7h1zm0-2H2V5h1zm2 2H4V7h1zm0-2H4V5h1zm2 2H6V7h1zm0-2H6V5h1zm0-2H6V3h1z'%3E%3C/path%3E %3C/g%3E %3C/svg%3E\""},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.outdoorConfig=void 0;var i=r(29);e.outdoorConfig=function(){return{url:i.mapxusTheme_v2}}},function(t,e,r){!function(e,r){"use strict";"function"==typeof window.define&&window.define.amd?window.define(r):t.exports?t.exports=r():e.exports?e.exports=r():e.Fingerprint2=r()}(this,(function(){"use strict";var t=function(e){if(!(this instanceof t))return new t(e);this.options=this.extend(e,{swfContainerId:"fingerprintjs2",swfPath:"flash/compiled/FontList.swf",detectScreenOrientation:!0,sortPluginsFor:[/palemoon/i],userDefinedFonts:[],excludeDoNotTrack:!0,excludePixelRatio:!0}),this.nativeForEach=Array.prototype.forEach,this.nativeMap=Array.prototype.map};return t.prototype={extend:function(t,e){if(null==t)return e;for(var r in t)null!=t[r]&&e[r]!==t[r]&&(e[r]=t[r]);return e},get:function(t){var e=this,r={data:[],addPreprocessedComponent:function(t){var i=t.value;"function"==typeof e.options.preprocessor&&(i=e.options.preprocessor(t.key,i)),r.data.push({key:t.key,value:i})}};r=this.userAgentKey(r);r=this.languageKey(r),r=this.colorDepthKey(r),r=this.deviceMemoryKey(r),r=this.pixelRatioKey(r),r=this.hardwareConcurrencyKey(r),r=this.screenResolutionKey(r),r=this.availableScreenResolutionKey(r),r=this.timezoneOffsetKey(r),r=this.sessionStorageKey(r),r=this.localStorageKey(r),r=this.indexedDbKey(r),r=this.addBehaviorKey(r),r=this.openDatabaseKey(r),r=this.cpuClassKey(r),r=this.platformKey(r),r=this.doNotTrackKey(r),r=this.pluginsKey(r),r=this.canvasKey(r),r=this.webglKey(r),r=this.webglVendorAndRendererKey(r),r=this.adBlockKey(r),r=this.hasLiedLanguagesKey(r),r=this.hasLiedResolutionKey(r),r=this.hasLiedOsKey(r),r=this.hasLiedBrowserKey(r),r=this.touchSupportKey(r),r=this.customEntropyFunction(r),this.fontsKey(r,(function(r){var i=[];e.each(r.data,(function(t){(t=t.value)&&"function"==typeof t.join&&(t=t.join(";")),i.push(t)}));var n=e.x64hash128(i.join("~~~"),31);return t(n,r.data)}))},customEntropyFunction:function(t){return"function"==typeof this.options.customFunction&&t.addPreprocessedComponent({key:"custom",value:this.options.customFunction()}),t},userAgentKey:function(t){return this.options.excludeUserAgent||t.addPreprocessedComponent({key:"user_agent",value:this.getUserAgent()}),t},getUserAgent:function(){return navigator.userAgent},languageKey:function(t){return this.options.excludeLanguage||t.addPreprocessedComponent({key:"language",value:navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||""}),t},colorDepthKey:function(t){return this.options.excludeColorDepth||t.addPreprocessedComponent({key:"color_depth",value:window.screen.colorDepth||-1}),t},deviceMemoryKey:function(t){return this.options.excludeDeviceMemory||t.addPreprocessedComponent({key:"device_memory",value:this.getDeviceMemory()}),t},getDeviceMemory:function(){return navigator.deviceMemory||-1},pixelRatioKey:function(t){return this.options.excludePixelRatio||t.addPreprocessedComponent({key:"pixel_ratio",value:this.getPixelRatio()}),t},getPixelRatio:function(){return window.devicePixelRatio||""},screenResolutionKey:function(t){return this.options.excludeScreenResolution?t:this.getScreenResolution(t)},getScreenResolution:function(t){var e=this.options.detectScreenOrientation&&window.screen.height>window.screen.width?[window.screen.height,window.screen.width]:[window.screen.width,window.screen.height];return t.addPreprocessedComponent({key:"resolution",value:e}),t},availableScreenResolutionKey:function(t){return this.options.excludeAvailableScreenResolution?t:this.getAvailableScreenResolution(t)},getAvailableScreenResolution:function(t){var e;return window.screen.availWidth&&window.screen.availHeight&&(e=!this.options.detectScreenOrientation||window.screen.availHeight>window.screen.availWidth?[window.screen.availHeight,window.screen.availWidth]:[window.screen.availWidth,window.screen.availHeight]),void 0!==e&&t.addPreprocessedComponent({key:"available_resolution",value:e}),t},timezoneOffsetKey:function(t){return this.options.excludeTimezoneOffset||t.addPreprocessedComponent({key:"timezone_offset",value:(new Date).getTimezoneOffset()}),t},sessionStorageKey:function(t){return!this.options.excludeSessionStorage&&this.hasSessionStorage()&&t.addPreprocessedComponent({key:"session_storage",value:1}),t},localStorageKey:function(t){return!this.options.excludeSessionStorage&&this.hasLocalStorage()&&t.addPreprocessedComponent({key:"local_storage",value:1}),t},indexedDbKey:function(t){return!this.options.excludeIndexedDB&&this.hasIndexedDB()&&t.addPreprocessedComponent({key:"indexed_db",value:1}),t},addBehaviorKey:function(t){return!this.options.excludeAddBehavior&&document.body&&document.body.addBehavior&&t.addPreprocessedComponent({key:"add_behavior",value:1}),t},openDatabaseKey:function(t){return!this.options.excludeOpenDatabase&&window.openDatabase&&t.addPreprocessedComponent({key:"open_database",value:1}),t},cpuClassKey:function(t){return this.options.excludeCpuClass||t.addPreprocessedComponent({key:"cpu_class",value:this.getNavigatorCpuClass()}),t},platformKey:function(t){return this.options.excludePlatform||t.addPreprocessedComponent({key:"navigator_platform",value:this.getNavigatorPlatform()}),t},doNotTrackKey:function(t){return this.options.excludeDoNotTrack||t.addPreprocessedComponent({key:"do_not_track",value:this.getDoNotTrack()}),t},canvasKey:function(t){return!this.options.excludeCanvas&&this.isCanvasSupported()&&t.addPreprocessedComponent({key:"canvas",value:this.getCanvasFp()}),t},webglKey:function(t){return!this.options.excludeWebGL&&this.isWebGlSupported()&&t.addPreprocessedComponent({key:"webgl",value:this.getWebglFp()}),t},webglVendorAndRendererKey:function(t){return!this.options.excludeWebGLVendorAndRenderer&&this.isWebGlSupported()&&t.addPreprocessedComponent({key:"webgl_vendor",value:this.getWebglVendorAndRenderer()}),t},adBlockKey:function(t){return this.options.excludeAdBlock||t.addPreprocessedComponent({key:"adblock",value:this.getAdBlock()}),t},hasLiedLanguagesKey:function(t){return this.options.excludeHasLiedLanguages||t.addPreprocessedComponent({key:"has_lied_languages",value:this.getHasLiedLanguages()}),t},hasLiedResolutionKey:function(t){return this.options.excludeHasLiedResolution||t.addPreprocessedComponent({key:"has_lied_resolution",value:this.getHasLiedResolution()}),t},hasLiedOsKey:function(t){return this.options.excludeHasLiedOs||t.addPreprocessedComponent({key:"has_lied_os",value:this.getHasLiedOs()}),t},hasLiedBrowserKey:function(t){return this.options.excludeHasLiedBrowser||t.addPreprocessedComponent({key:"has_lied_browser",value:this.getHasLiedBrowser()}),t},fontsKey:function(t,e){return this.options.excludeJsFonts?this.flashFontsKey(t,e):this.jsFontsKey(t,e)},flashFontsKey:function(t,e){return!this.options.excludeFlashFonts&&this.hasSwfObjectLoaded()&&this.hasMinFlashInstalled()&&void 0!==this.options.swfPath?void this.loadSwfAndDetectFonts((function(r){t.addPreprocessedComponent({key:"swf_fonts",value:r.join(";")}),e(t)})):e(t)},jsFontsKey:function(t,e){var r=this;return setTimeout((function(){var i=["monospace","sans-serif","serif"],n=["Andale Mono","Arial","Arial Black","Arial Hebrew","Arial MT","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Bitstream Vera Sans Mono","Book Antiqua","Bookman Old Style","Calibri","Cambria","Cambria Math","Century","Century Gothic","Century Schoolbook","Comic Sans","Comic Sans MS","Consolas","Courier","Courier New","Geneva","Georgia","Helvetica","Helvetica Neue","Impact","Lucida Bright","Lucida Calligraphy","Lucida Console","Lucida Fax","LUCIDA GRANDE","Lucida Handwriting","Lucida Sans","Lucida Sans Typewriter","Lucida Sans Unicode","Microsoft Sans Serif","Monaco","Monotype Corsiva","MS Gothic","MS Outlook","MS PGothic","MS Reference Sans Serif","MS Sans Serif","MS Serif","MYRIAD","MYRIAD PRO","Palatino","Palatino Linotype","Segoe Print","Segoe Script","Segoe UI","Segoe UI Light","Segoe UI Semibold","Segoe UI Symbol","Tahoma","Times","Times New Roman","Times New Roman PS","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3"];function o(){var t=document.createElement("span");return t.style.position="absolute",t.style.left="-9999px",t.style.fontSize="72px",t.style.fontStyle="normal",t.style.fontWeight="normal",t.style.letterSpacing="normal",t.style.lineBreak="auto",t.style.lineHeight="normal",t.style.textTransform="none",t.style.textAlign="left",t.style.textDecoration="none",t.style.textShadow="none",t.style.whiteSpace="normal",t.style.wordBreak="normal",t.style.wordSpacing="normal",t.innerHTML="mmmmmmmmmmlli",t}r.options.extendedJsFonts&&(n=n.concat(["Abadi MT Condensed Light","Academy Engraved LET","ADOBE CASLON PRO","Adobe Garamond","ADOBE GARAMOND PRO","Agency FB","Aharoni","Albertus Extra Bold","Albertus Medium","Algerian","Amazone BT","American Typewriter","American Typewriter Condensed","AmerType Md BT","Andalus","Angsana New","AngsanaUPC","Antique Olive","Aparajita","Apple Chancery","Apple Color Emoji","Apple SD Gothic Neo","Arabic Typesetting","ARCHER","ARNO PRO","Arrus BT","Aurora Cn BT","AvantGarde Bk BT","AvantGarde Md BT","AVENIR","Ayuthaya","Bandy","Bangla Sangam MN","Bank Gothic","BankGothic Md BT","Baskerville","Baskerville Old Face","Batang","BatangChe","Bauer Bodoni","Bauhaus 93","Bazooka","Bell MT","Bembo","Benguiat Bk BT","Berlin Sans FB","Berlin Sans FB Demi","Bernard MT Condensed","BernhardFashion BT","BernhardMod BT","Big Caslon","BinnerD","Blackadder ITC","BlairMdITC TT","Bodoni 72","Bodoni 72 Oldstyle","Bodoni 72 Smallcaps","Bodoni MT","Bodoni MT Black","Bodoni MT Condensed","Bodoni MT Poster Compressed","Bookshelf Symbol 7","Boulder","Bradley Hand","Bradley Hand ITC","Bremen Bd BT","Britannic Bold","Broadway","Browallia New","BrowalliaUPC","Brush Script MT","Californian FB","Calisto MT","Calligrapher","Candara","CaslonOpnface BT","Castellar","Centaur","Cezanne","CG Omega","CG Times","Chalkboard","Chalkboard SE","Chalkduster","Charlesworth","Charter Bd BT","Charter BT","Chaucer","ChelthmITC Bk BT","Chiller","Clarendon","Clarendon Condensed","CloisterBlack BT","Cochin","Colonna MT","Constantia","Cooper Black","Copperplate","Copperplate Gothic","Copperplate Gothic Bold","Copperplate Gothic Light","CopperplGoth Bd BT","Corbel","Cordia New","CordiaUPC","Cornerstone","Coronet","Cuckoo","Curlz MT","DaunPenh","Dauphin","David","DB LCD Temp","DELICIOUS","Denmark","DFKai-SB","Didot","DilleniaUPC","DIN","DokChampa","Dotum","DotumChe","Ebrima","Edwardian Script ITC","Elephant","English 111 Vivace BT","Engravers MT","EngraversGothic BT","Eras Bold ITC","Eras Demi ITC","Eras Light ITC","Eras Medium ITC","EucrosiaUPC","Euphemia","Euphemia UCAS","EUROSTILE","Exotc350 Bd BT","FangSong","Felix Titling","Fixedsys","FONTIN","Footlight MT Light","Forte","FrankRuehl","Fransiscan","Freefrm721 Blk BT","FreesiaUPC","Freestyle Script","French Script MT","FrnkGothITC Bk BT","Fruitger","FRUTIGER","Futura","Futura Bk BT","Futura Lt BT","Futura Md BT","Futura ZBlk BT","FuturaBlack BT","Gabriola","Galliard BT","Gautami","Geeza Pro","Geometr231 BT","Geometr231 Hv BT","Geometr231 Lt BT","GeoSlab 703 Lt BT","GeoSlab 703 XBd BT","Gigi","Gill Sans","Gill Sans MT","Gill Sans MT Condensed","Gill Sans MT Ext Condensed Bold","Gill Sans Ultra Bold","Gill Sans Ultra Bold Condensed","Gisha","Gloucester MT Extra Condensed","GOTHAM","GOTHAM BOLD","Goudy Old Style","Goudy Stout","GoudyHandtooled BT","GoudyOLSt BT","Gujarati Sangam MN","Gulim","GulimChe","Gungsuh","GungsuhChe","Gurmukhi MN","Haettenschweiler","Harlow Solid Italic","Harrington","Heather","Heiti SC","Heiti TC","HELV","Herald","High Tower Text","Hiragino Kaku Gothic ProN","Hiragino Mincho ProN","Hoefler Text","Humanst 521 Cn BT","Humanst521 BT","Humanst521 Lt BT","Imprint MT Shadow","Incised901 Bd BT","Incised901 BT","Incised901 Lt BT","INCONSOLATA","Informal Roman","Informal011 BT","INTERSTATE","IrisUPC","Iskoola Pota","JasmineUPC","Jazz LET","Jenson","Jester","Jokerman","Juice ITC","Kabel Bk BT","Kabel Ult BT","Kailasa","KaiTi","Kalinga","Kannada Sangam MN","Kartika","Kaufmann Bd BT","Kaufmann BT","Khmer UI","KodchiangUPC","Kokila","Korinna BT","Kristen ITC","Krungthep","Kunstler Script","Lao UI","Latha","Leelawadee","Letter Gothic","Levenim MT","LilyUPC","Lithograph","Lithograph Light","Long Island","Lydian BT","Magneto","Maiandra GD","Malayalam Sangam MN","Malgun Gothic","Mangal","Marigold","Marion","Marker Felt","Market","Marlett","Matisse ITC","Matura MT Script Capitals","Meiryo","Meiryo UI","Microsoft Himalaya","Microsoft JhengHei","Microsoft New Tai Lue","Microsoft PhagsPa","Microsoft Tai Le","Microsoft Uighur","Microsoft YaHei","Microsoft Yi Baiti","MingLiU","MingLiU_HKSCS","MingLiU_HKSCS-ExtB","MingLiU-ExtB","Minion","Minion Pro","Miriam","Miriam Fixed","Mistral","Modern","Modern No. 20","Mona Lisa Solid ITC TT","Mongolian Baiti","MONO","MoolBoran","Mrs Eaves","MS LineDraw","MS Mincho","MS PMincho","MS Reference Specialty","MS UI Gothic","MT Extra","MUSEO","MV Boli","Nadeem","Narkisim","NEVIS","News Gothic","News GothicMT","NewsGoth BT","Niagara Engraved","Niagara Solid","Noteworthy","NSimSun","Nyala","OCR A Extended","Old Century","Old English Text MT","Onyx","Onyx BT","OPTIMA","Oriya Sangam MN","OSAKA","OzHandicraft BT","Palace Script MT","Papyrus","Parchment","Party LET","Pegasus","Perpetua","Perpetua Titling MT","PetitaBold","Pickwick","Plantagenet Cherokee","Playbill","PMingLiU","PMingLiU-ExtB","Poor Richard","Poster","PosterBodoni BT","PRINCETOWN LET","Pristina","PTBarnum BT","Pythagoras","Raavi","Rage Italic","Ravie","Ribbon131 Bd BT","Rockwell","Rockwell Condensed","Rockwell Extra Bold","Rod","Roman","Sakkal Majalla","Santa Fe LET","Savoye LET","Sceptre","Script","Script MT Bold","SCRIPTINA","Serifa","Serifa BT","Serifa Th BT","ShelleyVolante BT","Sherwood","Shonar Bangla","Showcard Gothic","Shruti","Signboard","SILKSCREEN","SimHei","Simplified Arabic","Simplified Arabic Fixed","SimSun","SimSun-ExtB","Sinhala Sangam MN","Sketch Rockwell","Skia","Small Fonts","Snap ITC","Snell Roundhand","Socket","Souvenir Lt BT","Staccato222 BT","Steamer","Stencil","Storybook","Styllo","Subway","Swis721 BlkEx BT","Swiss911 XCm BT","Sylfaen","Synchro LET","System","Tamil Sangam MN","Technical","Teletype","Telugu Sangam MN","Tempus Sans ITC","Terminal","Thonburi","Traditional Arabic","Trajan","TRAJAN PRO","Tristan","Tubular","Tunga","Tw Cen MT","Tw Cen MT Condensed","Tw Cen MT Condensed Extra Bold","TypoUpright BT","Unicorn","Univers","Univers CE 55 Medium","Univers Condensed","Utsaah","Vagabond","Vani","Vijaya","Viner Hand ITC","VisualUI","Vivaldi","Vladimir Script","Vrinda","Westminster","WHITNEY","Wide Latin","ZapfEllipt BT","ZapfHumnst BT","ZapfHumnst Dm BT","Zapfino","Zurich BlkEx BT","Zurich Ex BT","ZWAdobeF"])),n=(n=n.concat(r.options.userDefinedFonts)).filter((function(t,e){return n.indexOf(t)===e}));var a=document.getElementsByTagName("body")[0],s=document.createElement("div"),u=document.createElement("div"),l={},c={},p=function(){for(var t=[],e=0,r=i.length;e<r;e++){var n=o();n.style.fontFamily=i[e],s.appendChild(n),t.push(n)}return t}();a.appendChild(s);for(var h=0,f=i.length;h<f;h++)l[i[h]]=p[h].offsetWidth,c[i[h]]=p[h].offsetHeight;var d=function(){for(var t,e,r={},a=0,s=n.length;a<s;a++){for(var l=[],c=0,p=i.length;c<p;c++){var h=(t=n[a],e=i[c],h=void 0,(h=o()).style.fontFamily="'"+t+"',"+e,h);u.appendChild(h),l.push(h)}r[n[a]]=l}return r}();a.appendChild(u);for(var m=[],y=0,g=n.length;y<g;y++)!function(t){for(var e=!1,r=0;r<i.length;r++)if(e=t[r].offsetWidth!==l[i[r]]||t[r].offsetHeight!==c[i[r]])return e;return e}(d[n[y]])||m.push(n[y]);a.removeChild(u),a.removeChild(s),t.addPreprocessedComponent({key:"js_fonts",value:m}),e(t)}),1)},pluginsKey:function(t){return this.options.excludePlugins||(this.isIE()?this.options.excludeIEPlugins||t.addPreprocessedComponent({key:"ie_plugins",value:this.getIEPlugins()}):t.addPreprocessedComponent({key:"regular_plugins",value:this.getRegularPlugins()})),t},getRegularPlugins:function(){var t=[];if(navigator.plugins)for(var e=0,r=navigator.plugins.length;e<r;e++)navigator.plugins[e]&&t.push(navigator.plugins[e]);return this.pluginsShouldBeSorted()&&(t=t.sort((function(t,e){return t.name>e.name?1:t.name<e.name?-1:0}))),this.map(t,(function(t){var e=this.map(t,(function(t){return[t.type,t.suffixes].join("~")})).join(",");return[t.name,t.description,e].join("::")}),this)},getIEPlugins:function(){var t=[];return(Object.getOwnPropertyDescriptor&&Object.getOwnPropertyDescriptor(window,"ActiveXObject")||"ActiveXObject"in window)&&(t=this.map(["AcroPDF.PDF","Adodb.Stream","AgControl.AgControl","DevalVRXCtrl.DevalVRXCtrl.1","MacromediaFlashPaper.MacromediaFlashPaper","Msxml2.DOMDocument","Msxml2.XMLHTTP","PDF.PdfCtrl","QuickTime.QuickTime","QuickTimeCheckObject.QuickTimeCheck.1","RealPlayer","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","Scripting.Dictionary","SWCtl.SWCtl","Shell.UIHelper","ShockwaveFlash.ShockwaveFlash","Skype.Detection","TDCCtl.TDCCtl","WMPlayer.OCX","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1"],(function(t){try{return new window.ActiveXObject(t),t}catch(t){return null}}))),navigator.plugins&&(t=t.concat(this.getRegularPlugins())),t},pluginsShouldBeSorted:function(){for(var t=!1,e=0,r=this.options.sortPluginsFor.length;e<r;e++){var i=this.options.sortPluginsFor[e];if(navigator.userAgent.match(i)){t=!0;break}}return t},touchSupportKey:function(t){return this.options.excludeTouchSupport||t.addPreprocessedComponent({key:"touch_support",value:this.getTouchSupport()}),t},hardwareConcurrencyKey:function(t){return this.options.excludeHardwareConcurrency||t.addPreprocessedComponent({key:"hardware_concurrency",value:this.getHardwareConcurrency()}),t},hasSessionStorage:function(){try{return!!window.sessionStorage}catch(t){return!0}},hasLocalStorage:function(){try{return!!window.localStorage}catch(t){return!0}},hasIndexedDB:function(){try{return!!window.indexedDB}catch(t){return!0}},getHardwareConcurrency:function(){return navigator.hardwareConcurrency||"unknown"},getNavigatorCpuClass:function(){return navigator.cpuClass||"unknown"},getNavigatorPlatform:function(){return navigator.platform||"unknown"},getDoNotTrack:function(){return navigator.doNotTrack||navigator.msDoNotTrack||window.doNotTrack||"unknown"},getTouchSupport:function(){var t=0,e=!1;void 0!==navigator.maxTouchPoints?t=navigator.maxTouchPoints:void 0!==navigator.msMaxTouchPoints&&(t=navigator.msMaxTouchPoints);try{document.createEvent("TouchEvent"),e=!0}catch(t){}return[t,e,"ontouchstart"in window]},getCanvasFp:function(){var t=[],e=document.createElement("canvas");e.width=2e3,e.height=200,e.style.display="inline";var r=e.getContext("2d");return r.rect(0,0,10,10),r.rect(2,2,6,6),t.push("canvas winding:"+(!1===r.isPointInPath(5,5,"evenodd")?"yes":"no")),r.textBaseline="alphabetic",r.fillStyle="#f60",r.fillRect(125,1,62,20),r.fillStyle="#069",this.options.dontUseFakeFontInCanvas?r.font="11pt Arial":r.font="11pt no-real-font-123",r.fillText("Cwm fjordbank glyphs vext quiz, 😃",2,15),r.fillStyle="rgba(102, 204, 0, 0.2)",r.font="18pt Arial",r.fillText("Cwm fjordbank glyphs vext quiz, 😃",4,45),r.globalCompositeOperation="multiply",r.fillStyle="rgb(255,0,255)",r.beginPath(),r.arc(50,50,50,0,2*Math.PI,!0),r.closePath(),r.fill(),r.fillStyle="rgb(0,255,255)",r.beginPath(),r.arc(100,50,50,0,2*Math.PI,!0),r.closePath(),r.fill(),r.fillStyle="rgb(255,255,0)",r.beginPath(),r.arc(75,100,50,0,2*Math.PI,!0),r.closePath(),r.fill(),r.fillStyle="rgb(255,0,255)",r.arc(75,75,75,0,2*Math.PI,!0),r.arc(75,75,25,0,2*Math.PI,!0),r.fill("evenodd"),e.toDataURL&&t.push("canvas fp:"+e.toDataURL()),t.join("~")},getWebglFp:function(){function t(t){return e.clearColor(0,0,0,1),e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),"["+t[0]+", "+t[1]+"]"}var e;if(!(e=this.getWebglCanvas()))return null;var r=[],i=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,i);var n=new Float32Array([-.2,-.9,0,.4,-.26,0,0,.732134444,0]);e.bufferData(e.ARRAY_BUFFER,n,e.STATIC_DRAW),i.itemSize=3,i.numItems=3;var o=e.createProgram(),a=e.createShader(e.VERTEX_SHADER);e.shaderSource(a,"attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}"),e.compileShader(a),n=e.createShader(e.FRAGMENT_SHADER),e.shaderSource(n,"precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}"),e.compileShader(n),e.attachShader(o,a),e.attachShader(o,n),e.linkProgram(o),e.useProgram(o),o.vertexPosAttrib=e.getAttribLocation(o,"attrVertex"),o.offsetUniform=e.getUniformLocation(o,"uniformOffset"),e.enableVertexAttribArray(o.vertexPosArray),e.vertexAttribPointer(o.vertexPosAttrib,i.itemSize,e.FLOAT,!1,0,0),e.uniform2f(o.offsetUniform,1,1),e.drawArrays(e.TRIANGLE_STRIP,0,i.numItems);try{r.push(e.canvas.toDataURL())}catch(e){}r.push("extensions:"+(e.getSupportedExtensions()||[]).join(";")),r.push("webgl aliased line width range:"+t(e.getParameter(e.ALIASED_LINE_WIDTH_RANGE))),r.push("webgl aliased point size range:"+t(e.getParameter(e.ALIASED_POINT_SIZE_RANGE))),r.push("webgl alpha bits:"+e.getParameter(e.ALPHA_BITS)),r.push("webgl antialiasing:"+(e.getContextAttributes().antialias?"yes":"no")),r.push("webgl blue bits:"+e.getParameter(e.BLUE_BITS)),r.push("webgl depth bits:"+e.getParameter(e.DEPTH_BITS)),r.push("webgl green bits:"+e.getParameter(e.GREEN_BITS)),r.push("webgl max anisotropy:"+function(t){var e=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic");return e?(0===(e=t.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT))&&(e=2),e):null}(e)),r.push("webgl max combined texture image units:"+e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS)),r.push("webgl max cube map texture size:"+e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE)),r.push("webgl max fragment uniform vectors:"+e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS)),r.push("webgl max render buffer size:"+e.getParameter(e.MAX_RENDERBUFFER_SIZE)),r.push("webgl max texture image units:"+e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),r.push("webgl max texture size:"+e.getParameter(e.MAX_TEXTURE_SIZE)),r.push("webgl max varying vectors:"+e.getParameter(e.MAX_VARYING_VECTORS)),r.push("webgl max vertex attribs:"+e.getParameter(e.MAX_VERTEX_ATTRIBS)),r.push("webgl max vertex texture image units:"+e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS)),r.push("webgl max vertex uniform vectors:"+e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS)),r.push("webgl max viewport dims:"+t(e.getParameter(e.MAX_VIEWPORT_DIMS))),r.push("webgl red bits:"+e.getParameter(e.RED_BITS)),r.push("webgl renderer:"+e.getParameter(e.RENDERER)),r.push("webgl shading language version:"+e.getParameter(e.SHADING_LANGUAGE_VERSION)),r.push("webgl stencil bits:"+e.getParameter(e.STENCIL_BITS)),r.push("webgl vendor:"+e.getParameter(e.VENDOR)),r.push("webgl version:"+e.getParameter(e.VERSION));try{var s=e.getExtension("WEBGL_debug_renderer_info");s&&(r.push("webgl unmasked vendor:"+e.getParameter(s.UNMASKED_VENDOR_WEBGL)),r.push("webgl unmasked renderer:"+e.getParameter(s.UNMASKED_RENDERER_WEBGL)))}catch(e){}return e.getShaderPrecisionFormat&&(r.push("webgl vertex shader high float precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision),r.push("webgl vertex shader high float precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).rangeMin),r.push("webgl vertex shader high float precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).rangeMax),r.push("webgl vertex shader medium float precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision),r.push("webgl vertex shader medium float precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).rangeMin),r.push("webgl vertex shader medium float precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).rangeMax),r.push("webgl vertex shader low float precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_FLOAT).precision),r.push("webgl vertex shader low float precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_FLOAT).rangeMin),r.push("webgl vertex shader low float precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_FLOAT).rangeMax),r.push("webgl fragment shader high float precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision),r.push("webgl fragment shader high float precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).rangeMin),r.push("webgl fragment shader high float precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).rangeMax),r.push("webgl fragment shader medium float precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision),r.push("webgl fragment shader medium float precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).rangeMin),r.push("webgl fragment shader medium float precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).rangeMax),r.push("webgl fragment shader low float precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_FLOAT).precision),r.push("webgl fragment shader low float precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_FLOAT).rangeMin),r.push("webgl fragment shader low float precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_FLOAT).rangeMax),r.push("webgl vertex shader high int precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_INT).precision),r.push("webgl vertex shader high int precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_INT).rangeMin),r.push("webgl vertex shader high int precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_INT).rangeMax),r.push("webgl vertex shader medium int precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_INT).precision),r.push("webgl vertex shader medium int precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_INT).rangeMin),r.push("webgl vertex shader medium int precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_INT).rangeMax),r.push("webgl vertex shader low int precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_INT).precision),r.push("webgl vertex shader low int precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_INT).rangeMin),r.push("webgl vertex shader low int precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_INT).rangeMax),r.push("webgl fragment shader high int precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_INT).precision),r.push("webgl fragment shader high int precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_INT).rangeMin),r.push("webgl fragment shader high int precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_INT).rangeMax),r.push("webgl fragment shader medium int precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_INT).precision),r.push("webgl fragment shader medium int precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_INT).rangeMin),r.push("webgl fragment shader medium int precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_INT).rangeMax),r.push("webgl fragment shader low int precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_INT).precision),r.push("webgl fragment shader low int precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_INT).rangeMin),r.push("webgl fragment shader low int precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_INT).rangeMax)),r.join("~")},getWebglVendorAndRenderer:function(){try{var t=this.getWebglCanvas(),e=t.getExtension("WEBGL_debug_renderer_info");return t.getParameter(e.UNMASKED_VENDOR_WEBGL)+"~"+t.getParameter(e.UNMASKED_RENDERER_WEBGL)}catch(t){return null}},getAdBlock:function(){var t=document.createElement("div");t.innerHTML="&nbsp;";var e=!(t.className="adsbox");try{document.body.appendChild(t),e=0===document.getElementsByClassName("adsbox")[0].offsetHeight,document.body.removeChild(t)}catch(t){e=!1}return e},getHasLiedLanguages:function(){if(void 0!==navigator.languages)try{if(navigator.languages[0].substr(0,2)!==navigator.language.substr(0,2))return!0}catch(t){return!0}return!1},getHasLiedResolution:function(){return window.screen.width<window.screen.availWidth||window.screen.height<window.screen.availHeight},getHasLiedOs:function(){var t=navigator.userAgent.toLowerCase(),e=navigator.oscpu,r=navigator.platform.toLowerCase();t=0<=t.indexOf("windows phone")?"Windows Phone":0<=t.indexOf("win")?"Windows":0<=t.indexOf("android")?"Android":0<=t.indexOf("linux")?"Linux":0<=t.indexOf("iphone")||0<=t.indexOf("ipad")?"iOS":0<=t.indexOf("mac")?"Mac":"Other";if(("ontouchstart"in window||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints)&&"Windows Phone"!=t&&"Android"!=t&&"iOS"!=t&&"Other"!=t)return!0;if(void 0!==e){if(0<=(e=e.toLowerCase()).indexOf("win")&&"Windows"!=t&&"Windows Phone"!=t)return!0;if(0<=e.indexOf("linux")&&"Linux"!=t&&"Android"!=t)return!0;if(0<=e.indexOf("mac")&&"Mac"!=t&&"iOS"!=t)return!0;if((-1===e.indexOf("win")&&-1===e.indexOf("linux")&&-1===e.indexOf("mac"))!=("Other"==t))return!0}return 0<=r.indexOf("win")&&"Windows"!=t&&"Windows Phone"!=t||(0<=r.indexOf("linux")||0<=r.indexOf("android")||0<=r.indexOf("pike"))&&"Linux"!=t&&"Android"!=t||(0<=r.indexOf("mac")||0<=r.indexOf("ipad")||0<=r.indexOf("ipod")||0<=r.indexOf("iphone"))&&"Mac"!=t&&"iOS"!=t||(-1===r.indexOf("win")&&-1===r.indexOf("linux")&&-1===r.indexOf("mac"))!=("Other"==t)||void 0===navigator.plugins&&"Windows"!=t&&"Windows Phone"!=t},getHasLiedBrowser:function(){var t,e,r=navigator.userAgent.toLowerCase(),i=navigator.productSub;if(("Chrome"==(t=0<=r.indexOf("firefox")?"Firefox":0<=r.indexOf("opera")||0<=r.indexOf("opr")?"Opera":0<=r.indexOf("chrome")?"Chrome":0<=r.indexOf("safari")?"Safari":0<=r.indexOf("trident")?"Internet Explorer":"Other")||"Safari"==t||"Opera"==t)&&"20030107"!==i)return!0;if(37===(i=eval.toString().length)&&"Safari"!=t&&"Firefox"!=t&&"Other"!=t)return!0;if(39===i&&"Internet Explorer"!=t&&"Other"!=t)return!0;if(33===i&&"Chrome"!=t&&"Opera"!=t&&"Other"!=t)return!0;try{throw"a"}catch(t){try{t.toSource(),e=!0}catch(t){e=!1}}return!(!e||"Firefox"==t||"Other"==t)},isCanvasSupported:function(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))},isWebGlSupported:function(){if(!this.isCanvasSupported())return!1;var t=this.getWebglCanvas();return!!window.WebGLRenderingContext&&!!t},isIE:function(){return"Microsoft Internet Explorer"===navigator.appName||!("Netscape"!==navigator.appName||!/Trident/.test(navigator.userAgent))},hasSwfObjectLoaded:function(){return void 0!==window.swfobject},hasMinFlashInstalled:function(){return window.swfobject.hasFlashPlayerVersion("9.0.0")},addFlashDivNode:function(){var t=document.createElement("div");t.setAttribute("id",this.options.swfContainerId),document.body.appendChild(t)},loadSwfAndDetectFonts:function(t){var e="___fp_swf_loaded";window[e]=function(e){t(e)};var r=this.options.swfContainerId;this.addFlashDivNode(),e={onReady:e},window.swfobject.embedSWF(this.options.swfPath,r,"1","1","9.0.0",!1,e,{allowScriptAccess:"always",menu:"false"},{})},getWebglCanvas:function(){var t=document.createElement("canvas"),e=null;try{e=t.getContext("webgl")||t.getContext("experimental-webgl")}catch(t){}return e||null},each:function(t,e,r){if(null!==t)if(this.nativeForEach&&t.forEach===this.nativeForEach)t.forEach(e,r);else if(t.length===+t.length){for(var i=0,n=t.length;i<n;i++)if(e.call(r,t[i],i,t)==={})return}else for(var o in t)if(t.hasOwnProperty(o)&&e.call(r,t[o],o,t)==={})return},map:function(t,e,r){var i=[];return null==t?i:this.nativeMap&&t.map===this.nativeMap?t.map(e,r):(this.each(t,(function(t,n,o){i[i.length]=e.call(r,t,n,o)})),i)},x64Add:function(t,e){t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]],e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]];var r=[0,0,0,0];return r[3]+=t[3]+e[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=t[2]+e[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=t[1]+e[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=t[0]+e[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]},x64Multiply:function(t,e){t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]],e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]];var r=[0,0,0,0];return r[3]+=t[3]*e[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=t[2]*e[3],r[1]+=r[2]>>>16,r[2]&=65535,r[2]+=t[3]*e[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=t[1]*e[3],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=t[2]*e[2],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=t[3]*e[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=t[0]*e[3]+t[1]*e[2]+t[2]*e[1]+t[3]*e[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]},x64Rotl:function(t,e){return 32==(e%=64)?[t[1],t[0]]:e<32?[t[0]<<e|t[1]>>>32-e,t[1]<<e|t[0]>>>32-e]:(e-=32,[t[1]<<e|t[0]>>>32-e,t[0]<<e|t[1]>>>32-e])},x64LeftShift:function(t,e){return 0==(e%=64)?t:e<32?[t[0]<<e|t[1]>>>32-e,t[1]<<e]:[t[1]<<e-32,0]},x64Xor:function(t,e){return[t[0]^e[0],t[1]^e[1]]},x64Fmix:function(t){return t=this.x64Xor(t,[0,t[0]>>>1]),t=this.x64Multiply(t,[4283543511,3981806797]),t=this.x64Xor(t,[0,t[0]>>>1]),t=this.x64Multiply(t,[3301882366,444984403]),this.x64Xor(t,[0,t[0]>>>1])},x64hash128:function(t,e){e=e||0;for(var r=(t=t||"").length%16,i=t.length-r,n=[0,e],o=[0,e],a=[0,0],s=[0,0],u=[2277735313,289559509],l=[1291169091,658871167],c=0;c<i;c+=16)a=[255&t.charCodeAt(c+4)|(255&t.charCodeAt(c+5))<<8|(255&t.charCodeAt(c+6))<<16|(255&t.charCodeAt(c+7))<<24,255&t.charCodeAt(c)|(255&t.charCodeAt(c+1))<<8|(255&t.charCodeAt(c+2))<<16|(255&t.charCodeAt(c+3))<<24],s=[255&t.charCodeAt(c+12)|(255&t.charCodeAt(c+13))<<8|(255&t.charCodeAt(c+14))<<16|(255&t.charCodeAt(c+15))<<24,255&t.charCodeAt(c+8)|(255&t.charCodeAt(c+9))<<8|(255&t.charCodeAt(c+10))<<16|(255&t.charCodeAt(c+11))<<24],a=this.x64Multiply(a,u),a=this.x64Rotl(a,31),a=this.x64Multiply(a,l),n=this.x64Xor(n,a),n=this.x64Rotl(n,27),n=this.x64Add(n,o),n=this.x64Add(this.x64Multiply(n,[0,5]),[0,1390208809]),s=this.x64Multiply(s,l),s=this.x64Rotl(s,33),s=this.x64Multiply(s,u),o=this.x64Xor(o,s),o=this.x64Rotl(o,31),o=this.x64Add(o,n),o=this.x64Add(this.x64Multiply(o,[0,5]),[0,944331445]);switch(a=[0,0],s=[0,0],r){case 15:s=this.x64Xor(s,this.x64LeftShift([0,t.charCodeAt(c+14)],48));case 14:s=this.x64Xor(s,this.x64LeftShift([0,t.charCodeAt(c+13)],40));case 13:s=this.x64Xor(s,this.x64LeftShift([0,t.charCodeAt(c+12)],32));case 12:s=this.x64Xor(s,this.x64LeftShift([0,t.charCodeAt(c+11)],24));case 11:s=this.x64Xor(s,this.x64LeftShift([0,t.charCodeAt(c+10)],16));case 10:s=this.x64Xor(s,this.x64LeftShift([0,t.charCodeAt(c+9)],8));case 9:s=this.x64Xor(s,[0,t.charCodeAt(c+8)]),s=this.x64Multiply(s,l),s=this.x64Rotl(s,33),s=this.x64Multiply(s,u),o=this.x64Xor(o,s);case 8:a=this.x64Xor(a,this.x64LeftShift([0,t.charCodeAt(c+7)],56));case 7:a=this.x64Xor(a,this.x64LeftShift([0,t.charCodeAt(c+6)],48));case 6:a=this.x64Xor(a,this.x64LeftShift([0,t.charCodeAt(c+5)],40));case 5:a=this.x64Xor(a,this.x64LeftShift([0,t.charCodeAt(c+4)],32));case 4:a=this.x64Xor(a,this.x64LeftShift([0,t.charCodeAt(c+3)],24));case 3:a=this.x64Xor(a,this.x64LeftShift([0,t.charCodeAt(c+2)],16));case 2:a=this.x64Xor(a,this.x64LeftShift([0,t.charCodeAt(c+1)],8));case 1:a=this.x64Xor(a,[0,t.charCodeAt(c)]),a=this.x64Multiply(a,u),a=this.x64Rotl(a,31),a=this.x64Multiply(a,l),n=this.x64Xor(n,a)}return n=this.x64Xor(n,[0,t.length]),o=this.x64Xor(o,[0,t.length]),n=this.x64Add(n,o),o=this.x64Add(o,n),n=this.x64Fmix(n),o=this.x64Fmix(o),n=this.x64Add(n,o),o=this.x64Add(o,n),("00000000"+(n[0]>>>0).toString(16)).slice(-8)+("00000000"+(n[1]>>>0).toString(16)).slice(-8)+("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)}},t.VERSION="1.8.0",t}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LogoControl=void 0,r(76);var i=r(10);n.prototype.onAdd=function(t){return this._container=i.domCreate("div","maplibregl-ctrl mapxus-ctrl-logo",t.getContainer()),(t=i.domCreate("a","mapxus-logo",this._container)).target="_blank",t.href="http://www.mapxus.com/",t.setAttribute("aria-label","Mapxus logo"),t.setAttribute("rel","noopener"),this._container.appendChild(t),this._container},n.prototype.onRemove=function(){i.domRemove(this._container)},n.prototype.getDefaultPosition=function(){return"bottom-left"},r=n;function n(){}e.LogoControl=r},function(t,e,r){var i=r(77);"string"==typeof i&&(i=[[t.i,i,""]]);r(9)(i,{transform:void 0}),i.locals&&(t.exports=i.locals)},function(t,e,r){var i=r(16);(t.exports=r(8)(!1)).push([t.i,".mapxus-logo {\n width: 106.4px;\n height: 28.4px;\n margin: 0 0 -3px 3px;\n display: block;\n background-repeat: no-repeat;\n cursor: pointer;\n background-image: url("+i(r(78))+");\n background-size: contain;\n}",""])},function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATAAAABRCAYAAABVJPq4AAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABzbSURBVHgB7Z0HnBfVtcfPLrANdqVlETCWZU0MVqyAaDAosHRUSIzl2RJLorHHgorl2RKNSl7UlzxFDSriY4WVsjSJYqE9xYI+UcEGAoKULWyBze+3O//N/z87d+bOv8Bfc76fz+zM/ufOnZk7954599xzz4goiqIoiqIoiqIoiqIoiqIoiqIoiqIoiqIoiqIoiqIoiqIoiqIoivJvQIb8m1NSUpJdXV2dm5eXl5OVlZVTX1/fMSMjo8vOnTu7tGrVKq+hoeEl8LkoipJ2tJbvOcOGDcvD6iAIo7137dpVCOHUFf93hmAqxLoblg4FBQUd8H8+hFZ77G/F45A+ksU5WHqLoihpx/daA4Pw2hcCaRE2fygJAOF2ArSwRaIoSlph1MDGjx+f+cYbb7SH1pIzd+7cdfipQSwoLi7OLioq2guCoyA7O7s9fuqAPL6AAPhQdjO4hhslQeHlMAqLCjBFSTOMGtjQoUPPhwD4z8zMzErYhfrNnDnza690Q4YMGYnu1lhs7u0s+dBYcnBsLrZzsLTG/1/j/75lZWWrZTcB7esgnHM5NvMkcVbl5OQcOWXKlApRFCVtyDTtQONvh2VvCJ/u0iSYPIHw+j1Wv8TyMyw9sfwQx/0A63biaHjMB4LwCNlNUHvkSpIjvEgPGPp7iqIoaYVRgEFwbXA2W0P4ZImZH4gFMJAPkN3EsmXLDsXqVEkeLKefi6IoaYWfBrbD2aQW5anJlJSUFIilloP8+shuAue6BksbSSLIb0SfPn1yRVGUtCHTZ9+W5kSZmR29ErRu3bqT2HfT9oVdqrOkGNjk2FUdJkkGAmy/wsLCXqIoStrgp4FVRrY5EumVBvavvaTJUB8I8uPI5GGSQnr27JkFYUubXHtJMuhSt0E5/EIURUkbjAIMNqu65kSZmZ52rrq6ug7iEmBo6JVeaSkAIMCOkxRSVFTUF+cYK6njGFEUJW0wCjBoG1uitj1tP45XezRV+O01MZNSAYBz3yb+3eJEOfDUU0/dTxRFSQuMjT0rK6s2sg3BYOqSud0rOGfwLUNaCsKUTcmBfW0gVv0ktXSqra09TRRFSQuMAgzdxqrINrp/BV5pINj2cf1Eh9VXxQA1Noxc9pDkk8GRR0mt9hUh6QMEiqLEh7HBt2nTplmAOV71LfDoQm6AsFuJ9bdiACOXx0qSGTVq1JE478myG8A9H787RlMVRQnGKMCmTJlSG/WvZ4OF0Ojm+n/TUUcd9Rk214uZpAqw/v3756BreidVMNk90Kl3tCiKsscJ6nJFvPGzDftjupCQIRvHjx+/C5tGQz7SJNVO1a5du8EQnANDHGI1Kd0P3MOpENRJdZRVFCU8vgIMDbXWWZu6TDFGfGhCjV1HCJRlhvRMc6AkiTFjxnC+5pVib/ui8HpEEuf4rkAURdmjBDX8b/gHAqmFDQxdN07WjvHChzDZzDXsXEtNGdKhdciQIUlxRdixY8cJWJ0Y4pAPcG23SNNoaSLk4z5+Koqi7FF8I7JGnFKxbuFGga7bPh7p13JdXV29GoMAX3qMUjbSqlWrvlh9JgkAAcprvyLMMbie+0pLSzfBCP86tveVxGC39Wn5DoJBj/a1tbX7c3vnzp3ry8vLGSopdNea+eD47ljYnf722GOP/cIxISQVPuu8vLwicV6YGCHf8SlYuXJlrewBaHfF9ewbuR7cfwXK8GNRQuEMhnVHr6zRfp2dnV0FpeSzWbNm1djmERRSejv/oLG3mAsJIbQPThybWevWjQKsT58+W5YvX87RSE8BhuOOxOpZSQBUII469rdND+G6HHarp6dPn877mYSfEp0WdCIqcvuFCxdukT3IoEGDuuLBz/Tah3K+56WXXprM7REjRhyGMrgUmwPQ4IojIbO5xr4K7HsZgmES1jNRRttN5xs9evSPcPzlSMd8DorkQfDMd6BSvoHyfQ77p+Lc30ic0DxQU1NDl5Wxjo2zbfT+Hj161BcXF8/HNfwPzjcD52ocNR86dOgIXM9t4l0eFyHdkujfhg8fTufqRyKhxKPAaRtuKSsre4n/UIjm5+efgXRn4veTpGkwRyL3j/vein0vY9+TkK0zg4TryJEjS5F2f699uKfSGTNm3O53PIVoQUHBc9hs0ZtBvmyYp0fH38N93oPrG+SRdsP27dtHoh7vEAtQvmfhfq/22ofyHRnw/YgM1LX+SHcWroXht/bnj5H6U19fTxmyC9f6NvY/hXSlQd+j8BVgyGQLbpCbWYyxFf12ReYtbEBbt25tFGBMh4ugId/TuI6G0ofzFuN9g7Iy4abvkKhKFACv+8bI9aOCLMPxHKAolPjZNzc393Cs/yF7EDyjbDwjz1hr+L0rKgwDTN6DhTHb2hvS0RwwHM90ONZvojHej4ozVZrKrZGBAwcWQlDehUo2Bv8WGC6HgSzZuE/C+lqc+7aPP/74+ZDPOQN1ZwS0eI4sH+KTjoEyByHNQCzv4Jir0GAXYLubqTy8ghIgbVscc5RTz90U8w/KYwiOvR5pjsPiWedoGsFqFKOWQLguKSoquqGiomIRBEO9V3rUwXKkfcRwnUU45yt4BgvFAHpAl+F5jfAafacQRd10N/wfG8qF2jenA1oJMJyu2FS+uB6Wr6fAwfPpjWPH8cWHtd/8aZq16BZ1JNJdh+P+kJOT89iUKVOqTYmN4IKaVbnFixe3c+12h2qucmkjK8QALu4QvD07SJzgTXgWVkeHOKQcD3Rh5B9Gl0XhzJYEQTc5rSd3oyH8hJoVNql52U5wZ0V7Fg3oAScwJN+6RRBe1FwuELPwcsOKPhEN+UG+rGwOgNaVhfNSe3o+QHg14zTgw3Gu6ajsv5bkQo3hOpxiKr+LIHYvTJYZZ5wsQD292ZQI9fGvWM0y7C7AOf9KDd9rJ7TgQxgu3SC8PoHwvxoNfqekCdTacF2zsQwVy+APDnTT+hPu5wUndFcLbN0oBFLQ7TbQxZSW4GLXiAG+rbD/AIkDdi1w7O9CHLIL6R90+bWRlyRBkG8JVXlJX9igj5LwtMYzunzp0qVnDxgwoBO2nxeProoFrXDsxRBiV0nwB2Qyqqqq7sF6nNhr1v86OCODXcwJWCdNiCGvc/CM7xKzG5Hfsbzf6yEAz/faTwGDvC8W84BSMQTgNV476urqLhLvF1IN8rxq/vz5myRNwIDdoSiKPzsaalzg2CHoMd3r5brkK8BQGHVR2/mufd1cJ1kb/T9U5LVIs07MxOUPBmn8C5wrTHjqN9atW/ey+0dolzOwsjYWesHuClT57+sn1zKgwU2ArfFZdrEkftiWx0Oz8o2lBu1pKNL91kurCAEFX9JitjldpVYSP1l8eUJ78Byxduw712IxaUtXDx48OCYEFQTi8Sii8wzppx1zzDEJv5iTCQTPXYkIrwjI46KuXbue4v7dV4ChAm+MbMP2kePKMMYHDA/qi+j/jzvuuE1I866YL+gECQm7GKzkIQ6px3WNg3G5zr2DRl/ktUQSgCGCUEbfiVDTzsvoPaxfwPI07r0c/68JOIwvrVM8fl+F5X+xTKQB3fnfD2owE/D8PIUBhBu/u/CYRRRdmijm4vofx0IjOO+nXnYTuD5q8+9jeQ4vwIn46RUsQdpOPgzTTzluRy1Az4blaBrQyoGZ4il0wRrNLdRA2C0X14AGwe9f4ppuSMUocLzgudLn0zR3eAvK81IsB+K+WqGM+K1WmmRMLlh8t93mrkNBbhQVkRdidFBD52OxbhU2RgNzDPlvisGQDw4Na8h3tK9DbdMj7UKMsBg/h8aRMqxCC1JXHsNRqL9NJ5uDB6ugEV+M8ns9erSJhnk0oItwD7eKhabhaNTXY3khMupH6E6Bbs1ICHMapU3zZo/C+WnXWuGxj7a1bj6n3sSuHO7heeTxdcQwzu47NOCf4fjrHRtVqqBQWITzj+OXriL3Thvha6+9tjfsg9c5XVdTyPF9cZ202z7q3sF6g/b0RxzPhu7VLTwc5Up3oVu7d+/O0d9ijzQ1SDMOo8efSnphCiPP8rwQ10vhLfQMkKYXweSTTz55NupkuSF2YE8oUowC3WyuCupCNn9GDBlGdyHz3CF2+Ok09/Eo1LfFnHdnGPKt7WB8g+GcvxN7r3te872mUSCCwpgjidMdtpuUBmpMBJTzR6gQvWfNmrXAPVQ+Z86cDRxZxOaFFvlsRndgEBrvU9HCi7z44otbMOz/JDbHUksxZEEtrMT9o+PP9xsxU4tzj8I5H8A9fBn9PHk/+H0mhOcwRyNKFc+hrgzEPb4afe98Sc+dO3ctfrsCdZ32sm2mDPx6Djj+HVz/jWLmcigDw5D/dV478Xs5hMBTkmZ4BHuIUIGXged0w3nz5m3F6hrDcXl41jGuWUFTiTZHbTe/XXDyHBSae0j6K/fxeKh+wQ05vG/9oY+99trrTKyOtE1PX6Rp06bN80uDBrES6V6XxDld0pMqPIMz8ZbfbEpADaCsrGyi4xtnBMLrQpTnu35p6DOFZ3qfT5IWz48alJjdWXagYY8J+io6nuM22Oouw7kTMgkYmAbhcFaQcyXK5gWsLhOzQ/DBsF8VG/Y1wHb1mDR1y72gslAm3uW0Hu3xbEnCHN9kg7pn8pHMxz6j7biiooI9t8uxXOle6CAfnbZ1wAXscJziMqMFFjLpiP/d04haGOxLS0s34M1Bh1bPbyriGLpCTJQA0NVpi4p8l9hTi2u/1yYh8p2D6+grCUDfH6yukvRjCRrfMpuE0DD+jjIba7BD7aqtrZ1vkw/K8ynkw4bcwk6D37007kGmvFDHymiUhuYjQfCjwyNHjrwJ558myfseKO/nBpSJlXCAIJkMW84Z2BxsSMJpb54e+9TmBg0adBnaVl8fzaUFKKM7KMAlDUF5/L9hTIb2rCfpMgON6tny8vIY2eFo2RPEAl8NDJWaBdNoo8IbuLlS4KG6I7HuwAWZCtHPH8xqdAtdoHOw6ij2zD/iiCPesUmICsO3XrUkAO69Bz3iJf14yzYhGt47uA+TB/4nto2ksrJyNfIxxYNr8cJE2p8Y0rKeTQpjlIYWtACrDyVJoH6+C+3POj9qabifx33y8x09Z0PG8f8l9tc3DyPs/y1pSufOnalJrTXspq/b/TBhvAsl52kMVPwHbKn7mwZ6TAR1Iak2Nxqno6OyomK5Da47IG09uyk47hUxc3SQkyMHDHC+a8UeGjTvtK340BLfw+ptSRAI2TGSZkR9nDgQRuBFetOAyhqxxLGzWU0hcnzounjtQ93bhDoVtkvIUcJXJUmgTGbbal8RcM0fmPYZDPAxoBt+N85ZKsF8npWVdaHXCHu6MHHiRPbgaN80DtRhP43yZ6GsJ6LsVnEuJNr8kxBqJf369Qt0dvcVYMiQmkmkgJpD6uBk7jmOVRAynpUWadmFMU1TaG1hyD8PD9Ta2I8CgU35xTckBLj2WZIgnAeWbjHCUBZW00MsCDXCanve3NzcLK9AAU4e22tqauLRjFdLkogEJwiD8zGcKq99GYbIxu4s0F2nOcI4x5YDJeC2qVOnJhQQYXcADXYa7aKW7i7U0LvTgRjrme3bt18MQXZnSUmJ0ZHYV4ChW8FRyMYTI9NoTSlGMnK00tTFwAjdKuw3hpiGkDQ6HjpTKcLYlujbdUfYtya6x9OinXbjpK/GCAsHug+ZRJJLQs7JiYK6V59oXcrPz6dPpV/XtQZ19jX5btAAIXYzyoT+ku+HOZA+YljdBDm0wu3QG8G38uANWRd5GFhHfxuyU0wmmZlfmfJwhkVXmvbjQRg98vEgf4ObKBJ7JkMFXykhgSGRxsb3JDFyUA4jRLEGNla6SHhqKzRZdOjQIZ4pRYlM0HdjO++zGQhl2nY8nVYttRDGubtJfD5BiHxyoYE9wml18h0BAzFTUS59cN2MoPwkFna1be2bP0Z3ee6QIUNa2BB9BRhGdrY6djCJnkGe4QqvEzBliOmNAQ5Nhnz0gxlv6VKxp4Kx8SWO4WQaX51JzwmBPNLVnSItOfroo2kj8fRkZx3Di2V/CY+1q00q8kKPgi9cT0M07unLoONhzGZ7uEYCHIuR10kQdDdI4jDWmvV8Xryk455axTBNEGTl0MjORTn1hvJCgXYr6sBC7K7wOxZpCnHuxxy/wX9dT9BJqRI7GURsFRwXzXcl8zUWczjVZ/cRXoZ83Bx9W/y8s2Pg9BgUTtyeyCicuZI4hw0cOPCHoljBgRaUu7GrhLo3WEKANzRHx619Cy04IQ67plELR2P1nXIVFSYqX+y4gpOlLdOaDOlt8Qy6iD2BAxE20OQEW/USxj2DQDsJ2vgRnFrEkV/TMbjOXgUFBTEuWUEBDSkYaJwvRuaN6jQaaB5HDlz+HV/55eHMiaRh10vS58CQ33vlypXNo5Uw2jFYYphoq/XoJ98nCQAhuxiV50vc2z4SPx3QhWBf/4+i2MLn/ivDvstRFyahsn8iFuD5XSKJxXhz07Fbt25XYaTPyqcQBueDUX/ONO0PCuGExnkeI5yIPXm4579L0wR23+4Y8t1o8MniwAJ7DiskgBEjRnRpaArmaEMGnl3njJaBIimItrlnczjPmFPRHoEWeirStHDq5dxjLP2x2ewiZWNAjfgGNfqBQd3kBOYYIz6Eja9qjNGkjwMM+TGqOh7KuWL4lJsXKKTHIM3XSALgTfAtrnGmJAjyGCKKNag7bNSmUctOeDE948y99WXUqFFs+OMk+YxHQwyMOOJofww7ZLKbrUej/T/T8TBS78/IFV778DuDZm40HHoYyofzMIOiePhpupdAOAX2dnAd54rB7cUN8ivEs/sAbXmde4H8mOrnPkV7mRgcfnGtMT0cGwFW6awbBQoqXIuJ3Mj0a78MaMhHmo9M+xmhNbLNONnOnEcrkJaz2v8iSYAFK4nTjzMHRLGCYafRMBb4JDkWz2Uy3/5eOzmhGvsGowvCuZip+DJ7DhriNGhXp4lBSHCKEK7xRTHMOCEM6Gfax24qzvGweM8goCvHr3D8TabjUf/vhgA9XHxw5h6aRmg7If8nTGUsTVFyR2J9i1gCOUHFx/P7sDjXgAMOOMD4MR6n/Zgc12PuIbALKY4/iiO4WBAd8bDaxV5Pw3qLfOiVa/qSTy+GPqaRDw/j9xJC+8J1PYRGEHrk0Qvc26s4/zdhzu+GU3EwYsL5fWWiWIG38u14jowm4Wn7Qf1ipIalaETzaPDF8jGOaQwFje7dyfj/xIzgUDyJwG7p04z4ivPMwbW+zWl2WP8I//dmGJiIicXANgioO0w7nSgTQ732MQoH6vcqdKu+wTnPMHTh2mPfwxiVHGQKvdyuXbv3q6url/tMmxvIgSzcI+PsL0L5foqeE7uotE1ReHGxDuzILiLy4vxQL6HXGtfLqUTjPv3000nREWkcTfBmj7nWjbi9BWzeWFXOgR2dtVtKV/h1DyNAOPhNyD2A05MYuliaooha4cRAelSShNMvTzggHMpIv9wdgmnTpi2W4Dmx7Dqcxzl0DBKAZ09Bcjd+G5Bi4RWBtiI2coa+oSBd5EwbYn31E158wd8DE4enHY8hjRqaPraS6XHg2xipbYybTxNHbW0t7cKe3W1cy/GO+4UnjEiMNA+JP5zWxZDe/FjKagjd951J/mMljqi0EH5P+ETo6MZRxR49evDF9AyWh7HMQPq3Gpoi1XrB9hnjLRAowGj8i2w7fifdXfs3R1wt/IBWQslp9MgHvXBDDCli7XvDYHqMby/JhQIs0dhew23jwCtNoAvIDz4k49NkaRPQz4HBrjwFB7u/OTk5D2DT5Ot4U/SUuNmzZzPszp0GfzK25Qtgr+thyEu2b9/Oa0mGmcQK2qXRRunqYfL144uHDqqcAM8AALQfGwdhkNez6KXF9PYCBRjnyEW2KysrKcDcE7k3rV69ujIon6qqKgpC42gSJD6/mhMmuulmCL0HJMngrTHfK7JGSDr79fGVlnBYHXVgJCp1IuGN5uN4qxFDG5zQQImE6FkErekS94hbhCVLlvwcAslU58tyc3PL3T+iDd6L+mmyGe6NNjHB9PLkPFW0Q2p7VoEOPGAbDjVNr6ysjPZpRpYIlBEBLONLzv1joABDATergAyjg8KL0cAYhcImquqcOXN4A2/6JOEnvcJ4Fj9SWlr6kSQZBudDxU3UK58qpTq1hoTx2Rx71zMSTgumRjLR6bp/LkmCLzI0Gl4PDfRhNDtGZ3mInz1zh4qJQEdtvCz/hHRedmgObHh+WYihZpzgh6auWUlRUdH5hn0yf/789TgnR2x9Y6y5YZvAC2Y4u+4SEggxRsz9NZZ45m5ygj7Dh5d49bZsbGDN9q26ujpOvo1R8fD/V2IJ0vrFpgozglQBdTiVvlZWsa/8QCU7JRLLXLGHth6GT3L8qQI1BTRGCr0LMJJ3gd8HeeMFQnXj2rVrx6In8kucJ8gfjbNAlqOhj8a1XMF7MSXEdf9BDC4JOM+fabg3HYt8l2P1F5+876ZPmmk/rm0t2s8pOA/974KcvzmIN4EDJRAgiyVOcD98KR2P5VYfu5gbfvPg7IqKirGmjyTbjEI227egVezt4ehpPWMfx7+JhytJ4LZUfhEbb91SXCvjxCcy14x2DU4LmScpZOPGjV916dLF0/kRQtQ6lhU0z60YATod9+41EhjqC9toQJchn84ev1tVXEfzmAz7z5QVK1b0xIuT98coBY1ft0Ed3AqBwnr3WnZ29ptMjwreeCzumdrSGq98YYd9U+KAIWuwTIaQnNq1a1eGD++D8++H62jrXA+7VvSF/AeuI9AhlKAdUIA94f6dgQigmQV2oyHkb4fRfi7y8ewu4vp8PQOcsEd/g137CYxO8ruavXEMPwrMOk+N9htcywcFBQUvT5o0Kfq5PY5zepZj27ZtfW2YKBsqO7ejHO/GyGs/PCsGNKVJqgMjHDrzrjm1jP5iL/fq1ev9oLBYgZ+wghbRNyo0NLtF90vUNwKp6jJeuVhAoyUqAi/Q9iOrLaA/GW7uBEZ7lRSCN9hCMbt9WIGyeRxlc4EoaQu6cv1Rp0zzYK9E9+dBUdKWwG4bhEWzfQsPmm+dmOHUMDGTKE05NCwJgOMfTbXwIrjXhP24IPh/mm4xwhTl+4TNKGRz9wHCg744ua79FRKOpRInTtSLF2X3kHCMMJZXYWHhgaIoSkoIFGA1NTXsDzdqYWiQ7DrGTHeArSOUfYQOgBI/E6DSJy3iph+wuzCoXFw2kyiyYEvTuZGKkiJsw+lEvPGL3F7PplDSJtq0aROvD8oqGBST5nUfhPOBhmQ4/Z0miqKkhEABhhEHal8RRzx3rCsGEaySEGC063MxeOb6AWHy8DPPPBM4ZSmZQHtidIpEPbttRnoVRYmDQAGWm5u7C8IjYsh3R2LdhKHpsB9eoCE/rHfzhxgu3+2fj3IcZeP1xOYwdRnK7gxRFCUlBAowdPlqTI5nDExWWVkZz5djQhnyoeU9xsmosgeAAJou4VmNMrsQI5Cjpk+fnoz5fYqieBDYvdm4cWNDfn6+p/DgRO6FCxeG/goMBN9STtEXCz808HVeXt7fZA8Bze/+6urqbs40le4ByRlihVNI7uLcvohzpaIoqSFQgNFjd9iwYR+hAR/tsZsjiqE/ogGtbUHbtm2/aggO30xD+nn8bLzsIRzN77IxY8ZcjRHZsbhmBluMKQu6W0Aos4t714wZM0J/S1DZc+C5bcYLZ6Fhd9Ln2irJxUYDktGjR3eqr6/vh4banN4J6PaKaaZ9EBCK9I862C8N8l8DgbAi7HceUwnDG+Peh+La+Mk3hgJZg/+v69Wr1wLbr4EripIcrASY0hJ+QaagoKBw27ZtGxghQBRFURRFURRFURRFURRFURRFURRFURRFURRFURRFURRFURRFURRFURRFSQX/BO3KWsJPj46IAAAAAElFTkSuQmCC"},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AttributionControl=void 0;var i=r(10);function n(t){this._theme=t.theme||"default"}r(80),n.prototype.onAdd=function(t){return this._container=i.domCreate("div","maplibregl-ctrl mapxus-ctrl-attribution",t.getContainer()),this._anchor=i.domCreate("a","mapxus-attribution",this._container),this._anchor.target="_blank",this._setCopyrightInfo(this._theme),this._anchor.setAttribute("aria-label","Mapxus attribution"),this._anchor.setAttribute("rel","noopener"),this._container.appendChild(this._anchor),this._container},n.prototype.onRemove=function(){i.domRemove(this._container)},n.prototype.getDefaultPosition=function(){return"bottom-right"},n.prototype.changeTheme=function(t){this._setCopyrightInfo(t)},n.prototype._setCopyrightInfo=function(t){this._anchor.innerText="landsD"===t?"© The Government of the Hong Kong SAR":"© OpenStreetMap contributors",this._anchor.href="landsD"===t?"https://www.map.gov.hk/gm/":"https://www.openstreetmap.org/copyright/"},r=n,e.AttributionControl=r},function(t,e,r){var i=r(81);"string"==typeof i&&(i=[[t.i,i,""]]);r(9)(i,{transform:void 0}),i.locals&&(t.exports=i.locals)},function(t,e,r){(t.exports=r(8)(!1)).push([t.i,".mapxus-ctrl-attribution {\n margin: 0 10px 5px 0 !important;\n}\n.mapxus-attribution {\n text-decoration: none;\n color: #404040;\n}",""])},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DistanceSearchType=void 0,(e=e.DistanceSearchType||(e.DistanceSearchType={})).POINT="Point",e.POLYGON="Polygon"},function(t,e,r){"use strict";function i(t){return-1<t.id.indexOf("mapxus-poi-restroom")}function n(t){var e=-1<t.id.indexOf("mapxus-poi-stairs"),r=-1<t.id.indexOf("mapxus-poi-escalator"),i=-1<t.id.indexOf("mapxus-poi-elevator");t=-1<t.id.indexOf("mapxus-poi-ramp");return e||r||i||t}function o(t){return/en/.test(t)}function a(t){return"zh-Hans"===t||"zh"===t||"zh-CN"===t}function s(t){return"zh-Hant"===t||"zh-TW"===t||"zh-HK"===t}Object.defineProperty(e,"__esModule",{value:!0}),e.isTraditionalChinese=e.isSimplifiedChinese=e.isEnglish=e.isConnectorPoi=e.isToiletPoi=e.getTextFieldCoalesceList=void 0,e.getTextFieldCoalesceList=function(t,e){return t.map((function(t){var r=[];r=o(e)?["coalesce",["get","name:en"],["get","name"]]:a(e)?["coalesce",["get","name:zh-Hans"],["get","name"]]:s(e)?["coalesce",["get","name:zh-Hant"],["get","name"]]:["coalesce",["get","name"]];return(i(t)||n(t))&&(r=""),{layerId:t.id,coalesce:r}}))},e.isToiletPoi=i,e.isConnectorPoi=n,e.isEnglish=o,e.isSimplifiedChinese=a,e.isTraditionalChinese=s},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ThemeType=void 0,(e=e.ThemeType||(e.ThemeType={})).CHRISTMAS="christmas",e.HALLOWEEN="halloween",e.MAPPY_BEE="mappyBee",e.MAPXUS="mapxus",e.LANDS_D="landsD",e.COMMON="common",e.MAPXUS_V2="mapxus_v2"},function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Marker=void 0;var o;r=r(5),n(a,o=r.Evented),a.prototype.onEventListener=function(t,e){this._map.on(t,this._layerId,e)},a.prototype.addTo=function(t){return this._map=t.getMap(),this._indoor=t.getIndoor(),this},a.prototype.create=function(t,e,r){var i=this;return this._coordinates=t,this._floor=e||"",this._buildingId=r||"",this._map.hasImage(this._imageName)?this._createData():this._loadImage((function(t){i._map.addImage(i._imageName,t),i._createData()})),this},a.prototype.remove=function(){return this._map.getLayer(this._layerId)&&(this._map.removeLayer(this._layerId),this._map.removeSource(this._sourceId)),this},a.prototype.switch=function(t,e){return this._map.getLayer(this._layerId)&&this._map.setFilter(this._layerId,["any",["all",["==","floor",t],["==","buildingId",e]],["==","buildingId",""],["==","floor",""]]),this},Object.defineProperty(a.prototype,"layerId",{get:function(){return this._layerId},enumerable:!1,configurable:!0}),a.prototype.setImageUrl=function(t){return this._imageUrl=t,this._imageName=this._imageName+"_"+t,this},a.prototype.setImageScale=function(t){return this._imageScale=t,this},a.prototype._createData=function(){var t=this;this._addSource()._addLayer(),this._indoor.currentFloor===this._floor&&this._indoor.buildingId===this._buildingId||this.switch(this._indoor.currentFloor||"",this._indoor.buildingId||""),this._indoor.on("switchFloor",(function(e){e=e.target,t.switch(e.currentFloor,e.buildingId)})),this._indoor.on("selectBuilding",(function(e){e.feature||t.switch("","")}))},a.prototype._loadImage=function(t){this._map.loadImage(this._imageUrl,(function(e,r){if(e)throw e;t(r)}))},a.prototype._addSource=function(){return this._map.getSource(this._sourceId)||this._map.addSource(this._sourceId,{type:"geojson",data:{type:"Feature",geometry:{type:this._isMultiArray()?"MultiPoint":"Point",coordinates:this._coordinates},properties:{floor:this._floor,buildingId:this._buildingId}}}),this},a.prototype._addLayer=function(){return this._map.getLayer(this._layerId)||this._map.addLayer({id:this._layerId,type:"symbol",source:this._sourceId,layout:{"icon-image":this._imageName,"icon-size":this._imageScale}}),this},a.prototype._isMultiArray=function(){for(var t=0,e=this._coordinates;t<e.length;t++)if(e[t]instanceof Array)return!0;return!1},n=a;function a(t){var e=o.call(this)||this;t&&e.addTo(t);var r=Math.floor(1e3*Math.random());t="mapxus_marker";return e._sourceId=t+"_source_"+r,e._layerId=t+"_layer_"+r,e._imageName="poi-01",e._imageUrl="https://map-service.mapxus.co.jp/bssww/assets/origin-marker.png",e._imageScale=.65,e}e.Marker=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RouteService=void 0;var i=r(7),n=r(87);o.prototype.search=function(t,e,r,i,o,a,s,u,l){if(void 0===s&&(s=n.WayFindingVehicleType.FOOT),!t.length||!e.length)throw new Error("Coord cannot be empty.");if(2!==t.length||2!==e.length)throw new Error("Coord cannot less than 2.");return s=[this._api+"?fromLon="+t[0],"fromLat="+t[1],"toLon="+e[0],"toLat="+e[1],"fromBuilding="+o,"toBuilding="+a,"fromFloor="+r,"toFloor="+i,"vehicle="+s],u&&s.push("locale="+u),l&&s.push("toDoor="+l),this._request.get(s.join("&"))},r=o;function o(){this._api="/api/v1/route",this._request=new i.Request}e.RouteService=r},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WayFindingVehicleType=void 0,(e=e.WayFindingVehicleType||(e.WayFindingVehicleType={})).FOOT="foot",e.WHEELCHAIR="wheelchair",e.ESCALATOR="escalator"},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version=void 0,e.version="4.1.1-jp"}],t.c=r,t.d=function(e,r,i){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:i})},t.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)t.d(i,n,function(t){return e[t]}.bind(null,n));return i},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},t.p="",t(t.s=18);function t(i){if(r[i])return r[i].exports;var n=r[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var e,r}));
26
+ */t.exports=function(t){return null!=t&&(r(t)||"function"==typeof(e=t).readFloatLE&&"function"==typeof e.slice&&r(e.slice(0,0))||!!t._isBuffer);var e}},function(t,e,r){"use strict";var i=r(14),n=r(3),o=r(56),a=r(57);function s(t){this.defaults=t,this.interceptors={request:new o,response:new o}}s.prototype.request=function(t){"string"==typeof t&&(t=n.merge({url:arguments[0]},arguments[1])),(t=n.merge(i,{method:"get"},this.defaults,t)).method=t.method.toLowerCase();var e=[a,void 0],r=Promise.resolve(t);for(this.interceptors.request.forEach((function(t){e.unshift(t.fulfilled,t.rejected)})),this.interceptors.response.forEach((function(t){e.push(t.fulfilled,t.rejected)}));e.length;)r=r.then(e.shift(),e.shift());return r},n.forEach(["delete","get","head","options"],(function(t){s.prototype[t]=function(e,r){return this.request(n.merge(r||{},{method:t,url:e}))}})),n.forEach(["post","put","patch"],(function(t){s.prototype[t]=function(e,r,i){return this.request(n.merge(i||{},{method:t,url:e,data:r}))}})),t.exports=s},function(t,e){var r,i;t=t.exports={};function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function a(t){if(r===setTimeout)return setTimeout(t,0);if((r===n||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0);try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:n}catch(t){r=n}try{i="function"==typeof clearTimeout?clearTimeout:o}catch(t){i=o}}();var s,u=[],l=!1,c=-1;function p(){l&&s&&(l=!1,s.length?u=s.concat(u):c=-1,u.length&&h())}function h(){if(!l){var t=a(p);l=!0;for(var e=u.length;e;){for(s=u,u=[];++c<e;)s&&s[c].run();c=-1,e=u.length}s=null,l=!1,function(t){if(i===clearTimeout)return clearTimeout(t);if((i===o||!i)&&clearTimeout)return i=clearTimeout,clearTimeout(t);try{i(t)}catch(e){try{return i.call(null,t)}catch(e){return i.call(this,t)}}}(t)}}function f(t,e){this.fun=t,this.array=e}function d(){}t.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];u.push(new f(t,e)),1!==u.length||l||a(h)},f.prototype.run=function(){this.fun.apply(null,this.array)},t.title="browser",t.browser=!0,t.env={},t.argv=[],t.version="",t.versions={},t.on=d,t.addListener=d,t.once=d,t.off=d,t.removeListener=d,t.removeAllListeners=d,t.emit=d,t.prependListener=d,t.prependOnceListener=d,t.listeners=function(t){return[]},t.binding=function(t){throw new Error("process.binding is not supported")},t.cwd=function(){return"/"},t.chdir=function(t){throw new Error("process.chdir is not supported")},t.umask=function(){return 0}},function(t,e,r){"use strict";var i=r(3);t.exports=function(t,e){i.forEach(t,(function(r,i){i!==e&&i.toUpperCase()===e.toUpperCase()&&(t[e]=r,delete t[i])}))}},function(t,e,r){"use strict";var i=r(23);t.exports=function(t,e,r){var n=r.config.validateStatus;r.status&&n&&!n(r.status)?e(i("Request failed with status code "+r.status,r.config,null,r.request,r)):t(r)}},function(t,e,r){"use strict";t.exports=function(t,e,r,i,n){return t.config=e,r&&(t.code=r),t.request=i,t.response=n,t}},function(t,e,r){"use strict";var i=r(3);function n(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,r){return e?((e=r?r(e):i.isURLSearchParams(e)?e.toString():(o=[],i.forEach(e,(function(t,e){null!=t&&(i.isArray(t)?e+="[]":t=[t],i.forEach(t,(function(t){i.isDate(t)?t=t.toISOString():i.isObject(t)&&(t=JSON.stringify(t)),o.push(n(e)+"="+n(t))})))})),o.join("&")))&&(t+=(-1===t.indexOf("?")?"?":"&")+e),t):t;var o}},function(t,e,r){"use strict";var i=r(3),n=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,r,o={};return t&&i.forEach(t.split("\n"),(function(t){r=t.indexOf(":"),e=i.trim(t.substr(0,r)).toLowerCase(),r=i.trim(t.substr(r+1)),e&&(o[e]&&0<=n.indexOf(e)||(o[e]="set-cookie"===e?(o[e]||[]).concat([r]):o[e]?o[e]+", "+r:r))})),o}},function(t,e,r){"use strict";var i,n,o,a=r(3);function s(t){return n&&(o.setAttribute("href",t),t=o.href),o.setAttribute("href",t),{href:o.href,protocol:o.protocol?o.protocol.replace(/:$/,""):"",host:o.host,search:o.search?o.search.replace(/^\?/,""):"",hash:o.hash?o.hash.replace(/^#/,""):"",hostname:o.hostname,port:o.port,pathname:"/"===o.pathname.charAt(0)?o.pathname:"/"+o.pathname}}t.exports=a.isStandardBrowserEnv()?(n=/(msie|trident)/i.test(navigator.userAgent),o=document.createElement("a"),i=s(window.location.href),function(t){return(t=a.isString(t)?s(t):t).protocol===i.protocol&&t.host===i.host}):function(){return!0}},function(t,e,r){"use strict";function i(){this.message="String contains an invalid character"}(i.prototype=new Error).code=5,i.prototype.name="InvalidCharacterError",t.exports=function(t){for(var e,r,n=String(t),o="",a=0,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.charAt(0|a)||(s="=",a%1);o+=s.charAt(63&e>>8-a%1*8)){if(255<(r=n.charCodeAt(a+=.75)))throw new i;e=e<<8|r}return o}},function(t,e,r){"use strict";var i=r(3);t.exports=i.isStandardBrowserEnv()?{write:function(t,e,r,n,o,a){var s=[];s.push(t+"="+encodeURIComponent(e)),i.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),i.isString(n)&&s.push("path="+n),i.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){return(t=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)")))?decodeURIComponent(t[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}},function(t,e,r){"use strict";var i=r(3);function n(){this.handlers=[]}n.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},n.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},n.prototype.forEach=function(t){i.forEach(this.handlers,(function(e){null!==e&&t(e)}))},t.exports=n},function(t,e,r){"use strict";var i=r(3),n=r(58),o=r(24),a=r(14),s=r(59),u=r(60);function l(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){return l(t),t.baseURL&&!s(t.url)&&(t.url=u(t.baseURL,t.url)),t.headers=t.headers||{},t.data=n(t.data,t.headers,t.transformRequest),t.headers=i.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),i.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]})),(t.adapter||a.adapter)(t).then((function(e){return l(t),e.data=n(e.data,e.headers,t.transformResponse),e}),(function(e){return o(e)||(l(t),e&&e.response&&(e.response.data=n(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},function(t,e,r){"use strict";var i=r(3);t.exports=function(t,e,r){return i.forEach(r,(function(r){t=r(t,e)})),t}},function(t,e,r){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},function(t,e,r){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},function(t,e,r){"use strict";var i=r(25);function n(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var r=this;t((function(t){r.reason||(r.reason=new i(t),e(r.reason))}))}n.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},n.source=function(){var t;return{token:new n((function(e){t=e})),cancel:t}},t.exports=n},function(t,e,r){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},function(t,e,r){t.exports=function(){"use strict";var t,e,r;function i(i,n){if(t)if(e){var o="var sharedChunk = {}; ("+t+")(sharedChunk); ("+e+")(sharedChunk);",a={};t(a),r=n(a),"undefined"!=typeof window&&(r.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else e=n;else t=n}return i(0,(function(t){function e(t,e){return t(e={exports:{}},e.exports),e.exports}var r=i;function i(t,e,r,i){this.cx=3*t,this.bx=3*(r-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=i,this.p2x=r,this.p2y=i}i.prototype.sampleCurveX=function(t){return((this.ax*t+this.bx)*t+this.cx)*t},i.prototype.sampleCurveY=function(t){return((this.ay*t+this.by)*t+this.cy)*t},i.prototype.sampleCurveDerivativeX=function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},i.prototype.solveCurveX=function(t,e){var r,i,n,o,a;for(void 0===e&&(e=1e-6),n=t,a=0;a<8;a++){if(o=this.sampleCurveX(n)-t,Math.abs(o)<e)return n;var s=this.sampleCurveDerivativeX(n);if(Math.abs(s)<1e-6)break;n-=o/s}if((n=t)<(r=0))return r;if(n>(i=1))return i;for(;r<i;){if(o=this.sampleCurveX(n),Math.abs(o-t)<e)return n;o<t?r=n:i=n,n=.5*(i-r)+r}return n},i.prototype.solve=function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))};var n=o;function o(t,e){this.x=t,this.y=e}o.prototype={clone:function(){return new o(this.x,this.y)},add:function(t){return this.clone()._add(t)},sub:function(t){return this.clone()._sub(t)},multByPoint:function(t){return this.clone()._multByPoint(t)},divByPoint:function(t){return this.clone()._divByPoint(t)},mult:function(t){return this.clone()._mult(t)},div:function(t){return this.clone()._div(t)},rotate:function(t){return this.clone()._rotate(t)},rotateAround:function(t,e){return this.clone()._rotateAround(t,e)},matMult:function(t){return this.clone()._matMult(t)},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(t){return this.x===t.x&&this.y===t.y},dist:function(t){return Math.sqrt(this.distSqr(t))},distSqr:function(t){var e=t.x-this.x;return e*e+(t=t.y-this.y)*t},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(t){return Math.atan2(this.y-t.y,this.x-t.x)},angleWith:function(t){return this.angleWithSep(t.x,t.y)},angleWithSep:function(t,e){return Math.atan2(this.x*e-this.y*t,this.x*t+this.y*e)},_matMult:function(t){var e=t[2]*this.x+t[3]*this.y;return this.x=t[0]*this.x+t[1]*this.y,this.y=e,this},_add:function(t){return this.x+=t.x,this.y+=t.y,this},_sub:function(t){return this.x-=t.x,this.y-=t.y,this},_mult:function(t){return this.x*=t,this.y*=t,this},_div:function(t){return this.x/=t,this.y/=t,this},_multByPoint:function(t){return this.x*=t.x,this.y*=t.y,this},_divByPoint:function(t){return this.x/=t.x,this.y/=t.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var t=this.y;return this.y=this.x,this.x=-t,this},_rotate:function(t){var e=Math.cos(t),r=Math.sin(t);t=r*this.x+e*this.y;return this.x=e*this.x-r*this.y,this.y=t,this},_rotateAround:function(t,e){var r=Math.cos(t),i=Math.sin(t);t=e.y+i*(this.x-e.x)+r*(this.y-e.y);return this.x=e.x+r*(this.x-e.x)-i*(this.y-e.y),this.y=t,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},o.convert=function(t){return t instanceof o||!Array.isArray(t)?t:new o(t[0],t[1])};var a="undefined"!=typeof self?self:{},s=Math.pow(2,53)-1;function u(t,e,i,n){var o=new r(t,e,i,n);return function(t){return o.solve(t)}}var l=u(.25,.1,.25,1);function c(t,e,r){return Math.min(r,Math.max(e,t))}function p(t,e,r){var i;return(i=((t-e)%(i=r-e)+i)%i+e)===e?r:i}function h(t){for(var e=[],r=arguments.length-1;0<r--;)e[r]=arguments[r+1];for(var i=0,n=e;i<n.length;i+=1){var o,a=n[i];for(o in a)t[o]=a[o]}return t}var f=1;function d(){return function t(e){return e?(e^16*Math.random()>>e/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,t)}()}function m(t){return t&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t)}function y(t,e){t.forEach((function(t){e[t]&&(e[t]=e[t].bind(e))}))}function g(t,e){return-1!==t.indexOf(e,t.length-e.length)}function _(t,e,r){var i,n={};for(i in t)n[i]=e.call(r||this,t[i],i,t);return n}function v(t,e,r){var i,n={};for(i in t)e.call(r||this,t[i],i,t)&&(n[i]=t[i]);return n}function x(t){return Array.isArray(t)?t.map(x):"object"==typeof t&&t?_(t,x):t}var b={};function w(t){b[t]||("undefined"!=typeof console&&console.warn(t),b[t]=!0)}function S(t,e,r){return(r.y-t.y)*(e.x-t.x)>(e.y-t.y)*(r.x-t.x)}function T(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function E(t){var e={};return t.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(function(t,r,i,n){return n=i||n,e[r]=!n||n.toLowerCase(),""})),e["max-age"]&&(t=parseInt(e["max-age"],10),isNaN(t)?delete e["max-age"]:e["max-age"]=t),e}var I=null;function A(t){var e;return null==I&&(e=t.navigator?t.navigator.userAgent:null,I=!!t.safari||!(!e||!(/\b(iPad|iPhone|iPod)\b/.test(e)||e.match("Safari")&&!e.match("Chrome")))),I}function C(t){try{var e=a[t];return e.setItem("_mapbox_test_",1),e.removeItem("_mapbox_test_"),!0}catch(t){return!1}}var P,M,k,z,L=a.performance&&a.performance.now?a.performance.now.bind(a.performance):Date.now.bind(Date),B=a.requestAnimationFrame||a.mozRequestAnimationFrame||a.webkitRequestAnimationFrame||a.msRequestAnimationFrame,D=a.cancelAnimationFrame||a.mozCancelAnimationFrame||a.webkitCancelAnimationFrame||a.msCancelAnimationFrame,R={now:L,frame:function(t){var e=B(t);return{cancel:function(){return D(e)}}},getImageData:function(t,e){void 0===e&&(e=0);var r=a.document.createElement("canvas"),i=r.getContext("2d");if(!i)throw new Error("failed to create canvas 2d context");return r.width=t.width,r.height=t.height,i.drawImage(t,0,0,t.width,t.height),i.getImageData(-e,-e,t.width+2*e,t.height+2*e)},resolveURL:function(t){return(P=P||a.document.createElement("a")).href=t,P.href},hardwareConcurrency:a.navigator&&a.navigator.hardwareConcurrency||4,get devicePixelRatio(){return a.devicePixelRatio},get prefersReducedMotion(){return!!a.matchMedia&&(null==M&&(M=a.matchMedia("(prefers-reduced-motion: reduce)")),M.matches)}},O={API_URL:"https://api.mapbox.com",get EVENTS_URL(){return this.API_URL?0===this.API_URL.indexOf("https://api.mapbox.cn")?"https://events.mapbox.cn/events/v2":0===this.API_URL.indexOf("https://api.mapbox.com")?"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,REGISTERED_PROTOCOLS:{}},F={supported:!1,testSupport:function(t){!j&&z&&(U?N(t):k=t)}},j=!1,U=!1;function N(t){var e=t.createTexture();t.bindTexture(t.TEXTURE_2D,e);try{if(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,z),t.isContextLost())return;F.supported=!0}catch(t){}t.deleteTexture(e),j=!0}function V(t,e){this._transformRequestFn=t,this._customAccessToken=e,this._createSkuToken()}a.document&&((z=a.document.createElement("img")).onload=function(){k&&N(k),U=!(k=null)},z.onerror=function(){j=!0,k=null},z.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");var q="01";function G(t){return 0===t.indexOf("mapbox:")}V.prototype._createSkuToken=function(){var t=function(){for(var t="",e=0;e<10;e++)t+="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62*Math.random())];return{token:["1",q,t].join(""),tokenExpiresAt:Date.now()+432e5}}();this._skuToken=t.token,this._skuTokenExpiresAt=t.tokenExpiresAt},V.prototype._isSkuTokenExpired=function(){return Date.now()>this._skuTokenExpiresAt},V.prototype.transformRequest=function(t,e){return this._transformRequestFn&&this._transformRequestFn(t,e)||{url:t}},V.prototype.normalizeStyleURL=function(t,e){return G(t)?((t=X(t)).path="/styles/v1"+t.path,this._makeAPIURL(t,this._customAccessToken||e)):t},V.prototype.normalizeGlyphsURL=function(t,e){return G(t)?((t=X(t)).path="/fonts/v1"+t.path,this._makeAPIURL(t,this._customAccessToken||e)):t},V.prototype.normalizeSourceURL=function(t,e){return G(t)?((t=X(t)).path="/v4/"+t.authority+".json",t.params.push("secure"),this._makeAPIURL(t,this._customAccessToken||e)):t},V.prototype.normalizeSpriteURL=function(t,e,r,i){var n=X(t);return G(t)?(n.path="/styles/v1"+n.path+"/sprite"+e+r,this._makeAPIURL(n,this._customAccessToken||i)):(n.path+=""+e+r,K(n))},V.prototype.normalizeTileURL=function(t,e){if(this._isSkuTokenExpired()&&this._createSkuToken(),t&&!G(t))return t;var r=X(t);return r.path=r.path.replace(/(\.(png|jpg)\d*)(?=$)/,(2<=R.devicePixelRatio||512===e?"@2x":"")+(F.supported?".webp":"$1")),r.path=r.path.replace(/^.+\/v4\//,"/"),r.path="/v4"+r.path,e=this._customAccessToken||function(){for(var t=0,e=r.params;t<e.length;t+=1){var i=e[t].match(/^access_token=(.*)$/);if(i)return i[1]}return null}()||O.ACCESS_TOKEN,O.REQUIRE_ACCESS_TOKEN&&e&&this._skuToken&&r.params.push("sku="+this._skuToken),this._makeAPIURL(r,e)},V.prototype.canonicalizeTileURL=function(t,e){var r=X(t);return r.path.match(/(^\/v4\/)/)&&r.path.match(/\.[\w]+$/)?(t="mapbox://tiles/",t+=r.path.replace("/v4/",""),r=r.params,e&&(r=r.filter((function(t){return!t.match(/^access_token=/)}))),r.length&&(t+="?"+r.join("&")),t):t},V.prototype.canonicalizeTileset=function(t,e){for(var r=!!e&&G(e),i=[],n=0,o=t.tiles||[];n<o.length;n+=1){var a=o[n];Z(a)?i.push(this.canonicalizeTileURL(a,r)):i.push(a)}return i},V.prototype._makeAPIURL=function(t,e){var r,i="See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes",n=X(O.API_URL);if(t.protocol=n.protocol,t.authority=n.authority,"http"===t.protocol&&0<=(r=t.params.indexOf("secure"))&&t.params.splice(r,1),"/"!==n.path&&(t.path=""+n.path+t.path),!O.REQUIRE_ACCESS_TOKEN)return K(t);if(!(e=e||O.ACCESS_TOKEN))throw new Error("An API access token is required to use Mapbox GL. "+i);if("s"===e[0])throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). "+i);return t.params=t.params.filter((function(t){return-1===t.indexOf("access_token")})),t.params.push("access_token="+e),K(t)},V.prototype.setTransformRequest=function(t){this._transformRequestFn=t};var H=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;function Z(t){return H.test(t)}var W=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function X(t){if(!(t=t.match(W)))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 K(t){var e=t.params.length?"?"+t.params.join("&"):"";return t.protocol+"://"+t.authority+t.path+e}function J(t){if(!t)return null;var e=t.split(".");if(!e||3!==e.length)return null;try{return JSON.parse(decodeURIComponent(a.atob(e[1]).split("").map((function(t){return"%"+("00"+t.charCodeAt(0).toString(16)).slice(-2)})).join("")))}catch(t){return null}}(ho=function(t){this.type=t,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}).prototype.getStorageKey=function(t){var e=(e=J(O.ACCESS_TOKEN))&&e.u?a.btoa(encodeURIComponent(e.u).replace(/%([0-9A-F]{2})/g,(function(t,e){return String.fromCharCode(Number("0x"+e))}))):O.ACCESS_TOKEN||"";return t?"mapbox.eventData."+t+":"+e:"mapbox.eventData:"+e},ho.prototype.fetchEventData=function(){var t=C("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{var i=a.localStorage.getItem(e);i&&(this.eventData=JSON.parse(i)),(i=a.localStorage.getItem(r))&&(this.anonId=i)}catch(t){w("Unable to read from LocalStorage")}},ho.prototype.saveEventData=function(){var t=C("localStorage"),e=this.getStorageKey(),r=this.getStorageKey("uuid");if(t)try{a.localStorage.setItem(r,this.anonId),1<=Object.keys(this.eventData).length&&a.localStorage.setItem(e,JSON.stringify(this.eventData))}catch(t){w("Unable to write to LocalStorage")}},ho.prototype.processRequests=function(t){},ho.prototype.postEvent=function(t,e,r,i){var n,o=this;O.EVENTS_URL&&((n=X(O.EVENTS_URL)).params.push("access_token="+(i||O.ACCESS_TOKEN||"")),t={event:this.type,created:new Date(t).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:"1.15.2",skuId:q,userId:this.anonId},t=e?h(t,e):t,t={url:K(n),headers:{"Content-Type":"text/plain"},body:JSON.stringify([t])},this.pendingRequest=bt(t,(function(t){o.pendingRequest=null,r(t),o.saveEventData(),o.processRequests(i)})))},ho.prototype.queueRequest=function(t,e){this.queue.push(t),this.processRequests(e)};var Y,Q,$,tt,et=((tt=ho)&&(st.__proto__=tt),((st.prototype=Object.create(tt&&tt.prototype)).constructor=st).prototype.postMapLoadEvent=function(t,e,r,i){this.skuToken=r,(O.EVENTS_URL&&i||O.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return G(t)||Z(t)})))&&this.queueRequest({id:e,timestamp:Date.now()},i)},st.prototype.processRequests=function(t){var e,r,i=this;this.pendingRequest||0===this.queue.length||(r=this.queue.shift(),e=r.id,r=r.timestamp,e&&this.success[e]||(this.anonId||this.fetchEventData(),m(this.anonId)||(this.anonId=d()),this.postEvent(r,{skuToken:this.skuToken},(function(t){t||e&&(i.success[e]=!0)}),t)))},st),rt=($s=(($=ho)&&(at.__proto__=$),((at.prototype=Object.create($&&$.prototype)).constructor=at).prototype.postTurnstileEvent=function(t,e){O.EVENTS_URL&&O.ACCESS_TOKEN&&Array.isArray(t)&&t.some((function(t){return G(t)||Z(t)}))&&this.queueRequest(Date.now(),e)},at.prototype.processRequests=function(t){var e=this;if(!this.pendingRequest&&0!==this.queue.length){this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();var r=J(O.ACCESS_TOKEN),i=r?r.u:O.ACCESS_TOKEN,n=i!==this.eventData.tokenU;m(this.anonId)||(this.anonId=d(),n=!0);var o,a,s=this.queue.shift();if(!(n=!this.eventData.lastSuccess||(o=new Date(this.eventData.lastSuccess),a=new Date(s),r=(s-this.eventData.lastSuccess)/864e5,n||1<=r||r<-1||o.getDate()!==a.getDate())))return this.processRequests();this.postEvent(s,{"enabled.telemetry":!1},(function(t){t||(e.eventData.lastSuccess=s,e.eventData.tokenU=i)}),t)}},new at)).postTurnstileEvent.bind($s),it=(Ao=new et).postMapLoadEvent.bind(Ao),nt=500,ot=50;function at(t){$.call(this,"appUserTurnstile"),this._customAccessToken=t}function st(){tt.call(this,"map.load"),this.success={},this.skuToken=""}function ut(){a.caches&&!Y&&(Y=a.caches.open("mapbox-tiles"))}function lt(t){var e=t.indexOf("?");return e<0?t:t.slice(0,e)}var ct,pt=1/0;function ht(){return null==ct&&(ct=a.OffscreenCanvas&&new a.OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof a.createImageBitmap),ct}var ft={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(ft);var dt,mt=((dt=Error)&&(gt.__proto__=dt),((gt.prototype=Object.create(dt&&dt.prototype)).constructor=gt).prototype.toString=function(){return this.name+": "+this.message+" ("+this.status+"): "+this.url},gt),yt=T()?function(){return self.worker&&self.worker.referrer}:function(){return("blob:"===a.location.protocol?a.parent:a).location.href};function gt(t,e,r){401===e&&Z(r)&&(t+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),dt.call(this,t),this.status=e,this.url=r,this.name=this.constructor.name,this.message=t}function _t(t,e){var r=new a.AbortController,i=new a.Request(t.url,{method:t.method||"GET",body:t.body,credentials:t.credentials,headers:t.headers,referrer:yt(),signal:r.signal}),n=!1,o=!1,s=0<(u=i.url).indexOf("sku=")&&Z(u);"json"===t.type&&i.headers.set("Accept","application/json");var u=function(r,n,u){if(!o){if(r&&"SecurityError"!==r.message&&w(r),n&&u)return l(n);var c=Date.now();a.fetch(i).then((function(r){if(r.ok){var i=s?r.clone():null;return l(r,i,c)}return e(new mt(r.statusText,r.status,t.url))})).catch((function(t){20!==t.code&&e(new Error(t.message))}))}},l=function(r,s,u){("arrayBuffer"===t.type?r.arrayBuffer():"json"===t.type?r.json():r.text()).then((function(t){var l,c,p,h,f;o||(s&&u&&(l=i,c=s,p=u,ut(),Y&&(h={status:c.status,statusText:c.statusText,headers:new a.Headers},c.headers.forEach((function(t,e){return h.headers.set(e,t)})),(f=E(c.headers.get("Cache-Control")||""))["no-store"]||(f["max-age"]&&h.headers.set("Expires",new Date(p+1e3*f["max-age"]).toUTCString()),new Date(h.headers.get("Expires")).getTime()-p<42e4||function(t,e){if(void 0===Q)try{new Response(new ReadableStream),Q=!0}catch(t){Q=!1}Q?e(t.body):t.blob().then(e)}(c,(function(t){var e=new a.Response(t,h);ut(),Y&&Y.then((function(t){return t.put(lt(l.url),e)})).catch((function(t){return w(t.message)}))}))))),n=!0,e(null,t,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((function(t){o||e(new Error(t.message))}))};return s?function(t,e){if(ut(),!Y)return e(null);var r=lt(t.url);Y.then((function(t){t.match(r).then((function(i){var n=function(t){if(!t)return!1;var e=new Date(t.headers.get("Expires")||0);t=E(t.headers.get("Cache-Control")||"");return e>Date.now()&&!t["no-cache"]}(i);t.delete(r),n&&t.put(r,i.clone()),e(null,i,n)})).catch(e)})).catch(e)}(i,u):u(null,null),{cancel:function(){o=!0,n||r.abort()}}}function vt(t,e){if(/:\/\//.test(t.url)&&!/^https?:|^file:/.test(t.url)){if(T()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e);if(!T()){var r=t.url.substring(0,t.url.indexOf("://"));return(O.REGISTERED_PROTOCOLS[r]||_t)(t,e)}}if(!(/^file:/.test(r=t.url)||/^file:/.test(yt())&&!/^\w+:/.test(r))){if(a.fetch&&a.Request&&a.AbortController&&a.Request.prototype.hasOwnProperty("signal"))return _t(t,e);if(T()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",t,e,void 0,!0)}return function(t,e){var r,i=new a.XMLHttpRequest;for(r in i.open(t.method||"GET",t.url,!0),"arrayBuffer"===t.type&&(i.responseType="arraybuffer"),t.headers)i.setRequestHeader(r,t.headers[r]);return"json"===t.type&&(i.responseType="text",i.setRequestHeader("Accept","application/json")),i.withCredentials="include"===t.credentials,i.onerror=function(){e(new Error(i.statusText))},i.onload=function(){if((200<=i.status&&i.status<300||0===i.status)&&null!==i.response){var r=i.response;if("json"===t.type)try{r=JSON.parse(i.response)}catch(r){return e(r)}e(null,r,i.getResponseHeader("Cache-Control"),i.getResponseHeader("Expires"))}else e(new mt(i.statusText,i.status,t.url))},i.send(t.body),{cancel:function(){return i.abort()}}}(t,e)}function xt(t,e){return vt(h(t,{type:"arrayBuffer"}),e)}var bt=function(t,e){return vt(h(t,{method:"POST"}),e)},wt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=",St=[],Tt=0,Et=function(t,e){if(F.supported&&(t.headers||(t.headers={}),t.headers.accept="image/webp,*/*"),Tt>=O.MAX_PARALLEL_IMAGE_REQUESTS){var r={requestParameters:t,callback:e,cancelled:!1,cancel:function(){this.cancelled=!0}};return St.push(r),r}function i(){if(!n)for(n=!0,Tt--;St.length&&Tt<O.MAX_PARALLEL_IMAGE_REQUESTS;){var t=St.shift();t.cancelled||(t.cancel=Et(t.requestParameters,t.callback).cancel)}}Tt++;var n=!1,o=xt(t,(function(t,r,n,o){var s;i(),t?e(t):r&&(ht()?(s=e,t=new a.Blob([new Uint8Array(r)],{type:"image/png"}),a.createImageBitmap(t).then((function(t){s(null,t)})).catch((function(t){s(new Error("Could not load image because of "+t.message+". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."))}))):function(t,e,r,i){var n=new a.Image,o=a.URL;n.onload=function(){e(null,n),o.revokeObjectURL(n.src),n.onload=null,a.requestAnimationFrame((function(){n.src=wt}))},n.onerror=function(){return e(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 s=new a.Blob([new Uint8Array(t)],{type:"image/png"});n.cacheControl=r,n.expires=i,n.src=t.byteLength?o.createObjectURL(s):wt}(r,e,n,o))}));return{cancel:function(){o.cancel(),i()}}};function It(t,e,r){r[t]&&-1!==r[t].indexOf(e)||(r[t]=r[t]||[],r[t].push(e))}function At(t,e,r){r&&r[t]&&-1!==(e=r[t].indexOf(e))&&r[t].splice(e,1)}function Ct(t,e){void 0===e&&(e={}),h(this,e),this.type=t}function Pt(){}var Mt,kt=((Mt=Ct)&&(zt.__proto__=Mt),(zt.prototype=Object.create(Mt&&Mt.prototype)).constructor=zt);function zt(t,e){void 0===e&&(e={}),Mt.call(this,"error",h({error:t},e))}Pt.prototype.on=function(t,e){return this._listeners=this._listeners||{},It(t,e,this._listeners),this},Pt.prototype.off=function(t,e){return At(t,e,this._listeners),At(t,e,this._oneTimeListeners),this},Pt.prototype.once=function(t,e){return this._oneTimeListeners=this._oneTimeListeners||{},It(t,e,this._oneTimeListeners),this},Pt.prototype.fire=function(t,e){"string"==typeof t&&(t=new Ct(t,e||{}));var r=t.type;if(this.listens(r)){for(var i=0,n=(t.target=this)._listeners&&this._listeners[r]?this._listeners[r].slice():[];i<n.length;i+=1)n[i].call(this,t);for(var o=0,a=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];o<a.length;o+=1){var s=a[o];At(r,s,this._oneTimeListeners),s.call(this,t)}(e=this._eventedParent)&&(h(t,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),e.fire(t))}else t instanceof kt&&console.error(t.error);return this},Pt.prototype.listens=function(t){return this._listeners&&this._listeners[t]&&0<this._listeners[t].length||this._oneTimeListeners&&this._oneTimeListeners[t]&&0<this._oneTimeListeners[t].length||this._eventedParent&&this._eventedParent.listens(t)};var Lt={$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:!(Pt.prototype.setEventedParent=function(t,e){return this._eventedParent=t,this._eventedParentData=e,this})},"*":{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"}}},Bt=function(t,e,r,i){this.message=(t?t+": ":"")+r,i&&(this.identifier=i),null!=e&&e.__line__&&(this.line=e.__line__)};function Dt(t){var e=t.value;return e?[new Bt(t.key,e,"constants have been deprecated as of v8")]:[]}function Rt(t){for(var e=[],r=arguments.length-1;0<r--;)e[r]=arguments[r+1];for(var i=0,n=e;i<n.length;i+=1){var o,a=n[i];for(o in a)t[o]=a[o]}return t}function Ot(t){return t instanceof Number||t instanceof String||t instanceof Boolean?t.valueOf():t}function Ft(t){if(Array.isArray(t))return t.map(Ft);if(t instanceof Object&&!(t instanceof Number||t instanceof String||t instanceof Boolean)){var e,r={};for(e in t)r[e]=Ft(t[e]);return r}return Ot(t)}function jt(t,e){void 0===e&&(e=[]),this.parent=t,this.bindings={};for(var r=0,i=e;r<i.length;r+=1){var n=i[r];this.bindings[n[0]]=n[1]}}var Ut,Nt=((Ut=Error)&&(Vt.__proto__=Ut),(Vt.prototype=Object.create(Ut&&Ut.prototype)).constructor=Vt);function Vt(t,e){Ut.call(this,e),this.message=e,this.key=t}jt.prototype.concat=function(t){return new jt(this,t)},jt.prototype.get=function(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(t+" not found in scope.")},jt.prototype.has=function(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)};var qt={kind:"null"},Gt={kind:"number"},Ht={kind:"string"},Zt={kind:"boolean"},Wt={kind:"color"},Xt={kind:"object"},Kt={kind:"value"},Jt={kind:"collator"},Yt={kind:"formatted"},Qt={kind:"resolvedImage"};function $t(t,e){return{kind:"array",itemType:t,N:e}}function te(t){if("array"!==t.kind)return t.kind;var e=te(t.itemType);return"number"==typeof t.N?"array<"+e+", "+t.N+">":"value"===t.itemType.kind?"array":"array<"+e+">"}var ee=[qt,Gt,Ht,Zt,Wt,Yt,Xt,$t(Kt),Qt];function re(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!re(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(var r=0,i=ee;r<i.length;r+=1)if(!re(i[r],e))return null}return"Expected "+te(t)+" but found "+te(e)+" instead."}function ie(t,e){return e.some((function(e){return e.kind===t.kind}))}function ne(t,e){return e.some((function(e){return"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t}))}var oe=e((function(t,e){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 i(t){return(t=Math.round(t))<0?0:255<t?255:t}function n(t){return i("%"===t[t.length-1]?parseFloat(t)/100*255:parseInt(t))}function o(t){return(t="%"===t[t.length-1]?parseFloat(t)/100:parseFloat(t))<0?0:1<t?1:t}function a(t,e,r){return r<0?r+=1:1<r&&--r,6*r<1?t+(e-t)*r*6:2*r<1?e:3*r<2?t+(e-t)*(2/3-r)*6:t}try{e.parseCSSColor=function(t){var e=t.replace(/ /g,"").toLowerCase();if(e in r)return r[e].slice();if("#"===e[0])return 4===e.length?0<=(u=parseInt(e.substr(1),16))&&u<=4095?[(3840&u)>>4|(3840&u)>>8,240&u|(240&u)>>4,15&u|(15&u)<<4,1]:null:7===e.length&&0<=(u=parseInt(e.substr(1),16))&&u<=16777215?[(16711680&u)>>16,(65280&u)>>8,255&u,1]:null;var s=e.indexOf("(");t=e.indexOf(")");if(-1!==s&&t+1===e.length){var u=e.substr(0,s),l=e.substr(s+1,t-(s+1)).split(","),c=1;switch(u){case"rgba":if(4!==l.length)return null;c=o(l.pop());case"rgb":return 3!==l.length?null:[n(l[0]),n(l[1]),n(l[2]),c];case"hsla":if(4!==l.length)return null;c=o(l.pop());case"hsl":if(3!==l.length)return null;var p,h=(parseFloat(l[0])%360+360)%360/360,f=o(l[1]);return[i(255*a(p=2*(p=o(l[2]))-(f=p<=.5?p*(f+1):p+f-p*f),f,h+1/3)),i(255*a(p,f,h)),i(255*a(p,f,h-1/3)),c];default:return null}}return null}}catch(t){}})).parseCSSColor,ae=function(t,e,r,i){void 0===i&&(i=1),this.r=t,this.g=e,this.b=r,this.a=i};ae.parse=function(t){if(t){if(t instanceof ae)return t;if("string"==typeof t&&(t=oe(t)))return new ae(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3])}},ae.prototype.toString=function(){var t=this.toArray(),e=t[1],r=t[2],i=t[3];return"rgba("+Math.round(t[0])+","+Math.round(e)+","+Math.round(r)+","+i+")"},ae.prototype.toArray=function(){var t=this.a;return 0===t?[0,0,0,0]:[255*this.r/t,255*this.g/t,255*this.b/t,t]},ae.black=new ae(0,0,0,1),ae.white=new ae(1,1,1,1),ae.transparent=new ae(0,0,0,0),ae.red=new ae(1,0,0,1);var se=function(t,e,r){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale||[],{sensitivity:this.sensitivity,usage:"search"})};function ue(t,e,r,i,n){this.text=t,this.image=e,this.scale=r,this.fontStack=i,this.textColor=n}se.prototype.compare=function(t,e){return this.collator.compare(t,e)},se.prototype.resolvedLocale=function(){return new Intl.Collator(this.locale||[]).resolvedOptions().locale};var le=function(t){this.sections=t};le.fromString=function(t){return new le([new ue(t,null,null,null,null)])},le.prototype.isEmpty=function(){return 0===this.sections.length||!this.sections.some((function(t){return 0!==t.text.length||t.image&&0!==t.image.name.length}))},le.factory=function(t){return t instanceof le?t:le.fromString(t)},le.prototype.toString=function(){return 0===this.sections.length?"":this.sections.map((function(t){return t.text})).join("")},le.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var i,n=r[e];n.image?t.push(["image",n.image.name]):(t.push(n.text),i={},n.fontStack&&(i["text-font"]=["literal",n.fontStack.split(",")]),n.scale&&(i["font-scale"]=n.scale),n.textColor&&(i["text-color"]=["rgba"].concat(n.textColor.toArray())),t.push(i))}return t};var ce=function(t){this.name=t.name,this.available=t.available};function pe(t,e,r,i){return"number"==typeof t&&0<=t&&t<=255&&"number"==typeof e&&0<=e&&e<=255&&"number"==typeof r&&0<=r&&r<=255?void 0===i||"number"==typeof i&&0<=i&&i<=1?null:"Invalid rgba value ["+[t,e,r,i].join(", ")+"]: 'a' must be between 0 and 1.":"Invalid rgba value ["+("number"==typeof i?[t,e,r,i]:[t,e,r]).join(", ")+"]: 'r', 'g', and 'b' must be between 0 and 255."}function he(t){if(null===t)return 1;if("string"==typeof t)return 1;if("boolean"==typeof t)return 1;if("number"==typeof t)return 1;if(t instanceof ae)return 1;if(t instanceof se)return 1;if(t instanceof le)return 1;if(t instanceof ce)return 1;if(Array.isArray(t)){for(var e=0,r=t;e<r.length;e+=1)if(!he(r[e]))return;return 1}if("object"==typeof t){for(var i in t)if(!he(t[i]))return;return 1}}function fe(t){if(null===t)return qt;if("string"==typeof t)return Ht;if("boolean"==typeof t)return Zt;if("number"==typeof t)return Gt;if(t instanceof ae)return Wt;if(t instanceof se)return Jt;if(t instanceof le)return Yt;if(t instanceof ce)return Qt;if(Array.isArray(t)){for(var e,r=t.length,i=0,n=t;i<n.length;i+=1){var o=fe(n[i]);if(e){if(e===o)continue;e=Kt;break}e=o}return $t(e||Kt,r)}return Xt}function de(t){var e=typeof t;return null===t?"":"string"==e||"number"==e||"boolean"==e?String(t):t instanceof ae||t instanceof le||t instanceof ce?t.toString():JSON.stringify(t)}function me(t,e){this.type=t,this.value=e}ce.prototype.toString=function(){return this.name},ce.fromString=function(t){return t?new ce({name:t,available:!1}):null},ce.prototype.serialize=function(){return["image",this.name]},me.parse=function(t,e){if(2!==t.length)return e.error("'literal' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(!he(t[1]))return e.error("invalid value");var r=t[1];t=fe(r),e=e.expectedType;return"array"!==t.kind||0!==t.N||!e||"array"!==e.kind||"number"==typeof e.N&&0!==e.N||(t=e),new me(t,r)},me.prototype.evaluate=function(){return this.value},me.prototype.eachChild=function(){},me.prototype.outputDefined=function(){return!0},me.prototype.serialize=function(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof ae?["rgba"].concat(this.value.toArray()):this.value instanceof le?this.value.serialize():this.value};var ye=function(t){this.name="ExpressionEvaluationError",this.message=t};function ge(t,e){this.type=t,this.args=e}ye.prototype.toJSON=function(){return this.message};var _e={string:Ht,number:Gt,boolean:Zt,object:Xt};function ve(t){this.type=Yt,this.sections=t}function xe(t){this.type=Qt,this.input=t}function be(t,e){this.type=t,this.args=e}ge.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r,i=1,n=t[0];if("array"===n){if(2<t.length){var o=t[1];if("string"!=typeof o||!(o in _e)||"object"===o)return e.error('The item type argument of "array" must be one of string, number, boolean',1);o=_e[o],i++}else o=Kt;if(3<t.length){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);r=t[2],i++}r=$t(o,r)}else r=_e[n];for(var a=[];i<t.length;i++){var s=e.parse(t[i],i,Kt);if(!s)return null;a.push(s)}return new ge(r,a)},ge.prototype.evaluate=function(t){for(var e=0;e<this.args.length;e++){var r=this.args[e].evaluate(t);if(!re(this.type,fe(r)))return r;if(e===this.args.length-1)throw new ye("Expected value to be of type "+te(this.type)+", but found "+te(fe(r))+" instead.")}return null},ge.prototype.eachChild=function(t){this.args.forEach(t)},ge.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},ge.prototype.serialize=function(){var t,e=this.type,r=[e.kind];return"array"===e.kind&&("string"!==(t=e.itemType).kind&&"number"!==t.kind&&"boolean"!==t.kind||(r.push(t.kind),("number"==typeof(e=e.N)||1<this.args.length)&&r.push(e))),r.concat(this.args.map((function(t){return t.serialize()})))},ve.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");var r=t[1];if(!Array.isArray(r)&&"object"==typeof r)return e.error("First argument must be an image or text section.");for(var i=[],n=!1,o=1;o<=t.length-1;++o){var a=t[o];if(n&&"object"==typeof a&&!Array.isArray(a)){n=!1;var s=null;if(a["font-scale"]&&!(s=e.parse(a["font-scale"],1,Gt)))return null;var u=null;if(a["text-font"]&&!(u=e.parse(a["text-font"],1,$t(Ht))))return null;var l=null;if(a["text-color"]&&!(l=e.parse(a["text-color"],1,Wt)))return null;var c=i[i.length-1];c.scale=s,c.font=u,c.textColor=l}else{if(!(c=e.parse(t[o],1,Kt)))return null;if("string"!==(l=c.type.kind)&&"value"!==l&&"null"!==l&&"resolvedImage"!==l)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,i.push({content:c,scale:null,font:null,textColor:null})}}return new ve(i)},ve.prototype.evaluate=function(t){return new le(this.sections.map((function(e){var r=e.content.evaluate(t);return fe(r)===Qt?new ue("",r,null,null,null):new ue(de(r),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null)})))},ve.prototype.eachChild=function(t){for(var e=0,r=this.sections;e<r.length;e+=1){var i=r[e];t(i.content),i.scale&&t(i.scale),i.font&&t(i.font),i.textColor&&t(i.textColor)}},ve.prototype.outputDefined=function(){return!1},ve.prototype.serialize=function(){for(var t=["format"],e=0,r=this.sections;e<r.length;e+=1){var i=r[e];t.push(i.content.serialize());var n={};i.scale&&(n["font-scale"]=i.scale.serialize()),i.font&&(n["text-font"]=i.font.serialize()),i.textColor&&(n["text-color"]=i.textColor.serialize()),t.push(n)}return t},xe.parse=function(t,e){return 2!==t.length?e.error("Expected two arguments."):(t=e.parse(t[1],1,Ht))?new xe(t):e.error("No image name provided.")},xe.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=ce.fromString(e);return r&&t.availableImages&&(r.available=-1<t.availableImages.indexOf(e)),r},xe.prototype.eachChild=function(t){t(this.input)},xe.prototype.outputDefined=function(){return!1},xe.prototype.serialize=function(){return["image",this.input.serialize()]};var we={"to-boolean":Zt,"to-color":Wt,"to-number":Gt,"to-string":Ht};function Se(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}be.parse=function(t,e){if(t.length<2)return e.error("Expected at least one argument.");if(("to-boolean"===(r=t[0])||"to-string"===r)&&2!==t.length)return e.error("Expected one argument.");for(var r=we[r],i=[],n=1;n<t.length;n++){var o=e.parse(t[n],n,Kt);if(!o)return null;i.push(o)}return new be(r,i)},be.prototype.evaluate=function(t){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(t));if("color"===this.type.kind){for(var e,r,i=0,n=this.args;i<n.length;i+=1){if(r=null,(e=n[i].evaluate(t))instanceof ae)return e;if("string"==typeof e){var o=t.parseColor(e);if(o)return o}else if(Array.isArray(e)&&!(r=e.length<3||4<e.length?"Invalid rbga value "+JSON.stringify(e)+": expected an array containing either three or four numeric values.":pe(e[0],e[1],e[2],e[3])))return new ae(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new ye(r||"Could not parse color from value '"+("string"==typeof e?e:String(JSON.stringify(e)))+"'")}if("number"!==this.type.kind)return"formatted"===this.type.kind?le.fromString(de(this.args[0].evaluate(t))):"resolvedImage"===this.type.kind?ce.fromString(de(this.args[0].evaluate(t))):de(this.args[0].evaluate(t));for(var a=null,s=0,u=this.args;s<u.length;s+=1){if(null===(a=u[s].evaluate(t)))return 0;var l=Number(a);if(!isNaN(l))return l}throw new ye("Could not convert "+JSON.stringify(a)+" to number.")},be.prototype.eachChild=function(t){this.args.forEach(t)},be.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},be.prototype.serialize=function(){if("formatted"===this.type.kind)return new ve([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new xe(this.args[0]).serialize();var t=["to-"+this.type.kind];return this.eachChild((function(e){t.push(e.serialize())})),t};var Te=["Unknown","Point","LineString","Polygon"];Se.prototype.id=function(){return this.feature&&"id"in this.feature?this.feature.id:null},Se.prototype.geometryType=function(){return this.feature?"number"==typeof this.feature.type?Te[this.feature.type]:this.feature.type:null},Se.prototype.geometry=function(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null},Se.prototype.canonicalID=function(){return this.canonical},Se.prototype.properties=function(){return this.feature&&this.feature.properties||{}},Se.prototype.parseColor=function(t){return this._parseColorCache[t]||(this._parseColorCache[t]=ae.parse(t))};var Ee=function(t,e,r,i){this.name=t,this.type=e,this._evaluate=r,this.args=i};function Ie(t,e,r){this.type=Jt,this.locale=r,this.caseSensitive=t,this.diacriticSensitive=e}function Ae(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function Ce(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function Pe(t,e){for(var r,i,n,o,a=!1,s=0,u=e.length;s<u;s++)for(var l=e[s],c=0,p=l.length;c<p-1;c++){if((r=t[0]-(n=l[c])[0])*(o=t[1]-(i=l[c+1])[1])-(i=t[0]-i[0])*(n=t[1]-n[1])==0&&r*i<=0&&n*o<=0)return;i=t,n=l[c],o=l[c+1],n[1]>i[1]!=o[1]>i[1]&&i[0]<(o[0]-n[0])*(i[1]-n[1])/(o[1]-n[1])+n[0]&&(a=!a)}return a}function Me(t,e,r,i){var n=i[0]-r[0];i=i[1]-r[1],t=(t[0]-r[0])*i-n*(t[1]-r[1]),r=(e[0]-r[0])*i-n*(e[1]-r[1]);return 0<t&&r<0||t<0&&0<r}function ke(t,e){for(var r=0;r<t.length;++r)if(!Pe(t[r],e))return;for(var i=0;i<t.length-1;++i)if(function(t,e,r){for(var i,n,o,a,s=0,u=r;s<u.length;s+=1)for(var l=u[s],c=0;c<l.length-1;++c)if(0!=(o=[(n=l[c+1])[0]-(i=l[c])[0],n[1]-i[1]])[0]*(a=[e[0]-t[0],e[1]-t[1]])[1]-o[1]*a[0]&&Me(t,e,i,n)&&Me(i,n,t,e))return 1}(t[i],t[i+1],e))return;return 1}function ze(t,e,r){for(var i,n,o=[],a=0;a<t.length;a++){for(var s=[],u=0;u<t[a].length;u++){var l=(l=r,void 0,n=(180+(i=t[a][u])[0])/360,i=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+i[1]*Math.PI/360)))/360,l=Math.pow(2,l.z),[Math.round(n*l*8192),Math.round(i*l*8192)]);Ae(e,l),s.push(l)}o.push(s)}return o}function Le(t,e,r){for(var i=[],n=0;n<t.length;n++){var o=ze(t[n],e,r);i.push(o)}return i}function Be(t,e,r,i){var n,o;(t[0]<r[0]||t[0]>r[2])&&(n=.5*i,0===(o=t[0]-r[0]>n?-i:r[0]-t[0]>n?i:0)&&(o=t[0]-r[2]>n?-i:r[2]-t[0]>n?i:0),t[0]+=o),Ae(e,t)}function De(t,e,r,i){for(var n=8192*Math.pow(2,i.z),o=[8192*i.x,8192*i.y],a=[],s=0,u=t;s<u.length;s+=1)for(var l=0,c=u[s];l<c.length;l+=1){var p;Be(p=[(p=c[l]).x+o[0],p.y+o[1]],e,r,n),a.push(p)}return a}function Re(t,e,r,i){for(var n=8192*Math.pow(2,i.z),o=[8192*i.x,8192*i.y],a=[],s=0,u=t;s<u.length;s+=1){for(var l=[],c=0,p=u[s];c<p.length;c+=1){var h;Ae(e,h=[(h=p[c]).x+o[0],h.y+o[1]]),l.push(h)}a.push(l)}if(e[2]-e[0]<=n/2){(t=e)[0]=t[1]=1/0,t[2]=t[3]=-1/0;for(var f=0,d=a;f<d.length;f+=1)for(var m=0,y=d[f];m<y.length;m+=1)Be(y[m],e,r,n)}return a}Ee.prototype.evaluate=function(t){return this._evaluate(t,this.args)},Ee.prototype.eachChild=function(t){this.args.forEach(t)},Ee.prototype.outputDefined=function(){return!1},Ee.prototype.serialize=function(){return[this.name].concat(this.args.map((function(t){return t.serialize()})))},Ee.parse=function(t,e){var r=t[0],i=Ee.definitions[r];if(!i)return e.error('Unknown expression "'+r+'". If you wanted a literal array, use ["literal", [...]].',0);for(var n=Array.isArray(i)?i[0]:i.type,o=(v=Array.isArray(i)?[[i[1],i[2]]]:i.overloads).filter((function(e){return e=e[0],!Array.isArray(e)||e.length===t.length-1})),a=null,s=0,u=o;s<u.length;s+=1){for(var l=(c=u[s])[0],c=c[1],p=(a=new Ve(e.registry,e.path,null,e.scope),[]),h=!1,f=1;f<t.length;f++){var d=t[f],m=Array.isArray(l)?l[f-1]:l.type;if(!(m=a.parse(d,1+p.length,m))){h=!0;break}p.push(m)}if(!h)if(Array.isArray(l)&&l.length!==p.length)a.error("Expected "+l.length+" arguments, but found "+p.length+" instead.");else{for(var y=0;y<p.length;y++){var g=Array.isArray(l)?l[y]:l.type,_=p[y];a.concat(y+1).checkSubtype(g,_.type)}if(0===a.errors.length)return new Ee(r,n,c,p)}}if(1===o.length)(i=e.errors).push.apply(i,a.errors);else{for(var v=(o.length?o:v).map((function(t){return t=t[0],Array.isArray(t)?"("+t.map(te).join(", ")+")":"("+te(t.type)+"...)"})).join(" | "),x=[],b=1;b<t.length;b++){var w=e.parse(t[b],1+x.length);if(!w)return null;x.push(te(w.type))}e.error("Expected arguments of type "+v+", but found ("+x.join(", ")+") instead.")}return null},Ee.register=function(t,e){for(var r in Ee.definitions=e)t[r]=Ee},Ie.parse=function(t,e){if(2!==t.length)return e.error("Expected one argument.");var r=t[1];if("object"!=typeof r||Array.isArray(r))return e.error("Collator options argument must be an object.");var i=e.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,Zt);if(!i)return null;var n=e.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,Zt);return n?(t=null,r.locale&&!(t=e.parse(r.locale,1,Ht))?null:new Ie(i,n,t)):null},Ie.prototype.evaluate=function(t){return new se(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)},Ie.prototype.eachChild=function(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)},Ie.prototype.outputDefined=function(){return!1},Ie.prototype.serialize=function(){var t={};return t["case-sensitive"]=this.caseSensitive.serialize(),t["diacritic-sensitive"]=this.diacriticSensitive.serialize(),this.locale&&(t.locale=this.locale.serialize()),["collator",t]};var Oe=function(t,e){this.type=Zt,this.geojson=t,this.geometries=e};function Fe(t){if(t instanceof Ee){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof Oe)return!1;var e=!0;return t.eachChild((function(t){e&&!Fe(t)&&(e=!1)})),e}function je(t){if(!(t instanceof Ee&&"feature-state"===t.name)){var e=!0;return t.eachChild((function(t){e&&!je(t)&&(e=!1)})),e}}function Ue(t,e){if(t instanceof Ee&&0<=e.indexOf(t.name))return!1;var r=!0;return t.eachChild((function(t){r&&!Ue(t,e)&&(r=!1)})),r}function Ne(t,e){this.type=e.type,this.name=t,this.boundExpression=e}Oe.parse=function(t,e){if(2!==t.length)return e.error("'within' expression requires exactly one argument, but found "+(t.length-1)+" instead.");if(he(t[1])){var r=t[1];if("FeatureCollection"===r.type)for(var i=0;i<r.features.length;++i){var n=r.features[i].geometry.type;if("Polygon"===n||"MultiPolygon"===n)return new Oe(r,r.features[i].geometry)}else if("Feature"===r.type){if("Polygon"===(t=r.geometry.type)||"MultiPolygon"===t)return new Oe(r,r.geometry)}else if("Polygon"===r.type||"MultiPolygon"===r.type)return new Oe(r,r)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")},Oe.prototype.evaluate=function(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){var o=ze(e.coordinates,i,n),a=De(t.geometry(),r,i,n);if(!Ce(r,i))return!1;for(var s=0,u=a;s<u.length;s+=1)if(!Pe(u[s],o))return!1}if("MultiPolygon"===e.type){var l=Le(e.coordinates,i,n);n=De(t.geometry(),r,i,n);if(!Ce(r,i))return!1;for(var c=0,p=n;c<p.length;c+=1)if(!function(t,e){for(var r=0;r<e.length;r++)if(Pe(t,e[r]))return 1}(p[c],l))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){var r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=t.canonicalID();if("Polygon"===e.type){var o=ze(e.coordinates,i,n),a=Re(t.geometry(),r,i,n);if(!Ce(r,i))return!1;for(var s=0,u=a;s<u.length;s+=1)if(!ke(u[s],o))return!1}if("MultiPolygon"===e.type){var l=Le(e.coordinates,i,n);n=Re(t.geometry(),r,i,n);if(!Ce(r,i))return!1;for(var c=0,p=n;c<p.length;c+=1)if(!function(t,e){for(var r=0;r<e.length;r++)if(ke(t,e[r]))return 1}(p[c],l))return!1}return!0}(t,this.geometries)}return!1},Oe.prototype.eachChild=function(){},Oe.prototype.outputDefined=function(){return!0},Oe.prototype.serialize=function(){return["within",this.geojson]},Ne.parse=function(t,e){return 2!==t.length||"string"!=typeof t[1]?e.error("'var' expression requires exactly one string literal argument."):(t=t[1],e.scope.has(t)?new Ne(t,e.scope.get(t)):e.error('Unknown variable "'+t+'". Make sure "'+t+'" has been bound in an enclosing "let" expression before using it.',1))},Ne.prototype.evaluate=function(t){return this.boundExpression.evaluate(t)},Ne.prototype.eachChild=function(){},Ne.prototype.outputDefined=function(){return!1},Ne.prototype.serialize=function(){return["var",this.name]};var Ve=function(t,e,r,i,n){void 0===e&&(e=[]),void 0===i&&(i=new jt),void 0===n&&(n=[]),this.registry=t,this.path=e,this.key=e.map((function(t){return"["+t+"]"})).join(""),this.scope=i,this.errors=n,this.expectedType=r};function qe(t,e){for(var r,i,n=t.length-1,o=0,a=n;o<=a;)if((r=t[i=Math.floor((o+a)/2)])<=e){if(i===n||e<t[i+1])return i;o=i+1}else{if(!(e<r))throw new ye("Input is not a number.");a=i-1}return 0}Ve.prototype.parse=function(t,e,r,i,n){return void 0===n&&(n={}),(e?this.concat(e,r,i):this)._parse(t,n)},Ve.prototype._parse=function(t,e){function r(t,e,r){return"assert"===r?new ge(e,[t]):"coerce"===r?new be(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');var i=t[0];if("string"!=typeof i)return this.error("Expression name must be a string, but found "+typeof i+' instead. If you wanted a literal array, use ["literal", [...]].',0),null;if(a=this.registry[i]){var n=a.parse(t,this);if(!n)return null;if(this.expectedType){var o=this.expectedType,a=n.type;if("string"!==o.kind&&"number"!==o.kind&&"boolean"!==o.kind&&"object"!==o.kind&&"array"!==o.kind||"value"!==a.kind)if("color"!==o.kind&&"formatted"!==o.kind&&"resolvedImage"!==o.kind||"value"!==a.kind&&"string"!==a.kind){if(this.checkSubtype(o,a))return null}else n=r(n,o,e.typeAnnotation||"coerce");else n=r(n,o,e.typeAnnotation||"assert")}if(!(n instanceof me)&&"resolvedImage"!==n.type.kind&&function t(e){if(e instanceof Ne)return t(e.boundExpression);if(e instanceof Ee&&"error"===e.name)return!1;if(e instanceof Ie)return!1;if(e instanceof Oe)return!1;var r=e instanceof be||e instanceof ge,i=!0;return e.eachChild((function(e){i=r?i&&t(e):i&&e instanceof me})),!!i&&Fe(e)&&Ue(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}(n)){var s=new Se;try{n=new me(n.type,n.evaluate(s))}catch(t){return this.error(t.message),null}}return n}return this.error('Unknown expression "'+i+'". If you wanted a literal array, use ["literal", [...]].',0)}return this.error(void 0===t?"'undefined' value invalid. Use null instead.":"object"==typeof t?'Bare objects invalid. Use ["literal", {...}] instead.':"Expected an array, but found "+typeof t+" instead.")},Ve.prototype.concat=function(t,e,r){return t="number"==typeof t?this.path.concat(t):this.path,r=r?this.scope.concat(r):this.scope,new Ve(this.registry,t,e||null,r,this.errors)},Ve.prototype.error=function(t){for(var e=[],r=arguments.length-1;0<r--;)e[r]=arguments[r+1];var i=""+this.key+e.map((function(t){return"["+t+"]"})).join("");this.errors.push(new Nt(i,t))},Ve.prototype.checkSubtype=function(t,e){return(e=re(t,e))&&this.error(e),e};var Ge=function(t,e,r){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(var i=0,n=r;i<n.length;i+=1){var o=n[i],a=o[1];this.labels.push(o[0]),this.outputs.push(a)}};function He(t,e,r){return t*(1-r)+e*r}Ge.parse=function(t,e){if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");var r=e.parse(t[1],1,Gt);if(!r)return null;var i=[],n=null;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);for(var o=1;o<t.length;o+=2){var a=1===o?-1/0:t[o],s=t[o+1],u=o,l=o+1;if("number"!=typeof a)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',u);if(i.length&&i[i.length-1][0]>=a)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',u);if(!(l=e.parse(s,l,n)))return null;n=n||l.type,i.push([a,l])}return new Ge(n,r,i)},Ge.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);var n=e.length;return(i>=e[n-1]?r[n-1]:r[qe(e,i)]).evaluate(t)},Ge.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},Ge.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},Ge.prototype.serialize=function(){for(var t=["step",this.input.serialize()],e=0;e<this.labels.length;e++)0<e&&t.push(this.labels[e]),t.push(this.outputs[e].serialize());return t};var Ze=Object.freeze({__proto__:null,number:He,color:function(t,e,r){return new ae(He(t.r,e.r,r),He(t.g,e.g,r),He(t.b,e.b,r),He(t.a,e.a,r))},array:function(t,e,r){return t.map((function(t,i){return He(t,e[i],r)}))}}),We=6/29*3*(6/29),Xe=Math.PI/180,Ke=180/Math.PI;function Je(t){return.008856451679035631<t?Math.pow(t,1/3):t/We+4/29}function Ye(t){return 6/29<t?t*t*t:We*(t-4/29)}function Qe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function $e(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function tr(t){var e=$e(t.r),r=$e(t.g),i=$e(t.b),n=Je((.4124564*e+.3575761*r+.1804375*i)/.95047),o=Je(.2126729*e+.7151522*r+.072175*i);return{l:116*o-16,a:500*(n-o),b:200*(o-Je((.0193339*e+.119192*r+.9503041*i)/1.08883)),alpha:t.a}}function er(t){var e=(t.l+16)/116,r=isNaN(t.a)?e:e+t.a/500,i=isNaN(t.b)?e:e-t.b/200;e=+Ye(e),r=.95047*Ye(r),i=1.08883*Ye(i);return new ae(Qe(3.2404542*r-1.5371385*e-.4985314*i),Qe(-.969266*r+1.8760108*e+.041556*i),Qe(.0556434*r-.2040259*e+1.0572252*i),t.alpha)}var rr={forward:tr,reverse:er,interpolate:function(t,e,r){return{l:He(t.l,e.l,r),a:He(t.a,e.a,r),b:He(t.b,e.b,r),alpha:He(t.alpha,e.alpha,r)}}},ir={forward:function(t){var e,r=(e=tr(t)).l,i=e.a,n=e.b;return{h:(e=Math.atan2(n,i)*Ke)<0?360+e:e,c:Math.sqrt(i*i+n*n),l:r,alpha:t.a}},reverse:function(t){var e=t.h*Xe,r=t.c;return er({l:t.l,a:Math.cos(e)*r,b:Math.sin(e)*r,alpha:t.alpha})},interpolate:function(t,e,r){return{h:(i=t.h,n=e.h,i+r*(180<(n-=i)||n<-180?n-360*Math.round(n/360):n)),c:He(t.c,e.c,r),l:He(t.l,e.l,r),alpha:He(t.alpha,e.alpha,r)};var i,n}},nr=Object.freeze({__proto__:null,lab:rr,hcl:ir}),or=function(t,e,r,i,n){this.type=t,this.operator=e,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];for(var o=0,a=n;o<a.length;o+=1){var s=a[o],u=s[1];this.labels.push(s[0]),this.outputs.push(u)}};function ar(t,e,r,i){return i-=r,r=t-r,0==i?0:1===e?r/i:(Math.pow(e,r)-1)/(Math.pow(e,i)-1)}or.interpolationFactor=function(t,e,i,n){var o=0;return"exponential"===t.name?o=ar(e,t.base,i,n):"linear"===t.name?o=ar(e,1,i,n):"cubic-bezier"===t.name&&(t=t.controlPoints,o=new r(t[0],t[1],t[2],t[3]).solve(ar(e,1,i,n))),o},or.parse=function(t,e){var r=t[0],i=t[1],n=t[2],o=t.slice(3);if(!Array.isArray(i)||0===i.length)return e.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){var a=i[1];if("number"!=typeof a)return e.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:a}}else{if("cubic-bezier"!==i[0])return e.error("Unknown interpolation type "+String(i[0]),1,0);if(4!==(a=i.slice(1)).length||a.some((function(t){return"number"!=typeof t||t<0||1<t})))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:a}}if(t.length-1<4)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(!(n=e.parse(n,2,Gt)))return null;var s=[],u=null;"interpolate-hcl"===r||"interpolate-lab"===r?u=Wt:e.expectedType&&"value"!==e.expectedType.kind&&(u=e.expectedType);for(var l=0;l<o.length;l+=2){var c=o[l],p=o[l+1],h=l+3,f=l+4;if("number"!=typeof c)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',h);if(s.length&&s[s.length-1][0]>=c)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',h);if(!(f=e.parse(p,f,u)))return null;u=u||f.type,s.push([c,f])}return"number"===u.kind||"color"===u.kind||"array"===u.kind&&"number"===u.itemType.kind&&"number"==typeof u.N?new or(u,r,i,n,s):e.error("Type "+te(u)+" is not interpolatable.")},or.prototype.evaluate=function(t){var e=this.labels,r=this.outputs;if(1===e.length)return r[0].evaluate(t);var i=this.input.evaluate(t);if(i<=e[0])return r[0].evaluate(t);var n=e.length;return i>=e[n-1]?r[n-1].evaluate(t):(n=qe(e,i),i=or.interpolationFactor(this.interpolation,i,e[n],e[n+1]),e=r[n].evaluate(t),t=r[n+1].evaluate(t),"interpolate"===this.operator?Ze[this.type.kind.toLowerCase()](e,t,i):"interpolate-hcl"===this.operator?ir.reverse(ir.interpolate(ir.forward(e),ir.forward(t),i)):rr.reverse(rr.interpolate(rr.forward(e),rr.forward(t),i)))},or.prototype.eachChild=function(t){t(this.input);for(var e=0,r=this.outputs;e<r.length;e+=1)t(r[e])},or.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))},or.prototype.serialize=function(){for(var t="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints),e=[this.operator,t,this.input.serialize()],r=0;r<this.labels.length;r++)e.push(this.labels[r],this.outputs[r].serialize());return e};var sr=function(t,e){this.type=t,this.args=e};sr.parse=function(t,e){if(t.length<2)return e.error("Expectected at least one argument.");var r=null,i=e.expectedType;i&&"value"!==i.kind&&(r=i);for(var n=[],o=0,a=t.slice(1);o<a.length;o+=1){var s=e.parse(a[o],1+n.length,r,void 0,{typeAnnotation:"omit"});if(!s)return null;r=r||s.type,n.push(s)}return t=i&&n.some((function(t){return re(i,t.type)})),new sr(t?Kt:r,n)},sr.prototype.evaluate=function(t){for(var e,r=null,i=0,n=0,o=this.args;n<o.length&&(i++,(r=o[n].evaluate(t))&&r instanceof ce&&!r.available&&(e=e||r.name,r=null,i===this.args.length&&(r=e)),null===r);n+=1);return r},sr.prototype.eachChild=function(t){this.args.forEach(t)},sr.prototype.outputDefined=function(){return this.args.every((function(t){return t.outputDefined()}))},sr.prototype.serialize=function(){var t=["coalesce"];return this.eachChild((function(e){t.push(e.serialize())})),t};var ur=function(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e};function lr(t,e,r){this.type=t,this.index=e,this.input=r}function cr(t,e){this.type=Zt,this.needle=t,this.haystack=e}function pr(t,e,r){this.type=Gt,this.needle=t,this.haystack=e,this.fromIndex=r}function hr(t,e,r,i,n,o){this.inputType=t,this.type=e,this.input=r,this.cases=i,this.outputs=n,this.otherwise=o}function fr(t,e,r){this.type=t,this.branches=e,this.otherwise=r}function dr(t,e,r,i){this.type=t,this.input=e,this.beginIndex=r,this.endIndex=i}function mr(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function yr(t,e,r,i){return 0===i.compare(e,r)}function gr(t,e,r){var i="=="!==t&&"!="!==t;return n.parse=function(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");var r=t[0],o=e.parse(t[1],1,Kt);if(!o)return null;if(!mr(r,o.type))return e.concat(1).error('"'+r+"\" comparisons are not supported for type '"+te(o.type)+"'.");var a=e.parse(t[2],2,Kt);if(!a)return null;if(!mr(r,a.type))return e.concat(2).error('"'+r+"\" comparisons are not supported for type '"+te(a.type)+"'.");if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot compare types '"+te(o.type)+"' and '"+te(a.type)+"'.");if(i&&("value"===o.type.kind&&"value"!==a.type.kind?o=new ge(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new ge(o.type,[a]))),r=null,4===t.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return e.error("Cannot use collator to compare non-string types.");if(!(r=e.parse(t[3],3,Jt)))return null}return new n(o,a,r)},n.prototype.evaluate=function(n){var o=this.lhs.evaluate(n),a=this.rhs.evaluate(n);if(i&&this.hasUntypedArgument){var s=fe(o),u=fe(a);if(s.kind!==u.kind||"string"!==s.kind&&"number"!==s.kind)throw new ye('Expected arguments for "'+t+'" to be (string, string) or (number, number), but found ('+s.kind+", "+u.kind+") instead.")}return this.collator&&!i&&this.hasUntypedArgument&&(s=fe(o),u=fe(a),"string"!==s.kind||"string"!==u.kind)?e(n,o,a):this.collator?r(n,o,a,this.collator.evaluate(n)):e(n,o,a)},n.prototype.eachChild=function(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)},n.prototype.outputDefined=function(){return!0},n.prototype.serialize=function(){var e=[t];return this.eachChild((function(t){e.push(t.serialize())})),e},n;function n(t,e,r){this.type=Zt,this.lhs=t,this.rhs=e,this.collator=r,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}}function _r(t,e,r,i,n){this.type=Ht,this.number=t,this.locale=e,this.currency=r,this.minFractionDigits=i,this.maxFractionDigits=n}ur.prototype.evaluate=function(t){return this.result.evaluate(t)},ur.prototype.eachChild=function(t){for(var e=0,r=this.bindings;e<r.length;e+=1)t(r[e][1]);t(this.result)},ur.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found "+(t.length-1)+" instead.");for(var r=[],i=1;i<t.length-1;i+=2){var n=t[i];if("string"!=typeof n)return e.error("Expected string, but found "+typeof n+" instead.",i);if(/[^a-zA-Z0-9_]/.test(n))return e.error("Variable names must contain only alphanumeric characters or '_'.",i);var o=e.parse(t[i+1],i+1);if(!o)return null;r.push([n,o])}var a=e.parse(t[t.length-1],t.length-1,e.expectedType,r);return a?new ur(r,a):null},ur.prototype.outputDefined=function(){return this.result.outputDefined()},ur.prototype.serialize=function(){for(var t=["let"],e=0,r=this.bindings;e<r.length;e+=1){var i=r[e];t.push(i[0],i[1].serialize())}return t.push(this.result.serialize()),t},lr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Gt);e=e.parse(t[2],2,$t(e.expectedType||Kt));return r&&e?new lr(e.type.itemType,r,e):null},lr.prototype.evaluate=function(t){var e=this.index.evaluate(t);t=this.input.evaluate(t);if(e<0)throw new ye("Array index out of bounds: "+e+" < 0.");if(e>=t.length)throw new ye("Array index out of bounds: "+e+" > "+(t.length-1)+".");if(e!==Math.floor(e))throw new ye("Array index must be an integer, but found "+e+" instead.");return t[e]},lr.prototype.eachChild=function(t){t(this.index),t(this.input)},lr.prototype.outputDefined=function(){return!1},lr.prototype.serialize=function(){return["at",this.index.serialize(),this.input.serialize()]},cr.parse=function(t,e){if(3!==t.length)return e.error("Expected 2 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Kt);t=e.parse(t[2],2,Kt);return r&&t?ie(r.type,[Zt,Ht,Gt,qt,Kt])?new cr(r,t):e.error("Expected first argument to be of type boolean, string, number or null, but found "+te(r.type)+" instead"):null},cr.prototype.evaluate=function(t){var e=this.needle.evaluate(t);if(!(t=this.haystack.evaluate(t)))return!1;if(!ne(e,["boolean","string","number","null"]))throw new ye("Expected first argument to be of type boolean, string, number or null, but found "+te(fe(e))+" instead.");if(!ne(t,["string","array"]))throw new ye("Expected second argument to be of type array or string, but found "+te(fe(t))+" instead.");return 0<=t.indexOf(e)},cr.prototype.eachChild=function(t){t(this.needle),t(this.haystack)},cr.prototype.outputDefined=function(){return!0},cr.prototype.serialize=function(){return["in",this.needle.serialize(),this.haystack.serialize()]},pr.parse=function(t,e){if(t.length<=2||5<=t.length)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Kt),i=e.parse(t[2],2,Kt);return r&&i?ie(r.type,[Zt,Ht,Gt,qt,Kt])?4!==t.length?new pr(r,i):(t=e.parse(t[3],3,Gt))?new pr(r,i,t):null:e.error("Expected first argument to be of type boolean, string, number or null, but found "+te(r.type)+" instead"):null},pr.prototype.evaluate=function(t){var e=this.needle.evaluate(t),r=this.haystack.evaluate(t);if(!ne(e,["boolean","string","number","null"]))throw new ye("Expected first argument to be of type boolean, string, number or null, but found "+te(fe(e))+" instead.");if(!ne(r,["string","array"]))throw new ye("Expected second argument to be of type array or string, but found "+te(fe(r))+" instead.");return this.fromIndex?(t=this.fromIndex.evaluate(t),r.indexOf(e,t)):r.indexOf(e)},pr.prototype.eachChild=function(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)},pr.prototype.outputDefined=function(){return!1},pr.prototype.serialize=function(){if(null==this.fromIndex||void 0===this.fromIndex)return["index-of",this.needle.serialize(),this.haystack.serialize()];var t=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),t]},hr.parse=function(t,e){if(t.length<5)return e.error("Expected at least 4 arguments, but found only "+(t.length-1)+".");if(t.length%2!=1)return e.error("Expected an even number of arguments.");var r,i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);for(var n={},o=[],a=2;a<t.length-1;a+=2){var s=t[a],u=t[a+1];Array.isArray(s)||(s=[s]);var l=e.concat(a);if(0===s.length)return l.error("Expected at least one branch label.");for(var c=0,p=s;c<p.length;c+=1){var h=p[c];if("number"!=typeof h&&"string"!=typeof h)return l.error("Branch labels must be numbers or strings.");if("number"==typeof h&&Math.abs(h)>Number.MAX_SAFE_INTEGER)return l.error("Branch labels must be integers no larger than "+Number.MAX_SAFE_INTEGER+".");if("number"==typeof h&&Math.floor(h)!==h)return l.error("Numeric branch labels must be integer values.");if(r){if(l.checkSubtype(r,fe(h)))return null}else r=fe(h);if(void 0!==n[String(h)])return l.error("Branch labels must be unique.");n[String(h)]=o.length}if(!(u=e.parse(u,a,i)))return null;i=i||u.type,o.push(u)}var f=e.parse(t[1],1,Kt);if(!f)return null;var d=e.parse(t[t.length-1],t.length-1,i);return!d||"value"!==f.type.kind&&e.concat(1).checkSubtype(r,f.type)?null:new hr(r,i,f,n,o,d)},hr.prototype.evaluate=function(t){var e=this.input.evaluate(t);return(fe(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)},hr.prototype.eachChild=function(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)},hr.prototype.outputDefined=function(){return this.outputs.every((function(t){return t.outputDefined()}))&&this.otherwise.outputDefined()},hr.prototype.serialize=function(){for(var t=this,e=["match",this.input.serialize()],r=[],i={},n=0,o=Object.keys(this.cases).sort();n<o.length;n+=1){var a=o[n];void 0===(c=i[this.cases[a]])?(i[this.cases[a]]=r.length,r.push([this.cases[a],[a]])):r[c][1].push(a)}for(var s=function(e){return"number"===t.inputType.kind?Number(e):e},u=0,l=r;u<l.length;u+=1){var c=(p=l[u])[0],p=p[1];e.push(1===p.length?s(p[0]):p.map(s)),e.push(this.outputs[outputIndex$1].serialize())}return e.push(this.otherwise.serialize()),e},fr.parse=function(t,e){if(t.length<4)return e.error("Expected at least 3 arguments, but found only "+(t.length-1)+".");if(t.length%2!=0)return e.error("Expected an odd number of arguments.");var r;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(var i=[],n=1;n<t.length-1;n+=2){var o=e.parse(t[n],n,Zt);if(!o)return null;var a=e.parse(t[n+1],n+1,r);if(!a)return null;i.push([o,a]),r=r||a.type}var s=e.parse(t[t.length-1],t.length-1,r);return s?new fr(r,i,s):null},fr.prototype.evaluate=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var i=r[e],n=i[1];if(i[0].evaluate(t))return n.evaluate(t)}return this.otherwise.evaluate(t)},fr.prototype.eachChild=function(t){for(var e=0,r=this.branches;e<r.length;e+=1){var i=r[e],n=i[1];t(i[0]),t(n)}t(this.otherwise)},fr.prototype.outputDefined=function(){return this.branches.every((function(t){return t[1].outputDefined()}))&&this.otherwise.outputDefined()},fr.prototype.serialize=function(){var t=["case"];return this.eachChild((function(e){t.push(e.serialize())})),t},dr.parse=function(t,e){if(t.length<=2||5<=t.length)return e.error("Expected 3 or 4 arguments, but found "+(t.length-1)+" instead.");var r=e.parse(t[1],1,Kt),i=e.parse(t[2],2,Gt);return r&&i?ie(r.type,[$t(Kt),Ht,Kt])?4!==t.length?new dr(r.type,r,i):(t=e.parse(t[3],3,Gt))?new dr(r.type,r,i,t):null:e.error("Expected first argument to be of type array or string, but found "+te(r.type)+" instead"):null},dr.prototype.evaluate=function(t){var e=this.input.evaluate(t),r=this.beginIndex.evaluate(t);if(!ne(e,["string","array"]))throw new ye("Expected first argument to be of type array or string, but found "+te(fe(e))+" instead.");return this.endIndex?(t=this.endIndex.evaluate(t),e.slice(r,t)):e.slice(r)},dr.prototype.eachChild=function(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)},dr.prototype.outputDefined=function(){return!1},dr.prototype.serialize=function(){if(null==this.endIndex||void 0===this.endIndex)return["slice",this.input.serialize(),this.beginIndex.serialize()];var t=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),t]};var vr=gr("==",(function(t,e,r){return e===r}),yr),xr=gr("!=",(function(t,e,r){return e!==r}),(function(t,e,r,i){return!yr(0,e,r,i)})),br=gr("<",(function(t,e,r){return e<r}),(function(t,e,r,i){return i.compare(e,r)<0})),wr=gr(">",(function(t,e,r){return r<e}),(function(t,e,r,i){return 0<i.compare(e,r)})),Sr=gr("<=",(function(t,e,r){return e<=r}),(function(t,e,r,i){return i.compare(e,r)<=0})),Tr=gr(">=",(function(t,e,r){return r<=e}),(function(t,e,r,i){return 0<=i.compare(e,r)}));function Er(t){this.type=Gt,this.input=t}_r.parse=function(t,e){if(3!==t.length)return e.error("Expected two arguments.");var r=e.parse(t[1],1,Gt);if(!r)return null;var i=t[2];if("object"!=typeof i||Array.isArray(i))return e.error("NumberFormat options argument must be an object.");var n=null;if(i.locale&&!(n=e.parse(i.locale,1,Ht)))return null;var o=null;if(i.currency&&!(o=e.parse(i.currency,1,Ht)))return null;var a=null;return i["min-fraction-digits"]&&!(a=e.parse(i["min-fraction-digits"],1,Gt))?null:(t=null,i["max-fraction-digits"]&&!(t=e.parse(i["max-fraction-digits"],1,Gt))?null:new _r(r,n,o,a,t))},_r.prototype.evaluate=function(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))},_r.prototype.eachChild=function(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)},_r.prototype.outputDefined=function(){return!1},_r.prototype.serialize=function(){var t={};return this.locale&&(t.locale=this.locale.serialize()),this.currency&&(t.currency=this.currency.serialize()),this.minFractionDigits&&(t["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(t["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),t]},Er.parse=function(t,e){return 2!==t.length?e.error("Expected 1 argument, but found "+(t.length-1)+" instead."):(t=e.parse(t[1],1))?"array"!==t.type.kind&&"string"!==t.type.kind&&"value"!==t.type.kind?e.error("Expected argument of type string or array, but found "+te(t.type)+" instead."):new Er(t):null},Er.prototype.evaluate=function(t){if("string"==typeof(t=this.input.evaluate(t)))return t.length;if(Array.isArray(t))return t.length;throw new ye("Expected value to be of type string or array, but found "+te(fe(t))+" instead.")},Er.prototype.eachChild=function(t){t(this.input)},Er.prototype.outputDefined=function(){return!1},Er.prototype.serialize=function(){var t=["length"];return this.eachChild((function(e){t.push(e.serialize())})),t};var Ir={"==":vr,"!=":xr,">":wr,"<":br,">=":Tr,"<=":Sr,array:ge,at:lr,boolean:ge,case:fr,coalesce:sr,collator:Ie,format:ve,image:xe,in:cr,"index-of":pr,interpolate:or,"interpolate-hcl":or,"interpolate-lab":or,length:Er,let:ur,literal:me,match:hr,number:ge,"number-format":_r,object:ge,slice:dr,step:Ge,string:ge,"to-boolean":be,"to-color":be,"to-number":be,"to-string":be,var:Ne,within:Oe};function Ar(t,e){var r=e[0],i=e[1],n=e[2];e=e[3];if(t=pe(r=r.evaluate(t),i=i.evaluate(t),n=n.evaluate(t),e=e?e.evaluate(t):1))throw new ye(t);return new ae(r/255*e,i/255*e,n/255*e,e)}function Cr(t,e){return void 0===(t=e[t])?null:t}function Pr(t){return{type:t}}function Mr(t){return{result:"success",value:t}}function kr(t){return{result:"error",value:t}}function zr(t){return"data-driven"===t["property-type"]||"cross-faded-data-driven"===t["property-type"]}function Lr(t){return t.expression&&-1<t.expression.parameters.indexOf("zoom")}function Br(t){return t.expression&&t.expression.interpolated}function Dr(t){return t instanceof Number?"number":t instanceof String?"string":t instanceof Boolean?"boolean":Array.isArray(t)?"array":null===t?"null":typeof t}function Rr(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)}function Or(t){return t}function Fr(t,e,r){return void 0!==t?t:void 0!==e?e:void 0!==r?r:void 0}function jr(t,e,r,i,n){return Fr(typeof r===n?i[r]:void 0,t.default,e.default)}function Ur(t,e,r){return"number"!==Dr(r)?Fr(t.default,e.default):1===(e=t.stops.length)||r<=t.stops[0][0]?t.stops[0][1]:r>=t.stops[e-1][0]?t.stops[e-1][1]:(r=qe(t.stops.map((function(t){return t[0]})),r),t.stops[r][1])}function Nr(t,e,r){var i=void 0!==t.base?t.base:1;if("number"!==Dr(r))return Fr(t.default,e.default);var n=t.stops.length;if(1===n)return t.stops[0][1];if(r<=t.stops[0][0])return t.stops[0][1];if(r>=t.stops[n-1][0])return t.stops[n-1][1];var o,a,s=qe(t.stops.map((function(t){return t[0]})),r),u=(o=i,n=t.stops[s][0],i=t.stops[s+1][0]-n,n=r-n,0==i?0:1===o?n/i:(Math.pow(o,n)-1)/(Math.pow(o,i)-1)),l=t.stops[s][1],c=t.stops[s+1][1],p=Ze[e.type]||Or;return t.colorSpace&&"rgb"!==t.colorSpace&&(a=nr[t.colorSpace],p=function(t,e){return a.reverse(a.interpolate(a.forward(t),a.forward(e),u))}),"function"==typeof l.evaluate?{evaluate:function(){for(var t=[],e=arguments.length;e--;)t[e]=arguments[e];var r=l.evaluate.apply(void 0,t),i=c.evaluate.apply(void 0,t);if(void 0!==r&&void 0!==i)return p(r,i,u)}}:p(l,c,u)}function Vr(t,e,r){return"color"===e.type?r=ae.parse(r):"formatted"===e.type?r=le.fromString(r.toString()):"resolvedImage"===e.type?r=ce.fromString(r.toString()):Dr(r)===e.type||"enum"===e.type&&e.values[r]||(r=void 0),Fr(r,t.default,e.default)}Ee.register(Ir,{error:[{kind:"error"},[Ht],function(t,e){throw new ye(e[0].evaluate(t))}],typeof:[Ht,[Kt],function(t,e){return te(fe(e[0].evaluate(t)))}],"to-rgba":[$t(Gt,4),[Wt],function(t,e){return e[0].evaluate(t).toArray()}],rgb:[Wt,[Gt,Gt,Gt],Ar],rgba:[Wt,[Gt,Gt,Gt,Gt],Ar],has:{type:Zt,overloads:[[[Ht],function(t,e){return e[0].evaluate(t)in t.properties()}],[[Ht,Xt],function(t,e){var r=e[1];return e[0].evaluate(t)in r.evaluate(t)}]]},get:{type:Kt,overloads:[[[Ht],function(t,e){return Cr(e[0].evaluate(t),t.properties())}],[[Ht,Xt],function(t,e){var r=e[1];return Cr(e[0].evaluate(t),r.evaluate(t))}]]},"feature-state":[Kt,[Ht],function(t,e){return Cr(e[0].evaluate(t),t.featureState||{})}],properties:[Xt,[],function(t){return t.properties()}],"geometry-type":[Ht,[],function(t){return t.geometryType()}],id:[Kt,[],function(t){return t.id()}],zoom:[Gt,[],function(t){return t.globals.zoom}],"heatmap-density":[Gt,[],function(t){return t.globals.heatmapDensity||0}],"line-progress":[Gt,[],function(t){return t.globals.lineProgress||0}],accumulated:[Kt,[],function(t){return void 0===t.globals.accumulated?null:t.globals.accumulated}],"+":[Gt,Pr(Gt),function(t,e){for(var r=0,i=0,n=e;i<n.length;i+=1)r+=n[i].evaluate(t);return r}],"*":[Gt,Pr(Gt),function(t,e){for(var r=1,i=0,n=e;i<n.length;i+=1)r*=n[i].evaluate(t);return r}],"-":{type:Gt,overloads:[[[Gt,Gt],function(t,e){var r=e[1];return e[0].evaluate(t)-r.evaluate(t)}],[[Gt],function(t,e){return-e[0].evaluate(t)}]]},"/":[Gt,[Gt,Gt],function(t,e){var r=e[1];return e[0].evaluate(t)/r.evaluate(t)}],"%":[Gt,[Gt,Gt],function(t,e){var r=e[1];return e[0].evaluate(t)%r.evaluate(t)}],ln2:[Gt,[],function(){return Math.LN2}],pi:[Gt,[],function(){return Math.PI}],e:[Gt,[],function(){return Math.E}],"^":[Gt,[Gt,Gt],function(t,e){var r=e[1];return Math.pow(e[0].evaluate(t),r.evaluate(t))}],sqrt:[Gt,[Gt],function(t,e){return Math.sqrt(e[0].evaluate(t))}],log10:[Gt,[Gt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN10}],ln:[Gt,[Gt],function(t,e){return Math.log(e[0].evaluate(t))}],log2:[Gt,[Gt],function(t,e){return Math.log(e[0].evaluate(t))/Math.LN2}],sin:[Gt,[Gt],function(t,e){return Math.sin(e[0].evaluate(t))}],cos:[Gt,[Gt],function(t,e){return Math.cos(e[0].evaluate(t))}],tan:[Gt,[Gt],function(t,e){return Math.tan(e[0].evaluate(t))}],asin:[Gt,[Gt],function(t,e){return Math.asin(e[0].evaluate(t))}],acos:[Gt,[Gt],function(t,e){return Math.acos(e[0].evaluate(t))}],atan:[Gt,[Gt],function(t,e){return Math.atan(e[0].evaluate(t))}],min:[Gt,Pr(Gt),function(t,e){return Math.min.apply(Math,e.map((function(e){return e.evaluate(t)})))}],max:[Gt,Pr(Gt),function(t,e){return Math.max.apply(Math,e.map((function(e){return e.evaluate(t)})))}],abs:[Gt,[Gt],function(t,e){return Math.abs(e[0].evaluate(t))}],round:[Gt,[Gt],function(t,e){return(t=e[0].evaluate(t))<0?-Math.round(-t):Math.round(t)}],floor:[Gt,[Gt],function(t,e){return Math.floor(e[0].evaluate(t))}],ceil:[Gt,[Gt],function(t,e){return Math.ceil(e[0].evaluate(t))}],"filter-==":[Zt,[Ht,Kt],function(t,e){var r=e[0];e=e[1];return t.properties()[r.value]===e.value}],"filter-id-==":[Zt,[Kt],function(t,e){return e=e[0],t.id()===e.value}],"filter-type-==":[Zt,[Ht],function(t,e){return e=e[0],t.geometryType()===e.value}],"filter-<":[Zt,[Ht,Kt],function(t,e){var r=e[0];e=e[1];return typeof(r=t.properties()[r.value])==typeof(e=e.value)&&r<e}],"filter-id-<":[Zt,[Kt],function(t,e){return e=e[0],typeof(t=t.id())==typeof(e=e.value)&&t<e}],"filter->":[Zt,[Ht,Kt],function(t,e){var r=e[0];e=e[1];return typeof(r=t.properties()[r.value])==typeof(e=e.value)&&e<r}],"filter-id->":[Zt,[Kt],function(t,e){return e=e[0],typeof(t=t.id())==typeof(e=e.value)&&e<t}],"filter-<=":[Zt,[Ht,Kt],function(t,e){var r=e[0];e=e[1];return typeof(r=t.properties()[r.value])==typeof(e=e.value)&&r<=e}],"filter-id-<=":[Zt,[Kt],function(t,e){return e=e[0],typeof(t=t.id())==typeof(e=e.value)&&t<=e}],"filter->=":[Zt,[Ht,Kt],function(t,e){var r=e[0];e=e[1];return typeof(r=t.properties()[r.value])==typeof(e=e.value)&&e<=r}],"filter-id->=":[Zt,[Kt],function(t,e){return e=e[0],typeof(t=t.id())==typeof(e=e.value)&&e<=t}],"filter-has":[Zt,[Kt],function(t,e){return e[0].value in t.properties()}],"filter-has-id":[Zt,[],function(t){return null!==t.id()&&void 0!==t.id()}],"filter-type-in":[Zt,[$t(Ht)],function(t,e){return 0<=e[0].value.indexOf(t.geometryType())}],"filter-id-in":[Zt,[$t(Kt)],function(t,e){return 0<=e[0].value.indexOf(t.id())}],"filter-in-small":[Zt,[Ht,$t(Kt)],function(t,e){var r=e[0];return 0<=e[1].value.indexOf(t.properties()[r.value])}],"filter-in-large":[Zt,[Ht,$t(Kt)],function(t,e){var r=e[0];e=e[1];return function(t,e,r,i){for(;r<=i;){var n=r+i>>1;if(e[n]===t)return!0;e[n]>t?i=n-1:r=1+n}return!1}(t.properties()[r.value],e.value,0,e.value.length-1)}],all:{type:Zt,overloads:[[[Zt,Zt],function(t,e){var r=e[1];return e[0].evaluate(t)&&r.evaluate(t)}],[Pr(Zt),function(t,e){for(var r=0,i=e;r<i.length;r+=1)if(!i[r].evaluate(t))return!1;return!0}]]},any:{type:Zt,overloads:[[[Zt,Zt],function(t,e){var r=e[1];return e[0].evaluate(t)||r.evaluate(t)}],[Pr(Zt),function(t,e){for(var r=0,i=e;r<i.length;r+=1)if(i[r].evaluate(t))return!0;return!1}]]},"!":[Zt,[Zt],function(t,e){return!e[0].evaluate(t)}],"is-supported-script":[Zt,[Ht],function(t,e){var r=t.globals&&t.globals.isSupportedScript;return!r||r(e[0].evaluate(t))}],upcase:[Ht,[Ht],function(t,e){return e[0].evaluate(t).toUpperCase()}],downcase:[Ht,[Ht],function(t,e){return e[0].evaluate(t).toLowerCase()}],concat:[Ht,Pr(Kt),function(t,e){return e.map((function(e){return de(e.evaluate(t))})).join("")}],"resolved-locale":[Ht,[Jt],function(t,e){return e[0].evaluate(t).resolvedLocale()}]});var qr=function(t,e){this.expression=t,this._warningHistory={},this._evaluator=new Se,this._defaultValue=e?"color"===(t=e).type&&Rr(t.default)?new ae(0,0,0,0):"color"===t.type?ae.parse(t.default)||null:void 0===t.default?null:t.default:null,this._enumValues=e&&"enum"===e.type?e.values:null};function Gr(t){return Array.isArray(t)&&0<t.length&&"string"==typeof t[0]&&t[0]in Ir}function Hr(t,e){var r;return(t=(r=new Ve(Ir,[],e?(r={color:Wt,string:Ht,number:Gt,enum:Ht,boolean:Zt,formatted:Yt,resolvedImage:Qt},"array"===e.type?$t(r[e.value]||Kt,e.length):r[e.type]):void 0)).parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0))?Mr(new qr(t,e)):kr(r.errors)}qr.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,n,o){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)},qr.prototype.evaluate=function(t,e,r,i,n,o){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o||null;try{var a=this.expression.evaluate(this._evaluator);if(null==a||"number"==typeof a&&a!=a)return this._defaultValue;if(this._enumValues&&!(a in this._enumValues))throw new ye("Expected value to be one of "+Object.keys(this._enumValues).map((function(t){return JSON.stringify(t)})).join(", ")+", but found "+JSON.stringify(a)+" instead.");return a}catch(t){return this._warningHistory[t.message]||(this._warningHistory[t.message]=!0,"undefined"!=typeof console&&console.warn(t.message)),this._defaultValue}};var Zr=function(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!je(e.expression)};Zr.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,n,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,o)},Zr.prototype.evaluate=function(t,e,r,i,n,o){return this._styleExpression.evaluate(t,e,r,i,n,o)};var Wr=function(t,e,r,i){this.kind=t,this.zoomStops=r,this._styleExpression=e,this.isStateDependent="camera"!==t&&!je(e.expression),this.interpolationType=i};function Xr(t,e){if("error"===(t=Hr(t,e)).result)return t;var r=t.value.expression,i=Fe(r);if(!i&&!zr(e))return kr([new Nt("","data expressions not supported")]);var n=Ue(r,["zoom"]);return n||Lr(e)?(r=function t(e){var r=null;if(e instanceof ur)r=t(e.result);else if(e instanceof sr)for(var i=0,n=e.args;i<n.length&&!(r=t(n[i]));i+=1);else(e instanceof Ge||e instanceof or)&&e.input instanceof Ee&&"zoom"===e.input.name&&(r=e);return r instanceof Nt||e.eachChild((function(e){(e=t(e))instanceof Nt?r=e:!r&&e?r=new Nt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):r&&e&&r!==e&&(r=new Nt("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),r}(r))||n?r instanceof Nt?kr([r]):r instanceof or&&!Br(e)?kr([new Nt("",'"interpolate" expressions cannot be used with this property')]):Mr(r?new Wr(i?"camera":"composite",t.value,r.labels,r instanceof or?r.interpolation:void 0):new Zr(i?"constant":"source",t.value)):kr([new Nt("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]):kr([new Nt("","zoom expressions not supported")])}function Kr(t,e){this._parameters=t,this._specification=e,Rt(this,function t(e,r){var i,n,o,a="color"===r.type,s=e.stops&&"object"==typeof e.stops[0][0],u=s||!(s||void 0!==e.property),l=e.type||(Br(r)?"exponential":"interval");if(a&&((e=Rt({},e)).stops&&(e.stops=e.stops.map((function(t){return[t[0],ae.parse(t[1])]}))),e.default=ae.parse(e.default||r.default)),e.colorSpace&&"rgb"!==e.colorSpace&&!nr[e.colorSpace])throw new Error("Unknown color space: "+e.colorSpace);if("exponential"===l)i=Nr;else if("interval"===l)i=Ur;else if("categorical"===l){i=jr,n=Object.create(null);for(var c=0,p=e.stops;c<p.length;c+=1){var h=p[c];n[h[0]]=h[1]}o=typeof e.stops[0][0]}else{if("identity"!==l)throw new Error('Unknown function type "'+l+'"');i=Vr}if(s){for(var f={},d=[],m=0;m<e.stops.length;m++){var y=e.stops[m],g=y[0].zoom;void 0===f[g]&&(f[g]={zoom:g,type:e.type,property:e.property,default:e.default,stops:[]},d.push(g)),f[g].stops.push([y[0].value,y[1]])}for(var _=[],v=0,x=d;v<x.length;v+=1){var b=x[v];_.push([f[b].zoom,t(f[b],r)])}return{kind:"composite",interpolationType:s={name:"linear"},interpolationFactor:or.interpolationFactor.bind(void 0,s),zoomStops:_.map((function(t){return t[0]})),evaluate:function(t,i){return t=t.zoom,Nr({stops:_,base:e.base},r,t).evaluate(t,i)}}}return u?{kind:"camera",interpolationType:l="exponential"===l?{name:"exponential",base:void 0!==e.base?e.base:1}:null,interpolationFactor:or.interpolationFactor.bind(void 0,l),zoomStops:e.stops.map((function(t){return t[0]})),evaluate:function(t){return i(e,r,t.zoom,n,o)}}:{kind:"source",evaluate:function(t,a){return void 0===(a=a&&a.properties?a.properties[e.property]:void 0)?Fr(e.default,r.default):i(e,r,a,n,o)}}}(this._parameters,this._specification))}function Jr(t){var e,r,i=t.key,n=t.value,o=t.valueSpec||{},a=t.objectElementValidators||{},s=t.style,u=t.styleSpec,l=[];if("object"!==(t=Dr(n)))return[new Bt(i,n,"object expected, "+t+" found")];for(e in n){var c=e.split(".")[0],p=o[c]||o["*"],h=void 0;if(a[c])h=a[c];else if(o[c])h=bi;else if(a["*"])h=a["*"];else{if(!o["*"]){l.push(new Bt(i,n[e],'unknown property "'+e+'"'));continue}h=bi}l=l.concat(h({key:(i&&i+".")+e,value:n[e],valueSpec:p,style:s,styleSpec:u,object:n,objectKey:e},n))}for(r in o)a[r]||o[r].required&&void 0===o[r].default&&void 0===n[r]&&l.push(new Bt(i,n,'missing required property "'+r+'"'));return l}function Yr(t){var e=t.value,r=t.valueSpec,i=t.style,n=t.styleSpec,o=t.key,a=t.arrayElementValidator||bi;if("array"!==Dr(e))return[new Bt(o,e,"array expected, "+Dr(e)+" found")];if(r.length&&e.length!==r.length)return[new Bt(o,e,"array length "+r.length+" expected, length "+e.length+" found")];if(r["min-length"]&&e.length<r["min-length"])return[new Bt(o,e,"array length at least "+r["min-length"]+" expected, length "+e.length+" found")];var s={type:r.value,values:r.values};n.$version<7&&(s.function=r.function),"object"===Dr(r.value)&&(s=r.value);for(var u=[],l=0;l<e.length;l++)u=u.concat(a({array:e,arrayIndex:l,value:e[l],valueSpec:s,style:i,styleSpec:n,key:o+"["+l+"]"}));return u}function Qr(t){var e=t.key,r=t.value,i=t.valueSpec;return"number"===(t=Dr(r))&&r!=r&&(t="NaN"),"number"!==t?[new Bt(e,r,"number expected, "+t+" found")]:"minimum"in i&&r<i.minimum?[new Bt(e,r,r+" is less than the minimum value "+i.minimum)]:"maximum"in i&&r>i.maximum?[new Bt(e,r,r+" is greater than the maximum value "+i.maximum)]:[]}function $r(t){var e,r,i,n=t.valueSpec,o=Ot(t.value.type),a={},s="categorical"!==o&&void 0===t.value.property,u=!s,l="array"===Dr(t.value.stops)&&"array"===Dr(t.value.stops[0])&&"object"===Dr(t.value.stops[0][0]),c=Jr({key:t.key,value:t.value,valueSpec:t.styleSpec.function,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{stops:function(t){if("identity"===o)return[new Bt(t.key,t.value,'identity function may not have a "stops" property')];var e=[],r=t.value;e=e.concat(Yr({key:t.key,value:r,valueSpec:t.valueSpec,style:t.style,styleSpec:t.styleSpec,arrayElementValidator:p}));return"array"===Dr(r)&&0===r.length&&e.push(new Bt(t.key,r,"array must have at least one stop")),e},default:function(t){return bi({key:t.key,value:t.value,valueSpec:n,style:t.style,styleSpec:t.styleSpec})}}});return"identity"===o&&s&&c.push(new Bt(t.key,t.value,'missing required property "property"')),"identity"===o||t.value.stops||c.push(new Bt(t.key,t.value,'missing required property "stops"')),"exponential"===o&&t.valueSpec.expression&&!Br(t.valueSpec)&&c.push(new Bt(t.key,t.value,"exponential functions not supported")),8<=t.styleSpec.$version&&(u&&!zr(t.valueSpec)?c.push(new Bt(t.key,t.value,"property functions not supported")):s&&!Lr(t.valueSpec)&&c.push(new Bt(t.key,t.value,"zoom functions not supported"))),"categorical"!==o&&!l||void 0!==t.value.property||c.push(new Bt(t.key,t.value,'"property" property is required')),c;function p(t){var e=[],o=t.value,s=t.key;if("array"!==Dr(o))return[new Bt(s,o,"array expected, "+Dr(o)+" found")];if(2!==o.length)return[new Bt(s,o,"array length 2 expected, length "+o.length+" found")];if(l){if("object"!==Dr(o[0]))return[new Bt(s,o,"object expected, "+Dr(o[0])+" found")];if(void 0===o[0].zoom)return[new Bt(s,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new Bt(s,o,"object stop key must have value")];if(i&&i>Ot(o[0].zoom))return[new Bt(s,o[0].zoom,"stop zoom values must appear in ascending order")];Ot(o[0].zoom)!==i&&(i=Ot(o[0].zoom),r=void 0,a={}),e=e.concat(Jr({key:s+"[0]",value:o[0],valueSpec:{zoom:{}},style:t.style,styleSpec:t.styleSpec,objectElementValidators:{zoom:Qr,value:h}}))}else e=e.concat(h({key:s+"[0]",value:o[0],valueSpec:{},style:t.style,styleSpec:t.styleSpec},o));return Gr(Ft(o[1]))?e.concat([new Bt(s+"[1]",o[1],"expressions are not allowed in function stops.")]):e.concat(bi({key:s+"[1]",value:o[1],valueSpec:n,style:t.style,styleSpec:t.styleSpec}))}function h(t,i){var s=Dr(t.value),u=Ot(t.value);i=null!==t.value?t.value:i;if(e){if(s!==e)return[new Bt(t.key,i,s+" stop domain type must match previous stop domain type "+e)]}else e=s;return"number"!==s&&"string"!==s&&"boolean"!==s?[new Bt(t.key,i,"stop domain value must be a number, string, or boolean")]:"number"===s||"categorical"===o?"categorical"!==o||"number"!==s||isFinite(u)&&Math.floor(u)===u?"categorical"!==o&&"number"===s&&void 0!==r&&u<r?[new Bt(t.key,i,"stop domain values must appear in ascending order")]:(r=u,"categorical"===o&&u in a?[new Bt(t.key,i,"stop domain values must be unique")]:(a[u]=!0,[])):[new Bt(t.key,i,"integer expected, found "+u)]:(s="number expected, "+s+" found",zr(n)&&void 0===o&&(s+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new Bt(t.key,i,s)])}}function ti(t){var e=("property"===t.expressionContext?Xr:Hr)(Ft(t.value),t.valueSpec);if("error"===e.result)return e.value.map((function(e){return new Bt(""+t.key+e.key,t.value,e.message)}));if(e=e.value.expression||e.value._styleExpression.expression,"property"===t.expressionContext&&"text-font"===t.propertyKey&&!e.outputDefined())return[new Bt(t.key,t.value,'Invalid data expression for "'+t.propertyKey+'". Output values must be contained as literals within the expression.')];if("property"===t.expressionContext&&"layout"===t.propertyType&&!je(e))return[new Bt(t.key,t.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===t.expressionContext&&!je(e))return[new Bt(t.key,t.value,'"feature-state" data expressions are not supported with filters.')];if(t.expressionContext&&0===t.expressionContext.indexOf("cluster")){if(!Ue(e,["zoom","feature-state"]))return[new Bt(t.key,t.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===t.expressionContext&&!Fe(e))return[new Bt(t.key,t.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function ei(t){var e=t.key,r=t.value,i=t.valueSpec;t=[];return Array.isArray(i.values)?-1===i.values.indexOf(Ot(r))&&t.push(new Bt(e,r,"expected one of ["+i.values.join(", ")+"], "+JSON.stringify(r)+" found")):-1===Object.keys(i.values).indexOf(Ot(r))&&t.push(new Bt(e,r,"expected one of ["+Object.keys(i.values).join(", ")+"], "+JSON.stringify(r)+" found")),t}function ri(t){if(!0===t||!1===t)return 1;if(Array.isArray(t)&&0!==t.length)switch(t[0]){case"has":return 2<=t.length&&"$id"!==t[1]&&"$type"!==t[1];case"in":return 3<=t.length&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(var e=0,r=t.slice(1);e<r.length;e+=1){var i=r[e];if(!ri(i)&&"boolean"!=typeof i)return}return 1;default:return 1}}Wr.prototype.evaluateWithoutErrorHandling=function(t,e,r,i,n,o){return this._styleExpression.evaluateWithoutErrorHandling(t,e,r,i,n,o)},Wr.prototype.evaluate=function(t,e,r,i,n,o){return this._styleExpression.evaluate(t,e,r,i,n,o)},Wr.prototype.interpolationFactor=function(t,e,r){return this.interpolationType?or.interpolationFactor(this.interpolationType,t,e,r):0},Kr.deserialize=function(t){return new Kr(t._parameters,t._specification)};var ii={type:"boolean",default:!(Kr.serialize=function(t){return{_parameters:t._parameters,_specification:t._specification}}),transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function ni(t){if(null==t)return{filter:function(){return!0},needGeometry:!1};ri(t)||(t=ai(t));var e=Hr(t,ii);if("error"===e.result)throw new Error(e.value.map((function(t){return t.key+": "+t.message})).join(", "));return{filter:function(t,r,i){return e.value.evaluate(t,r,{},i)},needGeometry:function t(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(var r=1;r<e.length;r++)if(t(e[r]))return!0;return!1}(t)}}function oi(t,e){return t<e?-1:e<t?1:0}function ai(t){if(!t)return!0;var e,r=t[0];return t.length<=1?"any"!==r:"=="===r?si(t[1],t[2],"=="):"!="===r?ci(si(t[1],t[2],"==")):"<"===r||">"===r||"<="===r||">="===r?si(t[1],t[2],r):"any"===r?(e=t.slice(1),["any"].concat(e.map(ai))):"all"===r?["all"].concat(t.slice(1).map(ai)):"none"===r?["all"].concat(t.slice(1).map(ai).map(ci)):"in"===r?ui(t[1],t.slice(2)):"!in"===r?ci(ui(t[1],t.slice(2))):"has"===r?li(t[1]):"!has"===r?ci(li(t[1])):"within"!==r||t}function si(t,e,r){switch(t){case"$type":return["filter-type-"+r,e];case"$id":return["filter-id-"+r,e];default:return["filter-"+r,t,e]}}function ui(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return 200<e.length&&!e.some((function(t){return typeof t!=typeof e[0]}))?["filter-in-large",t,["literal",e.sort(oi)]]:["filter-in-small",t,["literal",e]]}}function li(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function ci(t){return["!",t]}function pi(t){return ri(Ft(t.value))?ti(Rt({},t,{expressionContext:"filter",valueSpec:{value:"boolean"}})):function t(e){var r=e.value,i=e.key;if("array"!==Dr(r))return[new Bt(i,r,"array expected, "+Dr(r)+" found")];var n,o=e.styleSpec,a=[];if(r.length<1)return[new Bt(i,r,"filter array must have at least 1 element")];switch(a=a.concat(ei({key:i+"[0]",value:r[0],valueSpec:o.filter_operator,style:e.style,styleSpec:e.styleSpec})),Ot(r[0])){case"<":case"<=":case">":case">=":2<=r.length&&"$type"===Ot(r[1])&&a.push(new Bt(i,r,'"$type" cannot be use with operator "'+r[0]+'"'));case"==":case"!=":3!==r.length&&a.push(new Bt(i,r,'filter array for operator "'+r[0]+'" must have 3 elements'));case"in":case"!in":2<=r.length&&"string"!==(n=Dr(r[1]))&&a.push(new Bt(i+"[1]",r[1],"string expected, "+n+" found"));for(var s=2;s<r.length;s++)n=Dr(r[s]),"$type"===Ot(r[1])?a=a.concat(ei({key:i+"["+s+"]",value:r[s],valueSpec:o.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==n&&"number"!==n&&"boolean"!==n&&a.push(new Bt(i+"["+s+"]",r[s],"string, number, or boolean expected, "+n+" found"));break;case"any":case"all":case"none":for(var u=1;u<r.length;u++)a=a.concat(t({key:i+"["+u+"]",value:r[u],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":n=Dr(r[1]),2!==r.length?a.push(new Bt(i,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"string"!==n&&a.push(new Bt(i+"[1]",r[1],"string expected, "+n+" found"));break;case"within":n=Dr(r[1]),2!==r.length?a.push(new Bt(i,r,'filter array for "'+r[0]+'" operator must have 2 elements')):"object"!==n&&a.push(new Bt(i+"[1]",r[1],"object expected, "+n+" found"))}return a}(t)}function hi(t,e){var r=t.key,i=t.style,n=t.styleSpec,o=t.value,a=t.objectKey,s=n[e+"_"+t.layerType];if(!s)return[];var u=a.match(/^(.*)-transition$/);if("paint"===e&&u&&s[u[1]]&&s[u[1]].transition)return bi({key:r,value:o,valueSpec:n.transition,style:i,styleSpec:n});if(!(s=t.valueSpec||s[a]))return[new Bt(r,o,'unknown property "'+a+'"')];if("string"===Dr(o)&&zr(s)&&!s.tokens&&(l=/^{([^}]+)}$/.exec(o)))return[new Bt(r,o,'"'+a+'" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": '+JSON.stringify(l[1])+" }`.")];var l=[];return"symbol"===t.layerType&&("text-field"===a&&i&&!i.glyphs&&l.push(new Bt(r,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&Rr(Ft(o))&&"identity"===Ot(o.type)&&l.push(new Bt(r,o,'"text-font" does not support identity functions'))),l.concat(bi({key:t.key,value:o,valueSpec:s,style:i,styleSpec:n,expressionContext:"property",propertyType:e,propertyKey:a}))}function fi(t){return hi(t,"paint")}function di(t){return hi(t,"layout")}function mi(t){var e=[],r=t.value,i=t.key,n=t.style,o=t.styleSpec;r.type||r.ref||e.push(new Bt(i,r,'either "type" or "ref" is required'));var a,s,u,l=Ot(r.type),c=Ot(r.ref);if(r.id)for(var p=Ot(r.id),h=0;h<t.arrayIndex;h++){var f=n.layers[h];Ot(f.id)===p&&e.push(new Bt(i,r.id,'duplicate layer id "'+r.id+'", previously used at line '+f.id.__line__))}return"ref"in r?(["type","source","source-layer","filter","layout"].forEach((function(t){t in r&&e.push(new Bt(i,r[t],'"'+t+'" is prohibited for ref layers'))})),n.layers.forEach((function(t){Ot(t.id)===c&&(a=t)})),a?a.ref?e.push(new Bt(i,r.ref,"ref cannot reference another ref layer")):l=Ot(a.type):e.push(new Bt(i,r.ref,'ref layer "'+c+'" not found'))):"background"!==l&&(r.source?(u=(s=n.sources&&n.sources[r.source])&&Ot(s.type),s?"vector"===u&&"raster"===l?e.push(new Bt(i,r.source,'layer "'+r.id+'" requires a raster source')):"raster"===u&&"raster"!==l?e.push(new Bt(i,r.source,'layer "'+r.id+'" requires a vector source')):"vector"!==u||r["source-layer"]?"raster-dem"===u&&"hillshade"!==l?e.push(new Bt(i,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==l||!r.paint||!r.paint["line-gradient"]||"geojson"===u&&s.lineMetrics||e.push(new Bt(i,r,'layer "'+r.id+'" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')):e.push(new Bt(i,r,'layer "'+r.id+'" must specify a "source-layer"')):e.push(new Bt(i,r.source,'source "'+r.source+'" not found'))):e.push(new Bt(i,r,'missing required property "source"'))),e=e.concat(Jr({key:i,value:r,valueSpec:o.layer,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(){return[]},type:function(){return bi({key:i+".type",value:r.type,valueSpec:o.layer.type,style:t.style,styleSpec:t.styleSpec,object:r,objectKey:"type"})},filter:pi,layout:function(t){return Jr({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return di(Rt({layerType:l},t))}}})},paint:function(t){return Jr({layer:r,key:t.key,value:t.value,style:t.style,styleSpec:t.styleSpec,objectElementValidators:{"*":function(t){return fi(Rt({layerType:l},t))}}})}}}))}function yi(t){var e=t.value,r=t.key;return"string"!==(t=Dr(e))?[new Bt(r,e,"string expected, "+t+" found")]:[]}var gi={promoteId:function(t){var e=t.key,r=t.value;if("string"===Dr(r))return yi({key:e,value:r});var i,n=[];for(i in r)n.push.apply(n,yi({key:e+"."+i,value:r[i]}));return n}};function _i(t){var e=t.value,r=t.key,i=t.styleSpec,n=t.style;if(!e.type)return[new Bt(r,e,'"type" is required')];var o,a=Ot(e.type);switch(a){case"vector":case"raster":case"raster-dem":return Jr({key:r,value:e,valueSpec:i["source_"+a.replace("-","_")],style:t.style,styleSpec:i,objectElementValidators:gi});case"geojson":if(o=Jr({key:r,value:e,valueSpec:i.source_geojson,style:n,styleSpec:i,objectElementValidators:gi}),e.cluster)for(var s in e.clusterProperties){var u=e.clusterProperties[s],l="string"==typeof(l=u[0])?[l,["accumulated"],["get",s]]:l;o.push.apply(o,ti({key:r+"."+s+".map",value:u[1],expressionContext:"cluster-map"})),o.push.apply(o,ti({key:r+"."+s+".reduce",value:l,expressionContext:"cluster-reduce"}))}return o;case"video":return Jr({key:r,value:e,valueSpec:i.source_video,style:n,styleSpec:i});case"image":return Jr({key:r,value:e,valueSpec:i.source_image,style:n,styleSpec:i});case"canvas":return[new Bt(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return ei({key:r+".type",value:e.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,styleSpec:i})}}function vi(t){var e,r=t.value,i=t.styleSpec,n=i.light,o=t.style,a=[];t=Dr(r);if(void 0===r)return a;if("object"!==t)return a.concat([new Bt("light",r,"object expected, "+t+" found")]);for(e in r){var s=e.match(/^(.*)-transition$/);a=a.concat(s&&n[s[1]]&&n[s[1]].transition?bi({key:e,value:r[e],valueSpec:i.transition,style:o,styleSpec:i}):n[e]?bi({key:e,value:r[e],valueSpec:n[e],style:o,styleSpec:i}):[new Bt(e,r[e],'unknown property "'+e+'"')])}return a}var xi={"*":function(){return[]},array:Yr,boolean:function(t){var e=t.value,r=t.key;return"boolean"!==(t=Dr(e))?[new Bt(r,e,"boolean expected, "+t+" found")]:[]},number:Qr,color:function(t){var e=t.key,r=t.value;return"string"!==(t=Dr(r))?[new Bt(e,r,"color expected, "+t+" found")]:null===oe(r)?[new Bt(e,r,'color expected, "'+r+'" found')]:[]},constants:Dt,enum:ei,filter:pi,function:$r,layer:mi,object:Jr,source:_i,light:vi,string:yi,formatted:function(t){return 0===yi(t).length?[]:ti(t)},resolvedImage:function(t){return 0===yi(t).length?[]:ti(t)}};function bi(t){var e=t.value,r=t.valueSpec,i=t.styleSpec;return r.expression&&Rr(Ot(e))?$r(t):r.expression&&Gr(Ft(e))?ti(t):r.type&&xi[r.type]?xi[r.type](t):Jr(Rt({},t,{valueSpec:r.type?i[r.type]:r}))}function wi(t){var e=t.value,r=t.key;return(t=yi(t)).length||(-1===e.indexOf("{fontstack}")&&t.push(new Bt(r,e,'"glyphs" url must include a "{fontstack}" token')),-1===e.indexOf("{range}")&&t.push(new Bt(r,e,'"glyphs" url must include a "{range}" token'))),t}function Si(t,e){void 0===e&&(e=Lt);var r=(r=[]).concat(bi({key:"",value:t,valueSpec:e.$root,styleSpec:e,style:t,objectElementValidators:{glyphs:wi,"*":function(){return[]}}}));return t.constants&&(r=r.concat(Dt({key:"constants",value:t.constants,style:t,styleSpec:e}))),Ti(r)}function Ti(t){return[].concat(t).sort((function(t,e){return t.line-e.line}))}function Ei(t){return function(){for(var e=[],r=arguments.length;r--;)e[r]=arguments[r];return Ti(t.apply(this,e))}}Si.source=Ei(_i),Si.light=Ei(vi),Si.layer=Ei(mi),Si.filter=Ei(pi),Si.paintProperty=Ei(fi),Si.layoutProperty=Ei(di);var Ii=Si,Ai=Ii.light,Ci=Ii.paintProperty,Pi=Ii.layoutProperty;function Mi(t,e){var r=!1;if(e&&e.length)for(var i=0,n=e;i<n.length;i+=1)t.fire(new kt(new Error(n[i].message))),r=!0;return r}var ki=zi;function zi(t,e,r){var i=this.cells=[];if(t instanceof ArrayBuffer){this.arrayBuffer=t;var n=new Int32Array(this.arrayBuffer);t=n[0],this.d=(e=n[1])+2*(r=n[2]);for(var o=0;o<this.d*this.d;o++){var a=n[3+o],s=n[3+o+1];i.push(a===s?null:n.subarray(a,s))}var u=n[3+i.length+1];this.keys=n.subarray(n[3+i.length],u),this.bboxes=n.subarray(u),this.insert=this._insertReadonly}else{this.d=e+2*r;for(var l=0;l<this.d*this.d;l++)i.push([]);this.keys=[],this.bboxes=[]}this.n=e,this.extent=t,this.padding=r,this.scale=e/t,this.uid=0,e=r/e*t,this.min=-e,this.max=t+e}zi.prototype.insert=function(t,e,r,i,n){this._forEachCell(e,r,i,n,this._insertCell,this.uid++),this.keys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)},zi.prototype._insertReadonly=function(){throw"Cannot insert into a GridIndex created from an ArrayBuffer."},zi.prototype._insertCell=function(t,e,r,i,n,o){this.cells[n].push(o)},zi.prototype.query=function(t,e,r,i,n){var o=this.min,a=this.max;return t<=o&&e<=o&&a<=r&&a<=i&&!n?Array.prototype.slice.call(this.keys):(a=[],this._forEachCell(t,e,r,i,this._queryCell,a,{},n),a)},zi.prototype._queryCell=function(t,e,r,i,n,o,a,s){var u=this.cells[n];if(null!==u)for(var l=this.keys,c=this.bboxes,p=0;p<u.length;p++){var h,f=u[p];void 0===a[f]&&(h=4*f,(s?s(c[0+h],c[1+h],c[2+h],c[3+h]):t<=c[2+h]&&e<=c[3+h]&&r>=c[0+h]&&i>=c[1+h])?(a[f]=!0,o.push(l[f])):a[f]=!1)}},zi.prototype._forEachCell=function(t,e,r,i,n,o,a,s){for(var u=this._convertToCellCoord(t),l=this._convertToCellCoord(e),c=this._convertToCellCoord(r),p=this._convertToCellCoord(i),h=u;h<=c;h++)for(var f=l;f<=p;f++){var d=this.d*f+h;if((!s||s(this._convertFromCellCoord(h),this._convertFromCellCoord(f),this._convertFromCellCoord(h+1),this._convertFromCellCoord(f+1)))&&n.call(this,t,e,r,i,d,o,a,s))return}},zi.prototype._convertFromCellCoord=function(t){return(t-this.padding)/this.scale},zi.prototype._convertToCellCoord=function(t){return Math.max(0,Math.min(this.d-1,Math.floor(t*this.scale)+this.padding))},zi.prototype.toArrayBuffer=function(){if(this.arrayBuffer)return this.arrayBuffer;for(var t=this.cells,e=3+this.cells.length+1+1,r=0,i=0;i<this.cells.length;i++)r+=this.cells[i].length;var n=new Int32Array(e+r+this.keys.length+this.bboxes.length);n[0]=this.extent,n[1]=this.n,n[2]=this.padding;for(var o=e,a=0;a<t.length;a++){var s=t[a];n[3+a]=o,n.set(s,o),o+=s.length}return n[3+t.length]=o,n.set(this.keys,o),n[3+t.length+1]=o+=this.keys.length,n.set(this.bboxes,o),o+=this.bboxes.length,n.buffer};var Li,Bi=a.ImageData,Di=a.ImageBitmap,Ri={};function Oi(t,e,r){void 0===r&&(r={}),Object.defineProperty(e,"_classRegistryKey",{value:t,writeable:!1}),Ri[t]={klass:e,omit:r.omit||[],shallow:r.shallow||[]}}for(Li in Oi("Object",Object),ki.serialize=function(t,e){return t=t.toArrayBuffer(),e&&e.push(t),{buffer:t}},ki.deserialize=function(t){return new ki(t.buffer)},Oi("Grid",ki),Oi("Color",ae),Oi("Error",Error),Oi("ResolvedImage",ce),Oi("StylePropertyFunction",Kr),Oi("StyleExpression",qr,{omit:["_evaluator"]}),Oi("ZoomDependentExpression",Wr),Oi("ZoomConstantExpression",Zr),Oi("CompoundExpression",Ee,{omit:["_evaluate"]}),Ir)Ir[Li]._classRegistryKey||Oi("Expression_"+Li,Ir[Li]);function Fi(t){return t&&"undefined"!=typeof ArrayBuffer&&(t instanceof ArrayBuffer||t.constructor&&"ArrayBuffer"===t.constructor.name)}function ji(t){return Di&&t instanceof Di}function Ui(t,e){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp)return t;if(Fi(t)||ji(t))return e&&e.push(t),t;if(ArrayBuffer.isView(t)){var r=t;return e&&e.push(r.buffer),r}if(t instanceof Bi)return e&&e.push(t.data.buffer),t;if(Array.isArray(t)){for(var i=[],n=0,o=t;n<o.length;n+=1)i.push(Ui(o[n],e));return i}if("object"!=typeof t)throw new Error("can't serialize object of type "+typeof t);var a=(r=t.constructor)._classRegistryKey;if(!a)throw new Error("can't serialize object of unregistered class");var s,u=r.serialize?r.serialize(t,e):{};if(!r.serialize){for(var l in t)!t.hasOwnProperty(l)||0<=Ri[a].omit.indexOf(l)||(s=t[l],u[l]=0<=Ri[a].shallow.indexOf(l)?s:Ui(s,e));t instanceof Error&&(u.message=t.message)}if(u.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==a&&(u.$name=a),u}function Ni(t){if(null==t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||t instanceof Boolean||t instanceof Number||t instanceof String||t instanceof Date||t instanceof RegExp||Fi(t)||ji(t)||ArrayBuffer.isView(t)||t instanceof Bi)return t;if(Array.isArray(t))return t.map(Ni);if("object"!=typeof t)throw new Error("can't deserialize object of type "+typeof t);var e=t.$name||"Object",r=Ri[e].klass;if(!r)throw new Error("can't deserialize unregistered class "+e);if(r.deserialize)return r.deserialize(t);for(var i=Object.create(r.prototype),n=0,o=Object.keys(t);n<o.length;n+=1){var a,s=o[n];"$name"!==s&&(a=t[s],i[s]=0<=Ri[e].shallow.indexOf(s)?a:Ni(a))}return i}function Vi(){this.first=!0}Vi.prototype.update=function(t,e){var r=Math.floor(t);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=t,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=e):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=e),t!==this.lastZoom&&(this.lastZoom=t,this.lastFloorZoom=r,!0))};var qi={"Latin-1 Supplement":function(t){return 128<=t&&t<=255},Arabic:function(t){return 1536<=t&&t<=1791},"Arabic Supplement":function(t){return 1872<=t&&t<=1919},"Arabic Extended-A":function(t){return 2208<=t&&t<=2303},"Hangul Jamo":function(t){return 4352<=t&&t<=4607},"Unified Canadian Aboriginal Syllabics":function(t){return 5120<=t&&t<=5759},Khmer:function(t){return 6016<=t&&t<=6143},"Unified Canadian Aboriginal Syllabics Extended":function(t){return 6320<=t&&t<=6399},"General Punctuation":function(t){return 8192<=t&&t<=8303},"Letterlike Symbols":function(t){return 8448<=t&&t<=8527},"Number Forms":function(t){return 8528<=t&&t<=8591},"Miscellaneous Technical":function(t){return 8960<=t&&t<=9215},"Control Pictures":function(t){return 9216<=t&&t<=9279},"Optical Character Recognition":function(t){return 9280<=t&&t<=9311},"Enclosed Alphanumerics":function(t){return 9312<=t&&t<=9471},"Geometric Shapes":function(t){return 9632<=t&&t<=9727},"Miscellaneous Symbols":function(t){return 9728<=t&&t<=9983},"Miscellaneous Symbols and Arrows":function(t){return 11008<=t&&t<=11263},"CJK Radicals Supplement":function(t){return 11904<=t&&t<=12031},"Kangxi Radicals":function(t){return 12032<=t&&t<=12255},"Ideographic Description Characters":function(t){return 12272<=t&&t<=12287},"CJK Symbols and Punctuation":function(t){return 12288<=t&&t<=12351},Hiragana:function(t){return 12352<=t&&t<=12447},Katakana:function(t){return 12448<=t&&t<=12543},Bopomofo:function(t){return 12544<=t&&t<=12591},"Hangul Compatibility Jamo":function(t){return 12592<=t&&t<=12687},Kanbun:function(t){return 12688<=t&&t<=12703},"Bopomofo Extended":function(t){return 12704<=t&&t<=12735},"CJK Strokes":function(t){return 12736<=t&&t<=12783},"Katakana Phonetic Extensions":function(t){return 12784<=t&&t<=12799},"Enclosed CJK Letters and Months":function(t){return 12800<=t&&t<=13055},"CJK Compatibility":function(t){return 13056<=t&&t<=13311},"CJK Unified Ideographs Extension A":function(t){return 13312<=t&&t<=19903},"Yijing Hexagram Symbols":function(t){return 19904<=t&&t<=19967},"CJK Unified Ideographs":function(t){return 19968<=t&&t<=40959},"Yi Syllables":function(t){return 40960<=t&&t<=42127},"Yi Radicals":function(t){return 42128<=t&&t<=42191},"Hangul Jamo Extended-A":function(t){return 43360<=t&&t<=43391},"Hangul Syllables":function(t){return 44032<=t&&t<=55215},"Hangul Jamo Extended-B":function(t){return 55216<=t&&t<=55295},"Private Use Area":function(t){return 57344<=t&&t<=63743},"CJK Compatibility Ideographs":function(t){return 63744<=t&&t<=64255},"Arabic Presentation Forms-A":function(t){return 64336<=t&&t<=65023},"Vertical Forms":function(t){return 65040<=t&&t<=65055},"CJK Compatibility Forms":function(t){return 65072<=t&&t<=65103},"Small Form Variants":function(t){return 65104<=t&&t<=65135},"Arabic Presentation Forms-B":function(t){return 65136<=t&&t<=65279},"Halfwidth and Fullwidth Forms":function(t){return 65280<=t&&t<=65519}};function Gi(t){for(var e=0,r=t;e<r.length;e+=1)if(Hi(r[e].charCodeAt(0)))return!0;return!1}function Hi(t){return 746===t||747===t||!(t<4352)&&(qi["Bopomofo Extended"](t)||qi.Bopomofo(t)||qi["CJK Compatibility Forms"](t)&&!(65097<=t&&t<=65103)||qi["CJK Compatibility Ideographs"](t)||qi["CJK Compatibility"](t)||qi["CJK Radicals Supplement"](t)||qi["CJK Strokes"](t)||!(!qi["CJK Symbols and Punctuation"](t)||12296<=t&&t<=12305||12308<=t&&t<=12319||12336===t)||qi["CJK Unified Ideographs Extension A"](t)||qi["CJK Unified Ideographs"](t)||qi["Enclosed CJK Letters and Months"](t)||qi["Hangul Compatibility Jamo"](t)||qi["Hangul Jamo Extended-A"](t)||qi["Hangul Jamo Extended-B"](t)||qi["Hangul Jamo"](t)||qi["Hangul Syllables"](t)||qi.Hiragana(t)||qi["Ideographic Description Characters"](t)||qi.Kanbun(t)||qi["Kangxi Radicals"](t)||qi["Katakana Phonetic Extensions"](t)||qi.Katakana(t)&&12540!==t||!(!qi["Halfwidth and Fullwidth Forms"](t)||65288===t||65289===t||65293===t||65306<=t&&t<=65310||65339===t||65341===t||65343===t||65371<=t&&t<=65503||65507===t||65512<=t&&t<=65519)||!(!qi["Small Form Variants"](t)||65112<=t&&t<=65118||65123<=t&&t<=65126)||qi["Unified Canadian Aboriginal Syllabics"](t)||qi["Unified Canadian Aboriginal Syllabics Extended"](t)||qi["Vertical Forms"](t)||qi["Yijing Hexagram Symbols"](t)||qi["Yi Syllables"](t)||qi["Yi Radicals"](t))}function Zi(t){return!(Hi(t)||(t=t,qi["Latin-1 Supplement"](t)&&(167===t||169===t||174===t||177===t||188===t||189===t||190===t||215===t||247===t)||qi["General Punctuation"](t)&&(8214===t||8224===t||8225===t||8240===t||8241===t||8251===t||8252===t||8258===t||8263===t||8264===t||8265===t||8273===t)||qi["Letterlike Symbols"](t)||qi["Number Forms"](t)||qi["Miscellaneous Technical"](t)&&(8960<=t&&t<=8967||8972<=t&&t<=8991||8996<=t&&t<=9e3||9003===t||9085<=t&&t<=9114||9150<=t&&t<=9165||9167===t||9169<=t&&t<=9179||9186<=t&&t<=9215)||qi["Control Pictures"](t)&&9251!==t||qi["Optical Character Recognition"](t)||qi["Enclosed Alphanumerics"](t)||qi["Geometric Shapes"](t)||qi["Miscellaneous Symbols"](t)&&!(9754<=t&&t<=9759)||qi["Miscellaneous Symbols and Arrows"](t)&&(11026<=t&&t<=11055||11088<=t&&t<=11097||11192<=t&&t<=11243)||qi["CJK Symbols and Punctuation"](t)||qi.Katakana(t)||qi["Private Use Area"](t)||qi["CJK Compatibility Forms"](t)||qi["Small Form Variants"](t)||qi["Halfwidth and Fullwidth Forms"](t)||8734===t||8756===t||8757===t||9984<=t&&t<=10087||10102<=t&&t<=10131||65532===t||65533===t))}function Wi(t){return 1424<=t&&t<=2303||qi["Arabic Presentation Forms-A"](t)||qi["Arabic Presentation Forms-B"](t)}function Xi(t){t&&"string"==typeof t&&-1<t.indexOf("NetworkError")&&(Ji="error"),Ki&&Ki(t)}var Ki=null,Ji="unavailable",Yi=null;function Qi(){en.fire(new Ct("pluginStateChange",{pluginStatus:Ji,pluginURL:Yi}))}function $i(){if("deferred"!==Ji||!Yi)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");Ji="loading",Qi(),Yi&&xt({url:Yi},(function(t){t?Xi(t):(Ji="loaded",Qi())}))}function tn(t,e){this.zoom=t,e?(this.now=e.now,this.fadeDuration=e.fadeDuration,this.zoomHistory=e.zoomHistory,this.transition=e.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Vi,this.transition={})}var en=new Pt,rn={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:function(){return"loaded"===Ji||null!=rn.applyArabicShaping},isLoading:function(){return"loading"===Ji},setState:function(t){Ji=t.pluginStatus,Yi=t.pluginURL},isParsed:function(){return null!=rn.applyArabicShaping&&null!=rn.processBidirectionalText&&null!=rn.processStyledBidirectionalText},getPluginURL:function(){return Yi}};function nn(t,e){this.property=t,this.value=e,this.expression=function(t,e){if(Rr(t))return new Kr(t,e);if(Gr(t)){var r=Xr(t,e);if("error"===r.result)throw new Error(r.value.map((function(t){return t.key+": "+t.message})).join(", "));return r.value}var i=t;return"string"==typeof t&&"color"===e.type&&(i=ae.parse(t)),{kind:"constant",evaluate:function(){return i}}}(void 0===e?t.specification.default:e,t.specification)}function on(t){this.property=t,this.value=new nn(t,void 0)}function an(t){this._properties=t,this._values=Object.create(t.defaultTransitionablePropertyValues)}tn.prototype.isSupportedScript=function(t){return function(t,e){for(var r,i=0,n=t;i<n.length;i+=1)if(r=n[i].charCodeAt(0),!e&&Wi(r)||2304<=r&&r<=3583||3840<=r&&r<=4255||qi.Khmer(r))return!1;return!0}(t,rn.isLoaded())},tn.prototype.crossFadingFactor=function(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)},tn.prototype.getCrossfadeParameters=function(){var t=this.zoom,e=t-Math.floor(t),r=this.crossFadingFactor();return t>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:e+(1-e)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*e}},nn.prototype.isDataDriven=function(){return"source"===this.expression.kind||"composite"===this.expression.kind},nn.prototype.possiblyEvaluate=function(t,e,r){return this.property.possiblyEvaluate(this,t,e,r)},on.prototype.transitioned=function(t,e){return new sn(this.property,this.value,e,h({},t.transition,this.transition),t.now)},on.prototype.untransitioned=function(){return new sn(this.property,this.value,null,{},0)},an.prototype.getValue=function(t){return x(this._values[t].value.value)},an.prototype.setValue=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new on(this._values[t].property)),this._values[t].value=new nn(this._values[t].property,null===e?void 0:x(e))},an.prototype.getTransition=function(t){return x(this._values[t].transition)},an.prototype.setTransition=function(t,e){this._values.hasOwnProperty(t)||(this._values[t]=new on(this._values[t].property)),this._values[t].transition=x(e)||void 0},an.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var i=r[e],n=this.getValue(i);void 0!==n&&(t[i]=n),void 0!==(n=this.getTransition(i))&&(t[i+"-transition"]=n)}return t},an.prototype.transitioned=function(t,e){for(var r=new un(this._properties),i=0,n=Object.keys(this._values);i<n.length;i+=1){var o=n[i];r._values[o]=this._values[o].transitioned(t,e._values[o])}return r},an.prototype.untransitioned=function(){for(var t=new un(this._properties),e=0,r=Object.keys(this._values);e<r.length;e+=1){var i=r[e];t._values[i]=this._values[i].untransitioned()}return t};var sn=function(t,e,r,i,n){this.property=t,this.value=e,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,t.specification.transition&&(i.delay||i.duration)&&(this.prior=r)};sn.prototype.possiblyEvaluate=function(t,e,r){var i=t.now||0,n=this.value.possiblyEvaluate(t,e,r),o=this.prior;if(o){if(i>this.end)return this.prior=null,n;if(this.value.isDataDriven())return this.prior=null,n;if(i<this.begin)return o.possiblyEvaluate(t,e,r);var a=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(t,e,r),n,function(){if(a<=0)return 0;if(1<=a)return 1;var t=a*a,e=t*a;return 4*(a<.5?e:3*(a-t)+e-.75)}())}return n};var un=function(t){this._properties=t,this._values=Object.create(t.defaultTransitioningPropertyValues)};function ln(t){this._properties=t,this._values=Object.create(t.defaultPropertyValues)}function cn(t,e,r){this.property=t,this.value=e,this.parameters=r}un.prototype.possiblyEvaluate=function(t,e,r){for(var i=new pn(this._properties),n=0,o=Object.keys(this._values);n<o.length;n+=1){var a=o[n];i._values[a]=this._values[a].possiblyEvaluate(t,e,r)}return i},un.prototype.hasTransition=function(){for(var t=0,e=Object.keys(this._values);t<e.length;t+=1)if(this._values[e[t]].prior)return!0;return!1},ln.prototype.getValue=function(t){return x(this._values[t].value)},ln.prototype.setValue=function(t,e){this._values[t]=new nn(this._values[t].property,null===e?void 0:x(e))},ln.prototype.serialize=function(){for(var t={},e=0,r=Object.keys(this._values);e<r.length;e+=1){var i=r[e],n=this.getValue(i);void 0!==n&&(t[i]=n)}return t},ln.prototype.possiblyEvaluate=function(t,e,r){for(var i=new pn(this._properties),n=0,o=Object.keys(this._values);n<o.length;n+=1){var a=o[n];i._values[a]=this._values[a].possiblyEvaluate(t,e,r)}return i},cn.prototype.isConstant=function(){return"constant"===this.value.kind},cn.prototype.constantOr=function(t){return"constant"===this.value.kind?this.value.value:t},cn.prototype.evaluate=function(t,e,r,i){return this.property.evaluate(this.value,this.parameters,t,e,r,i)};var pn=function(t){this._properties=t,this._values=Object.create(t.defaultPossiblyEvaluatedValues)};function hn(t){this.specification=t}pn.prototype.get=function(t){return this._values[t]},hn.prototype.possiblyEvaluate=function(t,e){return t.expression.evaluate(e)},hn.prototype.interpolate=function(t,e,r){var i=Ze[this.specification.type];return i?i(t,e,r):t},(nc=function(t,e){this.specification=t,this.overrides=e}).prototype.possiblyEvaluate=function(t,e,r,i){return new cn(this,"constant"===t.expression.kind||"camera"===t.expression.kind?{kind:"constant",value:t.expression.evaluate(e,null,{},r,i)}:t.expression,e)},nc.prototype.interpolate=function(t,e,r){if("constant"!==t.value.kind||"constant"!==e.value.kind)return t;if(void 0===t.value.value||void 0===e.value.value)return new cn(this,{kind:"constant",value:void 0},t.parameters);var i=Ze[this.specification.type];return i?new cn(this,{kind:"constant",value:i(t.value.value,e.value.value,r)},t.parameters):t},nc.prototype.evaluate=function(t,e,r,i,n,o){return"constant"===t.kind?t.value:t.evaluate(e,r,i,n,o)};var fn,dn=((fn=nc)&&(mn.__proto__=fn),((mn.prototype=Object.create(fn&&fn.prototype)).constructor=mn).prototype.possiblyEvaluate=function(t,e,r,i){return void 0===t.value?new cn(this,{kind:"constant",value:void 0},e):"constant"===t.expression.kind?(i=t.expression.evaluate(e,null,{},r,i),i="resolvedImage"===t.property.specification.type&&"string"!=typeof i?i.name:i,new cn(this,{kind:"constant",value:i=this._calculate(i,i,i,e)},e)):"camera"!==t.expression.kind?new cn(this,t.expression,e):new cn(this,{kind:"constant",value:t=this._calculate(t.expression.evaluate({zoom:e.zoom-1}),t.expression.evaluate({zoom:e.zoom}),t.expression.evaluate({zoom:e.zoom+1}),e)},e)},mn.prototype.evaluate=function(t,e,r,i,n,o){return"source"!==t.kind?"composite"===t.kind?this._calculate(t.evaluate({zoom:Math.floor(e.zoom)-1},r,i),t.evaluate({zoom:Math.floor(e.zoom)},r,i),t.evaluate({zoom:Math.floor(e.zoom)+1},r,i),e):t.value:(o=t.evaluate(e,r,i,n,o),this._calculate(o,o,o,e))},mn.prototype._calculate=function(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},mn.prototype.interpolate=function(t){return t},mn);function mn(){fn.apply(this,arguments)}(sc=function(t){this.specification=t}).prototype.possiblyEvaluate=function(t,e,r,i){if(void 0!==t.value)return"constant"!==t.expression.kind?this._calculate(t.expression.evaluate(new tn(Math.floor(e.zoom-1),e)),t.expression.evaluate(new tn(Math.floor(e.zoom),e)),t.expression.evaluate(new tn(Math.floor(e.zoom+1),e)),e):(i=t.expression.evaluate(e,null,{},r,i),this._calculate(i,i,i,e))},sc.prototype._calculate=function(t,e,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:t,to:e}:{from:r,to:e}},sc.prototype.interpolate=function(t){return t};var yn=function(t){this.specification=t};function gn(t){for(var e in this.properties=t,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[],t){(i=t[e]).specification.overridable&&this.overridableProperties.push(e);var r=this.defaultPropertyValues[e]=new nn(i,void 0),i=this.defaultTransitionablePropertyValues[e]=new on(i);this.defaultTransitioningPropertyValues[e]=i.untransitioned(),this.defaultPossiblyEvaluatedValues[e]=r.possiblyEvaluate({})}}yn.prototype.possiblyEvaluate=function(t,e,r,i){return!!t.expression.evaluate(e,null,{},r,i)},yn.prototype.interpolate=function(){return!1},Oi("DataDrivenProperty",nc),Oi("DataConstantProperty",hn),Oi("CrossFadedDataDrivenProperty",dn),Oi("CrossFadedProperty",sc),Oi("ColorRampProperty",yn);var _n,vn=((_n=Pt)&&(wn.__proto__=_n),((wn.prototype=Object.create(_n&&_n.prototype)).constructor=wn).prototype.getCrossfadeParameters=function(){return this._crossfadeParameters},wn.prototype.getLayoutProperty=function(t){return"visibility"===t?this.visibility:this._unevaluatedLayout.getValue(t)},wn.prototype.setLayoutProperty=function(t,e,r){void 0===r&&(r={}),null!=e&&this._validate(Pi,"layers."+this.id+".layout."+t,t,e,r)||("visibility"!==t?this._unevaluatedLayout.setValue(t,e):this.visibility=e)},wn.prototype.getPaintProperty=function(t){return g(t,"-transition")?this._transitionablePaint.getTransition(t.slice(0,-"-transition".length)):this._transitionablePaint.getValue(t)},wn.prototype.setPaintProperty=function(t,e,r){if(void 0===r&&(r={}),null!=e&&this._validate(Ci,"layers."+this.id+".paint."+t,t,e,r))return!1;if(g(t,"-transition"))return this._transitionablePaint.setTransition(t.slice(0,-"-transition".length),e||void 0),!1;var i="cross-faded-data-driven"===(n=this._transitionablePaint._values[t]).property.specification["property-type"],n=(r=n.value.isDataDriven(),n.value);return this._transitionablePaint.setValue(t,e),this._handleSpecialPaintPropertyUpdate(t),(e=this._transitionablePaint._values[t].value).isDataDriven()||r||i||this._handleOverridablePaintPropertyUpdate(t,n,e)},wn.prototype._handleSpecialPaintPropertyUpdate=function(t){},wn.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!1},wn.prototype.isHidden=function(t){return!!(this.minzoom&&t<this.minzoom)||!!(this.maxzoom&&t>=this.maxzoom)||"none"===this.visibility},wn.prototype.updateTransitions=function(t){this._transitioningPaint=this._transitionablePaint.transitioned(t,this._transitioningPaint)},wn.prototype.hasTransition=function(){return this._transitioningPaint.hasTransition()},wn.prototype.recalculate=function(t,e){t.getCrossfadeParameters&&(this._crossfadeParameters=t.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(t,void 0,e)),this.paint=this._transitioningPaint.possiblyEvaluate(t,void 0,e)},wn.prototype.serialize=function(){var t={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&&(t.layout=t.layout||{},t.layout.visibility=this.visibility),v(t,(function(t,e){return!(void 0===t||"layout"===e&&!Object.keys(t).length||"paint"===e&&!Object.keys(t).length)}))},wn.prototype._validate=function(t,e,r,i,n){return void 0===n&&(n={}),(!n||!1!==n.validate)&&Mi(this,t.call(Ii,{key:e,layerType:this.type,objectKey:r,value:i,styleSpec:Lt,style:{glyphs:!0,sprite:!0}}))},wn.prototype.is3D=function(){return!1},wn.prototype.isTileClipped=function(){return!1},wn.prototype.hasOffscreenPass=function(){return!1},wn.prototype.resize=function(){},wn.prototype.isStateDependent=function(){for(var t in this.paint._values){var e=this.paint.get(t);if(e instanceof cn&&zr(e.property.specification)&&("source"===e.value.kind||"composite"===e.value.kind)&&e.value.isStateDependent)return!0}return!1},wn),xn={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array},bn=function(t,e){this._structArray=t,this._pos1=e*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8};function wn(t,e){if(_n.call(this),this.id=t.id,this.type=t.type,this._featureFilter={filter:function(){return!0},needGeometry:!1},"custom"!==t.type&&(this.metadata=t.metadata,this.minzoom=t.minzoom,this.maxzoom=t.maxzoom,"background"!==t.type&&(this.source=t.source,this.sourceLayer=t["source-layer"],this.filter=t.filter),e.layout&&(this._unevaluatedLayout=new ln(e.layout)),e.paint)){for(var r in this._transitionablePaint=new an(e.paint),t.paint)this.setPaintProperty(r,t.paint[r],{validate:!1});for(var i in t.layout)this.setLayoutProperty(i,t.layout[i],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new pn(e.paint)}}function Sn(t,e){void 0===e&&(e=1);var r=0,i=0;return{members:t.map((function(t){var n=xn[t.type].BYTES_PER_ELEMENT,o=r=Tn(r,Math.max(e,n)),a=t.components||1;return i=Math.max(i,n),r+=n*a,{name:t.name,type:t.type,components:a,offset:o}})),size:Tn(r,Math.max(i,e)),alignment:e}}function Tn(t,e){return Math.ceil(t/e)*e}(va=function(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}).serialize=function(t,e){return t._trim(),e&&(t.isTransferred=!0,e.push(t.arrayBuffer)),{length:t.length,arrayBuffer:t.arrayBuffer}},va.deserialize=function(t){var e=Object.create(this.prototype);return e.arrayBuffer=t.arrayBuffer,e.length=t.length,e.capacity=t.arrayBuffer.byteLength/e.bytesPerElement,e._refreshViews(),e},va.prototype._trim=function(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())},va.prototype.clear=function(){this.length=0},va.prototype.resize=function(t){this.reserve(t),this.length=t},va.prototype.reserve=function(t){t>this.capacity&&(this.capacity=Math.max(t,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement),t=this.uint8,this._refreshViews(),t&&this.uint8.set(t))},va.prototype._refreshViews=function(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")};var En,In=((En=va)&&(An.__proto__=En),((An.prototype=Object.create(En&&En.prototype)).constructor=An).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},An.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},An.prototype.emplace=function(t,e,r){var i=2*t;return this.int16[0+i]=e,this.int16[1+i]=r,t},An);function An(){En.apply(this,arguments)}In.prototype.bytesPerElement=4,Oi("StructArrayLayout2i4",In);var Cn,Pn=((Cn=va)&&(Mn.__proto__=Cn),((Mn.prototype=Object.create(Cn&&Cn.prototype)).constructor=Mn).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},Mn.prototype.emplaceBack=function(t,e,r,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)},Mn.prototype.emplace=function(t,e,r,i,n){var o=4*t;return this.int16[0+o]=e,this.int16[1+o]=r,this.int16[2+o]=i,this.int16[3+o]=n,t},Mn);function Mn(){Cn.apply(this,arguments)}Pn.prototype.bytesPerElement=8,Oi("StructArrayLayout4i8",Pn);var kn,zn=((kn=va)&&(Ln.__proto__=kn),((Ln.prototype=Object.create(kn&&kn.prototype)).constructor=Ln).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},Ln.prototype.emplaceBack=function(t,e,r,i,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n,o)},Ln.prototype.emplace=function(t,e,r,i,n,o,a){var s=6*t;return this.int16[0+s]=e,this.int16[1+s]=r,this.int16[2+s]=i,this.int16[3+s]=n,this.int16[4+s]=o,this.int16[5+s]=a,t},Ln);function Ln(){kn.apply(this,arguments)}zn.prototype.bytesPerElement=12,Oi("StructArrayLayout2i4i12",zn);var Bn,Dn=((Bn=va)&&(Rn.__proto__=Bn),((Rn.prototype=Object.create(Bn&&Bn.prototype)).constructor=Rn).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},Rn.prototype.emplaceBack=function(t,e,r,i,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n,o)},Rn.prototype.emplace=function(t,e,r,i,n,o,a){var s=4*t,u=8*t;return this.int16[0+s]=e,this.int16[1+s]=r,this.uint8[4+u]=i,this.uint8[5+u]=n,this.uint8[6+u]=o,this.uint8[7+u]=a,t},Rn);function Rn(){Bn.apply(this,arguments)}Dn.prototype.bytesPerElement=8,Oi("StructArrayLayout2i4ub8",Dn);var On,Fn=((On=va)&&(jn.__proto__=On),((jn.prototype=Object.create(On&&On.prototype)).constructor=jn).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},jn.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},jn.prototype.emplace=function(t,e,r){var i=2*t;return this.float32[0+i]=e,this.float32[1+i]=r,t},jn);function jn(){On.apply(this,arguments)}Fn.prototype.bytesPerElement=8,Oi("StructArrayLayout2f8",Fn);var Un,Nn=((Un=va)&&(Vn.__proto__=Un),((Vn.prototype=Object.create(Un&&Un.prototype)).constructor=Vn).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},Vn.prototype.emplaceBack=function(t,e,r,i,n,o,a,s,u,l){var c=this.length;return this.resize(c+1),this.emplace(c,t,e,r,i,n,o,a,s,u,l)},Vn.prototype.emplace=function(t,e,r,i,n,o,a,s,u,l,c){var p=10*t;return this.uint16[0+p]=e,this.uint16[1+p]=r,this.uint16[2+p]=i,this.uint16[3+p]=n,this.uint16[4+p]=o,this.uint16[5+p]=a,this.uint16[6+p]=s,this.uint16[7+p]=u,this.uint16[8+p]=l,this.uint16[9+p]=c,t},Vn);function Vn(){Un.apply(this,arguments)}Nn.prototype.bytesPerElement=20,Oi("StructArrayLayout10ui20",Nn);var qn,Gn=((qn=va)&&(Hn.__proto__=qn),((Hn.prototype=Object.create(qn&&qn.prototype)).constructor=Hn).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},Hn.prototype.emplaceBack=function(t,e,r,i,n,o,a,s,u,l,c,p){var h=this.length;return this.resize(h+1),this.emplace(h,t,e,r,i,n,o,a,s,u,l,c,p)},Hn.prototype.emplace=function(t,e,r,i,n,o,a,s,u,l,c,p,h){var f=12*t;return this.int16[0+f]=e,this.int16[1+f]=r,this.int16[2+f]=i,this.int16[3+f]=n,this.uint16[4+f]=o,this.uint16[5+f]=a,this.uint16[6+f]=s,this.uint16[7+f]=u,this.int16[8+f]=l,this.int16[9+f]=c,this.int16[10+f]=p,this.int16[11+f]=h,t},Hn);function Hn(){qn.apply(this,arguments)}Gn.prototype.bytesPerElement=24,Oi("StructArrayLayout4i4ui4i24",Gn);var Zn,Wn=((Zn=va)&&(Xn.__proto__=Zn),((Xn.prototype=Object.create(Zn&&Zn.prototype)).constructor=Xn).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},Xn.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},Xn.prototype.emplace=function(t,e,r,i){var n=3*t;return this.float32[0+n]=e,this.float32[1+n]=r,this.float32[2+n]=i,t},Xn);function Xn(){Zn.apply(this,arguments)}Wn.prototype.bytesPerElement=12,Oi("StructArrayLayout3f12",Wn);var Kn,Jn,Yn=((Kn=va)&&(Qn.__proto__=Kn),((Qn.prototype=Object.create(Kn&&Kn.prototype)).constructor=Qn).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)},Qn.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},Qn.prototype.emplace=function(t,e){return this.uint32[+t+0]=e,t},Qn);function Qn(){Kn.apply(this,arguments)}function $n(){Jn.apply(this,arguments)}Yn.prototype.bytesPerElement=4,Oi("StructArrayLayout1ul4",Yn),(Sa=((Jn=va)&&($n.__proto__=Jn),(($n.prototype=Object.create(Jn&&Jn.prototype)).constructor=$n).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)},$n.prototype.emplaceBack=function(t,e,r,i,n,o,a,s,u){var l=this.length;return this.resize(l+1),this.emplace(l,t,e,r,i,n,o,a,s,u)},$n.prototype.emplace=function(t,e,r,i,n,o,a,s,u,l){var c=10*t,p=5*t;return this.int16[0+c]=e,this.int16[1+c]=r,this.int16[2+c]=i,this.int16[3+c]=n,this.int16[4+c]=o,this.int16[5+c]=a,this.uint32[3+p]=s,this.uint16[8+c]=u,this.uint16[9+c]=l,t},$n)).prototype.bytesPerElement=20,Oi("StructArrayLayout6i1ul2ui20",Sa);var to,eo=((to=va)&&(ro.__proto__=to),((ro.prototype=Object.create(to&&to.prototype)).constructor=ro).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},ro.prototype.emplaceBack=function(t,e,r,i,n,o){var a=this.length;return this.resize(a+1),this.emplace(a,t,e,r,i,n,o)},ro.prototype.emplace=function(t,e,r,i,n,o,a){var s=6*t;return this.int16[0+s]=e,this.int16[1+s]=r,this.int16[2+s]=i,this.int16[3+s]=n,this.int16[4+s]=o,this.int16[5+s]=a,t},ro);function ro(){to.apply(this,arguments)}eo.prototype.bytesPerElement=12,Oi("StructArrayLayout2i2i2i12",eo);var io,no=((io=va)&&(oo.__proto__=io),((oo.prototype=Object.create(io&&io.prototype)).constructor=oo).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},oo.prototype.emplaceBack=function(t,e,r,i,n){var o=this.length;return this.resize(o+1),this.emplace(o,t,e,r,i,n)},oo.prototype.emplace=function(t,e,r,i,n,o){var a=4*t,s=8*t;return this.float32[0+a]=e,this.float32[1+a]=r,this.float32[2+a]=i,this.int16[6+s]=n,this.int16[7+s]=o,t},oo);function oo(){io.apply(this,arguments)}no.prototype.bytesPerElement=16,Oi("StructArrayLayout2f1f2i16",no);var ao,so=((ao=va)&&(uo.__proto__=ao),((uo.prototype=Object.create(ao&&ao.prototype)).constructor=uo).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},uo.prototype.emplaceBack=function(t,e,r,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)},uo.prototype.emplace=function(t,e,r,i,n){var o=12*t,a=3*t;return this.uint8[0+o]=e,this.uint8[1+o]=r,this.float32[1+a]=i,this.float32[2+a]=n,t},uo);function uo(){ao.apply(this,arguments)}so.prototype.bytesPerElement=12,Oi("StructArrayLayout2ub2f12",so);var lo,co,po,ho,fo=((lo=va)&&(mo.__proto__=lo),((mo.prototype=Object.create(lo&&lo.prototype)).constructor=mo).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},mo.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},mo.prototype.emplace=function(t,e,r,i){var n=3*t;return this.uint16[0+n]=e,this.uint16[1+n]=r,this.uint16[2+n]=i,t},mo);function mo(){lo.apply(this,arguments)}function yo(){co.apply(this,arguments)}function go(){po.apply(this,arguments)}fo.prototype.bytesPerElement=6,Oi("StructArrayLayout3ui6",fo),(L=((co=va)&&(yo.__proto__=co),((yo.prototype=Object.create(co&&co.prototype)).constructor=yo).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)},yo.prototype.emplaceBack=function(t,e,r,i,n,o,a,s,u,l,c,p,h,f,d,m,y){var g=this.length;return this.resize(g+1),this.emplace(g,t,e,r,i,n,o,a,s,u,l,c,p,h,f,d,m,y)},yo.prototype.emplace=function(t,e,r,i,n,o,a,s,u,l,c,p,h,f,d,m,y,g){var _=24*t,v=12*t,x=48*t;return this.int16[0+_]=e,this.int16[1+_]=r,this.uint16[2+_]=i,this.uint16[3+_]=n,this.uint32[2+v]=o,this.uint32[3+v]=a,this.uint32[4+v]=s,this.uint16[10+_]=u,this.uint16[11+_]=l,this.uint16[12+_]=c,this.float32[7+v]=p,this.float32[8+v]=h,this.uint8[36+x]=f,this.uint8[37+x]=d,this.uint8[38+x]=m,this.uint32[10+v]=y,this.int16[22+_]=g,t},yo)).prototype.bytesPerElement=48,Oi("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",L),(ho=((po=va)&&(go.__proto__=po),((go.prototype=Object.create(po&&po.prototype)).constructor=go).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)},go.prototype.emplaceBack=function(t,e,r,i,n,o,a,s,u,l,c,p,h,f,d,m,y,g,_,v,x,b,w,S,T,E,I,A){var C=this.length;return this.resize(C+1),this.emplace(C,t,e,r,i,n,o,a,s,u,l,c,p,h,f,d,m,y,g,_,v,x,b,w,S,T,E,I,A)},go.prototype.emplace=function(t,e,r,i,n,o,a,s,u,l,c,p,h,f,d,m,y,g,_,v,x,b,w,S,T,E,I,A,C){var P=34*t,M=17*t;return this.int16[0+P]=e,this.int16[1+P]=r,this.int16[2+P]=i,this.int16[3+P]=n,this.int16[4+P]=o,this.int16[5+P]=a,this.int16[6+P]=s,this.int16[7+P]=u,this.uint16[8+P]=l,this.uint16[9+P]=c,this.uint16[10+P]=p,this.uint16[11+P]=h,this.uint16[12+P]=f,this.uint16[13+P]=d,this.uint16[14+P]=m,this.uint16[15+P]=y,this.uint16[16+P]=g,this.uint16[17+P]=_,this.uint16[18+P]=v,this.uint16[19+P]=x,this.uint16[20+P]=b,this.uint16[21+P]=w,this.uint16[22+P]=S,this.uint32[12+M]=T,this.float32[13+M]=E,this.float32[14+M]=I,this.float32[15+M]=A,this.float32[16+M]=C,t},go)).prototype.bytesPerElement=68,Oi("StructArrayLayout8i15ui1ul4f68",ho);var _o,vo,xo,bo=((_o=va)&&(wo.__proto__=_o),((wo.prototype=Object.create(_o&&_o.prototype)).constructor=wo).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},wo.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},wo.prototype.emplace=function(t,e){return this.float32[+t+0]=e,t},wo);function wo(){_o.apply(this,arguments)}function So(){vo.apply(this,arguments)}function To(){xo.apply(this,arguments)}bo.prototype.bytesPerElement=4,Oi("StructArrayLayout1f4",bo),($s=((vo=va)&&(So.__proto__=vo),((So.prototype=Object.create(vo&&vo.prototype)).constructor=So).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)},So.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},So.prototype.emplace=function(t,e,r,i){var n=3*t;return this.int16[0+n]=e,this.int16[1+n]=r,this.int16[2+n]=i,t},So)).prototype.bytesPerElement=6,Oi("StructArrayLayout3i6",$s),(et=((xo=va)&&(To.__proto__=xo),((To.prototype=Object.create(xo&&xo.prototype)).constructor=To).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},To.prototype.emplaceBack=function(t,e,r){var i=this.length;return this.resize(i+1),this.emplace(i,t,e,r)},To.prototype.emplace=function(t,e,r,i){var n=4*t;return this.uint32[2*t+0]=e,this.uint16[2+n]=r,this.uint16[3+n]=i,t},To)).prototype.bytesPerElement=8,Oi("StructArrayLayout1ul2ui8",et);var Eo,Io,Ao,Co=((Eo=va)&&(Po.__proto__=Eo),((Po.prototype=Object.create(Eo&&Eo.prototype)).constructor=Po).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},Po.prototype.emplaceBack=function(t,e){var r=this.length;return this.resize(r+1),this.emplace(r,t,e)},Po.prototype.emplace=function(t,e,r){var i=2*t;return this.uint16[0+i]=e,this.uint16[1+i]=r,t},Po);function Po(){Eo.apply(this,arguments)}function Mo(){Io.apply(this,arguments)}Co.prototype.bytesPerElement=4,Oi("StructArrayLayout2ui4",Co),(Ao=((Io=va)&&(Mo.__proto__=Io),((Mo.prototype=Object.create(Io&&Io.prototype)).constructor=Mo).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)},Mo.prototype.emplaceBack=function(t){var e=this.length;return this.resize(e+1),this.emplace(e,t)},Mo.prototype.emplace=function(t,e){return this.uint16[+t+0]=e,t},Mo)).prototype.bytesPerElement=2,Oi("StructArrayLayout1ui2",Ao);var ko,zo=((ko=va)&&(Lo.__proto__=ko),((Lo.prototype=Object.create(ko&&ko.prototype)).constructor=Lo).prototype._refreshViews=function(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)},Lo.prototype.emplaceBack=function(t,e,r,i){var n=this.length;return this.resize(n+1),this.emplace(n,t,e,r,i)},Lo.prototype.emplace=function(t,e,r,i,n){var o=4*t;return this.float32[0+o]=e,this.float32[1+o]=r,this.float32[2+o]=i,this.float32[3+o]=n,t},Lo);function Lo(){ko.apply(this,arguments)}zo.prototype.bytesPerElement=16,Oi("StructArrayLayout4f16",zo);var Bo=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;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 n(this.anchorPointX,this.anchorPointY)},Object.defineProperties(e.prototype,r),e}(bn);Bo.prototype.size=20;var Do,Ro=((Do=Sa)&&(Oo.__proto__=Do),((Oo.prototype=Object.create(Do&&Do.prototype)).constructor=Oo).prototype.get=function(t){return new Bo(this,t)},Oo);function Oo(){Do.apply(this,arguments)}Oi("CollisionBoxArray",Ro);var Fo=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;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(t){this._structArray.uint8[this._pos1+37]=t},r.hidden.get=function(){return this._structArray.uint8[this._pos1+38]},r.hidden.set=function(t){this._structArray.uint8[this._pos1+38]=t},r.crossTileID.get=function(){return this._structArray.uint32[this._pos4+10]},r.crossTileID.set=function(t){this._structArray.uint32[this._pos4+10]=t},r.associatedIconIndex.get=function(){return this._structArray.int16[this._pos2+22]},Object.defineProperties(e.prototype,r),e}(bn);Fo.prototype.size=48;var jo,Uo=((jo=L)&&(No.__proto__=jo),((No.prototype=Object.create(jo&&jo.prototype)).constructor=No).prototype.get=function(t){return new Fo(this,t)},No);function No(){jo.apply(this,arguments)}Oi("PlacedSymbolArray",Uo);var Vo=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;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(t){this._structArray.uint32[this._pos4+12]=t},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(e.prototype,r),e}(bn);Vo.prototype.size=68;var qo,Go=((qo=ho)&&(Ho.__proto__=qo),((Ho.prototype=Object.create(qo&&qo.prototype)).constructor=Ho).prototype.get=function(t){return new Vo(this,t)},Ho);function Ho(){qo.apply(this,arguments)}Oi("SymbolInstanceArray",Go);var Zo,Wo=((Zo=bo)&&(Xo.__proto__=Zo),((Xo.prototype=Object.create(Zo&&Zo.prototype)).constructor=Xo).prototype.getoffsetX=function(t){return this.float32[+t+0]},Xo);function Xo(){Zo.apply(this,arguments)}Oi("GlyphOffsetArray",Wo);var Ko,Jo=((Ko=$s)&&(Yo.__proto__=Ko),((Yo.prototype=Object.create(Ko&&Ko.prototype)).constructor=Yo).prototype.getx=function(t){return this.int16[3*t+0]},Yo.prototype.gety=function(t){return this.int16[3*t+1]},Yo.prototype.gettileUnitDistanceFromAnchor=function(t){return this.int16[3*t+2]},Yo);function Yo(){Ko.apply(this,arguments)}Oi("SymbolLineVertexArray",Jo);var Qo=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),(e.prototype=Object.create(t&&t.prototype)).constructor=e;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(e.prototype,r),e}(bn);Qo.prototype.size=8;var $o,ta=(($o=et)&&(ea.__proto__=$o),((ea.prototype=Object.create($o&&$o.prototype)).constructor=ea).prototype.get=function(t){return new Qo(this,t)},ea);function ea(){$o.apply(this,arguments)}function ra(t){void 0===t&&(t=[]),this.segments=t}Oi("FeatureIndexArray",ta);var ia=Sn([{name:"a_pos",components:2,type:"Int16"}],4).members;function na(t,e){return 256*(t=c(Math.floor(t),0,255))+c(Math.floor(e),0,255)}ra.prototype.prepareSegment=function(t,e,r,i){var n=this.segments[this.segments.length-1];return ra.MAX_VERTEX_ARRAY_LENGTH<t&&w("Max vertices per segment is "+ra.MAX_VERTEX_ARRAY_LENGTH+": bucket requested "+t),(!n||n.vertexLength+t>ra.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==i)&&(n={vertexOffset:e.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==i&&(n.sortKey=i),this.segments.push(n)),n},ra.prototype.get=function(){return this.segments},ra.prototype.destroy=function(){for(var t=0,e=this.segments;t<e.length;t+=1){var r,i=e[t];for(r in i.vaos)i.vaos[r].destroy()}},ra.simpleSegment=function(t,e,r,i){return new ra([{vertexOffset:t,primitiveOffset:e,vertexLength:r,primitiveLength:i,vaos:{},sortKey:0}])},ra.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,Oi("SegmentVector",ra);var oa=Sn([{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"}]),aa=(vr=e((function(t){t.exports=function(t,e){for(var r,i,n,o=t.length-(r=3&t.length),a=e,s=3432918353,u=461845907,l=0;l<o;)n=255&t.charCodeAt(l)|(255&t.charCodeAt(++l))<<8|(255&t.charCodeAt(++l))<<16|(255&t.charCodeAt(++l))<<24,++l,a=27492+(65535&(i=5*(65535&(a=(a^=n=(65535&(n=(n=(65535&n)*s+(((n>>>16)*s&65535)<<16)&4294967295)<<15|n>>>17))*u+(((n>>>16)*u&65535)<<16)&4294967295)<<13|a>>>19))+((5*(a>>>16)&65535)<<16)&4294967295))+((58964+(i>>>16)&65535)<<16);switch(n=0,r){case 3:n^=(255&t.charCodeAt(l+2))<<16;case 2:n^=(255&t.charCodeAt(l+1))<<8;case 1:a^=n=(65535&(n=(n=(65535&(n^=255&t.charCodeAt(l)))*s+(((n>>>16)*s&65535)<<16)&4294967295)<<15|n>>>17))*u+(((n>>>16)*u&65535)<<16)&4294967295}return a^=t.length,a=2246822507*(65535&(a^=a>>>16))+((2246822507*(a>>>16)&65535)<<16)&4294967295,a=3266489909*(65535&(a^=a>>>13))+((3266489909*(a>>>16)&65535)<<16)&4294967295,(a^=a>>>16)>>>0}})),xr=e((function(t){t.exports=function(t,e){for(var r,i=t.length,n=e^i,o=0;4<=i;)r=1540483477*(65535&(r=255&t.charCodeAt(o)|(255&t.charCodeAt(++o))<<8|(255&t.charCodeAt(++o))<<16|(255&t.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16),i-=4,++o;switch(i){case 3:n^=(255&t.charCodeAt(o+2))<<16;case 2:n^=(255&t.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&t.charCodeAt(o)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0}})),vr);wr=xr;function sa(){this.ids=[],this.positions=[],this.indexed=!1}aa.murmur3=vr,aa.murmur2=wr,sa.prototype.add=function(t,e,r,i){this.ids.push(la(t)),this.positions.push(e,r,i)},sa.prototype.getPositions=function(t){for(var e=la(t),r=0,i=this.ids.length-1;r<i;){var n=r+i>>1;this.ids[n]>=e?i=n:r=1+n}for(var o=[];this.ids[r]===e;)o.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return o},sa.serialize=function(t,e){var r=new Float64Array(t.ids);return function t(e,r,i,n){for(;i<n;){for(var o=e[i+n>>1],a=i-1,s=n+1;;){for(;e[++a]<o;);for(;e[--s]>o;);if(s<=a)break;ca(e,a,s),ca(r,3*a,3*s),ca(r,3*a+1,3*s+1),ca(r,3*a+2,3*s+2)}s-i<n-s?(t(e,r,i,s),i=s+1):(t(e,r,s+1,n),n=s)}}(r,t=new Uint32Array(t.positions),0,r.length-1),e&&e.push(r.buffer,t.buffer),{ids:r,positions:t}},sa.deserialize=function(t){var e=new sa;return e.ids=t.ids,e.positions=t.positions,e.indexed=!0,e};var ua=Math.pow(2,53)-1;function la(t){var e=+t;return!isNaN(e)&&e<=ua?e:aa(String(t))}function ca(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}Oi("FeaturePositionMap",sa);(ga=br=function(t,e){this.gl=t.gl,this.location=e})&&(Ma.__proto__=ga),((Ma.prototype=Object.create(ga&&ga.prototype)).constructor=Ma).prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1i(this.location,t))},Tr=Ma;var pa,ha,fa,da,ma,ya,ga,_a=((ya=br)&&(Pa.__proto__=ya),((Pa.prototype=Object.create(ya&&ya.prototype)).constructor=Pa).prototype.set=function(t){this.current!==t&&(this.current=t,this.gl.uniform1f(this.location,t))},Pa),va=(Sr=((ma=br)&&(Ca.__proto__=ma),((Ca.prototype=Object.create(ma&&ma.prototype)).constructor=Ca).prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]||(this.current=t,this.gl.uniform2f(this.location,t[0],t[1]))},Ca),(da=br)&&(Aa.__proto__=da),((Aa.prototype=Object.create(da&&da.prototype)).constructor=Aa).prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]||(this.current=t,this.gl.uniform3f(this.location,t[0],t[1],t[2]))},Aa),xa=((fa=br)&&(Ia.__proto__=fa),((Ia.prototype=Object.create(fa&&fa.prototype)).constructor=Ia).prototype.set=function(t){t[0]===this.current[0]&&t[1]===this.current[1]&&t[2]===this.current[2]&&t[3]===this.current[3]||(this.current=t,this.gl.uniform4f(this.location,t[0],t[1],t[2],t[3]))},Ia),ba=((ha=br)&&(Ea.__proto__=ha),((Ea.prototype=Object.create(ha&&ha.prototype)).constructor=Ea).prototype.set=function(t){t.r===this.current.r&&t.g===this.current.g&&t.b===this.current.b&&t.a===this.current.a||(this.current=t,this.gl.uniform4f(this.location,t.r,t.g,t.b,t.a))},Ea),wa=new Float32Array(16),Sa=((pa=br)&&(Ta.__proto__=pa),((Ta.prototype=Object.create(pa&&pa.prototype)).constructor=Ta).prototype.set=function(t){if(t[12]!==this.current[12]||t[0]!==this.current[0])return this.current=t,void this.gl.uniformMatrix4fv(this.location,!1,t);for(var e=1;e<16;e++)if(t[e]!==this.current[e]){this.current=t,this.gl.uniformMatrix4fv(this.location,!1,t);break}},Ta);function Ta(t,e){pa.call(this,t,e),this.current=wa}function Ea(t,e){ha.call(this,t,e),this.current=ae.transparent}function Ia(t,e){fa.call(this,t,e),this.current=[0,0,0,0]}function Aa(t,e){da.call(this,t,e),this.current=[0,0,0]}function Ca(t,e){ma.call(this,t,e),this.current=[0,0]}function Pa(t,e){ya.call(this,t,e),this.current=0}function Ma(t,e){ga.call(this,t,e),this.current=0}function ka(t){return[na(255*t.r,255*t.g),na(255*t.b,255*t.a)]}function za(t,e,r){this.value=t,this.uniformNames=e.map((function(t){return"u_"+t})),this.type=r}function La(t,e){this.uniformNames=e.map((function(t){return"u_"+t})),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}function Ba(t,e,r,i){this.expression=t,this.type=r,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?2:1,offset:0}})),this.paintVertexArray=new i}function Da(t,e,r,i,n,o){this.expression=t,this.uniformNames=e.map((function(t){return"u_"+t+"_t"})),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=e.map((function(t){return{name:"a_"+t,type:"Float32",components:"color"===r?4:2,offset:0}})),this.paintVertexArray=new o}function Ra(t,e,r,i,n,o){this.expression=t,this.type=e,this.useIntegerZoom=r,this.zoom=i,this.layerId=o,this.zoomInPaintVertexArray=new n,this.zoomOutPaintVertexArray=new n}function Oa(t,e,r){this.binders={},this._buffers=[];var i,n,o,a,s,u,l,c=[];for(i in t.paint._values)!r(i)||(a=t.paint.get(i))instanceof cn&&zr(a.property.specification)&&(u=i,l=t.type,n={"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"]}[u]||[u.replace(l+"-","").replace(/-/g,"_")],o=a.value,u=a.property.specification.type,l=a.property.useIntegerZoom,a="cross-faded"===(a=a.property.specification["property-type"])||"cross-faded-data-driven"===a,"constant"===o.kind?(this.binders[i]=a?new La(o.value,n):new za(o.value,n,u),c.push("/u_"+i)):"source"===o.kind||a?(s=ja(i,u,"source"),this.binders[i]=a?new Ra(o,u,l,e,s,t.id):new Ba(o,n,u,s),c.push("/a_"+i)):(s=ja(i,u,"composite"),this.binders[i]=new Da(o,n,u,l,e,s),c.push("/z_"+i)));this.cacheKey=c.sort().join("")}function Fa(t,e,r){void 0===r&&(r=function(){return!0}),this.programConfigurations={};for(var i=0,n=t;i<n.length;i+=1){var o=n[i];this.programConfigurations[o.id]=new Oa(o,e,r)}this.needsUpload=!1,this._featureMap=new sa,this._bufferOffset=0}function ja(t,e,r){var i={color:{source:Fn,composite:zo},number:{source:bo,composite:Fn}};return(t={"line-pattern":{source:Nn,composite:Nn},"fill-pattern":{source:Nn,composite:Nn},"fill-extrusion-pattern":{source:Nn,composite:Nn}}[t])&&t[r]||i[e][r]}za.prototype.setUniform=function(t,e,r){t.set(r.constantOr(this.value))},za.prototype.getBinding=function(t,e,r){return new("color"===this.type?ba:_a)(t,e)},La.prototype.setConstantPatternPositions=function(t,e){this.pixelRatioFrom=e.pixelRatio,this.pixelRatioTo=t.pixelRatio,this.patternFrom=e.tlbr,this.patternTo=t.tlbr},La.prototype.setUniform=function(t,e,r,i){(i="u_pattern_to"===i?this.patternTo:"u_pattern_from"===i?this.patternFrom:"u_pixel_ratio_to"===i?this.pixelRatioTo:"u_pixel_ratio_from"===i?this.pixelRatioFrom:null)&&t.set(i)},La.prototype.getBinding=function(t,e,r){return new("u_pattern"===r.substr(0,9)?xa:_a)(t,e)},Ba.prototype.populatePaintArray=function(t,e,r,i,n){var o=this.paintVertexArray.length;n=this.expression.evaluate(new tn(0),e,{},i,[],n);this.paintVertexArray.resize(t),this._setPaintValue(o,t,n)},Ba.prototype.updatePaintArray=function(t,e,r,i){i=this.expression.evaluate({zoom:0},r,i),this._setPaintValue(t,e,i)},Ba.prototype._setPaintValue=function(t,e,r){if("color"===this.type)for(var i=ka(r),n=t;n<e;n++)this.paintVertexArray.emplace(n,i[0],i[1]);else{for(var o=t;o<e;o++)this.paintVertexArray.emplace(o,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}},Ba.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Ba.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Da.prototype.populatePaintArray=function(t,e,r,i,n){var o=this.expression.evaluate(new tn(this.zoom),e,{},i,[],n);i=this.expression.evaluate(new tn(this.zoom+1),e,{},i,[],n),n=this.paintVertexArray.length;this.paintVertexArray.resize(t),this._setPaintValue(n,t,o,i)},Da.prototype.updatePaintArray=function(t,e,r,i){var n=this.expression.evaluate({zoom:this.zoom},r,i);i=this.expression.evaluate({zoom:this.zoom+1},r,i);this._setPaintValue(t,e,n,i)},Da.prototype._setPaintValue=function(t,e,r,i){if("color"===this.type)for(var n=ka(r),o=ka(i),a=t;a<e;a++)this.paintVertexArray.emplace(a,n[0],n[1],o[0],o[1]);else{for(var s=t;s<e;s++)this.paintVertexArray.emplace(s,r,i);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(i))}},Da.prototype.upload=function(t){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=t.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))},Da.prototype.destroy=function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()},Da.prototype.setUniform=function(t,e){e=this.useIntegerZoom?Math.floor(e.zoom):e.zoom,e=c(this.expression.interpolationFactor(e,this.zoom,this.zoom+1),0,1),t.set(e)},Da.prototype.getBinding=function(t,e,r){return new _a(t,e)},Ra.prototype.populatePaintArray=function(t,e,r){var i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(t),this.zoomOutPaintVertexArray.resize(t),this._setPaintValues(i,t,e.patterns&&e.patterns[this.layerId],r)},Ra.prototype.updatePaintArray=function(t,e,r,i,n){this._setPaintValues(t,e,r.patterns&&r.patterns[this.layerId],n)},Ra.prototype._setPaintValues=function(t,e,r,i){if(i&&r){var n=i[r.min],o=i[r.mid],a=i[r.max];if(n&&o&&a)for(var s=t;s<e;s++)this.zoomInPaintVertexArray.emplace(s,o.tl[0],o.tl[1],o.br[0],o.br[1],n.tl[0],n.tl[1],n.br[0],n.br[1],o.pixelRatio,n.pixelRatio),this.zoomOutPaintVertexArray.emplace(s,o.tl[0],o.tl[1],o.br[0],o.br[1],a.tl[0],a.tl[1],a.br[0],a.br[1],o.pixelRatio,a.pixelRatio)}},Ra.prototype.upload=function(t){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=t.createVertexBuffer(this.zoomInPaintVertexArray,oa.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=t.createVertexBuffer(this.zoomOutPaintVertexArray,oa.members,this.expression.isStateDependent))},Ra.prototype.destroy=function(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()},Oa.prototype.getMaxValue=function(t){return(t=this.binders[t])instanceof Ba||t instanceof Da?t.maxValue:0},Oa.prototype.populatePaintArrays=function(t,e,r,i,n){for(var o in this.binders){var a=this.binders[o];(a instanceof Ba||a instanceof Da||a instanceof Ra)&&a.populatePaintArray(t,e,r,i,n)}},Oa.prototype.setConstantPatternPositions=function(t,e){for(var r in this.binders){var i=this.binders[r];i instanceof La&&i.setConstantPatternPositions(t,e)}},Oa.prototype.updatePaintArrays=function(t,e,r,i,n){var o,a=!1;for(o in t)for(var s=0,u=e.getPositions(o);s<u.length;s+=1){var l,c=u[s],p=r.feature(c.index);for(l in this.binders){var h,f=this.binders[l];(f instanceof Ba||f instanceof Da||f instanceof Ra)&&!0===f.expression.isStateDependent&&(h=i.paint.get(l),f.expression=h.value,f.updatePaintArray(c.start,c.end,p,t[o],n),a=!0)}}return a},Oa.prototype.defines=function(){var t,e=[];for(t in this.binders){var r=this.binders[t];(r instanceof za||r instanceof La)&&e.push.apply(e,r.uniformNames.map((function(t){return"#define HAS_UNIFORM_"+t})))}return e},Oa.prototype.getBinderAttributes=function(){var t,e=[];for(t in this.binders){var r=this.binders[t];if(r instanceof Ba||r instanceof Da)for(var i=0;i<r.paintVertexAttributes.length;i++)e.push(r.paintVertexAttributes[i].name);else if(r instanceof Ra)for(var n=0;n<oa.members.length;n++)e.push(oa.members[n].name)}return e},Oa.prototype.getBinderUniforms=function(){var t,e=[];for(t in this.binders){var r=this.binders[t];if(r instanceof za||r instanceof La||r instanceof Da)for(var i=0,n=r.uniformNames;i<n.length;i+=1)e.push(n[i])}return e},Oa.prototype.getPaintVertexBuffers=function(){return this._buffers},Oa.prototype.getUniforms=function(t,e){var r,i=[];for(r in this.binders){var n=this.binders[r];if(n instanceof za||n instanceof La||n instanceof Da)for(var o=0,a=n.uniformNames;o<a.length;o+=1){var s,u=a[o];e[u]&&(s=n.getBinding(t,e[u],u),i.push({name:u,property:r,binding:s}))}}return i},Oa.prototype.setUniforms=function(t,e,r,i){for(var n=0,o=e;n<o.length;n+=1){var a=o[n],s=a.name,u=a.property;this.binders[u].setUniform(a.binding,i,r.get(u),s)}},Oa.prototype.updatePaintBuffers=function(t){for(var e in this._buffers=[],this.binders){var r,i=this.binders[e];t&&i instanceof Ra?(r=2===t.fromScale?i.zoomInPaintVertexBuffer:i.zoomOutPaintVertexBuffer)&&this._buffers.push(r):(i instanceof Ba||i instanceof Da)&&i.paintVertexBuffer&&this._buffers.push(i.paintVertexBuffer)}},Oa.prototype.upload=function(t){for(var e in this.binders){var r=this.binders[e];(r instanceof Ba||r instanceof Da||r instanceof Ra)&&r.upload(t)}this.updatePaintBuffers()},Oa.prototype.destroy=function(){for(var t in this.binders){var e=this.binders[t];(e instanceof Ba||e instanceof Da||e instanceof Ra)&&e.destroy()}},Fa.prototype.populatePaintArrays=function(t,e,r,i,n,o){for(var a in this.programConfigurations)this.programConfigurations[a].populatePaintArrays(t,e,i,n,o);void 0!==e.id&&this._featureMap.add(e.id,r,this._bufferOffset,t),this._bufferOffset=t,this.needsUpload=!0},Fa.prototype.updatePaintArrays=function(t,e,r,i){for(var n=0,o=r;n<o.length;n+=1){var a=o[n];this.needsUpload=this.programConfigurations[a.id].updatePaintArrays(t,this._featureMap,e,a,i)||this.needsUpload}},Fa.prototype.get=function(t){return this.programConfigurations[t]},Fa.prototype.upload=function(t){if(this.needsUpload){for(var e in this.programConfigurations)this.programConfigurations[e].upload(t);this.needsUpload=!1}},Fa.prototype.destroy=function(){for(var t in this.programConfigurations)this.programConfigurations[t].destroy()},Oi("ConstantBinder",za),Oi("CrossFadedConstantBinder",La),Oi("SourceExpressionBinder",Ba),Oi("CrossFadedCompositeBinder",Ra),Oi("CompositeExpressionBinder",Da),Oi("ProgramConfiguration",Oa,{omit:["_buffers"]}),Oi("ProgramConfigurationSet",Fa);var Ua=Math.pow(2,14)-1,Na=-Ua-1;function Va(t){for(var e=8192/t.extent,r=t.loadGeometry(),i=0;i<r.length;i++)for(var n=r[i],o=0;o<n.length;o++){var a=n[o],s=Math.round(a.x*e),u=Math.round(a.y*e);a.x=c(s,Na,Ua),a.y=c(u,Na,Ua),(s<a.x||s>a.x+1||u<a.y||u>a.y+1)&&w("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return r}function qa(t,e){return{type:t.type,id:t.id,properties:t.properties,geometry:e?Va(t):[]}}function Ga(t,e,r,i,n){t.emplaceBack(2*e+(i+1)/2,2*r+(n+1)/2)}function Ha(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new In,this.indexArray=new fo,this.segments=new ra,this.programConfigurations=new Fa(t.layers,t.zoom),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))}function Za(t,e){for(var r=0;r<t.length;r++)if(Qa(e,t[r]))return!0;for(var i=0;i<e.length;i++)if(Qa(t,e[i]))return!0;return!!Xa(t,e)}function Wa(t,e){if(1===t.length)return Ya(e,t[0]);for(var r=0;r<e.length;r++)for(var i=e[r],n=0;n<i.length;n++)if(Qa(t,i[n]))return!0;for(var o=0;o<t.length;o++)if(Ya(e,t[o]))return!0;for(var a=0;a<e.length;a++)if(Xa(t,e[a]))return!0;return!1}function Xa(t,e){if(0!==t.length&&0!==e.length)for(var r,i,n,o,a=0;a<t.length-1;a++)for(var s=t[a],u=t[a+1],l=0;l<e.length-1;l++)if(i=u,S(r=s,n=e[l],o=e[l+1])!==S(i,n,o)&&S(r,i,n)!==S(r,i,o))return 1}function Ka(t,e,r){var i=r*r;if(1===e.length)return t.distSqr(e[0])<i;for(var n=1;n<e.length;n++)if(Ja(t,e[n-1],e[n])<i)return 1}function Ja(t,e,r){var i=e.distSqr(r);return 0===i?t.distSqr(e):(i=((t.x-e.x)*(r.x-e.x)+(t.y-e.y)*(r.y-e.y))/i,t.distSqr(i<0?e:1<i?r:r.sub(e)._mult(i)._add(e)))}function Ya(t,e){for(var r,i,n,o=!1,a=0;a<t.length;a++)for(var s=0,u=(r=t[a]).length-1;s<r.length;u=s++)(i=r[s]).y>e.y!=(n=r[u]).y>e.y&&e.x<(n.x-i.x)*(e.y-i.y)/(n.y-i.y)+i.x&&(o=!o);return o}function Qa(t,e){for(var r=!1,i=0,n=t.length-1;i<t.length;n=i++){var o=t[i],a=t[n];o.y>e.y!=a.y>e.y&&e.x<(a.x-o.x)*(e.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function $a(t,e,r){var i=e.paint.get(t).value;return"constant"===i.kind?i.value:r.programConfigurations.get(e.id).getMaxValue(t)}function ts(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function es(t,e,r,i,o){if(!e[0]&&!e[1])return t;var a=n.convert(e)._mult(o);"viewport"===r&&a._rotate(-i);for(var s=[],u=0;u<t.length;u++)s.push(t[u].sub(a));return s}Ha.prototype.populate=function(t,e,r){var i=this.layers[0],n=[],o=null,a=!1;"circle"===i.type&&(a=!(o=i.layout.get("circle-sort-key")).isConstant());for(var s=0,u=t;s<u.length;s+=1){var l=u[s],c=l.feature,p=l.id,h=l.index,f=l.sourceLayerIndex,d=this.layers[0]._featureFilter.needGeometry,m=qa(c,d);this.layers[0]._featureFilter.filter(new tn(this.zoom),m,r)&&(l=a?o.evaluate(m,{},r):void 0,l={id:p,properties:c.properties,type:c.type,sourceLayerIndex:f,index:h,geometry:d?m.geometry:Va(c),patterns:{},sortKey:l},n.push(l))}a&&n.sort((function(t,e){return t.sortKey-e.sortKey}));for(var y=0,g=n;y<g.length;y+=1){var _=g[y],v=_.geometry,x=_.index,b=_.sourceLayerIndex,w=t[x].feature;this.addFeature(_,v,x,r),e.featureIndex.insert(w,v,x,b,this.index)}},Ha.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Ha.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Ha.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Ha.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,ia),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},Ha.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},Ha.prototype.addFeature=function(t,e,r,i){for(var n=0,o=e;n<o.length;n+=1)for(var a=0,s=o[n];a<s.length;a+=1){var u,l=s[a],c=l.x,p=l.y;c<0||8192<=c||p<0||8192<=p||(l=(u=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,t.sortKey)).vertexLength,Ga(this.layoutVertexArray,c,p,-1,-1),Ga(this.layoutVertexArray,c,p,1,-1),Ga(this.layoutVertexArray,c,p,1,1),Ga(this.layoutVertexArray,c,p,-1,1),this.indexArray.emplaceBack(l,l+1,l+2),this.indexArray.emplaceBack(l,l+3,l+2),u.vertexLength+=4,u.primitiveLength+=2)}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,{},i)},Oi("CircleBucket",Ha,{omit:["layers"]});L=new gn({"circle-sort-key":new nc(Lt.layout_circle["circle-sort-key"])});var rs={paint:new gn({"circle-radius":new nc(Lt.paint_circle["circle-radius"]),"circle-color":new nc(Lt.paint_circle["circle-color"]),"circle-blur":new nc(Lt.paint_circle["circle-blur"]),"circle-opacity":new nc(Lt.paint_circle["circle-opacity"]),"circle-translate":new hn(Lt.paint_circle["circle-translate"]),"circle-translate-anchor":new hn(Lt.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new hn(Lt.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new hn(Lt.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new nc(Lt.paint_circle["circle-stroke-width"]),"circle-stroke-color":new nc(Lt.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new nc(Lt.paint_circle["circle-stroke-opacity"])}),layout:L},is="undefined"!=typeof Float32Array?Float32Array:Array;function ns(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function os(t,e,r){var i=e[0],n=e[1],o=e[2],a=e[3],s=e[4],u=e[5],l=e[6],c=e[7],p=e[8],h=e[9],f=e[10],d=e[11],m=e[12],y=e[13],g=e[14],_=e[15],v=r[0],x=r[1],b=r[2];e=r[3];return t[0]=v*i+x*s+b*p+e*m,t[1]=v*n+x*u+b*h+e*y,t[2]=v*o+x*l+b*f+e*g,t[3]=v*a+x*c+b*d+e*_,t[4]=(v=r[4])*i+(x=r[5])*s+(b=r[6])*p+(e=r[7])*m,t[5]=v*n+x*u+b*h+e*y,t[6]=v*o+x*l+b*f+e*g,t[7]=v*a+x*c+b*d+e*_,t[8]=(v=r[8])*i+(x=r[9])*s+(b=r[10])*p+(e=r[11])*m,t[9]=v*n+x*u+b*h+e*y,t[10]=v*o+x*l+b*f+e*g,t[11]=v*a+x*c+b*d+e*_,t[12]=(v=r[12])*i+(x=r[13])*s+(b=r[14])*p+(e=r[15])*m,t[13]=v*n+x*u+b*h+e*y,t[14]=v*o+x*l+b*f+e*g,t[15]=v*a+x*c+b*d+e*_,t}function as(t,e,r){var i=e[0],n=e[1],o=e[2];e=e[3];return t[0]=r[0]*i+r[4]*n+r[8]*o+r[12]*e,t[1]=r[1]*i+r[5]*n+r[9]*o+r[13]*e,t[2]=r[2]*i+r[6]*n+r[10]*o+r[14]*e,t[3]=r[3]*i+r[7]*n+r[11]*o+r[15]*e,t}Math.hypot||(Math.hypot=function(){for(var t=arguments,e=0,r=arguments.length;r--;)e+=t[r]*t[r];return Math.sqrt(e)}),ho=os,$s=new is(3),is!=Float32Array&&($s[0]=0,$s[1]=0,$s[2]=0),bn=new is(4),is!=Float32Array&&(bn[0]=0,bn[1]=0,bn[2]=0,bn[3]=0);var ss;et=new is(2),is!=Float32Array&&(et[0]=0,et[1]=0),(ss=vn)&&(us.__proto__=ss),((us.prototype=Object.create(ss&&ss.prototype)).constructor=us).prototype.createBucket=function(t){return new Ha(t)},us.prototype.queryRadius=function(t){return $a("circle-radius",this,t)+$a("circle-stroke-width",this,t)+ts(this.paint.get("circle-translate"))},us.prototype.queryIntersectsFeature=function(t,e,r,i,n,o,a,s){t=es(t,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),r=this.paint.get("circle-radius").evaluate(e,r)+this.paint.get("circle-stroke-width").evaluate(e,r);for(var u,l="map"===this.paint.get("circle-pitch-alignment"),c=l?t:(u=s,t.map((function(t){return ls(t,u)}))),p=l?r*a:r,h=0,f=i;h<f.length;h+=1)for(var d=0,m=f[h];d<m.length;d+=1){var y=m[d],g=l?y:ls(y,s),_=p;y=as([],[y.x,y.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?_*=y[3]/o.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(_*=o.cameraToCenterDistance/y[3]),y=_,Qa(_=c,g=g)||Ka(g,_,y))return!0}return!1},xr=us;function us(t){ss.call(this,t,rs)}function ls(t,e){return e=as([],[t.x,t.y,0,1],e),new n(e[0]/e[3],e[1]/e[3])}var cs,ps=((cs=Ha)&&(hs.__proto__=cs),(hs.prototype=Object.create(cs&&cs.prototype)).constructor=hs);function hs(){cs.apply(this,arguments)}function fs(t,e,r,i){var n=e.width;e=e.height;if(i){if(i instanceof Uint8ClampedArray)i=new Uint8Array(i.buffer);else if(i.length!==n*e*r)throw new RangeError("mismatched image size")}else i=new Uint8Array(n*e*r);return t.width=n,t.height=e,t.data=i,t}function ds(t,e,r){var i=e.width,n=e.height;i===t.width&&n===t.height||(ms(t,e=fs({},{width:i,height:n},r),{x:0,y:0},{x:0,y:0},{width:Math.min(t.width,i),height:Math.min(t.height,n)},r),t.width=i,t.height=n,t.data=e.data)}function ms(t,e,r,i,n,o){if(0===n.width||0===n.height)return e;if(n.width>t.width||n.height>t.height||r.x>t.width-n.width||r.y>t.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>e.width||n.height>e.height||i.x>e.width-n.width||i.y>e.height-n.height)throw new RangeError("out of range destination coordinates for image copy");for(var a=t.data,s=e.data,u=0;u<n.height;u++)for(var l=((r.y+u)*t.width+r.x)*o,c=((i.y+u)*e.width+i.x)*o,p=0;p<n.width*o;p++)s[c+p]=a[l+p];return e}Oi("HeatmapBucket",ps,{omit:["layers"]});var ys=function(t,e){fs(this,t,1,e)};function gs(t,e){fs(this,t,4,e)}ys.prototype.resize=function(t){ds(this,t,1)},ys.prototype.clone=function(){return new ys({width:this.width,height:this.height},new Uint8Array(this.data))},ys.copy=function(t,e,r,i,n){ms(t,e,r,i,n,1)},gs.prototype.resize=function(t){ds(this,t,4)},gs.prototype.replace=function(t,e){e?this.data.set(t):this.data=t instanceof Uint8ClampedArray?new Uint8Array(t.buffer):t},gs.prototype.clone=function(){return new gs({width:this.width,height:this.height},new Uint8Array(this.data))},gs.copy=function(t,e,r,i,n){ms(t,e,r,i,n,4)},Oi("AlphaImage",ys),Oi("RGBAImage",gs);var _s={paint:new gn({"heatmap-radius":new nc(Lt.paint_heatmap["heatmap-radius"]),"heatmap-weight":new nc(Lt.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new hn(Lt.paint_heatmap["heatmap-intensity"]),"heatmap-color":new yn(Lt.paint_heatmap["heatmap-color"]),"heatmap-opacity":new hn(Lt.paint_heatmap["heatmap-opacity"])})};function vs(t){function e(e,i,n){r[t.evaluationKey]=n,n=t.expression.evaluate(r),o.data[e+i+0]=Math.floor(255*n.r/n.a),o.data[e+i+1]=Math.floor(255*n.g/n.a),o.data[e+i+2]=Math.floor(255*n.b/n.a),o.data[e+i+3]=Math.floor(255*n.a)}var r={},i=t.resolution||256,n=t.clips?t.clips.length:1,o=t.image||new gs({width:i,height:n});if(t.clips)for(var a=0,s=0;a<n;++a,s+=4*i)for(var u=0,l=0;u<i;u++,l+=4){var c=u/(i-1),p=t.clips[a];e(s,l,p.start*(1-c)+p.end*c)}else for(var h=0,f=0;h<i;h++,f+=4)e(0,f,h/(i-1));return o}(bs=vn)&&(Is.__proto__=bs),((Is.prototype=Object.create(bs&&bs.prototype)).constructor=Is).prototype.createBucket=function(t){return new ps(t)},Is.prototype._handleSpecialPaintPropertyUpdate=function(t){"heatmap-color"===t&&this._updateColorRamp()},Is.prototype._updateColorRamp=function(){this.colorRamp=vs({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null},Is.prototype.resize=function(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)},Is.prototype.queryRadius=function(){return 0},Is.prototype.queryIntersectsFeature=function(){return!1},Is.prototype.hasOffscreenPass=function(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility},vr=Is;var xs,bs,ws={paint:new gn({"hillshade-illumination-direction":new hn(Lt.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new hn(Lt.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new hn(Lt.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new hn(Lt.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new hn(Lt.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new hn(Lt.paint_hillshade["hillshade-accent-color"])})},Ss=(wr=((xs=vn)&&(Es.__proto__=xs),((Es.prototype=Object.create(xs&&xs.prototype)).constructor=Es).prototype.hasOffscreenPass=function(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility},Es),Sn([{name:"a_pos",components:2,type:"Int16"}],4).members),Ts=As;br=As;function Es(t){xs.call(this,t,ws)}function Is(t){bs.call(this,t,_s),this._updateColorRamp()}function As(t,e,r){r=r||2;var i,n,o,a,s,u,l,c=e&&e.length,p=c?e[0]*r:t.length,h=Cs(t,0,p,r,!0),f=[];if(!h||h.next===h.prev)return f;if(c&&(h=function(t,e,r,i){for(var n,o,a,s=[],u=0,l=e.length;u<l;u++)(n=Cs(t,e[u]*i,u<l-1?e[u+1]*i:t.length,i,!1))===n.next&&(n.steiner=!0),s.push(function(t){for(var e=t,r=t;(e.x<r.x||e.x===r.x&&e.y<r.y)&&(r=e),(e=e.next)!==t;);return r}(n));for(s.sort(Ms),u=0;u<s.length;u++)(a=function(t,e){var r,i=e,n=t.x,o=t.y,a=-1/0;do{if(o<=i.y&&o>=i.next.y&&i.next.y!==i.y){var s=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(s<=n&&a<s){if((a=s)===n){if(o===i.y)return i;if(o===i.next.y)return i.next}r=i.x<i.next.x?i:i.next}}}while((i=i.next)!==e);if(!r)return null;if(n===a)return r;var u,l,c,p=r,h=r.x,f=r.y,d=1/0;for(i=r;n>=i.x&&i.x>=h&&n!==i.x&&zs(o<f?n:a,o,h,f,o<f?a:n,o,i.x,i.y)&&(u=Math.abs(o-i.y)/(n-i.x),Fs(i,t)&&(u<d||u===d&&(i.x>r.x||i.x===r.x&&(c=i,Ls((l=r).prev,l,c.prev)<0&&Ls(c.next,l,l.next)<0)))&&(r=i,d=u)),(i=i.next)!==p;);return r}(o=s[u],a=r))&&(o=js(a,o),Ps(a,a.next),Ps(o,o.next)),r=Ps(r,r.next);return r}(t,e,h,r)),t.length>80*r){i=o=t[0],n=a=t[1];for(var d=r;d<p;d+=r)(s=t[d])<i&&(i=s),(u=t[d+1])<n&&(n=u),o<s&&(o=s),a<u&&(a=u);l=0!==(l=Math.max(o-i,a-n))?1/l:0}return function t(e,r,i,n,o,a,s){if(e){!s&&a&&function(t,e,r,i){for(var n=t;null===n.z&&(n.z=ks(n.x,n.y,e,r,i)),n.prevZ=n.prev,n.nextZ=n.next,(n=n.next)!==t;);n.prevZ.nextZ=null,n.prevZ=null,function(t){var e,r,i,n,o,a,s,u,l=1;do{for(r=t,o=t=null,a=0;r;){for(a++,i=r,e=s=0;e<l&&(s++,i=i.nextZ);e++);for(u=l;0<s||0<u&&i;)0!==s&&(0===u||!i||r.z<=i.z)?(r=(n=r).nextZ,s--):(i=(n=i).nextZ,u--),o?o.nextZ=n:t=n,n.prevZ=o,o=n;r=i}}while(o.nextZ=null,l*=2,1<a)}(n)}(e,n,o,a);for(var u,l,c=e;e.prev!==e.next;)if(u=e.prev,l=e.next,a?function(t,e,r,i){var n=t.prev,o=t,a=t.next;if(0<=Ls(n,o,a))return!1;for(var s=(n.x>o.x?n.x>a.x?n:a:o.x>a.x?o:a).x,u=(n.y>o.y?n.y>a.y?n:a:o.y>a.y?o:a).y,l=ks((n.x<o.x?n.x<a.x?n:a:o.x<a.x?o:a).x,(n.y<o.y?n.y<a.y?n:a:o.y<a.y?o:a).y,e,r,i),c=ks(s,u,e,r,i),p=t.prevZ,h=t.nextZ;p&&p.z>=l&&h&&h.z<=c;){if(p!==t.prev&&p!==t.next&&zs(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=Ls(p.prev,p,p.next))return!1;if(p=p.prevZ,h!==t.prev&&h!==t.next&&zs(n.x,n.y,o.x,o.y,a.x,a.y,h.x,h.y)&&0<=Ls(h.prev,h,h.next))return!1;h=h.nextZ}for(;p&&p.z>=l;){if(p!==t.prev&&p!==t.next&&zs(n.x,n.y,o.x,o.y,a.x,a.y,p.x,p.y)&&0<=Ls(p.prev,p,p.next))return!1;p=p.prevZ}for(;h&&h.z<=c;){if(h!==t.prev&&h!==t.next&&zs(n.x,n.y,o.x,o.y,a.x,a.y,h.x,h.y)&&0<=Ls(h.prev,h,h.next))return!1;h=h.nextZ}return!0}(e,n,o,a):function(t){var e=t.prev,r=t,i=t.next;if(0<=Ls(e,r,i))return!1;for(var n=t.next.next;n!==t.prev;){if(zs(e.x,e.y,r.x,r.y,i.x,i.y,n.x,n.y)&&0<=Ls(n.prev,n,n.next))return!1;n=n.next}return!0}(e))r.push(u.i/i),r.push(e.i/i),r.push(l.i/i),Ns(e),e=l.next,c=l.next;else if((e=l)===c){s?1===s?t(e=function(t,e,r){var i=t;do{var n=i.prev,o=i.next.next}while(!Bs(n,o)&&Ds(n,i,i.next,o)&&Fs(n,o)&&Fs(o,n)&&(e.push(n.i/r),e.push(i.i/r),e.push(o.i/r),Ns(i),Ns(i.next),i=t=o),(i=i.next)!==t);return Ps(i)}(Ps(e),r,i),r,i,n,o,a,2):2===s&&function(e,r,i,n,o,a){var s=e;do{for(var u=s.next.next;u!==s.prev;){if(s.i!==u.i&&function(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!function(t,e){var r=t;do{if(r.i!==t.i&&r.next.i!==t.i&&r.i!==e.i&&r.next.i!==e.i&&Ds(r,r.next,t,e))return 1}while((r=r.next)!==t)}(t,e)&&(Fs(t,e)&&Fs(e,t)&&function(t,e){for(var r=t,i=!1,n=(t.x+e.x)/2,o=(t.y+e.y)/2;r.y>o!=r.next.y>o&&r.next.y!==r.y&&n<(r.next.x-r.x)*(o-r.y)/(r.next.y-r.y)+r.x&&(i=!i),(r=r.next)!==t;);return i}(t,e)&&(Ls(t.prev,t,e.prev)||Ls(t,e.prev,e))||Bs(t,e)&&0<Ls(t.prev,t,t.next)&&0<Ls(e.prev,e,e.next))}(s,u)){var l=js(s,u);return s=Ps(s,s.next),l=Ps(l,l.next),t(s,r,i,n,o,a),t(l,r,i,n,o,a)}u=u.next}}while((s=s.next)!==e)}(e,r,i,n,o,a):t(Ps(e),r,i,n,o,a,1);break}}}(h,f,r,i,n,l),f}function Cs(t,e,r,i,n){var o,a;if(n===0<qs(t,e,r,i))for(o=e;o<r;o+=i)a=Us(o,t[o],t[o+1],a);else for(o=r-i;e<=o;o-=i)a=Us(o,t[o],t[o+1],a);return a&&Bs(a,a.next)&&(Ns(a),a=a.next),a}function Ps(t,e){if(!t)return t;e=e||t;var r,i=t;do{if(r=!1,i.steiner||!Bs(i,i.next)&&0!==Ls(i.prev,i,i.next))i=i.next;else{if(Ns(i),(i=e=i.prev)===i.next)break;r=!0}}while(r||i!==e);return e}function Ms(t,e){return t.x-e.x}function ks(t,e,r,i,n){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-r)*n)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-i)*n)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function zs(t,e,r,i,n,o,a,s){return 0<=(n-a)*(e-s)-(t-a)*(o-s)&&0<=(t-a)*(i-s)-(r-a)*(e-s)&&0<=(r-a)*(o-s)-(n-a)*(i-s)}function Ls(t,e,r){return(e.y-t.y)*(r.x-e.x)-(e.x-t.x)*(r.y-e.y)}function Bs(t,e){return t.x===e.x&&t.y===e.y}function Ds(t,e,r,i){var n=Os(Ls(t,e,r)),o=Os(Ls(t,e,i)),a=Os(Ls(r,i,t)),s=Os(Ls(r,i,e));return n!==o&&a!==s||0===n&&Rs(t,r,e)||0===o&&Rs(t,i,e)||0===a&&Rs(r,t,i)||0===s&&Rs(r,e,i)}function Rs(t,e,r){return e.x<=Math.max(t.x,r.x)&&e.x>=Math.min(t.x,r.x)&&e.y<=Math.max(t.y,r.y)&&e.y>=Math.min(t.y,r.y)}function Os(t){return 0<t?1:t<0?-1:0}function Fs(t,e){return Ls(t.prev,t,t.next)<0?0<=Ls(t,e,t.next)&&0<=Ls(t,t.prev,e):Ls(t,e,t.prev)<0||Ls(t,t.next,e)<0}function js(t,e){var r=new Vs(t.i,t.x,t.y),i=new Vs(e.i,e.x,e.y),n=t.next,o=e.prev;return(t.next=e).prev=t,(r.next=n).prev=r,(i.next=r).prev=i,(o.next=i).prev=o,i}function Us(t,e,r,i){return r=new Vs(t,e,r),i?(r.next=i.next,(r.prev=i).next.prev=r,i.next=r):(r.prev=r).next=r,r}function Ns(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Vs(t,e,r){this.i=t,this.x=e,this.y=r,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function qs(t,e,r,i){for(var n=0,o=e,a=r-i;o<r;o+=i)n+=(t[a]-t[o])*(t[o+1]+t[a+1]),a=o;return n}function Gs(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function Hs(t,e){return t<e?-1:e<t?1:0}function Zs(t,e){var r=t.length;if(r<=1)return[t];for(var i,n,o,a,s=[],u=0;u<r;u++){var l=function(t){for(var e,r,i=0,n=0,o=t.length,a=o-1;n<o;a=n++)i+=((r=t[a]).x-(e=t[n]).x)*(e.y+r.y);return i}(t[u]);0!==l&&(t[u].area=Math.abs(l),void 0===n&&(n=l<0),n===l<0?(i&&s.push(i),i=[t[u]]):i.push(t[u]))}if(i&&s.push(i),1<e)for(var c=0;c<s.length;c++)s[c].length<=e||(1,a=Ws,function t(e,r,i,n,o){for(;i<n;){var a,s,u,l;600<n-i&&(a=n-i+1,s=r-i+1,l=Math.log(a),u=.5*Math.exp(2*l/3),l=.5*Math.sqrt(l*u*(a-u)/a)*(s-a/2<0?-1:1),t(e,r,Math.max(i,Math.floor(r-s*u/a+l)),Math.min(n,Math.floor(r+(a-s)*u/a+l)),o));var c=e[r],p=i,h=n;for(Gs(e,i,r),0<o(e[n],c)&&Gs(e,i,n);p<h;){for(Gs(e,p,h),p++,h--;o(e[p],c)<0;)p++;for(;0<o(e[h],c);)h--}0===o(e[i],c)?Gs(e,i,h):Gs(e,++h,n),h<=r&&(i=h+1),r<=h&&(n=h-1)}}(o=s[c],e,1,s[c].length-1||o.length-1,a||Hs),s[c]=s[c].slice(0,e));return s}function Ws(t,e){return e.area-t.area}function Xs(t,e,r){for(var i=r.patternDependencies,n=!1,o=0,a=e;o<a.length;o+=1){var s=a[o].paint.get(t+"-pattern");s.isConstant()||(n=!0),(s=s.constantOr(null))&&(n=!0,i[s.to]=!0,i[s.from]=!0)}return n}function Ks(t,e,r,i,n){for(var o=n.patternDependencies,a=0,s=e;a<s.length;a+=1){var u,l,c=s[a],p=c.paint.get(t+"-pattern").value;"constant"!==p.kind&&(u=p.evaluate({zoom:i-1},r,{},n.availableImages),l=p.evaluate({zoom:i},r,{},n.availableImages),p=p.evaluate({zoom:i+1},r,{},n.availableImages),l=l&&l.name?l.name:l,p=p&&p.name?p.name:p,o[u=u&&u.name?u.name:u]=!0,o[l]=!0,o[p]=!0,r.patterns[c.id]={min:u,mid:l,max:p})}return r}function Js(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new In,this.indexArray=new fo,this.indexArray2=new Co,this.programConfigurations=new Fa(t.layers,t.zoom),this.segments=new ra,this.segments2=new ra,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))}As.deviation=function(t,e,r,i){var n=e&&e.length,o=Math.abs(qs(t,0,n?e[0]*r:t.length,r));if(n)for(var a=0,s=e.length;a<s;a++)o-=Math.abs(qs(t,e[a]*r,a<s-1?e[a+1]*r:t.length,r));var u=0;for(a=0;a<i.length;a+=3){var l=i[a]*r,c=i[a+1]*r,p=i[a+2]*r;u+=Math.abs((t[l]-t[p])*(t[1+c]-t[1+l])-(t[l]-t[c])*(t[1+p]-t[1+l]))}return 0===o&&0===u?0:Math.abs((u-o)/o)},As.flatten=function(t){for(var e=t[0][0].length,r={vertices:[],holes:[],dimensions:e},i=0,n=0;n<t.length;n++){for(var o=0;o<t[n].length;o++)for(var a=0;a<e;a++)r.vertices.push(t[n][o][a]);0<n&&r.holes.push(i+=t[n-1].length)}return r},Ts.default=br,Js.prototype.populate=function(t,e,r){this.hasPattern=Xs("fill",this.layers,e);for(var i=this.layers[0].layout.get("fill-sort-key"),n=!i.isConstant(),o=[],a=0,s=t;a<s.length;a+=1){var u=s[a],l=u.feature,c=u.id,p=u.index,h=u.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,d=qa(l,f);this.layers[0]._featureFilter.filter(new tn(this.zoom),d,r)&&(u=n?i.evaluate(d,{},r,e.availableImages):void 0,u={id:c,properties:l.properties,type:l.type,sourceLayerIndex:h,index:p,geometry:f?d.geometry:Va(l),patterns:{},sortKey:u},o.push(u))}n&&o.sort((function(t,e){return t.sortKey-e.sortKey}));for(var m=0,y=o;m<y.length;m+=1){var g,_=y[m],v=_.geometry,x=_.index,b=_.sourceLayerIndex;this.hasPattern?(g=Ks("fill",this.layers,_,this.zoom,e),this.patternFeatures.push(g)):this.addFeature(_,v,x,r,{}),e.featureIndex.insert(t[x].feature,v,x,b,this.index)}},Js.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},Js.prototype.addFeatures=function(t,e,r){for(var i=0,n=this.patternFeatures;i<n.length;i+=1){var o=n[i];this.addFeature(o,o.geometry,o.index,e,r)}},Js.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},Js.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},Js.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,Ss),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.indexBuffer2=t.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(t),this.uploaded=!0},Js.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())},Js.prototype.addFeature=function(t,e,r,i,n){for(var o=0,a=Zs(e,500);o<a.length;o+=1){for(var s=a[o],u=0,l=0,c=s;l<c.length;l+=1)u+=c[l].length;for(var p=this.segments.prepareSegment(u,this.layoutVertexArray,this.indexArray),h=p.vertexLength,f=[],d=[],m=0,y=s;m<y.length;m+=1){var g=y[m];if(0!==g.length){g!==s[0]&&d.push(f.length/2);var _=this.segments2.prepareSegment(g.length,this.layoutVertexArray,this.indexArray2),v=_.vertexLength;this.layoutVertexArray.emplaceBack(g[0].x,g[0].y),this.indexArray2.emplaceBack(v+g.length-1,v),f.push(g[0].x),f.push(g[0].y);for(var x=1;x<g.length;x++)this.layoutVertexArray.emplaceBack(g[x].x,g[x].y),this.indexArray2.emplaceBack(v+x-1,v+x),f.push(g[x].x),f.push(g[x].y);_.vertexLength+=g.length,_.primitiveLength+=g.length}}for(var b=Ts(f,d),w=0;w<b.length;w+=3)this.indexArray.emplaceBack(h+b[w],h+b[w+1],h+b[w+2]);p.vertexLength+=u,p.primitiveLength+=b.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n,i)},Oi("FillBucket",Js,{omit:["layers","patternFeatures"]});L=new gn({"fill-sort-key":new nc(Lt.layout_fill["fill-sort-key"])});var Ys,Qs={paint:new gn({"fill-antialias":new hn(Lt.paint_fill["fill-antialias"]),"fill-opacity":new nc(Lt.paint_fill["fill-opacity"]),"fill-color":new nc(Lt.paint_fill["fill-color"]),"fill-outline-color":new nc(Lt.paint_fill["fill-outline-color"]),"fill-translate":new hn(Lt.paint_fill["fill-translate"]),"fill-translate-anchor":new hn(Lt.paint_fill["fill-translate-anchor"]),"fill-pattern":new dn(Lt.paint_fill["fill-pattern"])}),layout:L},$s=((Ys=vn)&&(ru.__proto__=Ys),((ru.prototype=Object.create(Ys&&Ys.prototype)).constructor=ru).prototype.recalculate=function(t,e){Ys.prototype.recalculate.call(this,t,e),"constant"===(e=this.paint._values["fill-outline-color"]).value.kind&&void 0===e.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])},ru.prototype.createBucket=function(t){return new Js(t)},ru.prototype.queryRadius=function(){return ts(this.paint.get("fill-translate"))},ru.prototype.queryIntersectsFeature=function(t,e,r,i,n,o,a){return Wa(es(t,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,a),i)},ru.prototype.isTileClipped=function(){return!0},ru),tu=Sn([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4).members,eu=iu;function ru(t){Ys.call(this,t,Qs)}function iu(t,e,r,i,n){this.properties={},this.extent=r,this.type=0,this._pbf=t,this._geometry=-1,this._keys=i,this._values=n,t.readFields(nu,this,e)}function nu(t,e,r){1==t?e.id=r.readVarint():2==t?function(t,e){for(var r=t.readVarint()+t.pos;t.pos<r;){var i=e._keys[t.readVarint()],n=e._values[t.readVarint()];e.properties[i]=n}}(r,e):3==t?e.type=r.readVarint():4==t&&(e._geometry=r.pos)}iu.types=["Unknown","Point","LineString","Polygon"],iu.prototype.loadGeometry=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r,i=t.readVarint()+t.pos,o=1,a=0,s=0,u=0,l=[];t.pos<i;)if(a<=0&&(o=7&(r=t.readVarint()),a=r>>3),a--,1===o||2===o)s+=t.readSVarint(),u+=t.readSVarint(),1===o&&(e&&l.push(e),e=[]),e.push(new n(s,u));else{if(7!==o)throw new Error("unknown command "+o);e&&e.push(e[0].clone())}return e&&l.push(e),l},iu.prototype.bbox=function(){var t=this._pbf;t.pos=this._geometry;for(var e,r=t.readVarint()+t.pos,i=1,n=0,o=0,a=0,s=1/0,u=-1/0,l=1/0,c=-1/0;t.pos<r;)if(n<=0&&(i=7&(e=t.readVarint()),n=e>>3),n--,1===i||2===i)(o+=t.readSVarint())<s&&(s=o),u<o&&(u=o),(a+=t.readSVarint())<l&&(l=a),c<a&&(c=a);else if(7!==i)throw new Error("unknown command "+i);return[s,l,u,c]},iu.prototype.toGeoJSON=function(t,e,r){var i,n=this.extent*Math.pow(2,r),o=this.extent*t,a=this.extent*e,s=this.loadGeometry();e=iu.types[this.type];function u(t){for(var e=0;e<t.length;e++){var r=t[e];t[e]=[360*(r.x+o)/n-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+a)/n)*Math.PI/180))-90]}}switch(this.type){case 1:for(var l=[],c=0;c<s.length;c++)l[c]=s[c][0];u(s=l);break;case 2:for(c=0;c<s.length;c++)u(s[c]);break;case 3:for(s=function(t){var e=t.length;if(e<=1)return[t];for(var r,i,n=[],o=0;o<e;o++){var a=function(t){for(var e,r,i=0,n=0,o=t.length,a=o-1;n<o;a=n++)i+=((r=t[a]).x-(e=t[n]).x)*(e.y+r.y);return i}(t[o]);0!==a&&(void 0===i&&(i=a<0),i===a<0?(r&&n.push(r),r=[t[o]]):r.push(t[o]))}return r&&n.push(r),n}(s),c=0;c<s.length;c++)for(i=0;i<s[c].length;i++)u(s[c][i])}return 1===s.length?s=s[0]:e="Multi"+e,e={type:"Feature",geometry:{type:e,coordinates:s},properties:this.properties},"id"in this&&(e.id=this.id),e};var ou=au;function au(t,e){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=t,this._keys=[],this._values=[],this._features=[],t.readFields(su,this,e),this.length=this._features.length}function su(t,e,r){15===t?e.version=r.readVarint():1===t?e.name=r.readString():5===t?e.extent=r.readVarint():2===t?e._features.push(r.pos):3===t?e._keys.push(r.readString()):4===t&&e._values.push(function(t){for(var e=null,r=t.readVarint()+t.pos;t.pos<r;){var i=t.readVarint()>>3;e=1==i?t.readString():2==i?t.readFloat():3==i?t.readDouble():4==i?t.readVarint64():5==i?t.readVarint():6==i?t.readSVarint():7==i?t.readBoolean():null}return e}(r))}function uu(t,e,r){3!==t||(r=new ou(r,r.readVarint()+r.pos)).length&&(e[r.name]=r)}au.prototype.feature=function(t){if(t<0||t>=this._features.length)throw new Error("feature index out of bounds");return this._pbf.pos=this._features[t],t=this._pbf.readVarint()+this._pbf.pos,new eu(this._pbf,t,this.extent,this._keys,this._values)};var lu={VectorTile:function(t,e){this.layers=t.readFields(uu,{},e)},VectorTileFeature:eu,VectorTileLayer:ou},cu=lu.VectorTileFeature.types,pu=Math.pow(2,13);function hu(t,e,r,i,n,o,a,s){t.emplaceBack(e,r,2*Math.floor(i*pu)+a,n*pu*2,o*pu*2,Math.round(s))}function fu(t){this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.layoutVertexArray=new zn,this.indexArray=new fo,this.programConfigurations=new Fa(t.layers,t.zoom),this.segments=new ra,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))}fu.prototype.populate=function(t,e,r){this.features=[],this.hasPattern=Xs("fill-extrusion",this.layers,e);for(var i=0,n=t;i<n.length;i+=1){var o=(c=n[i]).feature,a=c.id,s=c.index,u=c.sourceLayerIndex,l=this.layers[0]._featureFilter.needGeometry,c=qa(o,l);this.layers[0]._featureFilter.filter(new tn(this.zoom),c,r)&&(c={id:a,sourceLayerIndex:u,index:s,geometry:l?c.geometry:Va(o),properties:o.properties,type:o.type,patterns:{}},this.hasPattern?this.features.push(Ks("fill-extrusion",this.layers,c,this.zoom,e)):this.addFeature(c,c.geometry,s,r,{}),e.featureIndex.insert(o,c.geometry,s,u,this.index,!0))}},fu.prototype.addFeatures=function(t,e,r){for(var i=0,n=this.features;i<n.length;i+=1){var o=n[i];this.addFeature(o,o.geometry,o.index,e,r)}},fu.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},fu.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},fu.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},fu.prototype.upload=function(t){this.uploaded||(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,tu),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},fu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},fu.prototype.addFeature=function(t,e,r,i,n){for(var o,a=0,s=Zs(e,500);a<s.length;a+=1){for(var u=s[a],l=0,c=0,p=u;c<p.length;c+=1)l+=p[c].length;for(var h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),f=0,d=u;f<d.length;f+=1){var m=d[f];if(0!==m.length&&!((o=m).every((function(t){return t.x<0}))||o.every((function(t){return 8192<t.x}))||o.every((function(t){return t.y<0}))||o.every((function(t){return 8192<t.y}))))for(var y=0,g=0;g<m.length;g++){var _,v,x,b=m[g];1<=g&&(x=_=m[g-1],(v=b).x===x.x&&(v.x<0||8192<v.x)||v.y===x.y&&(v.y<0||8192<v.y)||(h.vertexLength+4>ra.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray)),x=b.sub(_)._perp()._unit(),32768<y+(v=_.dist(b))&&(y=0),hu(this.layoutVertexArray,b.x,b.y,x.x,x.y,0,0,y),hu(this.layoutVertexArray,b.x,b.y,x.x,x.y,0,1,y),hu(this.layoutVertexArray,_.x,_.y,x.x,x.y,0,0,y+=v),hu(this.layoutVertexArray,_.x,_.y,x.x,x.y,0,1,y),x=h.vertexLength,this.indexArray.emplaceBack(x,x+2,x+1),this.indexArray.emplaceBack(x+1,x+2,x+3),h.vertexLength+=4,h.primitiveLength+=2))}}if(h.vertexLength+l>ra.MAX_VERTEX_ARRAY_LENGTH&&(h=this.segments.prepareSegment(l,this.layoutVertexArray,this.indexArray)),"Polygon"===cu[t.type]){for(var w=[],S=[],T=h.vertexLength,E=0,I=u;E<I.length;E+=1){var A=I[E];if(0!==A.length){A!==u[0]&&S.push(w.length/2);for(var C=0;C<A.length;C++){var P=A[C];hu(this.layoutVertexArray,P.x,P.y,0,0,1,1,0),w.push(P.x),w.push(P.y)}}}for(var M=Ts(w,S),k=0;k<M.length;k+=3)this.indexArray.emplaceBack(T+M[k],T+M[k+2],T+M[k+1]);h.primitiveLength+=M.length/3,h.vertexLength+=l}}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n,i)},Oi("FillExtrusionBucket",fu,{omit:["layers","features"]});var du,mu={paint:new gn({"fill-extrusion-opacity":new hn(Lt["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new nc(Lt["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new hn(Lt["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new hn(Lt["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new dn(Lt["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new nc(Lt["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new nc(Lt["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new hn(Lt["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};(du=vn)&&(yu.__proto__=du),((yu.prototype=Object.create(du&&du.prototype)).constructor=yu).prototype.createBucket=function(t){return new fu(t)},yu.prototype.queryRadius=function(){return ts(this.paint.get("fill-extrusion-translate"))},yu.prototype.is3D=function(){return!0},yu.prototype.queryIntersectsFeature=function(t,e,r,i,o,a,s,u){var l=es(t,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),a.angle,s),c=this.paint.get("fill-extrusion-height").evaluate(e,r),p=this.paint.get("fill-extrusion-base").evaluate(e,r);r=function(t){for(var e=[],r=0,i=l;r<i.length;r+=1){var o;as(o=[(o=i[r]).x,o.y,0,1],o,t),e.push(new n(o[0]/o[3],o[1]/o[3]))}return e}(u);return function(t,e,r){var i=1/0;Wa(r,e)&&(i=_u(r,e[0]));for(var n=0;n<e.length;n++)for(var o=e[n],a=t[n],s=0;s<o.length-1;s++){var u;Za(r,u=[u=o[s],o[s+1],a[s+1],a[s],u])&&(i=Math.min(i,_u(r,u)))}return i!==1/0&&i}((u=function(t){for(var e=[],r=[],o=t[8]*p,a=t[9]*p,s=t[10]*p,u=t[11]*p,l=t[8]*c,h=t[9]*c,f=t[10]*c,d=t[11]*c,m=0,y=i;m<y.length;m+=1){for(var g=[],_=[],v=0,x=y[m];v<x.length;v+=1){var b=(I=x[v]).x,w=I.y,S=t[0]*b+t[4]*w+t[12],T=t[1]*b+t[5]*w+t[13],E=(A=t[2]*b+t[6]*w+t[14])+s,I=(C=t[3]*b+t[7]*w+t[15])+u,A=(b=S+l,w=T+h,A+f),C=C+d;(T=new n((S+o)/I,(T+a)/I)).z=E/I,g.push(T),(w=new n(b/C,w/C)).z=A/C,_.push(w)}e.push(g),r.push(_)}return[e,r]}(u))[0],u[1],r)},bn=yu;function yu(t){du.call(this,t,mu)}function gu(t,e){return t.x*e.x+t.y*e.y}function _u(t,e){if(1===t.length){for(var r,i=0,n=e[i++];!r||n.equals(r);)if(!(r=e[i++]))return 1/0;for(;i<e.length;i++){var o=e[i],a=t[0],s=r.sub(n),u=o.sub(n),l=a.sub(n),c=gu(s,s),p=gu(s,u);a=((a=gu(u,u))*(s=gu(l,s))-p*(l=gu(l,u)))/(u=c*a-p*p),u=(c*l-p*s)/u,u=n.z*(1-a-u)+r.z*a+o.z*u;if(isFinite(u))return u}return 1/0}for(var h=1/0,f=0,d=e;f<d.length;f+=1)h=Math.min(h,d[f].z);return h}function vu(t){var e=this;this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((function(t){e.gradients[t.id]={}})),this.layoutVertexArray=new Dn,this.layoutVertexArray2=new Fn,this.indexArray=new fo,this.programConfigurations=new Fa(t.layers,t.zoom),this.segments=new ra,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id}))}var xu=Sn([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4).members,bu=Sn([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]).members,wu=lu.VectorTileFeature.types,Su=Math.cos(Math.PI/180*37.5),Tu=Math.pow(2,14)/.5;vu.prototype.populate=function(t,e,r){this.hasPattern=Xs("line",this.layers,e);for(var i=this.layers[0].layout.get("line-sort-key"),n=!i.isConstant(),o=[],a=0,s=t;a<s.length;a+=1){var u=s[a],l=u.feature,c=u.id,p=u.index,h=u.sourceLayerIndex,f=this.layers[0]._featureFilter.needGeometry,d=qa(l,f);this.layers[0]._featureFilter.filter(new tn(this.zoom),d,r)&&(u=n?i.evaluate(d,{},r):void 0,u={id:c,properties:l.properties,type:l.type,sourceLayerIndex:h,index:p,geometry:f?d.geometry:Va(l),patterns:{},sortKey:u},o.push(u))}n&&o.sort((function(t,e){return t.sortKey-e.sortKey}));for(var m=0,y=o;m<y.length;m+=1){var g,_=y[m],v=_.geometry,x=_.index,b=_.sourceLayerIndex;this.hasPattern?(g=Ks("line",this.layers,_,this.zoom,e),this.patternFeatures.push(g)):this.addFeature(_,v,x,r,{}),e.featureIndex.insert(t[x].feature,v,x,b,this.index)}},vu.prototype.update=function(t,e,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(t,e,this.stateDependentLayers,r)},vu.prototype.addFeatures=function(t,e,r){for(var i=0,n=this.patternFeatures;i<n.length;i+=1){var o=n[i];this.addFeature(o,o.geometry,o.index,e,r)}},vu.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length},vu.prototype.uploadPending=function(){return!this.uploaded||this.programConfigurations.needsUpload},vu.prototype.upload=function(t){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=t.createVertexBuffer(this.layoutVertexArray2,bu)),this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,xu),this.indexBuffer=t.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(t),this.uploaded=!0},vu.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())},vu.prototype.lineFeatureClips=function(t){if(t.properties&&t.properties.hasOwnProperty("mapbox_clip_start")&&t.properties.hasOwnProperty("mapbox_clip_end"))return{start:+t.properties.mapbox_clip_start,end:+t.properties.mapbox_clip_end}},vu.prototype.addFeature=function(t,e,r,i,n){var o=this.layers[0].layout,a=o.get("line-join").evaluate(t,{}),s=o.get("line-cap"),u=o.get("line-miter-limit"),l=o.get("line-round-limit");this.lineClips=this.lineFeatureClips(t);for(var c=0,p=e;c<p.length;c+=1)this.addLine(p[c],t,a,s,u,l);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,t,r,n,i)},vu.prototype.addLine=function(t,e,r,i,n,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(var a=0;a<t.length-1;a++)this.totalDistance+=t[a].dist(t[a+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}for(var s="Polygon"===wu[e.type],u=t.length;2<=u&&t[u-1].equals(t[u-2]);)u--;for(var l=0;l<u-1&&t[l].equals(t[l+1]);)l++;if(!(u<(s?3:2))){"bevel"===r&&(n=1.05);var c,p=this.overscaling<=16?122880/(512*this.overscaling):0,h=this.segments.prepareSegment(10*u,this.layoutVertexArray,this.indexArray),f=void 0,d=void 0,m=void 0,y=void 0;this.e1=this.e2=-1,s&&(y=t[l].sub(c=t[u-2])._unit()._perp());for(var g=l;g<u;g++)if(!(d=g===u-1?s?t[l+1]:void 0:t[g+1])||!t[g].equals(d)){y&&(m=y),c&&(f=c),c=t[g],y=d?d.sub(c)._unit()._perp():m;var _=(m=m||y).add(y);0===_.x&&0===_.y||_._unit();var v=m.x*y.x+m.y*y.y,x=0!=(w=_.x*y.x+_.y*y.y)?1/w:1/0,b=2*Math.sqrt(2-2*w),w=w<Su&&f&&d,S=0<m.x*y.y-m.y*y.x;w&&l<g&&2*p<(T=c.dist(f))&&(E=c.sub(c.sub(f)._mult(p/T)._round()),this.updateDistance(f,E),this.addCurrentVertex(E,m,0,0,h),f=E);var T=f&&d,E=T?r:s?"butt":i;if(T&&"round"===E&&(x<o?E="miter":x<=2&&(E="fakeround")),"miter"===E&&n<x&&(E="bevel"),"bevel"===E&&(2<x&&(E="flipbevel"),x<n&&(E="miter")),f&&this.updateDistance(f,c),"miter"===E)_._mult(x),this.addCurrentVertex(c,_,0,0,h);else if("flipbevel"===E)100<x?_=y.mult(-1):(T=x*m.add(y).mag()/m.sub(y).mag(),_._perp()._mult(T*(S?-1:1))),this.addCurrentVertex(c,_,0,0,h),this.addCurrentVertex(c,_.mult(-1),0,0,h);else if("bevel"===E||"fakeround"===E){var I=-Math.sqrt(x*x-1);x=S?I:0,I=S?0:I;if(f&&this.addCurrentVertex(c,m,x,I,h),"fakeround"===E)for(var A=Math.round(180*b/Math.PI/20),C=1;C<A;C++){var P,M=C/A;.5!==M&&(M+=M*(P=M-.5)*(M-1)*((1.0904+v*(v*(3.55645-1.43519*v)-3.2452))*P*P+(.848013+v*(.215638*v-1.06021)))),M=y.sub(m)._mult(M)._add(m)._unit()._mult(S?-1:1),this.addHalfVertex(c,M.x,M.y,!1,S,0,h)}d&&this.addCurrentVertex(c,y,-x,-I,h)}else"butt"===E?this.addCurrentVertex(c,_,0,0,h):"square"===E?(I=f?1:-1,this.addCurrentVertex(c,_,I,I,h)):"round"===E&&(f&&(this.addCurrentVertex(c,m,0,0,h),this.addCurrentVertex(c,m,1,1,h,!0)),d&&(this.addCurrentVertex(c,y,-1,-1,h,!0),this.addCurrentVertex(c,y,0,0,h)));w&&g<u-1&&2*p<(w=c.dist(d))&&(w=c.add(d.sub(c)._mult(p/w)._round()),this.updateDistance(c,w),this.addCurrentVertex(w,y,0,0,h),c=w)}}},vu.prototype.addCurrentVertex=function(t,e,r,i,n,o){void 0===o&&(o=!1);var a=e.y*i-e.x,s=-e.y-e.x*i;this.addHalfVertex(t,e.x+e.y*r,e.y-e.x*r,o,!1,r,n),this.addHalfVertex(t,a,s,o,!0,-i,n),this.distance>Tu/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(t,e,r,i,n,o))},vu.prototype.addHalfVertex=function(t,e,r,i,n,o,a){var s=.5*(this.lineClips?this.scaledDistance*(Tu-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((t.x<<1)+(i?1:0),(t.y<<1)+(n?1:0),Math.round(63*e)+128,Math.round(63*r)+128,1+(0===o?0:o<0?-1:1)|(63&s)<<2,s>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length),s=a.vertexLength++,0<=this.e1&&0<=this.e2&&(this.indexArray.emplaceBack(this.e1,this.e2,s),a.primitiveLength++),n?this.e2=s:this.e1=s},vu.prototype.updateScaledDistance=function(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance},vu.prototype.updateDistance=function(t,e){this.distance+=t.dist(e),this.updateScaledDistance()},Oi("LineBucket",vu,{omit:["layers","patternFeatures"]});et=new gn({"line-cap":new hn(Lt.layout_line["line-cap"]),"line-join":new nc(Lt.layout_line["line-join"]),"line-miter-limit":new hn(Lt.layout_line["line-miter-limit"]),"line-round-limit":new hn(Lt.layout_line["line-round-limit"]),"line-sort-key":new nc(Lt.layout_line["line-sort-key"])});var Eu,Iu={paint:new gn({"line-opacity":new nc(Lt.paint_line["line-opacity"]),"line-color":new nc(Lt.paint_line["line-color"]),"line-translate":new hn(Lt.paint_line["line-translate"]),"line-translate-anchor":new hn(Lt.paint_line["line-translate-anchor"]),"line-width":new nc(Lt.paint_line["line-width"]),"line-gap-width":new nc(Lt.paint_line["line-gap-width"]),"line-offset":new nc(Lt.paint_line["line-offset"]),"line-blur":new nc(Lt.paint_line["line-blur"]),"line-dasharray":new sc(Lt.paint_line["line-dasharray"]),"line-pattern":new dn(Lt.paint_line["line-pattern"]),"line-gradient":new yn(Lt.paint_line["line-gradient"])}),layout:et},Au=((Eu=nc)&&(Cu.__proto__=Eu),((Cu.prototype=Object.create(Eu&&Eu.prototype)).constructor=Cu).prototype.possiblyEvaluate=function(t,e){return e=new tn(Math.floor(e.zoom),{now:e.now,fadeDuration:e.fadeDuration,zoomHistory:e.zoomHistory,transition:e.transition}),Eu.prototype.possiblyEvaluate.call(this,t,e)},Cu.prototype.evaluate=function(t,e,r,i){return e=h({},e,{zoom:Math.floor(e.zoom)}),Eu.prototype.evaluate.call(this,t,e,r,i)},new Cu(Iu.paint.properties["line-width"].specification));function Cu(){Eu.apply(this,arguments)}Au.useIntegerZoom=!0;var Pu;(Pu=vn)&&(Mu.__proto__=Pu),((Mu.prototype=Object.create(Pu&&Pu.prototype)).constructor=Mu).prototype._handleSpecialPaintPropertyUpdate=function(t){"line-gradient"===t&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Ge,this.gradientVersion=(this.gradientVersion+1)%s)},Mu.prototype.gradientExpression=function(){return this._transitionablePaint._values["line-gradient"].value.expression},Mu.prototype.recalculate=function(t,e){Pu.prototype.recalculate.call(this,t,e),this.paint._values["line-floorwidth"]=Au.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,t)},Mu.prototype.createBucket=function(t){return new vu(t)},Mu.prototype.queryRadius=function(t){t=ku($a("line-width",this,e=t),$a("line-gap-width",this,e));var e=$a("line-offset",this,e);return t/2+Math.abs(e)+ts(this.paint.get("line-translate"))},Mu.prototype.queryIntersectsFeature=function(t,e,r,i,o,a,s){return t=es(t,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),a.angle,s),a=s/2*ku(this.paint.get("line-width").evaluate(e,r),this.paint.get("line-gap-width").evaluate(e,r)),(r=this.paint.get("line-offset").evaluate(e,r))&&(i=function(t,e){for(var r=[],i=new n(0,0),o=0;o<t.length;o++){for(var a=t[o],s=[],u=0;u<a.length;u++){var l=a[u],c=a[u+1],p=0===u?i:l.sub(a[u-1])._unit()._perp();c=u===a.length-1?i:c.sub(l)._unit()._perp();(p=p._add(c)._unit())._mult(1/(p.x*c.x+p.y*c.y)),s.push(p._mult(e)._add(l))}r.push(s)}return r}(i,r*s)),function(t,e,r){for(var i=0;i<e.length;i++){var n=e[i];if(3<=t.length)for(var o=0;o<n.length;o++)if(Qa(t,n[o]))return!0;if(function(t,e,r){if(1<t.length){if(Xa(t,e))return 1;for(var i=0;i<e.length;i++)if(Ka(e[i],t,r))return 1}for(var n=0;n<t.length;n++)if(Ka(t[n],e,r))return 1}(t,n,r))return!0}return!1}(t,i,a)},Mu.prototype.isTileClipped=function(){return!0},br=Mu;function Mu(t){Pu.call(this,t,Iu),this.gradientVersion=0}function ku(t,e){return 0<e?e+2*t:t}var zu=Sn([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),Lu=Sn([{name:"a_projected_pos",components:3,type:"Float32"}],4),Bu=(Sn([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),Sn([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}])),Du=(Sn([{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"}]),Sn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4));L=Sn([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function Ru(t,e,r,i,n){var o,a,s=8*n-i-1,u=(1<<s)-1,l=u>>1,c=-7,p=r?n-1:0,h=r?-1:1;r=t[e+p];for(p+=h,o=r&(1<<-c)-1,r>>=-c,c+=s;0<c;o=256*o+t[e+p],p+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=i;0<c;a=256*a+t[e+p],p+=h,c-=8);if(0===o)o=1-l;else{if(o===u)return a?NaN:1/0*(r?-1:1);a+=Math.pow(2,i),o-=l}return(r?-1:1)*a*Math.pow(2,o-i)}function Ou(t,e,r,i,n,o){var a,s,u=8*o-n-1,l=(1<<u)-1,c=l>>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,h=i?0:o-1,f=i?1:-1;o=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=l):(a=Math.floor(Math.log(e)/Math.LN2),e*(i=Math.pow(2,-a))<1&&(a--,i*=2),2<=(e+=1<=a+c?p/i:p*Math.pow(2,1-c))*i&&(a++,i/=2),l<=a+c?(s=0,a=l):1<=a+c?(s=(e*i-1)*Math.pow(2,n),a+=c):(s=e*Math.pow(2,c-1)*Math.pow(2,n),a=0));8<=n;t[r+h]=255&s,h+=f,s/=256,n-=8);for(a=a<<n|s,u+=n;0<u;t[r+h]=255&a,h+=f,a/=256,u-=8);t[r+h-f]|=128*o}Sn([{name:"triangle",components:3,type:"Uint16"}]),Sn([{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"}]),Sn([{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"}]),Sn([{type:"Float32",name:"offsetX"}]),Sn([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);var Fu={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"},ju=Uu;function Uu(t){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(t)?t:new Uint8Array(t||0),this.pos=0,this.type=0,this.length=this.buf.length}Uu.Varint=0,Uu.Fixed64=1,Uu.Bytes=2,Uu.Fixed32=5;var Nu="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function Vu(t){return t.type===Uu.Bytes?t.readVarint()+t.pos:t.pos+1}function qu(t,e,r){return r?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function Gu(t,e,r){var i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;t<=n;n--)r.buf[n+i]=r.buf[n]}function Hu(t,e){for(var r=0;r<t.length;r++)e.writeVarint(t[r])}function Zu(t,e){for(var r=0;r<t.length;r++)e.writeSVarint(t[r])}function Wu(t,e){for(var r=0;r<t.length;r++)e.writeFloat(t[r])}function Xu(t,e){for(var r=0;r<t.length;r++)e.writeDouble(t[r])}function Ku(t,e){for(var r=0;r<t.length;r++)e.writeBoolean(t[r])}function Ju(t,e){for(var r=0;r<t.length;r++)e.writeFixed32(t[r])}function Yu(t,e){for(var r=0;r<t.length;r++)e.writeSFixed32(t[r])}function Qu(t,e){for(var r=0;r<t.length;r++)e.writeFixed64(t[r])}function $u(t,e){for(var r=0;r<t.length;r++)e.writeSFixed64(t[r])}function tl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+16777216*t[e+3]}function el(t,e,r){t[r]=e,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24}function rl(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16)+(t[e+3]<<24)}function il(t,e,r){1===t&&r.readMessage(nl,e)}function nl(t,e,r){var i,n,o,a;3===t&&(n=(i=r.readMessage(ol,{})).width,o=i.height,a=i.left,t=i.top,r=i.advance,e.push({id:i.id,bitmap:new ys({width:n+6,height:o+6},i.bitmap),metrics:{width:n,height:o,left:a,top:t,advance:r}}))}function ol(t,e,r){1===t?e.id=r.readVarint():2===t?e.bitmap=r.readBytes():3===t?e.width=r.readVarint():4===t?e.height=r.readVarint():5===t?e.left=r.readSVarint():6===t?e.top=r.readSVarint():7===t&&(e.advance=r.readVarint())}function al(t){for(var e=0,r=0,i=0,n=t;i<n.length;i+=1){var o=n[i];e+=o.w*o.h,r=Math.max(r,o.w)}t.sort((function(t,e){return e.h-t.h}));for(var a=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(e/.95)),r),h:1/0}],s=0,u=0,l=0,c=t;l<c.length;l+=1)for(var p=c[l],h=a.length-1;0<=h;h--){var f,d=a[h];if(!(p.w>d.w||p.h>d.h)){p.x=d.x,p.y=d.y,u=Math.max(u,p.y+p.h),s=Math.max(s,p.x+p.w),p.w===d.w&&p.h===d.h?(f=a.pop(),h<a.length&&(a[h]=f)):p.h===d.h?(d.x+=p.w,d.w-=p.w):(p.w===d.w||a.push({x:d.x+p.w,y:d.y,w:d.w-p.w,h:p.h}),d.y+=p.h,d.h-=p.h);break}}return{w:s,h:u,fill:e/(s*u)||0}}function sl(t,e){var r=e.pixelRatio,i=e.version,n=e.stretchX,o=e.stretchY;e=e.content;this.paddedRect=t,this.pixelRatio=r,this.stretchX=n,this.stretchY=o,this.content=e,this.version=i}function ul(){this.scale=1,this.fontStack="",this.imageName=null}Uu.prototype={destroy:function(){this.buf=null},readFields:function(t,e,r){for(r=r||this.length;this.pos<r;){var i=this.readVarint(),n=i>>3,o=this.pos;this.type=7&i,t(n,e,this),this.pos===o&&this.skip(i)}return e},readMessage:function(t,e){return this.readFields(t,e,this.readVarint()+this.pos)},readFixed32:function(){var t=tl(this.buf,this.pos);return this.pos+=4,t},readSFixed32:function(){var t=rl(this.buf,this.pos);return this.pos+=4,t},readFixed64:function(){var t=tl(this.buf,this.pos)+4294967296*tl(this.buf,this.pos+4);return this.pos+=8,t},readSFixed64:function(){var t=tl(this.buf,this.pos)+4294967296*rl(this.buf,this.pos+4);return this.pos+=8,t},readFloat:function(){var t=Ru(this.buf,this.pos,!0,23,4);return this.pos+=4,t},readDouble:function(){var t=Ru(this.buf,this.pos,!0,52,8);return this.pos+=8,t},readVarint:function(t){var e,r=this.buf,i=127&(e=r[this.pos++]);return e<128?i:(i|=(127&(e=r[this.pos++]))<<7,e<128?i:(i|=(127&(e=r[this.pos++]))<<14,e<128?i:(i|=(127&(e=r[this.pos++]))<<21,e<128?i:function(t,e,r){var i,n=r.buf,o=(112&(i=n[r.pos++]))>>4;if(i<128)return qu(t,o,e);if(o|=(127&(i=n[r.pos++]))<<3,i<128)return qu(t,o,e);if(o|=(127&(i=n[r.pos++]))<<10,i<128)return qu(t,o,e);if(o|=(127&(i=n[r.pos++]))<<17,i<128)return qu(t,o,e);if(o|=(127&(i=n[r.pos++]))<<24,i<128)return qu(t,o,e);if(o|=(1&(i=n[r.pos++]))<<31,i<128)return qu(t,o,e);throw new Error("Expected varint not more than 10 bytes")}(i|=(15&r[this.pos])<<28,t,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var t=this.readVarint();return t%2==1?(t+1)/-2:t/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var t,e=this.readVarint()+this.pos,r=this.pos;return 12<=(this.pos=e)-r&&Nu?(t=this.buf,Nu.decode(t.subarray(r,e))):function(t,e){for(var i="",n=r;n<e;){var o,a,s,u=t[n],l=null,c=239<u?4:223<u?3:191<u?2:1;if(e<n+c)break;1===c?u<128&&(l=u):2===c?128==(192&(o=t[n+1]))&&(l=(31&u)<<6|63&o)<=127&&(l=null):3===c?(a=t[n+2],128==(192&(o=t[n+1]))&&128==(192&a)&&((l=(15&u)<<12|(63&o)<<6|63&a)<=2047||55296<=l&&l<=57343)&&(l=null)):4===c&&(a=t[n+2],s=t[n+3],128==(192&(o=t[n+1]))&&128==(192&a)&&128==(192&s)&&((l=(15&u)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||1114112<=l)&&(l=null)),null===l?(l=65533,c=1):65535<l&&(l-=65536,i+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),i+=String.fromCharCode(l),n+=c}return i}(this.buf,e)},readBytes:function(){var t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e},readPackedVarint:function(t,e){if(this.type!==Uu.Bytes)return t.push(this.readVarint(e));var r=Vu(this);for(t=t||[];this.pos<r;)t.push(this.readVarint(e));return t},readPackedSVarint:function(t){if(this.type!==Uu.Bytes)return t.push(this.readSVarint());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readSVarint());return t},readPackedBoolean:function(t){if(this.type!==Uu.Bytes)return t.push(this.readBoolean());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readBoolean());return t},readPackedFloat:function(t){if(this.type!==Uu.Bytes)return t.push(this.readFloat());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readFloat());return t},readPackedDouble:function(t){if(this.type!==Uu.Bytes)return t.push(this.readDouble());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readDouble());return t},readPackedFixed32:function(t){if(this.type!==Uu.Bytes)return t.push(this.readFixed32());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readFixed32());return t},readPackedSFixed32:function(t){if(this.type!==Uu.Bytes)return t.push(this.readSFixed32());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed32());return t},readPackedFixed64:function(t){if(this.type!==Uu.Bytes)return t.push(this.readFixed64());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readFixed64());return t},readPackedSFixed64:function(t){if(this.type!==Uu.Bytes)return t.push(this.readSFixed64());var e=Vu(this);for(t=t||[];this.pos<e;)t.push(this.readSFixed64());return t},skip:function(t){if((t&=7)===Uu.Varint)for(;127<this.buf[this.pos++];);else if(t===Uu.Bytes)this.pos=this.readVarint()+this.pos;else if(t===Uu.Fixed32)this.pos+=4;else{if(t!==Uu.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(t,e){this.writeVarint(t<<3|e)},realloc:function(t){for(var e,r=this.length||16;r<this.pos+t;)r*=2;r!==this.length&&((e=new Uint8Array(r)).set(this.buf),this.buf=e,this.length=r)},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(t){this.realloc(4),el(this.buf,t,this.pos),this.pos+=4},writeSFixed32:function(t){this.realloc(4),el(this.buf,t,this.pos),this.pos+=4},writeFixed64:function(t){this.realloc(8),el(this.buf,-1&t,this.pos),el(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeSFixed64:function(t){this.realloc(8),el(this.buf,-1&t,this.pos),el(this.buf,Math.floor(t*(1/4294967296)),this.pos+4),this.pos+=8},writeVarint:function(t){268435455<(t=+t||0)||t<0?function(e){var r,i,n;if(0<=t?(n=t%4294967296|0,r=t/4294967296|0):(r=~(-t/4294967296),4294967295^(n=~(-t%4294967296))?n=n+1|0:r=r+1|(n=0)),0x10000000000000000<=t||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),i=n,(n=e).buf[n.pos++]=127&i|128,i>>>=7,n.buf[n.pos++]=127&i|128,i>>>=7,n.buf[n.pos++]=127&i|128,i>>>=7,n.buf[n.pos++]=127&i|128,n.buf[n.pos]=127&(i>>>=7),r=(7&(i=r))<<4,(e=e).buf[e.pos++]|=r|((i>>>=3)?128:0),i&&(e.buf[e.pos++]=127&i|((i>>>=7)?128:0),i&&(e.buf[e.pos++]=127&i|((i>>>=7)?128:0),i&&(e.buf[e.pos++]=127&i|((i>>>=7)?128:0),i&&(e.buf[e.pos++]=127&i|((i>>>=7)?128:0),i&&(e.buf[e.pos++]=127&i)))))}(this):(this.realloc(4),this.buf[this.pos++]=127&t|(127<t?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(127<t?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(127<t?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))},writeSVarint:function(t){this.writeVarint(t<0?2*-t-1:2*t)},writeBoolean:function(t){this.writeVarint(Boolean(t))},writeString:function(t){t=String(t),this.realloc(4*t.length),this.pos++;var e=this.pos;this.pos=function(t,e,r){for(var i,n,o=0;o<e.length;o++){if(55295<(i=e.charCodeAt(o))&&i<57344){if(!n){56319<i||o+1===e.length?(t[r++]=239,t[r++]=191,t[r++]=189):n=i;continue}if(i<56320){t[r++]=239,t[r++]=191,t[r++]=189,n=i;continue}i=n-55296<<10|i-56320|65536,n=null}else n&&(t[r++]=239,t[r++]=191,t[r++]=189,n=null);i<128?t[r++]=i:(i<2048?t[r++]=i>>6|192:(i<65536?t[r++]=i>>12|224:(t[r++]=i>>18|240,t[r++]=i>>12&63|128),t[r++]=i>>6&63|128),t[r++]=63&i|128)}return r}(this.buf,t,this.pos),128<=(t=this.pos-e)&&Gu(e,t,this),this.pos=e-1,this.writeVarint(t),this.pos+=t},writeFloat:function(t){this.realloc(4),Ou(this.buf,t,this.pos,!0,23,4),this.pos+=4},writeDouble:function(t){this.realloc(8),Ou(this.buf,t,this.pos,!0,52,8),this.pos+=8},writeBytes:function(t){var e=t.length;this.writeVarint(e),this.realloc(e);for(var r=0;r<e;r++)this.buf[this.pos++]=t[r]},writeRawMessage:function(t,e){this.pos++;var r=this.pos;t(e,this),128<=(e=this.pos-r)&&Gu(r,e,this),this.pos=r-1,this.writeVarint(e),this.pos+=e},writeMessage:function(t,e,r){this.writeTag(t,Uu.Bytes),this.writeRawMessage(e,r)},writePackedVarint:function(t,e){e.length&&this.writeMessage(t,Hu,e)},writePackedSVarint:function(t,e){e.length&&this.writeMessage(t,Zu,e)},writePackedBoolean:function(t,e){e.length&&this.writeMessage(t,Ku,e)},writePackedFloat:function(t,e){e.length&&this.writeMessage(t,Wu,e)},writePackedDouble:function(t,e){e.length&&this.writeMessage(t,Xu,e)},writePackedFixed32:function(t,e){e.length&&this.writeMessage(t,Ju,e)},writePackedSFixed32:function(t,e){e.length&&this.writeMessage(t,Yu,e)},writePackedFixed64:function(t,e){e.length&&this.writeMessage(t,Qu,e)},writePackedSFixed64:function(t,e){e.length&&this.writeMessage(t,$u,e)},writeBytesField:function(t,e){this.writeTag(t,Uu.Bytes),this.writeBytes(e)},writeFixed32Field:function(t,e){this.writeTag(t,Uu.Fixed32),this.writeFixed32(e)},writeSFixed32Field:function(t,e){this.writeTag(t,Uu.Fixed32),this.writeSFixed32(e)},writeFixed64Field:function(t,e){this.writeTag(t,Uu.Fixed64),this.writeFixed64(e)},writeSFixed64Field:function(t,e){this.writeTag(t,Uu.Fixed64),this.writeSFixed64(e)},writeVarintField:function(t,e){this.writeTag(t,Uu.Varint),this.writeVarint(e)},writeSVarintField:function(t,e){this.writeTag(t,Uu.Varint),this.writeSVarint(e)},writeStringField:function(t,e){this.writeTag(t,Uu.Bytes),this.writeString(e)},writeFloatField:function(t,e){this.writeTag(t,Uu.Fixed32),this.writeFloat(e)},writeDoubleField:function(t,e){this.writeTag(t,Uu.Fixed64),this.writeDouble(e)},writeBooleanField:function(t,e){this.writeVarintField(t,Boolean(e))}},(dn={tl:{configurable:!0},br:{configurable:!0},tlbr:{configurable:!0},displaySize:{configurable:!0}}).tl.get=function(){return[this.paddedRect.x+1,this.paddedRect.y+1]},dn.br.get=function(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]},dn.tlbr.get=function(){return this.tl.concat(this.br)},dn.displaySize.get=function(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]},Object.defineProperties(sl.prototype,dn),(yn=function(t,e){var r={},i={};this.haveRenderCallbacks=[];var n=[];this.addImages(t,r,n),this.addImages(e,i,n);var o,a,s=new gs({width:(n=al(n)).w||1,height:n.h||1});for(o in t){var u=t[o],l=r[o].paddedRect;gs.copy(u.data,s,{x:0,y:0},{x:l.x+1,y:l.y+1},u.data)}for(a in e){var c=e[a],p=(d=i[a].paddedRect).x+1,h=d.y+1,f=c.data.width,d=c.data.height;gs.copy(c.data,s,{x:0,y:0},{x:p,y:h},c.data),gs.copy(c.data,s,{x:0,y:d-1},{x:p,y:h-1},{width:f,height:1}),gs.copy(c.data,s,{x:0,y:0},{x:p,y:h+d},{width:f,height:1}),gs.copy(c.data,s,{x:f-1,y:0},{x:p-1,y:h},{width:1,height:d}),gs.copy(c.data,s,{x:0,y:0},{x:p+f,y:h},{width:1,height:d})}this.image=s,this.iconPositions=r,this.patternPositions=i}).prototype.addImages=function(t,e,r){for(var i in t){var n=t[i],o={x:0,y:0,w:n.data.width+2,h:n.data.height+2};r.push(o),e[i]=new sl(o,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(i)}},yn.prototype.patchUpdatedImages=function(t,e){for(var r in t.dispatchRenderCallbacks(this.haveRenderCallbacks),t.updatedImages)this.patchUpdatedImage(this.iconPositions[r],t.getImage(r),e),this.patchUpdatedImage(this.patternPositions[r],t.getImage(r),e)},yn.prototype.patchUpdatedImage=function(t,e,r){t&&e&&t.version!==e.version&&(t.version=e.version,t=t.tl,r.update(e.data,void 0,{x:t[0],y:t[1]}))},Oi("ImagePosition",sl),Oi("ImageAtlas",yn);var ll={horizontal:1,vertical:2,horizontalOnly:3};function cl(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}function pl(t,e,r,i,n,o,a,s,u,l,c,p,h,f,d,m){var y,g=cl.fromFeature(t,n);if(p===ll.vertical&&g.verticalizePunctuation(),t=rn.processBidirectionalText,n=rn.processStyledBidirectionalText,t&&1===g.sections.length){y=[];for(var _=0,v=t(g.toString(),gl(g,l,o,e,i,f,d));_<v.length;_+=1){var x=v[_],b=new cl;b.text=x,b.sections=g.sections;for(var w=0;w<x.length;w++)b.sectionIndex.push(0);y.push(b)}}else if(n){y=[];for(var S=0,T=n(g.text,g.sectionIndex,gl(g,l,o,e,i,f,d));S<T.length;S+=1){var E=T[S],I=new cl;I.text=E[0],I.sectionIndex=E[1],I.sections=g.sections,y.push(I)}}else y=function(t,e){for(var r=[],i=t.text,n=0,o=0,a=e;o<a.length;o+=1){var s=a[o];r.push(t.substring(n,s)),n=s}return n<i.length&&r.push(t.substring(n,i.length)),r}(g,gl(g,l,o,e,i,f,d));var A=[];return function(t,e,r,i,n,o,a,s,l,c,p){for(var h=0,f=-17,d=0,m=0,y="right"===u?1:"left"===u?0:.5,g=0,_=0,v=n;_<v.length;_+=1){var x=v[_];x.trim();var b=x.getMaxScale(),w=24*(b-1),S={positionedGlyphs:[],lineOffset:0},T=(t.positionedLines[g]=S).positionedGlyphs,E=0;if(x.length()){for(var I=0;I<x.length();I++){var A=x.getSection(I),C=x.getSectionIndex(I),P=x.getCharCode(I),M=0,k=null,z=null,L=null,B=24,D=!(s===ll.horizontal||!c&&!Hi(P)||c&&(hl[P]||(D=P,qi.Arabic(D)||qi["Arabic Supplement"](D)||qi["Arabic Extended-A"](D)||qi["Arabic Presentation Forms-A"](D)||qi["Arabic Presentation Forms-B"](D))));if(A.imageName){var R=i[A.imageName];if(!R)continue;L=A.imageName,t.iconsInText=t.iconsInText||!0,z=R.paddedRect,R=R.displaySize,A.scale=24*A.scale/p,M=w+(24-R[1]*A.scale),B=(k={width:R[0],height:R[1],left:1,top:-3,advance:D?R[1]:R[0]}).advance,0<(R=D?R[0]*A.scale-24*b:R[1]*A.scale-24*b)&&E<R&&(E=R)}else{if((R=(R=r[A.fontStack])&&R[P])&&R.rect)z=R.rect,k=R.metrics;else{if(!(R=(R=e[A.fontStack])&&R[P]))continue;k=R.metrics}M=24*(b-A.scale)}D?(t.verticalizable=!0,T.push({glyph:P,imageName:L,x:h,y:f+M,vertical:D,scale:A.scale,fontStack:A.fontStack,sectionIndex:C,metrics:k,rect:z}),h+=B*A.scale+l):(T.push({glyph:P,imageName:L,x:h,y:f+M,vertical:D,scale:A.scale,fontStack:A.fontStack,sectionIndex:C,metrics:k,rect:z}),h+=k.advance*A.scale+l)}0!==T.length&&(d=Math.max(h-l,d),function(t,e,r,i,n){if(i||n)for(var o=t[r],a=(t[r].x+o.metrics.advance*o.scale)*i,s=0;s<=r;s++)t[s].x-=a,t[s].y+=n}(T,0,T.length-1,y,E)),h=0;var O=o*b+E;S.lineOffset=Math.max(E,w),f+=O,m=Math.max(O,m),++g}else f+=o,++g}var F=f- -17,j=(a=_l(a)).horizontalAlign,U=a.verticalAlign;(function(t,e){for(var r=(y-j)*d,i=m!==o?-F*U+17:(-U*e+.5)*o,n=0,a=t;n<a.length;n+=1)for(var s=0,u=a[n].positionedGlyphs;s<u.length;s+=1){var l=u[s];l.x+=r,l.y+=i}})(t.positionedLines,n.length),t.top+=-U*F,t.bottom=t.top+F,t.left+=-j*d,t.right=t.left+d}(c={positionedLines:A,text:g.toString(),top:c[1],bottom:c[1],left:c[0],right:c[0],writingMode:p,iconsInText:!1,verticalizable:!1},e,r,i,y,a,s,p,l,h,m),!function(){for(var t=0,e=A;t<e.length;t+=1)if(0!==e[t].positionedGlyphs.length)return;return 1}()&&c}ul.forText=function(t,e){var r=new ul;return r.scale=t||1,r.fontStack=e,r},ul.forImage=function(t){var e=new ul;return e.imageName=t,e},cl.fromFeature=function(t,e){for(var r=new cl,i=0;i<t.sections.length;i++){var n=t.sections[i];n.image?r.addImageSection(n):r.addTextSection(n,e)}return r},cl.prototype.length=function(){return this.text.length},cl.prototype.getSection=function(t){return this.sections[this.sectionIndex[t]]},cl.prototype.getSectionIndex=function(t){return this.sectionIndex[t]},cl.prototype.getCharCode=function(t){return this.text.charCodeAt(t)},cl.prototype.verticalizePunctuation=function(){this.text=function(t){for(var e="",r=0;r<t.length;r++){var i=t.charCodeAt(r+1)||null,n=t.charCodeAt(r-1)||null;e+=i&&Zi(i)&&!Fu[t[r+1]]||n&&Zi(n)&&!Fu[t[r-1]]||!Fu[t[r]]?t[r]:Fu[t[r]]}return e}(this.text)},cl.prototype.trim=function(){for(var t=0,e=0;e<this.text.length&&hl[this.text.charCodeAt(e)];e++)t++;for(var r=this.text.length,i=this.text.length-1;0<=i&&t<=i&&hl[this.text.charCodeAt(i)];i--)r--;this.text=this.text.substring(t,r),this.sectionIndex=this.sectionIndex.slice(t,r)},cl.prototype.substring=function(t,e){var r=new cl;return r.text=this.text.substring(t,e),r.sectionIndex=this.sectionIndex.slice(t,e),r.sections=this.sections,r},cl.prototype.toString=function(){return this.text},cl.prototype.getMaxScale=function(){var t=this;return this.sectionIndex.reduce((function(e,r){return Math.max(e,t.sections[r].scale)}),0)},cl.prototype.addTextSection=function(t,e){this.text+=t.text,this.sections.push(ul.forText(t.scale,t.fontStack||e));for(var r=this.sections.length-1,i=0;i<t.text.length;++i)this.sectionIndex.push(r)},cl.prototype.addImageSection=function(t){var e=t.image?t.image.name:"";0!==e.length?(t=this.getNextImageSectionCharCode())?(this.text+=String.fromCharCode(t),this.sections.push(ul.forImage(e)),this.sectionIndex.push(this.sections.length-1)):w("Reached maximum number of images 6401"):w("Can't add FormattedSection with an empty image.")},cl.prototype.getNextImageSectionCharCode=function(){return this.imageSectionID?63743<=this.imageSectionID?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)};var hl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},fl={};function dl(t,e,r,i,n,o){return e.imageName?(i=i[e.imageName])?i.displaySize[0]*e.scale*24/o+n:0:(t=(r=r[e.fontStack])&&r[t])?t.metrics.advance*e.scale+n:0}function ml(t,e,r,i){var n=Math.pow(t-e,2);return i?t<e?n/2:2*n:n+Math.abs(r)*r}function yl(t,e,r,i,n,o){for(var a=null,s=ml(e,r,n,o),u=0,l=i;u<l.length;u+=1){var c=l[u],p=ml(e-c.x,r,n,o)+c.badness;p<=s&&(a=c,s=p)}return{index:t,x:e,priorBreak:a,badness:s}}function gl(t,e,r,i,n,o,a){if("point"!==o)return[];if(!t)return[];for(var s,u=[],l=function(t,e,r,i,n,o){for(var a=0,s=0;s<t.length();s++){var u=t.getSection(s);a+=dl(t.getCharCode(s),u,i,n,e,o)}return a/Math.max(1,Math.ceil(a/r))}(t,e,r,i,n,a),c=0<=t.text.indexOf("​"),p=0,h=0;h<t.length();h++){var f,d=t.getSection(h),m=t.getCharCode(h);hl[m]||(p+=dl(m,d,i,n,e,a)),h<t.length()-1&&(f=!((s=m)<11904||!(qi["Bopomofo Extended"](s)||qi.Bopomofo(s)||qi["CJK Compatibility Forms"](s)||qi["CJK Compatibility Ideographs"](s)||qi["CJK Compatibility"](s)||qi["CJK Radicals Supplement"](s)||qi["CJK Strokes"](s)||qi["CJK Symbols and Punctuation"](s)||qi["CJK Unified Ideographs Extension A"](s)||qi["CJK Unified Ideographs"](s)||qi["Enclosed CJK Letters and Months"](s)||qi["Halfwidth and Fullwidth Forms"](s)||qi.Hiragana(s)||qi["Ideographic Description Characters"](s)||qi["Kangxi Radicals"](s)||qi["Katakana Phonetic Extensions"](s)||qi.Katakana(s)||qi["Vertical Forms"](s)||qi["Yi Radicals"](s)||qi["Yi Syllables"](s))),(fl[m]||f||d.imageName)&&u.push(yl(h+1,p,l,u,(s=m,m=void 0,m=0,10===s&&(m-=1e4),f&&c&&(m+=150),40!==s&&65288!==s||(m+=50),41!==(d=t.getCharCode(h+1))&&65289!==d||(m+=50),m),!1)))}return function t(e){return e?t(e.priorBreak).concat(e.index):[]}(yl(t.length(),p,l,u,0,!0))}function _l(t){var e=.5,r=.5;switch(t){case"right":case"top-right":case"bottom-right":e=1;break;case"left":case"top-left":case"bottom-left":e=0}switch(t){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:e,verticalAlign:r}}function vl(t,e,r,i,n,o){var a;(t=t.image).content&&(l=t.content,c=t.pixelRatio||1,a=[l[0]/c,l[1]/c,t.displaySize[0]-l[2]/c,t.displaySize[1]-l[3]/c]);var s,u,l=e.left*o,c=e.right*o;l="width"===r||"both"===r?(u=n[0]+l-i[3],n[0]+c+i[1]):(u=n[0]+(l+c-t.displaySize[0])/2)+t.displaySize[0],c=e.top*o,o=e.bottom*o,o="height"===r||"both"===r?(s=n[1]+c-i[0],n[1]+o+i[2]):(s=n[1]+(c+o-t.displaySize[1])/2)+t.displaySize[1];return{image:t,top:s,right:l,bottom:o,left:u,collisionPadding:a}}fl[10]=!0,fl[32]=!0,fl[38]=!0,fl[40]=!0,fl[41]=!0,fl[43]=!0,fl[45]=!0,fl[47]=!0,fl[173]=!0,fl[183]=!0,fl[8203]=!0,fl[8208]=!0,fl[8211]=!0,fl[8231]=!0;var xl,bl=((xl=n)&&(wl.__proto__=xl),((wl.prototype=Object.create(xl&&xl.prototype)).constructor=wl).prototype.clone=function(){return new wl(this.x,this.y,this.angle,this.segment)},wl);function wl(t,e,r,i){xl.call(this,t,e),this.angle=r,void 0!==i&&(this.segment=i)}function Sl(t,e){var r=e.expression;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new tn(t+1))};if("source"===r.kind)return{kind:"source"};for(var i=r.zoomStops,n=r.interpolationType,o=0;o<i.length&&i[o]<=t;)o++;for(var a=o=Math.max(0,o-1);a<i.length&&i[a]<t+1;)a++;a=Math.min(i.length-1,a);var s=i[o];e=i[a];return"composite"===r.kind?{kind:"composite",minZoom:s,maxZoom:e,interpolationType:n}:{kind:"camera",minZoom:s,maxZoom:e,minSize:r.evaluate(new tn(s)),maxSize:r.evaluate(new tn(e)),interpolationType:n}}function Tl(t,e,r){var i=e.uSize,n=r.lowerSize;return"source"===t.kind?n/128:"composite"===t.kind?He(n/128,r.upperSize/128,e.uSizeT):i}function El(t,e){var r,i=0,n=0;return"constant"===t.kind?n=t.layoutSize:"source"!==t.kind&&(e=(r=t.interpolationType)?c(or.interpolationFactor(r,e,t.minZoom,t.maxZoom),0,1):0,"camera"===t.kind?n=He(t.minSize,t.maxSize,e):i=e),{uSizeT:i,uSize:n}}function Il(t,e,r,i,n){if(void 0===e.segment)return 1;for(var o=e,a=e.segment+1,s=0;-r/2<s;){if(--a<0)return;s-=t[a].dist(o),o=t[a]}s+=t[a].dist(t[a+1]),a++;for(var u=[],l=0;s<r/2;){var c=t[a],p=t[a+1];if(!p)return;var h=t[a-1].angleTo(c)-c.angleTo(p);h=Math.abs((h+3*Math.PI)%(2*Math.PI)-Math.PI);for(u.push({distance:s,angleDelta:h}),l+=h;s-u[0].distance>i;)l-=u.shift().angleDelta;if(n<l)return;a++,s+=c.dist(p)}return 1}function Al(t){for(var e=0,r=0;r<t.length-1;r++)e+=t[r].dist(t[r+1]);return e}function Cl(t,e){return Math.max(t?t.right-t.left:0,e?e.right-e.left:0)}function Pl(t,e,r,i,o){for(var a=[],s=0;s<t.length;s++)for(var u=t[s],l=void 0,c=0;c<u.length-1;c++){var p=u[c],h=u[c+1];p.x<e&&h.x<e||(p.x<e?p=new n(e,p.y+(e-p.x)/(h.x-p.x)*(h.y-p.y))._round():h.x<e&&(h=new n(e,p.y+(e-p.x)/(h.x-p.x)*(h.y-p.y))._round()),p.y<r&&h.y<r||(p.y<r?p=new n(p.x+(r-p.y)/(h.y-p.y)*(h.x-p.x),r)._round():h.y<r&&(h=new n(p.x+(r-p.y)/(h.y-p.y)*(h.x-p.x),r)._round()),p.x>=i&&h.x>=i||(p.x>=i?p=new n(i,p.y+(i-p.x)/(h.x-p.x)*(h.y-p.y))._round():h.x>=i&&(h=new n(i,p.y+(i-p.x)/(h.x-p.x)*(h.y-p.y))._round()),p.y>=o&&h.y>=o||(p.y>=o?p=new n(p.x+(o-p.y)/(h.y-p.y)*(h.x-p.x),o)._round():h.y>=o&&(h=new n(p.x+(o-p.y)/(h.y-p.y)*(h.x-p.x),o)._round()),l&&p.equals(l[l.length-1])||a.push(l=[p]),l.push(h)))))}return a}function Ml(t,e,r,i){var o=[],a=t.image,s=a.pixelRatio,u=a.paddedRect.w-2,l=a.paddedRect.h-2,c=t.right-t.left,p=t.bottom-t.top,h=a.stretchX||[[0,u]],f=a.stretchY||[[0,l]],d=function(t,e){return t+e[1]-e[0]},m=h.reduce(d,0),y=f.reduce(d,0),g=u-m,_=l-y,v=0,x=m,b=0,w=y,S=0,T=g,E=0,I=_;function A(i,o,u,l){var h=(i.stretch-v)/x*c+t.left,f=i.fixed-S-T*i.stretch/m,d=(o.stretch-b)/w*p+t.top,g=o.fixed-E-I*o.stretch/y,_=(u.stretch-v)/x*c+t.left,A=u.fixed-S-T*u.stretch/m,C=(l.stretch-b)/w*p+t.top,P=l.fixed-E-I*l.stretch/y,M=new n(h,d);d=new n(_,d),_=new n(_,C),C=new n(h,C),f=new n(f/s,g/s),g=new n(A/s,P/s);return(A=e*Math.PI/180)&&(P=Math.sin(A),A=[A=Math.cos(A),-P,P,A],M._matMult(A),d._matMult(A),C._matMult(A),_._matMult(A)),i=i.stretch+i.fixed,o=o.stretch+o.fixed,{tl:M,tr:d,bl:C,br:_,tex:{x:a.paddedRect.x+1+i,y:a.paddedRect.y+1+o,w:u.stretch+u.fixed-i,h:l.stretch+l.fixed-o},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:f,pixelOffsetBR:g,minFontScaleX:T/s/c,minFontScaleY:I/s/p,isSDF:r}}if(a.content&&i&&(d=a.content,v=kl(h,0,d[0]),b=kl(f,0,d[1]),x=kl(h,d[0],d[2]),w=kl(f,d[1],d[3]),S=d[0]-v,E=d[1]-b,T=d[2]-d[0]-x,I=d[3]-d[1]-w),i&&(a.stretchX||a.stretchY))for(var C=zl(h,g,m),P=zl(f,_,y),M=0;M<C.length-1;M++)for(var k=C[M],z=C[M+1],L=0;L<P.length-1;L++)o.push(A(k,P[L],z,P[L+1]));else o.push(A({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:1+u},{fixed:0,stretch:1+l}));return o}function kl(t,e,r){for(var i=0,n=0,o=t;n<o.length;n+=1){var a=o[n];i+=Math.max(e,Math.min(r,a[1]))-Math.max(e,Math.min(r,a[0]))}return i}function zl(t,e,r){for(var i=[{fixed:-1,stretch:0}],n=0,o=t;n<o.length;n+=1){var a=(u=o[n])[0],s=u[1],u=i[i.length-1];i.push({fixed:a-u.stretch,stretch:u.stretch}),i.push({fixed:a-u.stretch,stretch:u.stretch+(s-a)})}return i.push({fixed:e+1,stretch:r}),i}function Ll(t,e,r,i,o,a,s,u,l,c){var p,h,f,d;this.boxStartIndex=t.length,l?(f=a.top,h=a.bottom,(p=a.collisionPadding)&&(f-=p[1],h+=p[3]),0<(d=h-f)&&(d=Math.max(10,d),this.circleDiameter=d)):(l=a.top*s-u,p=a.bottom*s+u,h=a.left*s-u,f=a.right*s+u,(d=a.collisionPadding)&&(h-=d[0]*s,l-=d[1]*s,f+=d[2]*s,p+=d[3]*s),c&&(u=new n(h,l),a=new n(f,l),d=new n(h,p),s=new n(f,p),c=c*Math.PI/180,u._rotate(c),a._rotate(c),d._rotate(c),s._rotate(c),h=Math.min(u.x,a.x,d.x,s.x),f=Math.max(u.x,a.x,d.x,s.x),l=Math.min(u.y,a.y,d.y,s.y),p=Math.max(u.y,a.y,d.y,s.y)),t.emplaceBack(e.x,e.y,h,l,f,p,r,i,o)),this.boxEndIndex=t.length}Oi("Anchor",bl),et=Object.freeze({__proto__:null,getSizeData:Sl,evaluateSizeForFeature:Tl,evaluateSizeForZoom:El,SIZE_PACK_FACTOR:128});var Bl=function(t,e){if(void 0===t&&(t=[]),void 0===e&&(e=Dl),this.data=t,this.length=this.data.length,this.compare=e,0<this.length)for(var r=(this.length>>1)-1;0<=r;r--)this._down(r)};function Dl(t,e){return t<e?-1:e<t?1:0}function Rl(t,e){return e.max-t.max}function Ol(t,e,r,i){this.p=new n(t,e),this.h=r,this.d=function(t,e){for(var r=!1,i=1/0,n=0;n<e.length;n++)for(var o=e[n],a=0,s=o.length,u=s-1;a<s;u=a++){var l=o[a],c=o[u];l.y>t.y!=c.y>t.y&&t.x<(c.x-l.x)*(t.y-l.y)/(c.y-l.y)+l.x&&(r=!r),i=Math.min(i,Ja(t,l,c))}return(r?1:-1)*Math.sqrt(i)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}Bl.prototype.push=function(t){this.data.push(t),this.length++,this._up(this.length-1)},Bl.prototype.pop=function(){if(0!==this.length){var t=this.data[0],e=this.data.pop();return this.length--,0<this.length&&(this.data[0]=e,this._down(0)),t}},Bl.prototype.peek=function(){return this.data[0]},Bl.prototype._up=function(t){for(var e=this.data,r=this.compare,i=e[t];0<t;){var n=t-1>>1,o=e[n];if(0<=r(i,o))break;e[t]=o,t=n}e[t]=i},Bl.prototype._down=function(t){for(var e=this.data,r=this.compare,i=this.length>>1,n=e[t];t<i;){var o=1+(t<<1),a=e[o],s=o+1;if(s<this.length&&r(e[s],a)<0&&(a=e[o=s]),0<=r(a,n))break;e[t]=a,t=o}e[t]=n};var Fl=Number.POSITIVE_INFINITY;function jl(t,e){return e[1]!==Fl?function(t,e,r){var i=0,n=0;switch(e=Math.abs(e),r=Math.abs(r),t){case"top-right":case"top-left":case"top":n=r-7;break;case"bottom-right":case"bottom-left":case"bottom":n=7-r}switch(t){case"top-right":case"bottom-right":case"right":i=-e;break;case"top-left":case"bottom-left":case"left":i=e}return[i,n]}(t,e[0],e[1]):function(t,e){var r=0,i=0;e<0&&(e=0);var n=e/Math.sqrt(2);switch(t){case"top-right":case"top-left":i=n-7;break;case"bottom-right":case"bottom-left":i=7-n;break;case"bottom":i=7-e;break;case"top":i=e-7}switch(t){case"top-right":case"bottom-right":r=-n;break;case"top-left":case"bottom-left":r=n;break;case"left":r=e;break;case"right":r=-e}return[r,i]}(t,e[0])}function Ul(t){switch(t){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Nl(t,e,r,i,o,a,s,u,l,c,p,h,f,d,m){var y=function(t,e,r,i,a,s){for(var u=o.layout.get("text-rotate").evaluate(i,{})*Math.PI/180,l=[],c=0,p=t.positionedLines;c<p.length;c+=1)for(var h=p[c],f=0,d=h.positionedGlyphs;f<d.length;f+=1){var m,y,g,_,v,x,b,w,S,T,E,I,A,C=d[f];C.rect&&(m=C.rect||{},b=4,y=!0,_=1,v=0,S=(r||s)&&C.vertical,T=C.metrics.advance*C.scale/2,s&&t.verticalizable&&(v=h.lineOffset/2-(C.imageName?-(24-C.metrics.width*C.scale)/2:24*(C.scale-1))),C.imageName&&(y=(x=a[C.imageName]).sdf,b=1/(_=x.pixelRatio)),g=r?[C.x+T,C.y]:[0,0],w=r?[0,0]:[C.x+T+e[0],C.y+e[1]-v],E=[0,0],S&&(E=w,w=[0,0]),x=(C.metrics.left-b)*C.scale-T+w[0],v=(-C.metrics.top-b)*C.scale+w[1],b=x+m.w*C.scale/_,w=v+m.h*C.scale/_,_=new n(x,v),v=new n(b,v),x=new n(x,w),b=new n(b,w),S&&(w=new n(-T,T+17),S=-Math.PI/2,T=new n(22-(T=12-T),-(C.imageName?T:0)),E=new(Function.prototype.bind.apply(n,[null].concat(E))),_._rotateAround(S,w)._add(T)._add(E),v._rotateAround(S,w)._add(T)._add(E),x._rotateAround(S,w)._add(T)._add(E),b._rotateAround(S,w)._add(T)._add(E)),u&&(A=Math.sin(u),A=[I=Math.cos(u),-A,A,I],_._matMult(A),v._matMult(A),x._matMult(A),b._matMult(A)),I=new n(0,0),A=new n(0,0),l.push({tl:_,tr:v,bl:x,br:b,tex:m,writingMode:t.writingMode,glyphOffset:g,sectionIndex:C.sectionIndex,isSDF:y,pixelOffsetTL:I,pixelOffsetBR:A,minFontScaleX:0,minFontScaleY:0}))}return l}(r,u,a,s,i,t.allowVerticalPlacement);i=null;"source"===(r=t.textSizeData).kind?32640<(i=[128*o.layout.get("text-size").evaluate(s,{})])[0]&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'):"composite"===r.kind&&(32640<(i=[128*d.compositeTextSizes[0].evaluate(s,{},m),128*d.compositeTextSizes[1].evaluate(s,{},m)])[0]||32640<i[1])&&w(t.layerIds[0]+': Value for "text-size" is >= 255. Reduce your "text-size".'),t.addSymbols(t.text,y,i,u,a,s,c,e,l.lineStartIndex,l.lineLength,f,m);for(var g=0,_=p;g<_.length;g+=1)h[_[g]]=t.text.placedSymbolArray.length-1;return 4*y.length}function Vl(t){for(var e in t)return t[e];return null}var ql=lu.VectorTileFeature.types,Gl=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Hl(t,e,r,i,n,o,a,s,u,l,c,p,h){var f=s?Math.min(32640,Math.round(s[0])):0;s=s?Math.min(32640,Math.round(s[1])):0;t.emplaceBack(e,r,Math.round(32*i),Math.round(32*n),o,a,(f<<1)+(u?1:0),s,16*l,16*c,256*p,256*h)}function Zl(t,e,r){t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r),t.emplaceBack(e.x,e.y,r)}function Wl(t){for(var e=0,r=t.sections;e<r.length;e+=1)if(function(t){for(var e=0,r=t;e<r.length;e+=1)if(Wi(r[e].charCodeAt(0)))return 1}(r[e].text))return 1}function Xl(t){this.layoutVertexArray=new Gn,this.indexArray=new fo,this.programConfigurations=t,this.segments=new ra,this.dynamicLayoutVertexArray=new Wn,this.opacityVertexArray=new Yn,this.placedSymbolArray=new Uo}function Kl(t,e,r){this.layoutVertexArray=new t,this.layoutAttributes=e,this.indexArray=new r,this.segments=new ra,this.collisionVertexArray=new so}function Jl(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((function(t){return t.id})),this.index=t.index,this.pixelRatio=t.pixelRatio,this.sourceLayerIndex=t.sourceLayerIndex,this.hasPattern=!1,this.hasRTLText=!1,this.sortKeyRanges=[],this.collisionCircleArray=[],this.placementInvProjMatrix=ns([]),this.placementViewportMatrix=ns([]);var e=this.layers[0]._unevaluatedLayout._values;this.textSizeData=Sl(this.zoom,e["text-size"]),this.iconSizeData=Sl(this.zoom,e["icon-size"]);var r=this.layers[0].layout,i=r.get("symbol-sort-key");e=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="viewport-y"!==e&&!i.isConstant(),this.sortFeaturesByY=("viewport-y"===e||"auto"===e&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===r.get("symbol-placement")&&(this.writingModes=r.get("text-writing-mode").map((function(t){return ll[t]}))),this.stateDependentLayerIds=this.layers.filter((function(t){return t.isStateDependent()})).map((function(t){return t.id})),this.sourceID=t.sourceID}function Yl(t){this.type=t.property.overrides?t.property.overrides.runtimeType:qt,this.defaultValue=t}Xl.prototype.isEmpty=function(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length},Xl.prototype.upload=function(t,e,r,i){this.isEmpty()||(r&&(this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,zu.members),this.indexBuffer=t.createIndexBuffer(this.indexArray,e),this.dynamicLayoutVertexBuffer=t.createVertexBuffer(this.dynamicLayoutVertexArray,Lu.members,!0),this.opacityVertexBuffer=t.createVertexBuffer(this.opacityVertexArray,Gl,!0),this.opacityVertexBuffer.itemSize=1),(r||i)&&this.programConfigurations.upload(t))},Xl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())},Oi("SymbolBuffers",Xl),Kl.prototype.upload=function(t){this.layoutVertexBuffer=t.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=t.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=t.createVertexBuffer(this.collisionVertexArray,Bu.members,!0)},Kl.prototype.destroy=function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())},Oi("CollisionBuffers",Kl),Jl.prototype.createArrays=function(){this.text=new Xl(new Fa(this.layers,this.zoom,(function(t){return/^text/.test(t)}))),this.icon=new Xl(new Fa(this.layers,this.zoom,(function(t){return/^icon/.test(t)}))),this.glyphOffsetArray=new Wo,this.lineVertexArray=new Jo,this.symbolInstances=new Go},Jl.prototype.calculateGlyphDependencies=function(t,e,r,i,n){for(var o,a=0;a<t.length;a++)e[t.charCodeAt(a)]=!0,(r||i)&&n&&(o=Fu[t.charAt(a)])&&(e[o.charCodeAt(0)]=!0)},Jl.prototype.populate=function(t,e,r){var i=this.layers[0],n=i.layout,o=n.get("text-font"),a=n.get("text-field"),s=n.get("icon-image"),u=("constant"!==a.value.kind||a.value.value instanceof le&&!a.value.value.isEmpty()||0<a.value.value.toString().length)&&("constant"!==o.value.kind||0<o.value.value.length),l="constant"!==s.value.kind||!!s.value.value||0<Object.keys(s.parameters).length,c=n.get("symbol-sort-key");if(this.features=[],u||l){for(var p=e.iconDependencies,h=e.glyphDependencies,f=e.availableImages,d=new tn(this.zoom),m=0,y=t;m<y.length;m+=1){var g=(w=y[m]).feature,_=w.id,v=w.index,x=w.sourceLayerIndex,b=i._featureFilter.needGeometry,w=qa(g,b);if(i._featureFilter.filter(d,w,r)){b||(w.geometry=Va(g));var S=void 0;u&&(T=i.getValueAndResolveTokens("text-field",w,r,f),Wl(T=le.factory(T))&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===Ji||this.hasRTLText&&rn.isParsed())&&(S=function(t,e,r){return t.sections.forEach((function(t){t.text=function(t,r){return"uppercase"===(r=e.layout.get("text-transform").evaluate(r,{}))?t=t.toLocaleUpperCase():"lowercase"===r&&(t=t.toLocaleLowerCase()),rn.applyArabicShaping&&(t=rn.applyArabicShaping(t)),t}(t.text,r)})),t}(T,i,w)));var T=void 0;if(l&&(T=(E=i.getValueAndResolveTokens("icon-image",w,r,f))instanceof ce?E:ce.fromString(E)),S||T){var E=this.sortFeaturesByKey?c.evaluate(w,{},r):void 0;if(this.features.push({id:_,text:S,icon:T,index:v,sourceLayerIndex:x,geometry:w.geometry,properties:g.properties,type:ql[g.type],sortKey:E}),T&&(p[T.name]=!0),S){var I=o.evaluate(w,{},r).join(","),A="map"===n.get("text-rotation-alignment")&&"point"!==n.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&0<=this.writingModes.indexOf(ll.vertical);for(var C=0,P=S.sections;C<P.length;C+=1){var M,k,z=P[C];z.image?p[z.image.name]=!0:(M=Gi(S.toString()),k=h[k=z.fontStack||I]=h[k]||{},this.calculateGlyphDependencies(z.text,k,A,this.allowVerticalPlacement,M))}}}}}"line"===n.get("symbol-placement")&&(this.features=function(t){var e={},r={},i=[],n=0;function o(e){i.push(t[e]),n++}function a(t,e,n){var o=r[t];return delete r[t],r[e]=o,i[o].geometry[0].pop(),i[o].geometry[0]=i[o].geometry[0].concat(n[0]),o}function s(t,r,n){var o=e[r];return delete e[r],e[t]=o,i[o].geometry[0].shift(),i[o].geometry[0]=n[0].concat(i[o].geometry[0]),o}function u(t,e,r){return t+":"+(e=r?e[0][e[0].length-1]:e[0][0]).x+":"+e.y}for(var l=0;l<t.length;l++){var c,p,h,f=t[l],d=f.geometry,m=f.text?f.text.toString():null;m?(c=u(m,d),p=u(m,d,!0),c in r&&p in e&&r[c]!==e[p]?(h=s(c,p,d),f=a(c,p,i[h].geometry),delete e[c],delete r[p],r[u(m,i[f].geometry,!0)]=f,i[h].geometry=null):c in r?a(c,p,d):p in e?s(c,p,d):(o(l),e[c]=n-1,r[p]=n-1)):o(l)}return i.filter((function(t){return t.geometry}))}(this.features)),this.sortFeaturesByKey&&this.features.sort((function(t,e){return t.sortKey-e.sortKey}))}},Jl.prototype.update=function(t,e,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(t,e,this.layers,r),this.icon.programConfigurations.updatePaintArrays(t,e,this.layers,r))},Jl.prototype.isEmpty=function(){return 0===this.symbolInstances.length&&!this.hasRTLText},Jl.prototype.uploadPending=function(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload},Jl.prototype.upload=function(t){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(t),this.iconCollisionBox.upload(t)),this.text.upload(t,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(t,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0},Jl.prototype.destroyDebugData=function(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()},Jl.prototype.destroy=function(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()},Jl.prototype.addToLineVertexArray=function(t,e){var r=this.lineVertexArray.length;if(void 0!==t.segment){for(var i=t.dist(e[t.segment+1]),n=t.dist(e[t.segment]),o={},a=t.segment+1;a<e.length;a++)o[a]={x:e[a].x,y:e[a].y,tileUnitDistanceFromAnchor:i},a<e.length-1&&(i+=e[a+1].dist(e[a]));for(var s=t.segment||0;0<=s;s--)o[s]={x:e[s].x,y:e[s].y,tileUnitDistanceFromAnchor:n},0<s&&(n+=e[s-1].dist(e[s]));for(var u=0;u<e.length;u++){var l=o[u];this.lineVertexArray.emplaceBack(l.x,l.y,l.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}},Jl.prototype.addSymbols=function(t,e,r,i,n,o,a,s,u,l,c,p){for(var h=t.indexArray,f=t.layoutVertexArray,d=t.segments.prepareSegment(4*e.length,f,h,this.canOverlap?o.sortKey:void 0),m=this.glyphOffsetArray.length,y=d.vertexLength,g=this.allowVerticalPlacement&&a===ll.vertical?Math.PI/2:0,_=o.text&&o.text.sections,v=0;v<e.length;v++){var x=(L=e[v]).tl,b=L.tr,w=L.bl,S=L.br,T=L.tex,E=L.pixelOffsetTL,I=L.pixelOffsetBR,A=L.minFontScaleX,C=L.minFontScaleY,P=L.glyphOffset,M=L.isSDF,k=L.sectionIndex,z=d.vertexLength,L=P[1];Hl(f,s.x,s.y,x.x,L+x.y,T.x,T.y,r,M,E.x,E.y,A,C),Hl(f,s.x,s.y,b.x,L+b.y,T.x+T.w,T.y,r,M,I.x,E.y,A,C),Hl(f,s.x,s.y,w.x,L+w.y,T.x,T.y+T.h,r,M,E.x,I.y,A,C),Hl(f,s.x,s.y,S.x,L+S.y,T.x+T.w,T.y+T.h,r,M,I.x,I.y,A,C),Zl(t.dynamicLayoutVertexArray,s,g),h.emplaceBack(z,z+1,z+2),h.emplaceBack(z+1,z+2,z+3),d.vertexLength+=4,d.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(P[0]),v!==e.length-1&&k===e[v+1].sectionIndex||t.programConfigurations.populatePaintArrays(f.length,o,o.index,{},p,_&&_[k])}t.placedSymbolArray.emplaceBack(s.x,s.y,m,this.glyphOffsetArray.length-m,y,u,l,s.segment,r?r[0]:0,r?r[1]:0,i[0],i[1],a,0,!1,0,c)},Jl.prototype._addCollisionDebugVertex=function(t,e,r,i,n,o){return e.emplaceBack(0,0),t.emplaceBack(r.x,r.y,i,n,Math.round(o.x),Math.round(o.y))},Jl.prototype.addCollisionDebugVertices=function(t,e,r,i,o,a,s){var u=o.segments.prepareSegment(4,o.layoutVertexArray,o.indexArray),l=u.vertexLength,c=o.layoutVertexArray,p=o.collisionVertexArray,h=s.anchorX;s=s.anchorY;this._addCollisionDebugVertex(c,p,a,h,s,new n(t,e)),this._addCollisionDebugVertex(c,p,a,h,s,new n(r,e)),this._addCollisionDebugVertex(c,p,a,h,s,new n(r,i)),this._addCollisionDebugVertex(c,p,a,h,s,new n(t,i)),u.vertexLength+=4,(o=o.indexArray).emplaceBack(l,l+1),o.emplaceBack(l+1,l+2),o.emplaceBack(l+2,l+3),o.emplaceBack(l+3,l),u.primitiveLength+=4},Jl.prototype.addDebugCollisionBoxes=function(t,e,r,i){for(var n=t;n<e;n++){var o=this.collisionBoxArray.get(n);this.addCollisionDebugVertices(o.x1,o.y1,o.x2,o.y2,i?this.textCollisionBox:this.iconCollisionBox,o.anchorPoint,r)}},Jl.prototype.generateCollisionDebugBuffers=function(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new Kl(eo,Du.members,Co),this.iconCollisionBox=new Kl(eo,Du.members,Co);for(var t=0;t<this.symbolInstances.length;t++){var e=this.symbolInstances.get(t);this.addDebugCollisionBoxes(e.textBoxStartIndex,e.textBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.verticalTextBoxStartIndex,e.verticalTextBoxEndIndex,e,!0),this.addDebugCollisionBoxes(e.iconBoxStartIndex,e.iconBoxEndIndex,e,!1),this.addDebugCollisionBoxes(e.verticalIconBoxStartIndex,e.verticalIconBoxEndIndex,e,!1)}},Jl.prototype._deserializeCollisionBoxesForSymbol=function(t,e,r,i,n,o,a,s,u){for(var l={},c=e;c<r;c++){var p=t.get(c);l.textBox={x1:p.x1,y1:p.y1,x2:p.x2,y2:p.y2,anchorPointX:p.anchorPointX,anchorPointY:p.anchorPointY},l.textFeatureIndex=p.featureIndex;break}for(var h=i;h<n;h++){var f=t.get(h);l.verticalTextBox={x1:f.x1,y1:f.y1,x2:f.x2,y2:f.y2,anchorPointX:f.anchorPointX,anchorPointY:f.anchorPointY},l.verticalTextFeatureIndex=f.featureIndex;break}for(var d=o;d<a;d++){var m=t.get(d);l.iconBox={x1:m.x1,y1:m.y1,x2:m.x2,y2:m.y2,anchorPointX:m.anchorPointX,anchorPointY:m.anchorPointY},l.iconFeatureIndex=m.featureIndex;break}for(var y=s;y<u;y++){var g=t.get(y);l.verticalIconBox={x1:g.x1,y1:g.y1,x2:g.x2,y2:g.y2,anchorPointX:g.anchorPointX,anchorPointY:g.anchorPointY},l.verticalIconFeatureIndex=g.featureIndex;break}return l},Jl.prototype.deserializeCollisionBoxes=function(t){this.collisionArrays=[];for(var e=0;e<this.symbolInstances.length;e++){var r=this.symbolInstances.get(e);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}},Jl.prototype.hasTextData=function(){return 0<this.text.segments.get().length},Jl.prototype.hasIconData=function(){return 0<this.icon.segments.get().length},Jl.prototype.hasDebugData=function(){return this.textCollisionBox&&this.iconCollisionBox},Jl.prototype.hasTextCollisionBoxData=function(){return this.hasDebugData()&&0<this.textCollisionBox.segments.get().length},Jl.prototype.hasIconCollisionBoxData=function(){return this.hasDebugData()&&0<this.iconCollisionBox.segments.get().length},Jl.prototype.addIndicesForPlacedSymbol=function(t,e){for(var r=(e=t.placedSymbolArray.get(e)).vertexStartIndex+4*e.numGlyphs,i=e.vertexStartIndex;i<r;i+=4)t.indexArray.emplaceBack(i,i+1,i+2),t.indexArray.emplaceBack(i+1,i+2,i+3)},Jl.prototype.getSortedSymbolIndexes=function(t){if(this.sortedAngle===t&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;for(var e=Math.sin(t),r=Math.cos(t),i=[],n=[],o=[],a=0;a<this.symbolInstances.length;++a){o.push(a);var s=this.symbolInstances.get(a);i.push(0|Math.round(e*s.anchorX+r*s.anchorY)),n.push(s.featureIndex)}return o.sort((function(t,e){return i[t]-i[e]||n[e]-n[t]})),o},Jl.prototype.addToSortKeyRanges=function(t,e){var r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===e?r.symbolInstanceEnd=t+1:this.sortKeyRanges.push({sortKey:e,symbolInstanceStart:t,symbolInstanceEnd:t+1})},Jl.prototype.sortFeatures=function(t){var e=this;if(this.sortFeaturesByY&&this.sortedAngle!==t&&!(1<this.text.segments.get().length||1<this.icon.segments.get().length)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(t),this.sortedAngle=t,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(var r=0,i=this.symbolInstanceIndexes;r<i.length;r+=1){var n=this.symbolInstances.get(i[r]);this.featureSortOrder.push(n.featureIndex),[n.rightJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.leftJustifiedTextSymbolIndex].forEach((function(t,r,i){0<=t&&i.indexOf(t)===r&&e.addIndicesForPlacedSymbol(e.text,t)})),0<=n.verticalPlacedTextSymbolIndex&&this.addIndicesForPlacedSymbol(this.text,n.verticalPlacedTextSymbolIndex),0<=n.placedIconSymbolIndex&&this.addIndicesForPlacedSymbol(this.icon,n.placedIconSymbolIndex),0<=n.verticalPlacedIconSymbolIndex&&this.addIndicesForPlacedSymbol(this.icon,n.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}},Oi("SymbolBucket",Jl,{omit:["layers","collisionBoxArray","features","compareText"]}),Jl.MAX_GLYPHS=65535,Jl.addDynamicAttributes=Zl;dn=new gn({"symbol-placement":new hn(Lt.layout_symbol["symbol-placement"]),"symbol-spacing":new hn(Lt.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new hn(Lt.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new nc(Lt.layout_symbol["symbol-sort-key"]),"symbol-z-order":new hn(Lt.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new hn(Lt.layout_symbol["icon-allow-overlap"]),"icon-ignore-placement":new hn(Lt.layout_symbol["icon-ignore-placement"]),"icon-optional":new hn(Lt.layout_symbol["icon-optional"]),"icon-rotation-alignment":new hn(Lt.layout_symbol["icon-rotation-alignment"]),"icon-size":new nc(Lt.layout_symbol["icon-size"]),"icon-text-fit":new hn(Lt.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new hn(Lt.layout_symbol["icon-text-fit-padding"]),"icon-image":new nc(Lt.layout_symbol["icon-image"]),"icon-rotate":new nc(Lt.layout_symbol["icon-rotate"]),"icon-padding":new hn(Lt.layout_symbol["icon-padding"]),"icon-keep-upright":new hn(Lt.layout_symbol["icon-keep-upright"]),"icon-offset":new nc(Lt.layout_symbol["icon-offset"]),"icon-anchor":new nc(Lt.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new hn(Lt.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new hn(Lt.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new hn(Lt.layout_symbol["text-rotation-alignment"]),"text-field":new nc(Lt.layout_symbol["text-field"]),"text-font":new nc(Lt.layout_symbol["text-font"]),"text-size":new nc(Lt.layout_symbol["text-size"]),"text-max-width":new nc(Lt.layout_symbol["text-max-width"]),"text-line-height":new hn(Lt.layout_symbol["text-line-height"]),"text-letter-spacing":new nc(Lt.layout_symbol["text-letter-spacing"]),"text-justify":new nc(Lt.layout_symbol["text-justify"]),"text-radial-offset":new nc(Lt.layout_symbol["text-radial-offset"]),"text-variable-anchor":new hn(Lt.layout_symbol["text-variable-anchor"]),"text-anchor":new nc(Lt.layout_symbol["text-anchor"]),"text-max-angle":new hn(Lt.layout_symbol["text-max-angle"]),"text-writing-mode":new hn(Lt.layout_symbol["text-writing-mode"]),"text-rotate":new nc(Lt.layout_symbol["text-rotate"]),"text-padding":new hn(Lt.layout_symbol["text-padding"]),"text-keep-upright":new hn(Lt.layout_symbol["text-keep-upright"]),"text-transform":new nc(Lt.layout_symbol["text-transform"]),"text-offset":new nc(Lt.layout_symbol["text-offset"]),"text-allow-overlap":new hn(Lt.layout_symbol["text-allow-overlap"]),"text-ignore-placement":new hn(Lt.layout_symbol["text-ignore-placement"]),"text-optional":new hn(Lt.layout_symbol["text-optional"])});var Ql={paint:new gn({"icon-opacity":new nc(Lt.paint_symbol["icon-opacity"]),"icon-color":new nc(Lt.paint_symbol["icon-color"]),"icon-halo-color":new nc(Lt.paint_symbol["icon-halo-color"]),"icon-halo-width":new nc(Lt.paint_symbol["icon-halo-width"]),"icon-halo-blur":new nc(Lt.paint_symbol["icon-halo-blur"]),"icon-translate":new hn(Lt.paint_symbol["icon-translate"]),"icon-translate-anchor":new hn(Lt.paint_symbol["icon-translate-anchor"]),"text-opacity":new nc(Lt.paint_symbol["text-opacity"]),"text-color":new nc(Lt.paint_symbol["text-color"],{runtimeType:Wt,getOverride:function(t){return t.textColor},hasOverride:function(t){return!!t.textColor}}),"text-halo-color":new nc(Lt.paint_symbol["text-halo-color"]),"text-halo-width":new nc(Lt.paint_symbol["text-halo-width"]),"text-halo-blur":new nc(Lt.paint_symbol["text-halo-blur"]),"text-translate":new hn(Lt.paint_symbol["text-translate"]),"text-translate-anchor":new hn(Lt.paint_symbol["text-translate-anchor"])}),layout:dn};function $l(t,e,r,i){this.context=t,this.format=r,this.texture=t.gl.createTexture(),this.update(e,i)}Yl.prototype.evaluate=function(t){if(t.formattedSection){var e=this.defaultValue.property.overrides;if(e&&e.hasOverride(t.formattedSection))return e.getOverride(t.formattedSection)}return t.feature&&t.featureState?this.defaultValue.evaluate(t.feature,t.featureState):this.defaultValue.property.specification.default},Yl.prototype.eachChild=function(t){this.defaultValue.isConstant()||t(this.defaultValue.value._styleExpression.expression)},Yl.prototype.outputDefined=function(){return!1},Yl.prototype.serialize=function(){return null},Oi("FormatSectionOverride",Yl,{omit:["defaultValue"]});var tc,ec,rc,ic,nc=((ic=vn)&&(_c.__proto__=ic),((_c.prototype=Object.create(ic&&ic.prototype)).constructor=_c).prototype.recalculate=function(t,e){if(ic.prototype.recalculate.call(this,t,e),"auto"===this.layout.get("icon-rotation-alignment")&&(this.layout._values["icon-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-rotation-alignment")&&(this.layout._values["text-rotation-alignment"]="point"!==this.layout.get("symbol-placement")?"map":"viewport"),"auto"===this.layout.get("text-pitch-alignment")&&(this.layout._values["text-pitch-alignment"]=this.layout.get("text-rotation-alignment")),"auto"===this.layout.get("icon-pitch-alignment")&&(this.layout._values["icon-pitch-alignment"]=this.layout.get("icon-rotation-alignment")),"point"===this.layout.get("symbol-placement"))if(e=this.layout.get("text-writing-mode")){for(var r=[],i=0,n=e;i<n.length;i+=1){var o=n[i];r.indexOf(o)<0&&r.push(o)}this.layout._values["text-writing-mode"]=r}else this.layout._values["text-writing-mode"]=["horizontal"];this._setPaintOverrides()},_c.prototype.getValueAndResolveTokens=function(t,e,r,i){var n;i=this.layout.get(t).evaluate(e,{},r,i);return(t=this._unevaluatedLayout._values[t]).isDataDriven()||Gr(t.value)||!i?i:(n=e.properties,i.replace(/{([^{}]+)}/g,(function(t,e){return e in n?String(n[e]):""})))},_c.prototype.createBucket=function(t){return new Jl(t)},_c.prototype.queryRadius=function(){return 0},_c.prototype.queryIntersectsFeature=function(){return!1},_c.prototype._setPaintOverrides=function(){for(var t=0,e=Ql.paint.overridableProperties;t<e.length;t+=1){var r,i,n=e[t];_c.hasPaintOverride(this.layout,n)&&(i=new Yl(r=this.paint.get(n)),i=new qr(i,r.property.specification),i="constant"===r.value.kind||"source"===r.value.kind?new Zr("source",i):new Wr("composite",i,r.value.zoomStops,r.value._interpolationType),this.paint._values[n]=new cn(r.property,i,r.parameters))}},_c.prototype._handleOverridablePaintPropertyUpdate=function(t,e,r){return!(!this.layout||e.isDataDriven()||r.isDataDriven())&&_c.hasPaintOverride(this.layout,t)},_c.hasPaintOverride=function(t,e){function r(t){for(var e=0,r=t;e<r.length;e+=1)if(n.overrides&&n.overrides.hasOverride(r[e]))return o=!0,0}t=t.get("text-field");var i,n=Ql.paint.properties[e],o=!1;return"constant"===t.value.kind&&t.value.value instanceof le?r(t.value.value.sections):"source"===t.value.kind&&(i=function(t){o||(t instanceof me&&fe(t.value)===Yt?r(t.value.sections):t instanceof ve?r(t.sections):t.eachChild(i))},(t=t.value)._styleExpression&&i(t._styleExpression.expression)),o},_c),oc={paint:new gn({"background-color":new hn(Lt.paint_background["background-color"]),"background-pattern":new sc(Lt.paint_background["background-pattern"]),"background-opacity":new hn(Lt.paint_background["background-opacity"])})},ac=(dn=((rc=vn)&&(gc.__proto__=rc),(gc.prototype=Object.create(rc&&rc.prototype)).constructor=gc),{paint:new gn({"raster-opacity":new hn(Lt.paint_raster["raster-opacity"]),"raster-hue-rotate":new hn(Lt.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new hn(Lt.paint_raster["raster-brightness-min"]),"raster-brightness-max":new hn(Lt.paint_raster["raster-brightness-max"]),"raster-saturation":new hn(Lt.paint_raster["raster-saturation"]),"raster-contrast":new hn(Lt.paint_raster["raster-contrast"]),"raster-resampling":new hn(Lt.paint_raster["raster-resampling"]),"raster-fade-duration":new hn(Lt.paint_raster["raster-fade-duration"])})}),sc=((ec=vn)&&(yc.__proto__=ec),(yc.prototype=Object.create(ec&&ec.prototype)).constructor=yc),uc=((tc=vn)&&(mc.__proto__=tc),((mc.prototype=Object.create(tc&&tc.prototype)).constructor=mc).prototype.is3D=function(){return"3d"===this.implementation.renderingMode},mc.prototype.hasOffscreenPass=function(){return void 0!==this.implementation.prerender},mc.prototype.recalculate=function(){},mc.prototype.updateTransitions=function(){},mc.prototype.hasTransition=function(){},mc.prototype.serialize=function(){},mc.prototype.onAdd=function(t){this.implementation.onAdd&&this.implementation.onAdd(t,t.painter.context.gl)},mc.prototype.onRemove=function(t){this.implementation.onRemove&&this.implementation.onRemove(t,t.painter.context.gl)},mc),lc={circle:xr,heatmap:vr,hillshade:wr,fill:$s,"fill-extrusion":bn,line:br,symbol:nc,background:dn,raster:sc},cc=a.HTMLImageElement,pc=a.HTMLCanvasElement,hc=a.HTMLVideoElement,fc=a.ImageData,dc=a.ImageBitmap;function mc(t){tc.call(this,t,{}),this.implementation=t}function yc(t){ec.call(this,t,ac)}function gc(t){rc.call(this,t,oc)}function _c(t){ic.call(this,t,Ql)}function vc(t){var e=this;this._callback=t,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=function(){e._triggered=!1,e._callback()})}function xc(t,e,r){return[t*(r=2*Math.PI*6378137/256/Math.pow(2,r))-2*Math.PI*6378137/2,e*r-2*Math.PI*6378137/2]}function bc(t,e){t&&(e?this.setSouthWest(t).setNorthEast(e):4===t.length?this.setSouthWest([t[0],t[1]]).setNorthEast([t[2],t[3]]):this.setSouthWest(t[0]).setNorthEast(t[1]))}$l.prototype.update=function(t,e,r){var i=t.width,n=t.height,o=!(this.size&&this.size[0]===i&&this.size[1]===n||r),a=this.context,s=a.gl;this.useMipmap=Boolean(e&&e.useMipmap),s.bindTexture(s.TEXTURE_2D,this.texture),a.pixelStoreUnpackFlipY.set(!1),a.pixelStoreUnpack.set(1),a.pixelStoreUnpackPremultiplyAlpha.set(this.format===s.RGBA&&(!e||!1!==e.premultiply)),o?(this.size=[i,n],t instanceof cc||t instanceof pc||t instanceof hc||t instanceof fc||dc&&t instanceof dc?s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,s.UNSIGNED_BYTE,t):s.texImage2D(s.TEXTURE_2D,0,this.format,i,n,0,this.format,s.UNSIGNED_BYTE,t.data)):(r=(o=r||{x:0,y:0}).x,o=o.y,t instanceof cc||t instanceof pc||t instanceof hc||t instanceof fc||dc&&t instanceof dc?s.texSubImage2D(s.TEXTURE_2D,0,r,o,s.RGBA,s.UNSIGNED_BYTE,t):s.texSubImage2D(s.TEXTURE_2D,0,r,o,i,n,s.RGBA,s.UNSIGNED_BYTE,t.data)),this.useMipmap&&this.isSizePowerOfTwo()&&s.generateMipmap(s.TEXTURE_2D)},$l.prototype.bind=function(t,e,r){var i=this.context.gl;i.bindTexture(i.TEXTURE_2D,this.texture),r!==i.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=i.LINEAR),t!==this.filter&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,t),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,r||t),this.filter=t),e!==this.wrap&&(i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,e),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,e),this.wrap=e)},$l.prototype.isSizePowerOfTwo=function(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0},$l.prototype.destroy=function(){this.context.gl.deleteTexture(this.texture),this.texture=null},vc.prototype.trigger=function(){var t=this;this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((function(){t._triggered=!1,t._callback()}),0))},vc.prototype.remove=function(){delete this._channel,this._callback=function(){}},($s=function(t,e,r){this.target=t,this.parent=e,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},y(["receive","process"],this),this.invoker=new vc(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=T()?t:a}).prototype.send=function(t,e,r,i,n){var o=this;void 0===n&&(n=!1);var a=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[a]=r);var s=A(this.globalScope)?void 0:[];return this.target.postMessage({id:a,type:t,hasCallback:!!r,targetMapId:i,mustQueue:n,sourceMapId:this.mapId,data:Ui(e,s)},s),{cancel:function(){r&&delete o.callbacks[a],o.target.postMessage({id:a,type:"<cancel>",targetMapId:i,sourceMapId:o.mapId})}}},$s.prototype.receive=function(t){var e=t.data,r=e.id;!r||e.targetMapId&&this.mapId!==e.targetMapId||("<cancel>"===e.type?(delete this.tasks[r],t=this.cancelCallbacks[r],delete this.cancelCallbacks[r],t&&t()):T()||e.mustQueue?(this.tasks[r]=e,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,e))},$s.prototype.process=function(){var t,e;this.taskQueue.length&&(t=this.taskQueue.shift(),e=this.tasks[t],delete this.tasks[t],this.taskQueue.length&&this.invoker.trigger(),e&&this.processTask(t,e))},$s.prototype.processTask=function(t,e){var r,i,n,o,a,s,u=this;"<response>"===e.type?(a=this.callbacks[t],delete this.callbacks[t],a&&(e.error?a(Ni(e.error)):a(null,Ni(e.data)))):(r=!1,i=A(this.globalScope)?void 0:[],n=e.hasCallback?function(e,n){r=!0,delete u.cancelCallbacks[t],u.target.postMessage({id:t,type:"<response>",sourceMapId:u.mapId,error:e?Ui(e):null,data:Ui(n,i)},i)}:function(t){r=!0},s=null,o=Ni(e.data),this.parent[e.type]?s=this.parent[e.type](e.sourceMapId,o,n):this.parent.getWorkerSource?(a=e.type.split("."),s=this.parent.getWorkerSource(e.sourceMapId,a[0],o.source)[a[1]](o,n)):n(new Error("Could not find function "+e.type)),!r&&s&&s.cancel&&(this.cancelCallbacks[t]=s.cancel))},$s.prototype.remove=function(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)},bc.prototype.setNorthEast=function(t){return this._ne=t instanceof wc?new wc(t.lng,t.lat):wc.convert(t),this},bc.prototype.setSouthWest=function(t){return this._sw=t instanceof wc?new wc(t.lng,t.lat):wc.convert(t),this},bc.prototype.extend=function(t){var e,r,i=this._sw,n=this._ne;if(t instanceof wc)r=e=t;else{if(!(t instanceof bc))return Array.isArray(t)?4===t.length||t.every(Array.isArray)?this.extend(bc.convert(t)):this.extend(wc.convert(t)):this;if(r=t._ne,!(e=t._sw)||!r)return this}return i||n?(i.lng=Math.min(e.lng,i.lng),i.lat=Math.min(e.lat,i.lat),n.lng=Math.max(r.lng,n.lng),n.lat=Math.max(r.lat,n.lat)):(this._sw=new wc(e.lng,e.lat),this._ne=new wc(r.lng,r.lat)),this},bc.prototype.getCenter=function(){return new wc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)},bc.prototype.getSouthWest=function(){return this._sw},bc.prototype.getNorthEast=function(){return this._ne},bc.prototype.getNorthWest=function(){return new wc(this.getWest(),this.getNorth())},bc.prototype.getSouthEast=function(){return new wc(this.getEast(),this.getSouth())},bc.prototype.getWest=function(){return this._sw.lng},bc.prototype.getSouth=function(){return this._sw.lat},bc.prototype.getEast=function(){return this._ne.lng},bc.prototype.getNorth=function(){return this._ne.lat},bc.prototype.toArray=function(){return[this._sw.toArray(),this._ne.toArray()]},bc.prototype.toString=function(){return"LngLatBounds("+this._sw.toString()+", "+this._ne.toString()+")"},bc.prototype.isEmpty=function(){return!(this._sw&&this._ne)},bc.prototype.contains=function(t){var e=(r=wc.convert(t)).lng,r=(t=r.lat,this._sw.lng<=e&&e<=this._ne.lng);return this._sw.lng>this._ne.lng&&(r=this._sw.lng>=e&&e>=this._ne.lng),this._sw.lat<=t&&t<=this._ne.lat&&r},bc.convert=function(t){return!t||t instanceof bc?t:new bc(t)};var wc=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid LngLat object: ("+t+", "+e+")");if(this.lng=+t,this.lat=+e,90<this.lat||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")};wc.prototype.wrap=function(){return new wc(p(this.lng,-180,180),this.lat)},wc.prototype.toArray=function(){return[this.lng,this.lat]},wc.prototype.toString=function(){return"LngLat("+this.lng+", "+this.lat+")"},wc.prototype.distanceTo=function(t){var e=Math.PI/180,r=this.lat*e,i=t.lat*e;e=Math.sin(r)*Math.sin(i)+Math.cos(r)*Math.cos(i)*Math.cos((t.lng-this.lng)*e);return 6371008.8*Math.acos(Math.min(e,1))},wc.prototype.toBounds=function(t){void 0===t&&(t=0);var e=360*t/40075017;t=e/Math.cos(Math.PI/180*this.lat);return new bc(new wc(this.lng-t,this.lat-e),new wc(this.lng+t,this.lat+e))},wc.convert=function(t){if(t instanceof wc)return t;if(Array.isArray(t)&&(2===t.length||3===t.length))return new wc(Number(t[0]),Number(t[1]));if(!Array.isArray(t)&&"object"==typeof t&&null!==t)return new wc(Number("lng"in t?t.lng:t.lon),Number(t.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 Sc=2*Math.PI*6371008.8;function Tc(t){return Sc*Math.cos(t*Math.PI/180)}function Ec(t){return(180+t)/360}function Ic(t){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+t*Math.PI/360)))/360}function Ac(t,e){return t/Tc(e)}function Cc(t){return 360/Math.PI*Math.atan(Math.exp((180-360*t)*Math.PI/180))-90}function Pc(t,e,r){void 0===r&&(r=0),this.x=+t,this.y=+e,this.z=+r}function Mc(t,e,r){this.z=t,this.x=e,this.y=r,this.key=Lc(0,t,t,e,r)}function kc(t,e){this.wrap=t,this.canonical=e,this.key=Lc(t,e.z,e.z,e.x,e.y)}function zc(t,e,r,i,n){this.overscaledZ=t,this.wrap=e,this.canonical=new Mc(r,+i,+n),this.key=Lc(e,t,r,i,n)}function Lc(t,e,r,i,n){(t*=2)<0&&(t=-1*t-1);var o=1<<r;return(o*o*t+o*n+i).toString(36)+r.toString(36)+e.toString(36)}function Bc(t){this._stringToNumber={},this._numberToString=[];for(var e=0;e<t.length;e++){var r=t[e];this._stringToNumber[r]=e,this._numberToString[e]=r}}function Dc(t,e,r,i,n){this.type="Feature",(this._vectorTileFeature=t)._z=e,t._x=r,t._y=i,this.properties=t.properties,this.id=n}function Rc(t,e,r,i,n){return _(t,(function(t,o){return(o=e instanceof pn?e.get(o):null)&&o.evaluate?o.evaluate(r,i,n):o}))}function Oc(t){for(var e=1/0,r=1/0,i=-1/0,n=-1/0,o=0,a=t;o<a.length;o+=1){var s=a[o];e=Math.min(e,s.x),r=Math.min(r,s.y),i=Math.max(i,s.x),n=Math.max(n,s.y)}return{minX:e,minY:r,maxX:i,maxY:n}}function Fc(t,e){return e-t}Pc.fromLngLat=function(t,e){return void 0===e&&(e=0),new Pc(Ec((t=wc.convert(t)).lng),Ic(t.lat),Ac(e,t.lat))},Pc.prototype.toLngLat=function(){return new wc(360*this.x-180,Cc(this.y))},Pc.prototype.toAltitude=function(){return this.z*Tc(Cc(this.y))},Pc.prototype.meterInMercatorCoordinateUnits=function(){return 1/Sc*(t=Cc(this.y),1/Math.cos(t*Math.PI/180));var t},Mc.prototype.equals=function(t){return this.z===t.z&&this.x===t.x&&this.y===t.y},Mc.prototype.url=function(t,e){var r,i,n=(i=this.y,o=this.z,n=xc(256*(r=this.x),256*(i=Math.pow(2,o)-i-1),o),o=xc(256*(r+1),256*(1+i),o),n[0]+","+n[1]+","+o[0]+","+o[1]),o=function(t,e,r){for(var i,n="",o=t;0<o;o--)n+=(e&(i=1<<o-1)?1:0)+(r&i?2:0);return n}(this.z,this.x,this.y);return t[(this.x+this.y)%t.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("tms"===e?Math.pow(2,this.z)-this.y-1:this.y)).replace("{quadkey}",o).replace("{bbox-epsg-3857}",n)},Mc.prototype.getTilePoint=function(t){var e=Math.pow(2,this.z);return new n(8192*(t.x*e-this.x),8192*(t.y*e-this.y))},Mc.prototype.toString=function(){return this.z+"/"+this.x+"/"+this.y},zc.prototype.equals=function(t){return this.overscaledZ===t.overscaledZ&&this.wrap===t.wrap&&this.canonical.equals(t.canonical)},zc.prototype.scaledTo=function(t){var e=this.canonical.z-t;return t>this.canonical.z?new zc(t,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new zc(t,this.wrap,t,this.canonical.x>>e,this.canonical.y>>e)},zc.prototype.calculateScaledKey=function(t,e){var r=this.canonical.z-t;return t>this.canonical.z?Lc(this.wrap*+e,t,this.canonical.z,this.canonical.x,this.canonical.y):Lc(this.wrap*+e,t,t,this.canonical.x>>r,this.canonical.y>>r)},zc.prototype.isChildOf=function(t){if(t.wrap!==this.wrap)return!1;var e=this.canonical.z-t.canonical.z;return 0===t.overscaledZ||t.overscaledZ<this.overscaledZ&&t.canonical.x===this.canonical.x>>e&&t.canonical.y===this.canonical.y>>e},zc.prototype.children=function(t){if(this.overscaledZ>=t)return[new zc(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];var e=this.canonical.z+1,r=2*this.canonical.x;t=2*this.canonical.y;return[new zc(e,this.wrap,e,r,t),new zc(e,this.wrap,e,1+r,t),new zc(e,this.wrap,e,r,1+t),new zc(e,this.wrap,e,1+r,1+t)]},zc.prototype.isLessThan=function(t){return this.wrap<t.wrap||!(this.wrap>t.wrap)&&(this.overscaledZ<t.overscaledZ||!(this.overscaledZ>t.overscaledZ)&&(this.canonical.x<t.canonical.x||!(this.canonical.x>t.canonical.x)&&this.canonical.y<t.canonical.y))},zc.prototype.wrapped=function(){return new zc(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)},zc.prototype.unwrapTo=function(t){return new zc(this.overscaledZ,t,this.canonical.z,this.canonical.x,this.canonical.y)},zc.prototype.overscaleFactor=function(){return Math.pow(2,this.overscaledZ-this.canonical.z)},zc.prototype.toUnwrapped=function(){return new kc(this.wrap,this.canonical)},zc.prototype.toString=function(){return this.overscaledZ+"/"+this.canonical.x+"/"+this.canonical.y},zc.prototype.getTilePoint=function(t){return this.canonical.getTilePoint(new Pc(t.x-this.wrap,t.y))},Oi("CanonicalTileID",Mc),Oi("OverscaledTileID",zc,{omit:["posMatrix"]}),(bn=function(t,e,r){if(this.uid=t,e.height!==e.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return w('"'+r+'" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');this.stride=e.height;var i=this.dim=e.height-2;this.data=new Uint32Array(e.data.buffer),this.encoding=r||"mapbox";for(var n=0;n<i;n++)this.data[this._idx(-1,n)]=this.data[this._idx(0,n)],this.data[this._idx(i,n)]=this.data[this._idx(i-1,n)],this.data[this._idx(n,-1)]=this.data[this._idx(n,0)],this.data[this._idx(n,i)]=this.data[this._idx(n,i-1)];this.data[this._idx(-1,-1)]=this.data[this._idx(0,0)],this.data[this._idx(i,-1)]=this.data[this._idx(i-1,0)],this.data[this._idx(-1,i)]=this.data[this._idx(0,i-1)],this.data[this._idx(i,i)]=this.data[this._idx(i-1,i-1)]}).prototype.get=function(t,e){var r=new Uint8Array(this.data.buffer);e=4*this._idx(t,e);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(r[e],r[1+e],r[2+e])},bn.prototype.getUnpackVector=function(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]},bn.prototype._idx=function(t,e){if(t<-1||t>=this.dim+1||e<-1||e>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(e+1)*this.stride+(t+1)},bn.prototype._unpackMapbox=function(t,e,r){return(256*t*256+256*e+r)/10-1e4},bn.prototype._unpackTerrarium=function(t,e,r){return 256*t+e+r/256-32768},bn.prototype.getPixels=function(){return new gs({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))},bn.prototype.backfillBorder=function(t,e,r){if(this.dim!==t.dim)throw new Error("dem dimension mismatch");var i=e*this.dim,n=e*this.dim+this.dim,o=r*this.dim,a=r*this.dim+this.dim;switch(e){case-1:i=n-1;break;case 1:n=i+1}switch(r){case-1:o=a-1;break;case 1:a=o+1}for(var s=-e*this.dim,u=-r*this.dim,l=o;l<a;l++)for(var c=i;c<n;c++)this.data[this._idx(c,l)]=t.data[this._idx(c+s,l+u)]},Oi("DEMData",bn),Bc.prototype.encode=function(t){return this._stringToNumber[t]},Bc.prototype.decode=function(t){return this._numberToString[t]},(br={geometry:{configurable:!0}}).geometry.get=function(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry},br.geometry.set=function(t){this._geometry=t},Dc.prototype.toJSON=function(){var t,e={geometry:this.geometry};for(t in this)"_geometry"!==t&&"_vectorTileFeature"!==t&&(e[t]=this[t]);return e},Object.defineProperties(Dc.prototype,br),(nc=function(){this.state={},this.stateChanges={},this.deletedStates={}}).prototype.updateState=function(t,e,r){var i=String(e);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][i]=this.stateChanges[t][i]||{},h(this.stateChanges[t][i],r),null===this.deletedStates[t])for(var n in this.deletedStates[t]={},this.state[t])n!==i&&(this.deletedStates[t][n]=null);else if(this.deletedStates[t]&&null===this.deletedStates[t][i])for(var o in this.deletedStates[t][i]={},this.state[t][i])r[o]||(this.deletedStates[t][i][o]=null);else for(var a in r)this.deletedStates[t]&&this.deletedStates[t][i]&&null===this.deletedStates[t][i][a]&&delete this.deletedStates[t][i][a]},nc.prototype.removeFeatureState=function(t,e,r){if(null!==this.deletedStates[t]){var i=String(e);if(this.deletedStates[t]=this.deletedStates[t]||{},r&&void 0!==e)null!==this.deletedStates[t][i]&&(this.deletedStates[t][i]=this.deletedStates[t][i]||{},this.deletedStates[t][i][r]=null);else if(void 0!==e)if(this.stateChanges[t]&&this.stateChanges[t][i])for(r in this.deletedStates[t][i]={},this.stateChanges[t][i])this.deletedStates[t][i][r]=null;else this.deletedStates[t][i]=null;else this.deletedStates[t]=null}},nc.prototype.getState=function(t,e){var r=String(e),i=h({},(this.state[t]||{})[r],(this.stateChanges[t]||{})[r]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){var n;if(null===(e=this.deletedStates[t][e]))return{};for(n in e)delete i[n]}return i},nc.prototype.initializeTileState=function(t,e){t.setFeatureState(this.state,e)},nc.prototype.coalesceChanges=function(t,e){var r,i,n={};for(r in this.stateChanges){this.state[r]=this.state[r]||{};var o,a={};for(o in this.stateChanges[r])this.state[r][o]||(this.state[r][o]={}),h(this.state[r][o],this.stateChanges[r][o]),a[o]=this.state[r][o];n[r]=a}for(i in this.deletedStates){this.state[i]=this.state[i]||{};var s={};if(null===this.deletedStates[i])for(var u in this.state[i])s[u]={},this.state[i][u]={};else for(var l in this.deletedStates[i]){if(null===this.deletedStates[i][l])this.state[i][l]={};else for(var c=0,p=Object.keys(this.deletedStates[i][l]);c<p.length;c+=1)delete this.state[i][l][p[c]];s[l]=this.state[i][l]}n[i]=n[i]||{},h(n[i],s)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(n).length)for(var f in t)t[f].setFeatureState(n,e)},(dn=function(t,e){this.tileID=t,this.x=t.canonical.x,this.y=t.canonical.y,this.z=t.canonical.z,this.grid=new ki(8192,16,0),this.grid3D=new ki(8192,16,0),this.featureIndexArray=new ta,this.promoteId=e}).prototype.insert=function(t,e,r,i,n,o){var a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);for(var s=o?this.grid3D:this.grid,u=0;u<e.length;u++){for(var l=e[u],c=[1/0,1/0,-1/0,-1/0],p=0;p<l.length;p++){var h=l[p];c[0]=Math.min(c[0],h.x),c[1]=Math.min(c[1],h.y),c[2]=Math.max(c[2],h.x),c[3]=Math.max(c[3],h.y)}c[0]<8192&&c[1]<8192&&0<=c[2]&&0<=c[3]&&s.insert(a,c[0],c[1],c[2],c[3])}},dn.prototype.loadVTLayers=function(){return this.vtLayers||(this.vtLayers=new lu.VectorTile(new ju(this.rawTileData)).layers,this.sourceLayerCoder=new Bc(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers},dn.prototype.query=function(t,e,r,i){var o=this;this.loadVTLayers();for(var a=t.params||{},s=8192/t.tileSize/t.scale,u=ni(a.filter),l=t.queryGeometry,c=t.queryPadding*s,p=Oc(l),h=this.grid.query(p.minX-c,p.minY-c,p.maxX+c,p.maxY+c),f=(p=Oc(t.cameraQueryGeometry),0),d=this.grid3D.query(p.minX-c,p.minY-c,p.maxX+c,p.maxY+c,(function(e,r,i,o){return function(t,e,r,i,o){for(var a=0,s=t;a<s.length;a+=1){var u=s[a];if(e<=u.x&&r<=u.y&&i>=u.x&&o>=u.y)return!0}var l=[new n(e,r),new n(e,o),new n(i,o),new n(i,r)];if(2<t.length)for(var c=0,p=l;c<p.length;c+=1)if(Qa(t,p[c]))return!0;for(var h=0;h<t.length-1;h++)if(function(t,e,r){var i=r[0],n=r[2];if(!(t.x<i.x&&e.x<i.x||t.x>n.x&&e.x>n.x||t.y<i.y&&e.y<i.y||t.y>n.y&&e.y>n.y))return(n=S(t,e,r[0]))!==S(t,e,r[1])||n!==S(t,e,r[2])||n!==S(t,e,r[3])}(t[h],t[h+1],l))return!0;return!1}(t.cameraQueryGeometry,e-c,r-c,i+c,o+c)}));f<d.length;f+=1)h.push(d[f]);h.sort(Fc);for(var m,y={},g=0;g<h.length;g++)!function(n){var c;(n=h[n])!==m&&(m=n,n=o.featureIndexArray.get(n),c=null,o.loadMatchingFeature(y,n.bucketIndex,n.sourceLayerIndex,n.featureIndex,u,a.layers,a.availableImages,e,r,i,(function(e,r,i){return c=c||Va(e),r.queryIntersectsFeature(l,e,i,c,o.z,t.transform,s,t.pixelPosMatrix)})))}(g);return y},dn.prototype.loadMatchingFeature=function(t,e,r,i,n,o,a,s,u,l,c){var p=this.bucketLayerIDs[e];if(!o||function(t,e){for(var r=0;r<t.length;r++)if(0<=e.indexOf(t[r]))return 1}(o,p)){e=this.sourceLayerCoder.decode(r);var f=this.vtLayers[e].feature(i);if(n.needGeometry){if(r=qa(f,!0),!n.filter(new tn(this.tileID.overscaledZ),r,this.tileID.canonical))return}else if(!n.filter(new tn(this.tileID.overscaledZ),f))return;for(var d=this.getId(f,e),m=0;m<p.length;m++){var y,g,_,v=p[m];o&&o.indexOf(v)<0||(y=s[v])&&(g={},void 0!==d&&l&&(g=l.getState(y.sourceLayer||"_geojsonTileLayer",d)),(_=h({},u[v])).paint=Rc(_.paint,y.paint,f,g,a),_.layout=Rc(_.layout,y.layout,f,g,a),(y=!c||c(f,y,g))&&((g=new Dc(f,this.z,this.x,this.y,d)).layer=_,void 0===(_=t[v])&&(_=t[v]=[]),_.push({featureIndex:i,feature:g,intersectionZ:y})))}}},dn.prototype.lookupSymbolFeatures=function(t,e,r,i,n,o,a,s){var u={};this.loadVTLayers();for(var l=ni(n),c=0,p=t;c<p.length;c+=1)this.loadMatchingFeature(u,r,i,p[c],l,o,a,s,e);return u},dn.prototype.hasLayer=function(t){for(var e=0,r=this.bucketLayerIDs;e<r.length;e+=1)for(var i=0,n=r[e];i<n.length;i+=1)if(t===n[i])return!0;return!1},dn.prototype.getId=function(t,e){var r=t.id;return this.promoteId&&"boolean"==typeof(r=t.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[e]])&&(r=Number(r)),r},Oi("FeatureIndex",dn,{omit:["rawTileData","sourceLayerCoder"]}),(sc=function(t,e){this.tileID=t,this.uid=f++,this.uses=0,this.tileSize=e,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.expiredRequestCount=0,this.state="loading"}).prototype.registerFadeDuration=function(t){(t+=this.timeAdded)<R.now()||this.fadeEndTime&&t<this.fadeEndTime||(this.fadeEndTime=t)},sc.prototype.wasRequested=function(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state},sc.prototype.loadVectorData=function(t,e,r){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){for(var i in t.featureIndex&&(this.latestFeatureIndex=t.featureIndex,t.rawTileData?(this.latestRawTileData=t.rawTileData,this.latestFeatureIndex.rawTileData=t.rawTileData):this.latestRawTileData&&(this.latestFeatureIndex.rawTileData=this.latestRawTileData)),this.collisionBoxArray=t.collisionBoxArray,this.buckets=function(t,e){var r={};if(!e)return r;for(var i=0,n=t;i<n.length;i+=1)!function(){var t=n[i],o=t.layerIds.map((function(t){return e.getLayer(t)})).filter(Boolean);if(0!==o.length){t.layers=o,t.stateDependentLayerIds&&(t.stateDependentLayers=t.stateDependentLayerIds.map((function(t){return o.filter((function(e){return e.id===t}))[0]})));for(var a=0,s=o;a<s.length;a+=1)r[s[a].id]=t}}();return r}(t.buckets,e.style),this.hasSymbolBuckets=!1,this.buckets){var n=this.buckets[i];if(n instanceof Jl){if(this.hasSymbolBuckets=!0,!r)break;n.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(var o in this.buckets){var a=this.buckets[o];if(a instanceof Jl&&a.hasRTLText){this.hasRTLText=!0,rn.isLoading()||rn.isLoaded()||"deferred"!==Ji||$i();break}}for(var s in this.queryPadding=0,this.buckets){var u=this.buckets[s];this.queryPadding=Math.max(this.queryPadding,e.style.getLayer(s).queryRadius(u))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new Ro},sc.prototype.unloadVectorData=function(){for(var t in this.buckets)this.buckets[t].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"},sc.prototype.getBucket=function(t){return this.buckets[t.id]},sc.prototype.upload=function(t){for(var e in this.buckets){var r=this.buckets[e];r.uploadPending()&&r.upload(t)}var i=t.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new $l(t,this.imageAtlas.image,i.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new $l(t,this.glyphAtlasImage,i.ALPHA),this.glyphAtlasImage=null)},sc.prototype.prepare=function(t){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(t,this.imageAtlasTexture)},sc.prototype.queryRenderedFeatures=function(t,e,r,i,n,o,a,s,u,l){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:i,cameraQueryGeometry:n,scale:o,tileSize:this.tileSize,pixelPosMatrix:l,transform:s,params:a,queryPadding:this.queryPadding*u},t,e,r):{}},sc.prototype.querySourceFeatures=function(t,e){var r=this.latestFeatureIndex;if(r&&r.rawTileData){var i=r.loadVTLayers(),n=e?e.sourceLayer:"",o=i._geojsonTileLayer||i[n];if(o)for(var a=ni(e&&e.filter),s=(e=this.tileID.canonical).z,u=e.x,l=e.y,c={z:s,x:u,y:l},p=0;p<o.length;p++){var h=o.feature(p);if(a.needGeometry){var f=qa(h,!0);if(!a.filter(new tn(this.tileID.overscaledZ),f,this.tileID.canonical))continue}else if(!a.filter(new tn(this.tileID.overscaledZ),h))continue;(f=new Dc(h,s,u,l,f=r.getId(h,n))).tile=c,t.push(f)}}},sc.prototype.hasData=function(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state},sc.prototype.patternsLoaded=function(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length},sc.prototype.setExpiryData=function(t){var e,r,i=this.expirationTime;t.cacheControl?(e=E(t.cacheControl))["max-age"]&&(this.expirationTime=Date.now()+1e3*e["max-age"]):t.expires&&(this.expirationTime=new Date(t.expires).getTime()),this.expirationTime&&(e=Date.now(),t=!1,this.expirationTime>e?t=!1:!i||this.expirationTime<i||!(r=this.expirationTime-i)?t=!0:this.expirationTime=e+Math.max(r,3e4),t?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0)},sc.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)},sc.prototype.setFeatureState=function(t,e){if(this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData&&0!==Object.keys(t).length){var r,i,n,o,a=this.latestFeatureIndex.loadVTLayers();for(r in this.buckets)e.style.hasLayer(r)&&(o=a[n=(i=this.buckets[r]).layers[0].sourceLayer||"_geojsonTileLayer"],n=t[n],o&&n&&0!==Object.keys(n).length&&(i.update(n,o,this.imageAtlas&&this.imageAtlas.patternPositions||{}),(o=e&&e.style&&e.style.getLayer(r))&&(this.queryPadding=Math.max(this.queryPadding,o.queryRadius(i)))))}},sc.prototype.holdingForFade=function(){return void 0!==this.symbolFadeHoldUntil},sc.prototype.symbolFadeFinished=function(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<R.now()},sc.prototype.clearFadeHold=function(){this.symbolFadeHoldUntil=void 0},sc.prototype.setHoldDuration=function(t){this.symbolFadeHoldUntil=R.now()+t},sc.prototype.setDependencies=function(t,e){for(var r={},i=0,n=e;i<n.length;i+=1)r[n[i]]=!0;this.dependencies[t]=r},sc.prototype.hasDependency=function(t,e){for(var r=0,i=t;r<i.length;r+=1){var n=this.dependencies[i[r]];if(n)for(var o=0,a=e;o<a.length;o+=1)if(n[a[o]])return!0}return!1};var jc=a.performance;(br=function(t){this._marks={start:[t.url,"start"].join("#"),end:[t.url,"end"].join("#"),measure:t.url.toString()},jc.mark(this._marks.start)}).prototype.finish=function(){jc.mark(this._marks.end);var t=jc.getEntriesByName(this._marks.measure);return 0===t.length&&(jc.measure(this._marks.measure,this._marks.start,this._marks.end),t=jc.getEntriesByName(this._marks.measure),jc.clearMarks(this._marks.start),jc.clearMarks(this._marks.end),jc.clearMeasures(this._marks.measure)),t},t.Actor=$s,t.AlphaImage=ys,t.CanonicalTileID=Mc,t.CollisionBoxArray=Ro,t.Color=ae,t.DEMData=bn,t.DataConstantProperty=hn,t.DictionaryCoder=Bc,t.EXTENT=8192,t.ErrorEvent=kt,t.EvaluationParameters=tn,t.Event=Ct,t.Evented=Pt,t.FeatureIndex=dn,t.FillBucket=Js,t.FillExtrusionBucket=fu,t.ImageAtlas=yn,t.ImagePosition=sl,t.LineBucket=vu,t.LngLat=wc,t.LngLatBounds=bc,t.MercatorCoordinate=Pc,t.ONE_EM=24,t.OverscaledTileID=zc,t.Point=n,t.Point$1=n,t.Properties=gn,t.Protobuf=ju,t.RGBAImage=gs,t.RequestManager=V,t.RequestPerformance=br,t.ResourceType=ft,t.SegmentVector=ra,t.SourceFeatureState=nc,t.StructArrayLayout1ui2=Ao,t.StructArrayLayout2f1f2i16=no,t.StructArrayLayout2i4=In,t.StructArrayLayout3ui6=fo,t.StructArrayLayout4i8=Pn,t.SymbolBucket=Jl,t.Texture=$l,t.Tile=sc,t.Transitionable=an,t.Uniform1f=_a,t.Uniform1i=Tr,t.Uniform2f=Sr,t.Uniform3f=va,t.Uniform4f=xa,t.UniformColor=ba,t.UniformMatrix4f=Sa,t.UnwrappedTileID=kc,t.ValidationError=Bt,t.WritingMode=ll,t.ZoomHistory=Vi,t.add=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t},t.addDynamicAttributes=Zl,t.asyncAll=function(t,e,r){if(!t.length)return r(null,[]);var i=t.length,n=new Array(t.length),o=null;t.forEach((function(t,a){e(t,(function(t,e){t&&(o=t),n[a]=e,0==--i&&r(o,n)}))}))},t.bezier=u,t.bindAll=y,t.browser=R,t.cacheEntryPossiblyAdded=function(t){++pt>ot&&(t.getActor().send("enforceCacheSizeLimit",nt),pt=0)},t.clamp=c,t.clearTileCache=function(t){var e=a.caches.delete("mapbox-tiles");t&&e.catch(t).then((function(){return t()}))},t.clipLine=Pl,t.clone=function(t){var e=new is(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],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},t.clone$1=x,t.clone$2=function(t){var e=new is(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e},t.collisionCircleLayout=L,t.config=O,t.create=function(){var t=new is(16);return is!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t},t.create$1=function(){var t=new is(9);return is!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t},t.create$2=function(){var t=new is(4);return is!=Float32Array&&(t[1]=0,t[2]=0),t[0]=1,t[3]=1,t},t.createCommonjsModule=e,t.createExpression=Hr,t.createLayout=Sn,t.createStyleLayer=function(t){return new("custom"===t.type?uc:lc[t.type])(t)},t.cross=function(t,e,r){var i=e[0],n=e[1],o=e[2],a=r[0];e=r[1],r=r[2];return t[0]=n*r-o*e,t[1]=o*a-i*r,t[2]=i*e-n*a,t},t.deepEqual=function t(e,r){if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(var i=0;i<e.length;i++)if(!t(e[i],r[i]))return!1;return!0}if("object"!=typeof e||null===e||null===r)return e===r;if("object"!=typeof r)return!1;if(Object.keys(e).length!==Object.keys(r).length)return!1;for(var n in e)if(!t(e[n],r[n]))return!1;return!0},t.dot=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},t.dot$1=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]},t.ease=l,t.emitValidationErrors=Mi,t.endsWith=g,t.enforceCacheSizeLimit=function(t){ut(),Y&&Y.then((function(e){e.keys().then((function(r){for(var i=0;i<r.length-t;i++)e.delete(r[i])}))}))},t.evaluateSizeForFeature=Tl,t.evaluateSizeForZoom=El,t.evaluateVariableOffset=jl,t.evented=en,t.extend=h,t.featureFilter=ni,t.filterObject=v,t.fromRotation=function(t,e){var r=Math.sin(e);e=Math.cos(e);return t[0]=e,t[1]=r,t[2]=0,t[3]=-r,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t},t.getAnchorAlignment=_l,t.getAnchorJustification=Ul,t.getArrayBuffer=xt,t.getImage=Et,t.getJSON=function(t,e){return vt(h(t,{type:"json"}),e)},t.getRTLTextPluginStatus=function(){return Ji},t.getReferrer=yt,t.getVideo=function(t,e){var r=a.document.createElement("video");r.muted=!0,r.onloadstart=function(){e(null,r)};for(var i=0;i<t.length;i++){var n=a.document.createElement("source"),o=t[i],s=void 0;(s=a.document.createElement("a")).href=o,s.protocol===a.document.location.protocol&&s.host===a.document.location.host||(r.crossOrigin="Anonymous"),n.src=t[i],r.appendChild(n)}return{cancel:function(){}}},t.identity=ns,t.invert=function(t,e){var r=e[0],i=e[1],n=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],p=e[9],h=e[10],f=e[11],d=e[12],m=e[13],y=e[14],g=e[15],_=r*s-i*a,v=r*u-n*a,x=r*l-o*a,b=i*u-n*s,w=i*l-o*s,S=n*l-o*u,T=c*m-p*d,E=c*y-h*d,I=c*g-f*d,A=p*y-h*m,C=p*g-f*m,P=h*g-f*y;return(e=_*P-v*C+x*A+b*I-w*E+S*T)?(t[0]=(s*P-u*C+l*A)*(e=1/e),t[1]=(n*C-i*P-o*A)*e,t[2]=(m*S-y*w+g*b)*e,t[3]=(h*w-p*S-f*b)*e,t[4]=(u*I-a*P-l*E)*e,t[5]=(r*P-n*I+o*E)*e,t[6]=(y*x-d*S-g*v)*e,t[7]=(c*S-h*x+f*v)*e,t[8]=(a*C-s*I+l*T)*e,t[9]=(i*I-r*C-o*T)*e,t[10]=(d*w-m*x+g*_)*e,t[11]=(p*x-c*w-f*_)*e,t[12]=(s*E-a*A-u*T)*e,t[13]=(r*A-i*E+n*T)*e,t[14]=(m*v-d*b-y*_)*e,t[15]=(c*b-p*v+h*_)*e,t):null},t.isChar=qi,t.isMapboxURL=G,t.keysDifference=function(t,e){var r,i=[];for(r in t)r in e||i.push(r);return i},t.makeRequest=vt,t.mapObject=_,t.mercatorXfromLng=Ec,t.mercatorYfromLat=Ic,t.mercatorZfromAltitude=Ac,t.mul=ho,t.multiply=os,t.mvt=lu,t.nextPowerOfTwo=function(t){return t<=1?1:Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))},t.normalize=function(t,e){var r,i=e[0],n=e[1];return 0<(r=i*i+n*n+(r=e[2])*r)&&(r=1/Math.sqrt(r)),t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t},t.number=He,t.offscreenCanvasSupported=ht,t.ortho=function(t,e,r,i,n,o,a){var s=1/(e-r),u=1/(i-n),l=1/(o-a);return t[0]=-2*s,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*u,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*l,t[11]=0,t[12]=(e+r)*s,t[13]=(n+i)*u,t[14]=(a+o)*l,t[15]=1,t},t.parseGlyphPBF=function(t){return new ju(t).readFields(il,[])},t.pbf=ju,t.performSymbolLayout=function(t,e,r,i,o,a,s){t.createArrays(),t.tilePixelRatio=8192/(512*t.overscaling),t.compareText={},t.iconsNeedLinear=!1;var u,l,c=t.layers[0].layout,p=t.layers[0]._unevaluatedLayout._values,h={};"composite"===t.textSizeData.kind&&(l=(u=t.textSizeData).maxZoom,h.compositeTextSizes=[p["text-size"].possiblyEvaluate(new tn(u.minZoom),s),p["text-size"].possiblyEvaluate(new tn(l),s)]),"composite"===t.iconSizeData.kind&&(l=(u=t.iconSizeData).maxZoom,h.compositeIconSizes=[p["icon-size"].possiblyEvaluate(new tn(u.minZoom),s),p["icon-size"].possiblyEvaluate(new tn(l),s)]),h.layoutTextSize=p["text-size"].possiblyEvaluate(new tn(t.zoom+1),s),h.layoutIconSize=p["icon-size"].possiblyEvaluate(new tn(t.zoom+1),s),h.textMaxSize=p["text-size"].possiblyEvaluate(new tn(18));for(var f=24*c.get("text-line-height"),d="map"===c.get("text-rotation-alignment")&&"point"!==c.get("symbol-placement"),m=c.get("text-keep-upright"),y=c.get("text-size"),g=function(){var a=v[_],u=c.get("text-font").evaluate(a,{},s).join(","),l=y.evaluate(a,{},s),p=h.layoutTextSize.evaluate(a,{},s),g=h.layoutIconSize.evaluate(a,{},s),x={horizontal:{},vertical:void 0},b=a.text,S=[0,0];if(b){var T=b.toString(),E=24*c.get("text-letter-spacing").evaluate(a,{},s),I=function(){for(var t,e=0,r=T;e<r.length;e+=1)if(t=r[e].charCodeAt(0),qi.Arabic(t)||qi["Arabic Supplement"](t)||qi["Arabic Extended-A"](t)||qi["Arabic Presentation Forms-A"](t)||qi["Arabic Presentation Forms-B"](t))return;return 1}()?E:0,A=c.get("text-anchor").evaluate(a,{},s),C=c.get("text-variable-anchor");C||(j=c.get("text-radial-offset").evaluate(a,{},s),S=j?jl(A,[24*j,Fl]):c.get("text-offset").evaluate(a,{},s).map((function(t){return 24*t})));var P=d?"center":c.get("text-justify").evaluate(a,{},s),M=c.get("symbol-placement"),k="point"===M?24*c.get("text-max-width").evaluate(a,{},s):0,z=function(){t.allowVerticalPlacement&&Gi(T)&&(x.vertical=pl(b,e,r,o,u,k,f,A,"left",I,S,ll.vertical,!0,M,p,l))};if(!d&&C){for(var L="auto"===P?C.map(Ul):[P],B=!1,D=0;D<L.length;D++){var R,O=L[D];x.horizontal[O]||(B?x.horizontal[O]=x.horizontal[0]:(R=pl(b,e,r,o,u,k,f,"center",O,I,S,ll.horizontal,!1,M,p,l))&&(B=1===(x.horizontal[O]=R).positionedLines.length))}z()}else{"auto"===P&&(P=Ul(A));var F=pl(b,e,r,o,u,k,f,A,P,I,S,ll.horizontal,!1,M,p,l);F&&(x.horizontal[P]=F),z(),Gi(T)&&d&&m&&(x.vertical=pl(b,e,r,o,u,k,f,A,P,I,S,ll.vertical,!1,M,p,l))}}E=void 0;var j=!1;a.icon&&a.icon.name&&(U=i[a.icon.name])&&(C=o[a.icon.name],F=c.get("icon-offset").evaluate(a,{},s),z=_l(c.get("icon-anchor").evaluate(a,{},s)),P=F[0]-C.displaySize[0]*z.horizontalAlign,E={image:C,top:z=F[1]-C.displaySize[1]*z.verticalAlign,bottom:z+C.displaySize[1],left:P,right:P+C.displaySize[0]},j=U.sdf,void 0===t.sdfIcons?t.sdfIcons=U.sdf:t.sdfIcons!==U.sdf&&w("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),U.pixelRatio===t.pixelRatio&&0===c.get("icon-rotate").constantOr(1)||(t.iconsNeedLinear=!0));var U=Vl(x.horizontal)||x.vertical;t.iconsInText=!!U&&U.iconsInText,(U||E)&&function(t,e,r,i,o,a,s,u,l,c,p){void 0===(O=a.textMaxSize.evaluate(e,{}))&&(O=s);var h,f,d,m,y,g,_,v,x,b,S,T=t.layers[0].layout,E=T.get("icon-offset").evaluate(e,{},p),I=Vl(r.horizontal),A=s/24,C=t.tilePixelRatio*A,P=t.tilePixelRatio*O/24,M=t.tilePixelRatio*u,k=t.tilePixelRatio*T.get("symbol-spacing"),z=T.get("text-padding")*t.tilePixelRatio,L=T.get("icon-padding")*t.tilePixelRatio,B=T.get("text-max-angle")/180*Math.PI,D="map"===T.get("text-rotation-alignment")&&"point"!==T.get("symbol-placement"),R="map"===T.get("icon-rotation-alignment")&&"point"!==T.get("symbol-placement"),O=T.get("symbol-placement"),F=k/2;u=T.get("icon-text-fit");function j(n,u){u.x<0||8192<=u.x||u.y<0||8192<=u.y||function(t,e,r,i,o,a,s,u,l,c,p,h,f,d,m,y,g,_,v,x,b,S,T,E){var I,A,C,P,M,k=t.addToLineVertexArray(e,n),z=0,L=0,B=0,D=0,R=-1,O=-1,F={},j=aa(""),U=0,N=void 0===s._unevaluatedLayout.getValue("text-radial-offset")?(U=(A=s.layout.get("text-offset").evaluate(x,{},T).map((function(t){return 24*t})))[0],A[1]):(U=24*s.layout.get("text-radial-offset").evaluate(x,{},T),Fl);for(M in t.allowVerticalPlacement&&r.vertical&&(A=s.layout.get("text-rotate").evaluate(x,{},T)+90,C=new Ll(u,e,l,c,p,r.vertical,h,f,d,A),a&&(I=new Ll(u,e,l,c,p,a,y,g,d,A))),i&&(W=Ml(i,H=s.layout.get("icon-rotate").evaluate(x,{}),S,Z="none"!==s.layout.get("icon-text-fit")),X=a?Ml(a,H,S,Z):void 0,P=new Ll(u,e,l,c,p,i,y,g,!1,H),z=4*W.length,K=null,"source"===(Z=t.iconSizeData).kind?32640<(K=[128*s.layout.get("icon-size").evaluate(x,{})])[0]&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'):"composite"===Z.kind&&(32640<(K=[128*b.compositeIconSizes[0].evaluate(x,{},T),128*b.compositeIconSizes[1].evaluate(x,{},T)])[0]||32640<K[1])&&w(t.layerIds[0]+': Value for "icon-size" is >= 255. Reduce your "icon-size".'),t.addSymbols(t.icon,W,K,v,_,x,!1,e,k.lineStartIndex,k.lineLength,-1,T),R=t.icon.placedSymbolArray.length-1,X&&(L=4*X.length,t.addSymbols(t.icon,X,K,v,_,x,ll.vertical,e,k.lineStartIndex,k.lineLength,-1,T),O=t.icon.placedSymbolArray.length-1)),r.horizontal){var V,q=r.horizontal[M];V||(j=aa(q.text),V=new Ll(u,e,l,c,p,q,h,f,d,G=s.layout.get("text-rotate").evaluate(x,{},T)));var G=1===q.positionedLines.length;if(B+=Nl(t,e,q,o,s,d,x,m,k,r.vertical?ll.horizontal:ll.horizontalOnly,G?Object.keys(r.horizontal):[M],F,R,b,T),G)break}r.vertical&&(D+=Nl(t,e,r.vertical,o,s,d,x,m,k,ll.vertical,["vertical"],F,O,b,T));i=V?V.boxStartIndex:t.collisionBoxArray.length,y=V?V.boxEndIndex:t.collisionBoxArray.length,g=C?C.boxStartIndex:t.collisionBoxArray.length;var H=C?C.boxEndIndex:t.collisionBoxArray.length,Z=P?P.boxStartIndex:t.collisionBoxArray.length,W=P?P.boxEndIndex:t.collisionBoxArray.length,X=I?I.boxStartIndex:t.collisionBoxArray.length,K=I?I.boxEndIndex:t.collisionBoxArray.length;(_=-1<(v=(_=function(t,e){return t&&t.circleDiameter?Math.max(t.circleDiameter,e):e})(I,v=_(P,v=_(C,v=_(V,v=-1)))))?1:0)&&(v*=E/24),t.glyphOffsetArray.length>=Jl.MAX_GLYPHS&&w("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==x.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,x.sortKey),t.symbolInstances.emplaceBack(e.x,e.y,0<=F.right?F.right:-1,0<=F.center?F.center:-1,0<=F.left?F.left:-1,F.vertical||-1,R,O,j,i,y,g,H,Z,W,X,K,l,B,D,z,L,_,0,h,U,N,v)}(t,u,r,i,o,h,t.layers[0],t.collisionBoxArray,e.index,e.sourceLayerIndex,t.index,C,z,D,l,M,L,R,E,e,a,c,p,s)}if(i&&"none"!==u&&(t.allowVerticalPlacement&&r.vertical&&(h=vl(i,r.vertical,u,T.get("icon-text-fit-padding"),E,A)),I&&(i=vl(i,I,u,T.get("icon-text-fit-padding"),E,A))),"line"===O)for(var U=0,N=Pl(e.geometry,0,0,8192,8192);U<N.length;U+=1)for(var V=N[U],q=0,G=(f=V,d=k,m=B,y=r.vertical||I,g=i,24,_=P,v=t.overscaling,x=8192,void 0,b=y?.6*24*_:0,d-(y=(S=Cl(y,g))*_)<d/4&&(d=y+d/4),function t(e,r,i,n,o,a,s,u,l){for(var c=a/2,p=Al(e),h=0,f=r-i,d=[],m=0;m<e.length-1;m++){for(var y=e[m],g=e[m+1],_=y.dist(g),v=g.angleTo(y);f+i<h+_;){var x=((f+=i)-h)/_,b=He(y.x,g.x,x);x=He(y.y,g.y,x);0<=b&&b<l&&0<=x&&x<l&&0<=f-c&&f+c<=p&&((x=new bl(b,x,v,m))._round(),n&&!Il(e,x,a,n,o)||d.push(x))}h+=_}return u||d.length||s||(d=t(e,h/2,i,n,o,a,s,!0,l)),d}(f,(g=0===f[0].x||f[0].x===x||0===f[0].y||f[0].y===x)?d/2*v%d:(S/2+48)*_*v%d,d,b,m,y,g,!1,x));q<G.length;q+=1){var H=G[q];I&&function(t,e,r,i){if(e in(t=t.compareText)){for(var n=t[e],o=n.length-1;0<=o;o--)if(i.dist(n[o])<r)return 1}else t[e]=[];return t[e].push(i),0}(t,I.text,F,H)||j(V,H)}else if("line-center"===O)for(var Z=0,W=e.geometry;Z<W.length;Z+=1){var X,K=W[Z];1<K.length&&(X=function(t,e,r,i,n,o){for(var a=r?.6*24*o:0,s=Cl(r,i)*o,u=0,l=Al(t)/2,c=0;c<t.length-1;c++){var p=t[c],h=t[c+1],f=p.dist(h);if(l<u+f){var d=(l-u)/f,m=He(p.x,h.x,d);d=He(p.y,h.y,d);return(p=new bl(m,d,h.angleTo(p),c))._round(),!a||Il(t,p,s,a,e)?p:void 0}u+=f}}(K,B,r.vertical||I,i,0,P))&&j(K,X)}else if("Polygon"===e.type)for(var J=0,Y=Zs(e.geometry,0);J<Y.length;J+=1){var Q=Y[J],$=function(t,e,r){void 0===e&&(e=1),void 0===r&&(r=!1);for(var i=1/0,o=1/0,a=-1/0,s=-1/0,u=t[0],l=0;l<u.length;l++){var c=u[l];(!l||c.x<i)&&(i=c.x),(!l||c.y<o)&&(o=c.y),(!l||c.x>a)&&(a=c.x),(!l||c.y>s)&&(s=c.y)}var p=Math.min(a-i,s-o),h=p/2,f=new Bl([],Rl);if(0===p)return new n(i,o);for(var d=i;d<a;d+=p)for(var m=o;m<s;m+=p)f.push(new Ol(d+h,m+h,h,t));for(var y=function(t){for(var e=0,r=0,i=0,n=t[0],o=0,a=n.length,s=a-1;o<a;s=o++){var u=n[o],l=n[s],c=u.x*l.y-l.x*u.y;r+=(u.x+l.x)*c,i+=(u.y+l.y)*c,e+=3*c}return new Ol(r/e,i/e,0,t)}(t),g=f.length;f.length;){var _=f.pop();(_.d>y.d||!y.d)&&(y=_,r&&console.log("found best %d after %d probes",Math.round(1e4*_.d)/1e4,g)),_.max-y.d<=e||(f.push(new Ol(_.p.x-(h=_.h/2),_.p.y-h,h,t)),f.push(new Ol(_.p.x+h,_.p.y-h,h,t)),f.push(new Ol(_.p.x-h,_.p.y+h,h,t)),f.push(new Ol(_.p.x+h,_.p.y+h,h,t)),g+=4)}return r&&(console.log("num probes: "+g),console.log("best distance: "+y.d)),y.p}(Q,16);j(Q[0],new bl($.x,$.y,0))}else if("LineString"===e.type)for(var tt=0,et=e.geometry;tt<et.length;tt+=1){var rt=et[tt];j(rt,new bl(rt[0].x,rt[0].y,0))}else if("Point"===e.type)for(var it=0,nt=e.geometry;it<nt.length;it+=1)for(var ot=0,at=nt[it];ot<at.length;ot+=1){var st=at[ot];j([st],new bl(st.x,st.y,0))}}(t,a,x,E,i,h,p,g,S,j,s)},_=0,v=t.features;_<v.length;_+=1)g();a&&t.generateCollisionDebugBuffers()},t.perspective=function(t,e,r,i,n){e=1/Math.tan(e/2);return t[0]=e/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,null!=n&&n!==1/0?(t[10]=(n+i)*(e=1/(i-n)),t[14]=2*n*i*e):(t[10]=-1,t[14]=-2*i),t},t.pick=function(t,e){for(var r={},i=0;i<e.length;i++){var n=e[i];n in t&&(r[n]=t[n])}return r},t.plugin=rn,t.polygonIntersectsPolygon=Za,t.postMapLoadEvent=it,t.postTurnstileEvent=rt,t.potpack=al,t.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],t.register=Oi,t.registerForPluginStateChange=function(t){return t({pluginStatus:Ji,pluginURL:Yi}),en.on("pluginStateChange",t),t},t.renderColorRamp=vs,t.rotate=function(t,e,r){var i=e[0],n=e[1],o=e[2],a=e[3];e=Math.sin(r),r=Math.cos(r);return t[0]=i*r+o*e,t[1]=n*r+a*e,t[2]=i*-e+o*r,t[3]=n*-e+a*r,t},t.rotateX=function(t,e,r){var i=Math.sin(r),n=Math.cos(r),o=e[4],a=e[5],s=e[6],u=e[7],l=e[8],c=e[9],p=e[10];r=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=o*n+l*i,t[5]=a*n+c*i,t[6]=s*n+p*i,t[7]=u*n+r*i,t[8]=l*n-o*i,t[9]=c*n-a*i,t[10]=p*n-s*i,t[11]=r*n-u*i,t},t.rotateZ=function(t,e,r){var i=Math.sin(r),n=Math.cos(r),o=e[0],a=e[1],s=e[2],u=e[3],l=e[4],c=e[5],p=e[6];r=e[7];return e!==t&&(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[0]=o*n+l*i,t[1]=a*n+c*i,t[2]=s*n+p*i,t[3]=u*n+r*i,t[4]=l*n-o*i,t[5]=c*n-a*i,t[6]=p*n-s*i,t[7]=r*n-u*i,t},t.scale=function(t,e,r){var i=r[0],n=r[1];r=r[2];return t[0]=e[0]*i,t[1]=e[1]*i,t[2]=e[2]*i,t[3]=e[3]*i,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},t.scale$1=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t},t.scale$2=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t},t.setCacheLimits=function(t,e){nt=t,ot=e},t.setRTLTextPlugin=function(t,e,r){if(void 0===r&&(r=!1),"deferred"===Ji||"loading"===Ji||"loaded"===Ji)throw new Error("setRTLTextPlugin cannot be called multiple times.");Yi=R.resolveURL(t),Ji="deferred",Ki=e,Qi(),r||$i()},t.sphericalToCartesian=function(t){var e=t[0],r=t[1];t=t[2];return r+=90,r*=Math.PI/180,t*=Math.PI/180,{x:e*Math.cos(r)*Math.sin(t),y:e*Math.sin(r)*Math.sin(t),z:e*Math.cos(t)}},t.sqrLen=function(t){var e=t[0];return e*e+(t=t[1])*t},t.styleSpec=Lt,t.sub=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t},t.symbolSize=et,t.transformMat3=function(t,e,r){var i=e[0],n=e[1];e=e[2];return t[0]=i*r[0]+n*r[3]+e*r[6],t[1]=i*r[1]+n*r[4]+e*r[7],t[2]=i*r[2]+n*r[5]+e*r[8],t},t.transformMat4=as,t.translate=function(t,e,r){var i,n,o,a,s,u,l,c,p,h,f,d=r[0],m=r[1],y=r[2];return e===t?(t[12]=e[0]*d+e[4]*m+e[8]*y+e[12],t[13]=e[1]*d+e[5]*m+e[9]*y+e[13],t[14]=e[2]*d+e[6]*m+e[10]*y+e[14],t[15]=e[3]*d+e[7]*m+e[11]*y+e[15]):(i=e[1],n=e[2],o=e[3],a=e[4],s=e[5],u=e[6],l=e[7],c=e[8],p=e[9],h=e[10],f=e[11],t[0]=r=e[0],t[1]=i,t[2]=n,t[3]=o,t[4]=a,t[5]=s,t[6]=u,t[7]=l,t[8]=c,t[9]=p,t[10]=h,t[11]=f,t[12]=r*d+a*m+c*y+e[12],t[13]=i*d+s*m+p*y+e[13],t[14]=n*d+u*m+h*y+e[14],t[15]=o*d+l*m+f*y+e[15]),t},t.triggerPluginCompletionEvent=Xi,t.uniqueId=function(){return f++},t.validateCustomStyleLayer=function(t){var e=[],r=t.id;return void 0===r&&e.push({message:"layers."+r+': missing required property "id"'}),void 0===t.render&&e.push({message:"layers."+r+': missing required method "render"'}),t.renderingMode&&"2d"!==t.renderingMode&&"3d"!==t.renderingMode&&e.push({message:"layers."+r+': property "renderingMode" must be either "2d" or "3d"'}),e},t.validateLight=Ai,t.validateStyle=Ii,t.values=function(t){var e,r=[];for(e in t)r.push(t[e]);return r},t.vectorTile=lu,t.version="1.15.2",t.warnOnce=w,t.webpSupported=F,t.window=a,t.wrap=p})),i(0,(function(t){function e(e){for(var r="",i=0,n=t.refProperties;i<n.length;i+=1)r+="/"+function t(e){var r=typeof e;if("number"==r||"boolean"==r||"string"==r||null==e)return JSON.stringify(e);if(Array.isArray(e)){for(var i="[",n=0,o=e;n<o.length;n+=1)i+=t(o[n])+",";return i+"]"}for(var a=Object.keys(e).sort(),s="{",u=0;u<a.length;u++)s+=JSON.stringify(a[u])+":"+t(e[a[u]])+",";return s+"}"}(e[n[i]]);return r}function r(t){this.keyCache={},t&&this.replace(t)}function i(e){var r,i={},n=[];for(r in e){var o,a=e[r],s=i[r]={};for(o in a){var u,l=a[+o];l&&0!==l.bitmap.width&&0!==l.bitmap.height&&(u={x:0,y:0,w:l.bitmap.width+2,h:l.bitmap.height+2},n.push(u),s[o]={rect:u,metrics:l.metrics})}}var c,p=t.potpack(n),h=new t.AlphaImage({width:p.w||1,height:p.h||1});for(c in e){var f,d=e[c];for(f in d){var m,y=d[+f];y&&0!==y.bitmap.width&&0!==y.bitmap.height&&(m=i[c][f].rect,t.AlphaImage.copy(y.bitmap,h,{x:0,y:0},{x:m.x+1,y:m.y+1},y.bitmap))}}this.image=h,this.positions=i}function n(e){this.tileID=new t.OverscaledTileID(e.tileID.overscaledZ,e.tileID.wrap,e.tileID.canonical.z,e.tileID.canonical.x,e.tileID.canonical.y),this.uid=e.uid,this.zoom=e.zoom,this.pixelRatio=e.pixelRatio,this.tileSize=e.tileSize,this.source=e.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=e.showCollisionBoxes,this.collectResourceTiming=!!e.collectResourceTiming,this.returnDependencies=!!e.returnDependencies,this.promoteId=e.promoteId}function o(e,r,i){for(var n=new t.EvaluationParameters(r),o=0,a=e;o<a.length;o+=1)a[o].recalculate(n,i)}function a(e,r){var i=t.getArrayBuffer(e.request,(function(e,i,n,o){e?r(e):i&&r(null,{vectorTile:new t.vectorTile.VectorTile(new t.pbf(i)),rawData:i,cacheControl:n,expires:o})}));return function(){i.cancel(),r()}}function s(t,e,r,i){this.actor=t,this.layerIndex=e,this.availableImages=r,this.loadVectorData=i||a,this.loading={},this.loaded={}}function u(){this.loaded={}}r.prototype.replace=function(t){this._layerConfigs={},this._layers={},this.update(t,[])},r.prototype.update=function(r,i){for(var n=this,o=0,a=r;o<a.length;o+=1){var s=a[o];this._layerConfigs[s.id]=s;var u=this._layers[s.id]=t.createStyleLayer(s);u._featureFilter=t.featureFilter(u.filter),this.keyCache[s.id]&&delete this.keyCache[s.id]}for(var l=0,c=i;l<c.length;l+=1){var p=c[l];delete this.keyCache[p],delete this._layerConfigs[p],delete this._layers[p]}this.familiesBySource={};for(var h=0,f=function(t,r){for(var i={},n=0;n<t.length;n++){var o=r&&r[t[n].id]||e(t[n]);r&&(r[t[n].id]=o),(i[o]||(i[o]=[])).push(t[n])}var a,s=[];for(a in i)s.push(i[a]);return s}(t.values(this._layerConfigs),this.keyCache);h<f.length;h+=1){var d,m,y=f[h].map((function(t){return n._layers[t.id]})),g=y[0];"none"!==g.visibility&&(d=g.source||"",((m=(m=this.familiesBySource[d])||(this.familiesBySource[d]={}))[g=g.sourceLayer||"_geojsonTileLayer"]||(m[g]=[])).push(y))}},t.register("GlyphAtlas",i),n.prototype.parse=function(e,r,n,a,s){var u=this;this.status="parsing",this.data=e,this.collisionBoxArray=new t.CollisionBoxArray;var l=new t.DictionaryCoder(Object.keys(e.layers).sort()),c=new t.FeatureIndex(this.tileID,this.promoteId);c.bucketLayerIDs=[];var p,h,f,d,m,y={},g={featureIndex:c,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:n},_=r.familiesBySource[this.source];for(m in _){var v=e.layers[m];if(v){1===v.version&&t.warnOnce('Vector tile source "'+this.source+'" layer "'+m+'" does not use vector tile spec v2 and therefore may have some rendering errors.');for(var x=l.encode(m),b=[],w=0;w<v.length;w++){var S=v.feature(w),T=c.getId(S,m);b.push({feature:S,id:T,index:w,sourceLayerIndex:x})}for(var E=0,I=_[m];E<I.length;E+=1){var A=I[E],C=A[0];C.minzoom&&this.zoom<Math.floor(C.minzoom)||C.maxzoom&&this.zoom>=C.maxzoom||"none"!==C.visibility&&(o(A,this.zoom,n),(y[C.id]=C.createBucket({index:c.bucketLayerIDs.length,layers:A,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:x,sourceID:this.source})).populate(b,g,this.tileID.canonical),c.bucketLayerIDs.push(A.map((function(t){return t.id}))))}}}function P(){if(p)return s(p);if(h&&f&&d){var e,r=new i(h),a=new t.ImageAtlas(f,d);for(e in y){var u=y[e];u instanceof t.SymbolBucket?(o(u.layers,this.zoom,n),t.performSymbolLayout(u,h,r.positions,f,a.iconPositions,this.showCollisionBoxes,this.tileID.canonical)):u.hasPattern&&(u instanceof t.LineBucket||u instanceof t.FillBucket||u instanceof t.FillExtrusionBucket)&&(o(u.layers,this.zoom,n),u.addFeatures(g,this.tileID.canonical,a.patternPositions))}this.status="done",s(null,{buckets:t.values(y).filter((function(t){return!t.isEmpty()})),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:r.image,imageAtlas:a,glyphMap:this.returnDependencies?h:null,iconMap:this.returnDependencies?f:null,glyphPositions:this.returnDependencies?r.positions:null})}}r=t.mapObject(g.glyphDependencies,(function(t){return Object.keys(t).map(Number)})),Object.keys(r).length?a.send("getGlyphs",{uid:this.uid,stacks:r},(function(t,e){p||(p=t,h=e,P.call(u))})):h={},(r=Object.keys(g.iconDependencies)).length?a.send("getImages",{icons:r,source:this.source,tileID:this.tileID,type:"icons"},(function(t,e){p||(p=t,f=e,P.call(u))})):f={},(r=Object.keys(g.patternDependencies)).length?a.send("getImages",{icons:r,source:this.source,tileID:this.tileID,type:"patterns"},(function(t,e){p||(p=t,d=e,P.call(u))})):d={},P.call(this)},s.prototype.loadTile=function(e,r){var i=this,o=e.uid;this.loading||(this.loading={});var a=!!(e&&e.request&&e.request.collectResourceTiming)&&new t.RequestPerformance(e.request),s=this.loading[o]=new n(e);s.abort=this.loadVectorData(e,(function(e,n){if(delete i.loading[o],e||!n)return s.status="done",i.loaded[o]=s,r(e);var u=n.rawData,l={};n.expires&&(l.expires=n.expires),n.cacheControl&&(l.cacheControl=n.cacheControl);var c={};!a||(e=a.finish())&&(c.resourceTiming=JSON.parse(JSON.stringify(e))),s.vectorTile=n.vectorTile,s.parse(n.vectorTile,i.layerIndex,i.availableImages,i.actor,(function(e,i){return e||!i?r(e):void r(null,t.extend({rawTileData:u.slice(0)},i,l,c))})),i.loaded=i.loaded||{},i.loaded[o]=s}))},s.prototype.reloadTile=function(t,e){var r,i=this,n=this.loaded,o=t.uid,a=this;n&&n[o]&&((r=n[o]).showCollisionBoxes=t.showCollisionBoxes,t=function(t,n){var o=r.reloadCallback;o&&(delete r.reloadCallback,r.parse(r.vectorTile,a.layerIndex,i.availableImages,a.actor,o)),e(t,n)},"parsing"===r.status?r.reloadCallback=t:"done"===r.status&&(r.vectorTile?r.parse(r.vectorTile,this.layerIndex,this.availableImages,this.actor,t):t()))},s.prototype.abortTile=function(t,e){var r=this.loading;t=t.uid;r&&r[t]&&r[t].abort&&(r[t].abort(),delete r[t]),e()},s.prototype.removeTile=function(t,e){var r=this.loaded;t=t.uid;r&&r[t]&&delete r[t],e()};var l=t.window.ImageBitmap;function c(t,e){if(0!==t.length){p(t[0],e);for(var r=1;r<t.length;r++)p(t[r],!e)}}function p(t,e){for(var r=0,i=0,n=t.length,o=n-1;i<n;o=i++)r+=(t[i][0]-t[o][0])*(t[o][1]+t[i][1]);0<=r!=!!e&&t.reverse()}function h(e){this._feature=e,this.extent=t.EXTENT,this.type=e.type,this.properties=e.tags,"id"in e&&!isNaN(e.id)&&(this.id=parseInt(e.id,10))}u.prototype.loadTile=function(e,r){var i=e.uid,n=e.encoding;e=e.rawImageData,e=l&&e instanceof l?this.getImageData(e):e,n=new t.DEMData(i,e,n);this.loaded=this.loaded||{},r(null,this.loaded[i]=n)},u.prototype.getImageData=function(e){return this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(e.width,e.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=e.width,this.offscreenCanvas.height=e.height,this.offscreenCanvasContext.drawImage(e,0,0,e.width,e.height),e=this.offscreenCanvasContext.getImageData(-1,-1,e.width+2,e.height+2),this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new t.RGBAImage({width:e.width,height:e.height},e.data)},u.prototype.removeTile=function(t){var e=this.loaded;t=t.uid;e&&e[t]&&delete e[t]};var f=t.vectorTile.VectorTileFeature.prototype.toGeoJSON;h.prototype.loadGeometry=function(){if(1===this._feature.type){for(var e=[],r=0,i=this._feature.geometry;r<i.length;r+=1){var n=i[r];e.push([new t.Point$1(n[0],n[1])])}return e}for(var o=[],a=0,s=this._feature.geometry;a<s.length;a+=1){for(var u=[],l=0,c=s[a];l<c.length;l+=1){var p=c[l];u.push(new t.Point$1(p[0],p[1]))}o.push(u)}return o},h.prototype.toGeoJSON=function(t,e,r){return f.call(this,t,e,r)};var d=function(e){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=t.EXTENT,this.length=e.length,this._features=e};d.prototype.feature=function(t){return new h(this._features[t])};var m=t.vectorTile.VectorTileFeature,y=g;function g(t,e){this.options=e||{},this.features=t,this.length=t.length}function _(t,e){this.id="number"==typeof t.id?t.id:void 0,this.type=t.type,this.rawGeometry=1===t.type?[t.geometry]:t.geometry,this.properties=t.tags,this.extent=e||4096}g.prototype.feature=function(t){return new _(this.features[t],this.options.extent)},_.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var r=0;r<e.length;r++){for(var i=e[r],n=[],o=0;o<i.length;o++)n.push(new t.Point$1(i[o][0],i[o][1]));this.geometry.push(n)}return this.geometry},_.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var t=this.geometry,e=1/0,r=-1/0,i=1/0,n=-1/0,o=0;o<t.length;o++)for(var a=t[o],s=0;s<a.length;s++){var u=a[s];e=Math.min(e,u.x),r=Math.max(r,u.x),i=Math.min(i,u.y),n=Math.max(n,u.y)}return[e,i,r,n]},_.prototype.toGeoJSON=m.prototype.toGeoJSON;var v=x;m=y;function x(e){var r=new t.pbf;return function(t,e){for(var r in t.layers)e.writeMessage(3,b,t.layers[r])}(e,r),r.finish()}function b(t,e){e.writeVarintField(15,t.version||1),e.writeStringField(1,t.name||""),e.writeVarintField(5,t.extent||4096);for(var r={keys:[],values:[],keycache:{},valuecache:{}},i=0;i<t.length;i++)r.feature=t.feature(i),e.writeMessage(2,w,r);var n=r.keys;for(i=0;i<n.length;i++)e.writeStringField(3,n[i]);var o=r.values;for(i=0;i<o.length;i++)e.writeMessage(4,A,o[i])}function w(t,e){var r=t.feature;void 0!==r.id&&e.writeVarintField(1,r.id),e.writeMessage(2,S,t),e.writeVarintField(3,r.type),e.writeMessage(4,I,r)}function S(t,e){var r,i=t.feature,n=t.keys,o=t.values,a=t.keycache,s=t.valuecache;for(r in i.properties){var u=a[r];void 0===u&&(n.push(r),a[r]=u=n.length-1),e.writeVarint(u);var l=i.properties[r],c=typeof l;"string"!=c&&"boolean"!=c&&"number"!=c&&(l=JSON.stringify(l)),void 0===(c=s[u=c+":"+l])&&(o.push(l),s[u]=c=o.length-1),e.writeVarint(c)}}function T(t,e){return(e<<3)+(7&t)}function E(t){return t<<1^t>>31}function I(t,e){for(var r=t.loadGeometry(),i=t.type,n=0,o=0,a=r.length,s=0;s<a;s++){var u=r[s],l=1;1===i&&(l=u.length),e.writeVarint(T(1,l));for(var c=3===i?u.length-1:u.length,p=0;p<c;p++){1===p&&1!==i&&e.writeVarint(T(2,c-1));var h=u[p].x-n,f=u[p].y-o;e.writeVarint(E(h)),e.writeVarint(E(f)),n+=h,o+=f}3===i&&e.writeVarint(15)}}function A(t,e){var r=typeof t;"string"==r?e.writeStringField(1,t):"boolean"==r?e.writeBooleanField(7,t):"number"==r&&(t%1!=0?e.writeDoubleField(3,t):t<0?e.writeSVarintField(6,t):e.writeVarintField(5,t))}function C(t,e,r,i){P(t,r,i),P(e,2*r,2*i),P(e,2*r+1,2*i+1)}function P(t,e,r){var i=t[e];t[e]=t[r],t[r]=i}function M(t,e,r,i){return(r=t-r)*r+(i=e-i)*i}function k(t){return t[0]}function z(t){return t[1]}function L(t,e,r,i,n){void 0===e&&(e=k),void 0===r&&(r=z),void 0===i&&(i=64),void 0===n&&(n=Float64Array),this.nodeSize=i;for(var o=(this.points=t).length<65536?Uint16Array:Uint32Array,a=this.ids=new o(t.length),s=this.coords=new n(2*t.length),u=0;u<t.length;u++)s[2*(a[u]=u)]=e(t[u]),s[2*u+1]=r(t[u]);!function t(e,r,i,n,o,a){var s;o-n<=i||(function t(e,r,i,n,o,a){for(;n<o;){var s,u,l,c;600<o-n&&(s=o-n+1,u=i-n+1,c=Math.log(s),l=.5*Math.exp(2*c/3),c=.5*Math.sqrt(c*l*(s-l)/s)*(u-s/2<0?-1:1),t(e,r,i,Math.max(n,Math.floor(i-u*l/s+c)),Math.min(o,Math.floor(i+(s-u)*l/s+c)),a));var p=r[2*i+a],h=n,f=o;for(C(e,r,n,i),r[2*o+a]>p&&C(e,r,n,o);h<f;){for(C(e,r,h,f),h++,f--;r[2*h+a]<p;)h++;for(;r[2*f+a]>p;)f--}r[2*n+a]===p?C(e,r,n,f):C(e,r,++f,o),f<=i&&(n=f+1),i<=f&&(o=f-1)}}(e,r,s=n+o>>1,n,o,a%2),t(e,r,i,n,s-1,a+1),t(e,r,i,1+s,o,a+1))}(a,s,i,0,a.length-1,0)}function B(t){this.options=U(Object.create(D),t),this.trees=new Array(this.options.maxZoom+1)}v.fromVectorTileJs=x,v.fromGeojsonVt=function(t,e){e=e||{};var r,i={};for(r in t)i[r]=new y(t[r].features,e),i[r].name=r,i[r].version=e.version,i[r].extent=e.extent;return x({layers:i})},v.GeoJSONWrapper=m,L.prototype.range=function(t,e,r,i){return function(t,e,r,i,n,o,a){for(var s,u=[0,t.length-1,0],l=[];u.length;){var c=u.pop(),p=u.pop(),h=u.pop();if(p-h<=a)for(var f=h;f<=p;f++)m=e[2*f+1],(s=e[2*f])>=r&&s<=n&&i<=m&&m<=o&&l.push(t[f]);else{var d=Math.floor((h+p)/2),m=e[2*d+1];(s=e[2*d])>=r&&s<=n&&i<=m&&m<=o&&l.push(t[d]);var y=(c+1)%2;(0===c?r<=s:i<=m)&&(u.push(h),u.push(d-1),u.push(y)),(0===c?s<=n:m<=o)&&(u.push(d+1),u.push(p),u.push(y))}}return l}(this.ids,this.coords,t,e,r,i,this.nodeSize)};var D={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!(L.prototype.within=function(t,e,r){return function(t,e,r,i,n,o){for(var a=[0,t.length-1,0],s=[],u=n*n;a.length;){var l=a.pop(),c=a.pop(),p=a.pop();if(c-p<=o)for(var h=p;h<=c;h++)M(e[2*h],e[2*h+1],r,i)<=u&&s.push(t[h]);else{var f=Math.floor((p+c)/2),d=e[2*f],m=e[2*f+1];M(d,m,r,i)<=u&&s.push(t[f]);var y=(l+1)%2;(0===l?r-n<=d:i-n<=m)&&(a.push(p),a.push(f-1),a.push(y)),(0===l?d<=r+n:m<=i+n)&&(a.push(f+1),a.push(c),a.push(y))}}return s}(this.ids,this.coords,t,e,r,this.nodeSize)}),generateId:!1,reduce:null,map:function(t){return t}};function R(t){return{type:"Feature",id:t.id,properties:O(t),geometry:{type:"Point",coordinates:[360*(t.x-.5),(t=(180-360*t.y)*Math.PI/180,360*Math.atan(Math.exp(t))/Math.PI-90)]}}}function O(t){var e=t.numPoints,r=1e4<=e?Math.round(e/1e3)+"k":1e3<=e?Math.round(e/100)/10+"k":e;return U(U({},t.properties),{cluster:!0,cluster_id:t.id,point_count:e,point_count_abbreviated:r})}function F(t){return t/360+.5}function j(t){return t=Math.sin(t*Math.PI/180),(t=.5-.25*Math.log((1+t)/(1-t))/Math.PI)<0?0:1<t?1:t}function U(t,e){for(var r in e)t[r]=e[r];return t}function N(t){return t.x}function V(t){return t.y}function q(t,e,r,i){return function(t){var e=t.geometry,r=t.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)G(t,e);else if("Polygon"===r||"MultiLineString"===r)for(var i=0;i<e.length;i++)G(t,e[i]);else if("MultiPolygon"===r)for(i=0;i<e.length;i++)for(var n=0;n<e[i].length;n++)G(t,e[i][n])}(i={id:void 0===t?null:t,type:e,geometry:r,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}),i}function G(t,e){for(var r=0;r<e.length;r+=3)t.minX=Math.min(t.minX,e[r]),t.minY=Math.min(t.minY,e[r+1]),t.maxX=Math.max(t.maxX,e[r]),t.maxY=Math.max(t.maxY,e[r+1])}function H(t,e,r,i){if(e.geometry){var n=e.geometry.coordinates,o=e.geometry.type,a=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],u=e.id;if(r.promoteId?u=e.properties[r.promoteId]:r.generateId&&(u=i||0),"Point"===o)Z(n,s);else if("MultiPoint"===o)for(var l=0;l<n.length;l++)Z(n[l],s);else if("LineString"===o)W(n,s,a,!1);else if("MultiLineString"===o){if(r.lineMetrics){for(l=0;l<n.length;l++)W(n[l],s=[],a,!1),t.push(q(u,"LineString",s,e.properties));return}X(n,s,a,!1)}else if("Polygon"===o)X(n,s,a,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"!==o)throw new Error("Input data is not a valid GeoJSON object.");for(l=0;l<e.geometry.geometries.length;l++)H(t,{id:u,geometry:e.geometry.geometries[l],properties:e.properties},r,i);return}for(l=0;l<n.length;l++){var c=[];X(n[l],c,a,!0),s.push(c)}}t.push(q(u,o,s,e.properties))}}function Z(t,e){e.push(K(t[0])),e.push(J(t[1])),e.push(0)}function W(t,e,r,i){for(var n,o,a=0,s=0;s<t.length;s++){var u=K(t[s][0]),l=J(t[s][1]);e.push(u),e.push(l),e.push(0),0<s&&(a+=i?(n*l-u*o)/2:Math.sqrt(Math.pow(u-n,2)+Math.pow(l-o,2))),n=u,o=l}var c=e.length-3;e[2]=1,function t(e,r,i,n){for(var o,a,s,u,l,c,p,h,f,d=n,m=i-r>>1,y=i-r,g=e[r],_=e[r+1],v=e[i],x=e[i+1],b=r+3;b<i;b+=3){var w=(a=e[b],s=e[b+1],w=f=h=void 0,w=(p=x)-(l=_),0==(f=(c=v)-(u=g))&&0===w||(1<(h=((a-u)*f+(s-l)*w)/(f*f+w*w))?(u=c,l=p):0<h&&(u+=f*h,l+=w*h)),(f=a-u)*f+(w=s-l)*w);d<w?(o=b,d=w):w!==d||(w=Math.abs(b-m))<y&&(o=b,y=w)}n<d&&(3<o-r&&t(e,r,o,n),e[o+2]=d,3<i-o&&t(e,o,i,n))}(e,0,c,r),e[2+c]=1,e.size=Math.abs(a),e.start=0,e.end=e.size}function X(t,e,r,i){for(var n=0;n<t.length;n++){var o=[];W(t[n],o,r,i),e.push(o)}}function K(t){return t/360+.5}function J(t){return t=Math.sin(t*Math.PI/180),(t=.5-.25*Math.log((1+t)/(1-t))/Math.PI)<0?0:1<t?1:t}function Y(t,e,r,i,n,o,a,s){if(i/=e,o>=(r/=e)&&a<i)return t;if(a<r||i<=o)return null;for(var u=[],l=0;l<t.length;l++){var c=t[l],p=c.geometry,h=c.type,f=0===n?c.minX:c.minY,d=0===n?c.maxX:c.maxY;if(r<=f&&d<i)u.push(c);else if(!(d<r||i<=f)){var m=[];if("Point"===h||"MultiPoint"===h)!function(t,e,r,i,n){for(var o=0;o<t.length;o+=3){var a=t[o+n];r<=a&&a<=i&&(e.push(t[o]),e.push(t[o+1]),e.push(t[o+2]))}}(p,m,r,i,n);else if("LineString"===h)Q(p,m,r,i,n,!1,s.lineMetrics);else if("MultiLineString"===h)tt(p,m,r,i,n,!1);else if("Polygon"===h)tt(p,m,r,i,n,!0);else if("MultiPolygon"===h)for(var y=0;y<p.length;y++){var g=[];tt(p[y],g,r,i,n,!0),g.length&&m.push(g)}if(m.length)if(s.lineMetrics&&"LineString"===h)for(y=0;y<m.length;y++)u.push(q(c.id,h,m[y],c.tags));else"LineString"!==h&&"MultiLineString"!==h||(1===m.length?(h="LineString",m=m[0]):h="MultiLineString"),"Point"!==h&&"MultiPoint"!==h||(h=3===m.length?"Point":"MultiPoint"),u.push(q(c.id,h,m,c.tags))}}return u.length?u:null}function Q(t,e,r,i,n,o,a){for(var s,u,l=$(t),c=0===n?rt:it,p=t.start,h=0;h<t.length-3;h+=3){var f=t[h],d=t[h+1],m=t[h+2],y=t[h+3],g=t[h+4],_=0===n?f:d,v=0===n?y:g,x=!1;a&&(s=Math.sqrt(Math.pow(f-y,2)+Math.pow(d-g,2))),_<r?r<v&&(u=c(l,f,d,y,g,r),a&&(l.start=p+s*u)):i<_?v<i&&(u=c(l,f,d,y,g,i),a&&(l.start=p+s*u)):et(l,f,d,m),v<r&&r<=_&&(u=c(l,f,d,y,g,r),x=!0),i<v&&_<=i&&(u=c(l,f,d,y,g,i),x=!0),!o&&x&&(a&&(l.end=p+s*u),e.push(l),l=$(t)),a&&(p+=s)}var b=t.length-3;f=t[b],d=t[1+b],m=t[2+b];(_=0===n?f:d)>=r&&_<=i&&et(l,f,d,m),b=l.length-3,o&&3<=b&&(l[b]!==l[0]||l[1+b]!==l[1])&&et(l,l[0],l[1],l[2]),l.length&&e.push(l)}function $(t){var e=[];return e.size=t.size,e.start=t.start,e.end=t.end,e}function tt(t,e,r,i,n,o){for(var a=0;a<t.length;a++)Q(t[a],e,r,i,n,o,!1)}function et(t,e,r,i){t.push(e),t.push(r),t.push(i)}function rt(t,e,r,i,n,o){return e=(o-e)/(i-e),t.push(o),t.push(r+(n-r)*e),t.push(1),e}function it(t,e,r,i,n,o){return r=(o-r)/(n-r),t.push(e+(i-e)*r),t.push(o),t.push(1),r}function nt(t,e){for(var r=[],i=0;i<t.length;i++){var n,o=t[i],a=o.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)n=ot(o.geometry,e);else if("MultiLineString"===a||"Polygon"===a){n=[];for(var s=0;s<o.geometry.length;s++)n.push(ot(o.geometry[s],e))}else if("MultiPolygon"===a)for(n=[],s=0;s<o.geometry.length;s++){for(var u=[],l=0;l<o.geometry[s].length;l++)u.push(ot(o.geometry[s][l],e));n.push(u)}r.push(q(o.id,a,n,o.tags))}return r}function ot(t,e){var r=[];r.size=t.size,void 0!==t.start&&(r.start=t.start,r.end=t.end);for(var i=0;i<t.length;i+=3)r.push(t[i]+e,t[i+1],t[i+2]);return r}function at(t,e){if(t.transformed)return t;for(var r,i=1<<t.z,n=t.x,o=t.y,a=0;a<t.features.length;a++){var s=t.features[a],u=s.geometry,l=s.type;if(s.geometry=[],1===l)for(r=0;r<u.length;r+=2)s.geometry.push(st(u[r],u[r+1],e,i,n,o));else for(r=0;r<u.length;r++){for(var c=[],p=0;p<u[r].length;p+=2)c.push(st(u[r][p],u[r][p+1],e,i,n,o));s.geometry.push(c)}}return t.transformed=!0,t}function st(t,e,r,i,n,o){return[Math.round(r*(t*i-n)),Math.round(r*(e*i-o))]}function ut(t,e,r,i,n){for(var o=e===n.maxZoom?0:n.tolerance/((1<<e)*n.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:i,z:e,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<t.length;s++){a.numFeatures++,function(t,e,r,i){var n=e.geometry,o=e.type,a=[];if("Point"===o||"MultiPoint"===o)for(var s=0;s<n.length;s+=3)a.push(n[s]),a.push(n[s+1]),t.numPoints++,t.numSimplified++;else if("LineString"===o)lt(a,n,t,r,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(s=0;s<n.length;s++)lt(a,n[s],t,r,"Polygon"===o,0===s);else if("MultiPolygon"===o)for(var u=0;u<n.length;u++){var l=n[u];for(s=0;s<l.length;s++)lt(a,l[s],t,r,!0,0===s)}if(a.length){var c=e.tags||null;if("LineString"===o&&i.lineMetrics){for(var p in c={},e.tags)c[p]=e.tags[p];c.mapbox_clip_start=n.start/n.size,c.mapbox_clip_end=n.end/n.size}i={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:c},null!==e.id&&(i.id=e.id),t.features.push(i)}}(a,t[s],o,n);var u=t[s].minX,l=t[s].minY,c=t[s].maxX,p=t[s].maxY;u<a.minX&&(a.minX=u),l<a.minY&&(a.minY=l),c>a.maxX&&(a.maxX=c),p>a.maxY&&(a.maxY=p)}return a}function lt(t,e,r,i,n,o){var a=i*i;if(0<i&&e.size<(n?a:i))r.numPoints+=e.length/3;else{for(var s=[],u=0;u<e.length;u+=3)(0===i||e[u+2]>a)&&(r.numSimplified++,s.push(e[u]),s.push(e[u+1])),r.numPoints++;n&&function(t,e){for(var r=0,i=0,n=t.length,o=n-2;i<n;o=i,i+=2)r+=(t[i]-t[o])*(t[i+1]+t[o+1]);if(0<r===e)for(i=0,n=t.length;i<n/2;i+=2){var a=t[i],s=t[i+1];t[i]=t[n-2-i],t[i+1]=t[n-1-i],t[n-2-i]=a,t[n-1-i]=s}}(s,o),t.push(s)}}function ct(t,e){var r=(e=this.options=function(t,e){for(var r in e)t[r]=e[r];return t}(Object.create(this.options),e)).debug;if(r&&console.time("preprocess data"),e.maxZoom<0||24<e.maxZoom)throw new Error("maxZoom should be in the 0-24 range");if(e.promoteId&&e.generateId)throw new Error("promoteId and generateId cannot be used together.");var i,n,o,a,s=function(t,e){var r=[];if("FeatureCollection"===t.type)for(var i=0;i<t.features.length;i++)H(r,t.features[i],e,i);else H(r,"Feature"===t.type?t:{geometry:t},e);return r}(t,e);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",e.indexMaxZoom,e.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),t=Y(a=i=s,1,-1-(o=(n=e).buffer/n.extent),o,0,-1,2,n),e=Y(i,1,1-o,2+o,0,-1,2,n),(t||e)&&(a=Y(i,1,-o,1+o,0,-1,2,n)||[],t&&(a=nt(t,1).concat(a)),e&&(a=a.concat(nt(e,-1)))),(s=a).length&&this.splitTile(s,0,0,0),r&&(s.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 pt(t,e,r){return 32*((1<<t)*r+e)+t}function ht(t,e){var r=t.tileID.canonical;return this._geoJSONIndex&&(t=this._geoJSONIndex.getTile(r.z,r.x,r.y))?(r=new d(t.features),0===(t=v(r)).byteOffset&&t.byteLength===t.buffer.byteLength||(t=new Uint8Array(t)),void e(null,{vectorTile:r,rawData:t.buffer})):e(null,null)}B.prototype.load=function(t){var e=this.options,r=e.log,i=e.minZoom,n=e.maxZoom,o=e.nodeSize;r&&console.time("total time"),e="prepare "+t.length+" points",r&&console.time(e),this.points=t;for(var a,s,u,l=[],c=0;c<t.length;c++)t[c].geometry&&l.push((s=c,void 0,a=(u=(a=t[c]).geometry.coordinates)[1],{x:F(u[0]),y:j(a),zoom:1/0,index:s,parentId:-1}));this.trees[n+1]=new L(l,N,V,o,Float32Array),r&&console.timeEnd(e);for(var p=n;i<=p;p--){var h=+Date.now();l=this._cluster(l,p);this.trees[p]=new L(l,N,V,o,Float32Array),r&&console.log("z%d: %d clusters in %dms",p,l.length,+Date.now()-h)}return r&&console.timeEnd("total time"),this},B.prototype.getClusters=function(t,e){var r=((t[0]+180)%360+360)%360-180,i=Math.max(-90,Math.min(90,t[1])),n=180===t[2]?180:((t[2]+180)%360+360)%360-180,o=Math.max(-90,Math.min(90,t[3]));if(360<=t[2]-t[0])r=-180,n=180;else if(n<r){var a=this.getClusters([r,i,180,o],e);t=this.getClusters([-180,i,n,o],e);return a.concat(t)}for(var s=this.trees[this._limitZoom(e)],u=[],l=0,c=s.range(F(r),j(o),F(n),j(i));l<c.length;l+=1){var p=s.points[c[l]];u.push(p.numPoints?R(p):this.points[p.index])}return u},B.prototype.getChildren=function(t){var e=this._getOriginId(t),r=this._getOriginZoom(t),i="No cluster with the specified id.",n=this.trees[r];if(!n)throw new Error(i);if(!(e=n.points[e]))throw new Error(i);r=this.options.radius/(this.options.extent*Math.pow(2,r-1));for(var o=[],a=0,s=n.within(e.x,e.y,r);a<s.length;a+=1){var u=n.points[s[a]];u.parentId===t&&o.push(u.numPoints?R(u):this.points[u.index])}if(0===o.length)throw new Error(i);return o},B.prototype.getLeaves=function(t,e,r){var i=[];return this._appendLeaves(i,t,e=e||10,r=r||0,0),i},B.prototype.getTile=function(t,e,r){var i=this.trees[this._limitZoom(t)],n=Math.pow(2,t),o=(s=this.options).radius/s.extent,a=(r-o)/n,s=(t=(r+1+o)/n,{features:[]});return this._addTileFeatures(i.range((e-o)/n,a,(e+1+o)/n,t),i.points,e,r,n,s),0===e&&this._addTileFeatures(i.range(1-o/n,a,1,t),i.points,n,r,n,s),e===n-1&&this._addTileFeatures(i.range(0,a,o/n,t),i.points,-1,r,n,s),s.features.length?s:null},B.prototype.getClusterExpansionZoom=function(t){for(var e=this._getOriginZoom(t)-1;e<=this.options.maxZoom;){var r=this.getChildren(t);if(e++,1!==r.length)break;t=r[0].properties.cluster_id}return e},B.prototype._appendLeaves=function(t,e,r,i,n){for(var o=0,a=this.getChildren(e);o<a.length;o+=1){var s=a[o],u=s.properties;if(u&&u.cluster?n+u.point_count<=i?n+=u.point_count:n=this._appendLeaves(t,u.cluster_id,r,i,n):n<i?n++:t.push(s),t.length===r)break}return n},B.prototype._addTileFeatures=function(t,e,r,i,n,o){for(var a=0,s=t;a<s.length;a+=1){var u=e[s[a]],l=u.numPoints,c={type:1,geometry:[[Math.round(this.options.extent*(u.x*n-r)),Math.round(this.options.extent*(u.y*n-i))]],tags:l?O(u):this.points[u.index].properties},p=void 0;l?p=u.id:this.options.generateId?p=u.index:this.points[u.index].id&&(p=this.points[u.index].id),void 0!==p&&(c.id=p),o.features.push(c)}},B.prototype._limitZoom=function(t){return Math.max(this.options.minZoom,Math.min(+t,this.options.maxZoom+1))},B.prototype._cluster=function(t,e){for(var r=[],i=this.options,n=i.reduce,o=i.minPoints,a=i.radius/(i.extent*Math.pow(2,e)),s=0;s<t.length;s++){var u=t[s];if(!(u.zoom<=e)){u.zoom=e;for(var l=this.trees[e+1],c=l.within(u.x,u.y,a),p=u.numPoints||1,h=p,f=0,d=c;f<d.length;f+=1){var m=l.points[d[f]];m.zoom>e&&(h+=m.numPoints||1)}if(o<=h){for(var y=u.x*p,g=u.y*p,_=n&&1<p?this._map(u,!0):null,v=(s<<5)+(e+1)+this.points.length,x=0,b=c;x<b.length;x+=1){var w,S=l.points[b[x]];S.zoom<=e||(S.zoom=e,w=S.numPoints||1,y+=S.x*w,g+=S.y*w,S.parentId=v,n&&n(_=_||this._map(u,!0),this._map(S)))}u.parentId=v,r.push({x:y/h,y:g/h,zoom:1/0,id:v,parentId:-1,numPoints:h,properties:_})}else if(r.push(u),1<h)for(var T=0,E=c;T<E.length;T+=1){var I=l.points[E[T]];I.zoom<=e||(I.zoom=e,r.push(I))}}}return r},B.prototype._getOriginId=function(t){return t-this.points.length>>5},B.prototype._getOriginZoom=function(t){return(t-this.points.length)%32},ct.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!(B.prototype._map=function(t,e){if(t.numPoints)return e?U({},t.properties):t.properties;var r=this.points[t.index].properties;t=this.options.map(r);return e&&t===r?U({},t):t}),promoteId:null,generateId:!1,debug:0},ct.prototype.splitTile=function(t,e,r,i,n,o,a){for(var s=[t,e,r,i],u=this.options,l=u.debug;s.length;){i=s.pop(),r=s.pop(),e=s.pop(),t=s.pop();var c,p,h,f,d,m,y,g,_=1<<e,v=pt(e,r,i),x=this.tiles[v];if(!x&&(1<l&&console.time("creation"),x=this.tiles[v]=ut(t,e,r,i,u),this.tileCoords.push({z:e,x:r,y:i}),l)&&(1<l&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",e,r,i,x.numFeatures,x.numPoints,x.numSimplified),console.timeEnd("creation")),g="z"+e,this.stats[g]=(this.stats[g]||0)+1,this.total++),x.source=t,n){if(e===u.maxZoom||e===n)continue;var b=1<<n-e;if(r!==Math.floor(o/b)||i!==Math.floor(a/b))continue}else if(e===u.indexMaxZoom||x.numPoints<=u.indexMaxPoints)continue;x.source=null,0!==t.length&&(1<l&&console.time("clipping"),d=.5-(f=.5*u.buffer/u.extent),m=1+f,y=c=p=h=null,g=Y(t,_,r-f,r+(v=.5+f),0,x.minX,x.maxX,u),b=Y(t,_,r+d,r+m,0,x.minX,x.maxX,u),t=null,g&&(y=Y(g,_,i-f,i+v,1,x.minY,x.maxY,u),c=Y(g,_,i+d,i+m,1,x.minY,x.maxY,u),g=null),b&&(p=Y(b,_,i-f,i+v,1,x.minY,x.maxY,u),h=Y(b,_,i+d,i+m,1,x.minY,x.maxY,u),b=null),1<l&&console.timeEnd("clipping"),s.push(y||[],e+1,2*r,2*i),s.push(c||[],e+1,2*r,2*i+1),s.push(p||[],e+1,2*r+1,2*i),s.push(h||[],e+1,2*r+1,2*i+1))}},ct.prototype.getTile=function(t,e,r){var i=this.options,n=i.extent,o=i.debug;if(t<0||24<t)return null;if(i=pt(t,e=(e%(i=1<<t)+i)%i,r),this.tiles[i])return at(this.tiles[i],n);1<o&&console.log("drilling down to z%d-%d-%d",t,e,r);for(var a,s=t,u=e,l=r;!a&&0<s;)s--,u=Math.floor(u/2),l=Math.floor(l/2),a=this.tiles[pt(s,u,l)];return a&&a.source?(1<o&&console.log("found parent tile z%d-%d-%d",s,u,l),1<o&&console.time("drilling down"),this.splitTile(a.source,s,u,l,t,e,r),1<o&&console.timeEnd("drilling down"),this.tiles[i]?at(this.tiles[i],n):null):null};var ft,dt=((ft=s)&&(mt.__proto__=ft),((mt.prototype=Object.create(ft&&ft.prototype)).constructor=mt).prototype.loadData=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),this._pendingCallback=e,this._pendingLoadDataParams=t,this._state&&"Idle"!==this._state?this._state="NeedsLoadData":(this._state="Coalescing",this._loadData())},mt.prototype._loadData=function(){var e,r,i,n=this;this._pendingCallback&&this._pendingLoadDataParams&&(e=this._pendingCallback,r=this._pendingLoadDataParams,delete this._pendingCallback,delete this._pendingLoadDataParams,i=!!(r&&r.request&&r.request.collectResourceTiming)&&new t.RequestPerformance(r.request),this.loadGeoJSON(r,(function(o,a){if(o||!a)return e(o);if("object"!=typeof a)return e(new Error("Input data given to '"+r.source+"' is not a valid GeoJSON object."));!function t(e,r){var i,n=e&&e.type;if("FeatureCollection"===n)for(i=0;i<e.features.length;i++)t(e.features[i],r);else if("GeometryCollection"===n)for(i=0;i<e.geometries.length;i++)t(e.geometries[i],r);else if("Feature"===n)t(e.geometry,r);else if("Polygon"===n)c(e.coordinates,r);else if("MultiPolygon"===n)for(i=0;i<e.coordinates.length;i++)c(e.coordinates[i],r);return e}(a,!0);try{if(r.filter){var s=t.createExpression(r.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===s.result)throw new Error(s.value.map((function(t){return t.key+": "+t.message})).join(", "));a={type:"FeatureCollection",features:a.features.filter((function(t){return s.value.evaluate({zoom:0},t)}))}}n._geoJSONIndex=r.cluster?new B(function(){var e=r.superclusterOptions,i=r.clusterProperties;if(!i||!e)return e;for(var n={},o={},a={accumulated:null,zoom:0},s={properties:null},u=Object.keys(i),l=0,c=u;l<c.length;l+=1){var p=c[l],h=(f=i[p])[0],f=t.createExpression(f[1]);h=t.createExpression("string"==typeof h?[h,["accumulated"],["get",p]]:h);n[p]=f.value,o[p]=h.value}return e.map=function(t){s.properties=t;for(var e={},r=0,i=u;r<i.length;r+=1){var o=i[r];e[o]=n[o].evaluate(a,s)}return e},e.reduce=function(t,e){s.properties=e;for(var r=0,i=u;r<i.length;r+=1){var n=i[r];a.accumulated=t[n],t[n]=o[n].evaluate(a,s)}},e}()).load(a.features):new ct(a,r.geojsonVtOptions)}catch(o){return e(o)}n.loaded={};var u,l={};!i||(u=i.finish())&&(l.resourceTiming={},l.resourceTiming[r.source]=JSON.parse(JSON.stringify(u))),e(null,l)})))},mt.prototype.coalesce=function(){"Coalescing"===this._state?this._state="Idle":"NeedsLoadData"===this._state&&(this._state="Coalescing",this._loadData())},mt.prototype.reloadTile=function(t,e){var r=this.loaded;return r&&r[t.uid]?ft.prototype.reloadTile.call(this,t,e):this.loadTile(t,e)},mt.prototype.loadGeoJSON=function(e,r){if(e.request)t.getJSON(e.request,r);else{if("string"!=typeof e.data)return r(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."));try{return r(null,JSON.parse(e.data))}catch(t){return r(new Error("Input data given to '"+e.source+"' is not a valid GeoJSON object."))}}},mt.prototype.removeSource=function(t,e){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),e()},mt.prototype.getClusterExpansionZoom=function(t,e){try{e(null,this._geoJSONIndex.getClusterExpansionZoom(t.clusterId))}catch(t){e(t)}},mt.prototype.getClusterChildren=function(t,e){try{e(null,this._geoJSONIndex.getChildren(t.clusterId))}catch(t){e(t)}},mt.prototype.getClusterLeaves=function(t,e){try{e(null,this._geoJSONIndex.getLeaves(t.clusterId,t.limit,t.offset))}catch(t){e(t)}},mt);function mt(t,e,r,i){ft.call(this,t,e,r,ht),i&&(this.loadGeoJSON=i)}return(m=function(e){var r=this;this.self=e,this.actor=new t.Actor(e,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:s,geojson:dt},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=function(t,e){if(r.workerSourceTypes[t])throw new Error('Worker source with name "'+t+'" already registered.');r.workerSourceTypes[t]=e},this.self.registerRTLTextPlugin=function(e){if(t.plugin.isParsed())throw new Error("RTL text plugin already registered.");t.plugin.applyArabicShaping=e.applyArabicShaping,t.plugin.processBidirectionalText=e.processBidirectionalText,t.plugin.processStyledBidirectionalText=e.processStyledBidirectionalText}}).prototype.setReferrer=function(t,e){this.referrer=e},m.prototype.setImages=function(t,e,r){for(var i in this.availableImages[t]=e,this.workerSources[t]){var n,o=this.workerSources[t][i];for(n in o)o[n].availableImages=e}r()},m.prototype.setLayers=function(t,e,r){this.getLayerIndex(t).replace(e),r()},m.prototype.updateLayers=function(t,e,r){this.getLayerIndex(t).update(e.layers,e.removedIds),r()},m.prototype.loadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).loadTile(e,r)},m.prototype.loadDEMTile=function(t,e,r){this.getDEMWorkerSource(t,e.source).loadTile(e,r)},m.prototype.reloadTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).reloadTile(e,r)},m.prototype.abortTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).abortTile(e,r)},m.prototype.removeTile=function(t,e,r){this.getWorkerSource(t,e.type,e.source).removeTile(e,r)},m.prototype.removeDEMTile=function(t,e){this.getDEMWorkerSource(t,e.source).removeTile(e)},m.prototype.removeSource=function(t,e,r){var i;this.workerSources[t]&&this.workerSources[t][e.type]&&this.workerSources[t][e.type][e.source]&&(i=this.workerSources[t][e.type][e.source],delete this.workerSources[t][e.type][e.source],void 0!==i.removeSource?i.removeSource(e,r):r())},m.prototype.loadWorkerSource=function(t,e,r){try{this.self.importScripts(e.url),r()}catch(t){r(t.toString())}},m.prototype.syncRTLPluginState=function(e,r,i){try{t.plugin.setState(r);var n,o=t.plugin.getPluginURL();t.plugin.isLoaded()&&!t.plugin.isParsed()&&null!=o&&(this.self.importScripts(o),i((n=t.plugin.isParsed())?void 0:new Error("RTL Text Plugin failed to import scripts from "+o),n))}catch(e){i(e.toString())}},m.prototype.getAvailableImages=function(t){return this.availableImages[t]||[]},m.prototype.getLayerIndex=function(t){return this.layerIndexes[t]||(this.layerIndexes[t]=new r)},m.prototype.getWorkerSource=function(t,e,r){var i=this;return this.workerSources[t]||(this.workerSources[t]={}),this.workerSources[t][e]||(this.workerSources[t][e]={}),this.workerSources[t][e][r]||(this.workerSources[t][e][r]=new this.workerSourceTypes[e]({send:function(e,r,n){i.actor.send(e,r,n,t)}},this.getLayerIndex(t),this.getAvailableImages(t))),this.workerSources[t][e][r]},m.prototype.getDEMWorkerSource=function(t,e){return this.demWorkerSources[t]||(this.demWorkerSources[t]={}),this.demWorkerSources[t][e]||(this.demWorkerSources[t][e]=new u),this.demWorkerSources[t][e]},m.prototype.enforceCacheSizeLimit=function(e,r){t.enforceCacheSizeLimit(r)},"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope&&(self.worker=new m(self)),m})),i(0,(function(t){var e=t.createCommonjsModule((function(t){function e(t){return!r(t)}function r(t){return"undefined"==typeof window||"undefined"==typeof document?"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){var t,e,r=new Blob([""],{type:"text/javascript"}),i=URL.createObjectURL(r);try{e=new Worker(i),t=!0}catch(e){t=!1}return e&&e.terminate(),URL.revokeObjectURL(i),t}}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var t=document.createElement("canvas");t.width=t.height=1;var e=t.getContext("2d");if(e)return(e=e.getImageData(0,0,1,1))&&e.width===t.width}()?(void 0===i[r=t&&t.failIfMajorPerformanceCaveat]&&(i[r]=function(){var t,i;if(!(i=(t=r,i=document.createElement("canvas"),(n=Object.create(e.webGLContextAttributes)).failIfMajorPerformanceCaveat=t,i.probablySupportsContext?i.probablySupportsContext("webgl",n)||i.probablySupportsContext("experimental-webgl",n):i.supportsContext?i.supportsContext("webgl",n)||i.supportsContext("experimental-webgl",n):i.getContext("webgl",n)||i.getContext("experimental-webgl",n))))return!1;var n=i.createShader(i.VERTEX_SHADER);return!(!n||i.isContextLost())&&(i.shaderSource(n,"void main() {}"),i.compileShader(n),!0===i.getShaderParameter(n,i.COMPILE_STATUS))}()),i[r]?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 r}t.exports?t.exports=e:window&&(window.mapboxgl=window.mapboxgl||{},window.mapboxgl.supported=e,window.mapboxgl.notSupportedReason=r);var i={};e.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0}})),r={create:function(e,r,i){return e=t.window.document.createElement(e),void 0!==r&&(e.className=r),i&&i.appendChild(e),e},createNS:function(e,r){return t.window.document.createElementNS(e,r)}},i=t.window.document&&t.window.document.documentElement.style;function n(t){if(!i)return t[0];for(var e=0;e<t.length;e++)if(t[e]in i)return t[e];return t[0]}var o,a=n(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]);r.disableDrag=function(){i&&a&&(o=i[a],i[a]="none")},r.enableDrag=function(){i&&a&&(i[a]=o)};var s=n(["transform","WebkitTransform"]),u=!(r.setTransform=function(t,e){t.style[s]=e});try{var l=Object.defineProperty({},"passive",{get:function(){u=!0}});t.window.addEventListener("test",l,l),t.window.removeEventListener("test",l,l)}catch(t){u=!1}r.addEventListener=function(t,e,r,i){void 0===i&&(i={}),t.addEventListener(e,r,"passive"in i&&u?i:i.capture)},r.removeEventListener=function(t,e,r,i){void 0===i&&(i={}),t.removeEventListener(e,r,"passive"in i&&u?i:i.capture)};var c=function(e){e.preventDefault(),e.stopPropagation(),t.window.removeEventListener("click",c,!0)};r.suppressClick=function(){t.window.addEventListener("click",c,!0),t.window.setTimeout((function(){t.window.removeEventListener("click",c,!0)}),0)},r.mousePos=function(e,r){var i=e.getBoundingClientRect();return new t.Point(r.clientX-i.left-e.clientLeft,r.clientY-i.top-e.clientTop)},r.touchPos=function(e,r){for(var i=e.getBoundingClientRect(),n=[],o=0;o<r.length;o++)n.push(new t.Point(r[o].clientX-i.left-e.clientLeft,r[o].clientY-i.top-e.clientTop));return n},r.mouseButton=function(e){return void 0!==t.window.InstallTrigger&&2===e.button&&e.ctrlKey&&0<=t.window.navigator.platform.toUpperCase().indexOf("MAC")?0:e.button},r.remove=function(t){t.parentNode&&t.parentNode.removeChild(t)};var p,h=((p=t.Evented)&&(y.__proto__=p),((y.prototype=Object.create(p&&p.prototype)).constructor=y).prototype.isLoaded=function(){return this.loaded},y.prototype.setLoaded=function(t){if(this.loaded!==t&&(this.loaded=t)){for(var e=0,r=this.requestors;e<r.length;e+=1){var i=r[e];this._notify(i.ids,i.callback)}this.requestors=[]}},y.prototype.getImage=function(t){return this.images[t]},y.prototype.addImage=function(t,e){this._validate(t,e)&&(this.images[t]=e)},y.prototype._validate=function(e,r){var i=!0;return this._validateStretch(r.stretchX,r.data&&r.data.width)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchX" value'))),i=!1),this._validateStretch(r.stretchY,r.data&&r.data.height)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "stretchY" value'))),i=!1),this._validateContent(r.content,r)||(this.fire(new t.ErrorEvent(new Error('Image "'+e+'" has invalid "content" value'))),i=!1),i},y.prototype._validateStretch=function(t,e){if(!t)return!0;for(var r=0,i=0,n=t;i<n.length;i+=1){var o=n[i];if(o[0]<r||o[1]<o[0]||e<o[1])return!1;r=o[1]}return!0},y.prototype._validateContent=function(t,e){return!(t&&(4!==t.length||t[0]<0||e.data.width<t[0]||t[1]<0||e.data.height<t[1]||t[2]<0||e.data.width<t[2]||t[3]<0||e.data.height<t[3]||t[2]<t[0]||t[3]<t[1]))},y.prototype.updateImage=function(t,e){e.version=this.images[t].version+1,this.images[t]=e,this.updatedImages[t]=!0},y.prototype.removeImage=function(t){var e=this.images[t];delete this.images[t],delete this.patterns[t],e.userImage&&e.userImage.onRemove&&e.userImage.onRemove()},y.prototype.listImages=function(){return Object.keys(this.images)},y.prototype.getImages=function(t,e){var r=!0;if(!this.isLoaded())for(var i=0,n=t;i<n.length;i+=1)this.images[n[i]]||(r=!1);this.isLoaded()||r?this._notify(t,e):this.requestors.push({ids:t,callback:e})},y.prototype._notify=function(e,r){for(var i={},n=0,o=e;n<o.length;n+=1){var a=o[n];this.images[a]||this.fire(new t.Event("styleimagemissing",{id:a}));var s=this.images[a];s?i[a]={data:s.data.clone(),pixelRatio:s.pixelRatio,sdf:s.sdf,version:s.version,stretchX:s.stretchX,stretchY:s.stretchY,content:s.content,hasRenderCallback:Boolean(s.userImage&&s.userImage.render)}:t.warnOnce('Image "'+a+'" 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.')}r(null,i)},y.prototype.getPixelSize=function(){var t=this.atlasImage;return{width:t.width,height:t.height}},y.prototype.getPattern=function(e){var r=this.patterns[e],i=this.getImage(e);return i?r&&r.position.version===i.version?r.position:(r?r.position.version=i.version:(r={w:i.data.width+2,h:i.data.height+2,x:0,y:0},i=new t.ImagePosition(r,i),this.patterns[e]={bin:r,position:i}),this._updatePatternAtlas(),this.patterns[e].position):null},y.prototype.bind=function(e){var r=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new t.Texture(e,this.atlasImage,r.RGBA),this.atlasTexture.bind(r.LINEAR,r.CLAMP_TO_EDGE)},y.prototype._updatePatternAtlas=function(){var e,r=[];for(e in this.patterns)r.push(this.patterns[e].bin);var i,n=(o=t.potpack(r)).w,o=o.h,a=this.atlasImage;for(i in a.resize({width:n||1,height:o||1}),this.patterns){var s=(p=this.patterns[i].bin).x+1,u=p.y+1,l=this.images[i].data,c=l.width,p=l.height;t.RGBAImage.copy(l,a,{x:0,y:0},{x:s,y:u},{width:c,height:p}),t.RGBAImage.copy(l,a,{x:0,y:p-1},{x:s,y:u-1},{width:c,height:1}),t.RGBAImage.copy(l,a,{x:0,y:0},{x:s,y:u+p},{width:c,height:1}),t.RGBAImage.copy(l,a,{x:c-1,y:0},{x:s-1,y:u},{width:1,height:p}),t.RGBAImage.copy(l,a,{x:0,y:0},{x:s+c,y:u},{width:1,height:p})}this.dirty=!0},y.prototype.beginFrame=function(){this.callbackDispatchedThisFrame={}},y.prototype.dispatchRenderCallbacks=function(t){for(var e,r,i=0,n=t;i<n.length;i+=1){var o,a=n[i];this.callbackDispatchedThisFrame[a]||(this.callbackDispatchedThisFrame[a]=!0,r=void 0,(r=(e=o=this.images[a]).userImage)&&r.render&&r.render()&&(e.data.replace(new Uint8Array(r.data.buffer)),1)&&this.updateImage(a,o))}},y),f=g,d=g,m=1e20;function y(){p.call(this),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new t.RGBAImage({width:1,height:1}),this.dirty=!0}function g(t,e,r,i,n,o){this.fontSize=t||24,this.buffer=void 0===e?3:e,this.cutoff=i||.25,this.fontFamily=n||"sans-serif",this.fontWeight=o||"normal",this.radius=r||8,r=this.size=this.fontSize+2*this.buffer,this.canvas=document.createElement("canvas"),this.canvas.width=this.canvas.height=r,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(r*r),this.gridInner=new Float64Array(r*r),this.f=new Float64Array(r),this.d=new Float64Array(r),this.z=new Float64Array(r+1),this.v=new Int16Array(r),this.middle=Math.round(r/2*(0<=navigator.userAgent.indexOf("Gecko/")?1.2:1))}function _(t,e,r,i,n,o,a){for(var s=0;s<e;s++){for(var u=0;u<r;u++)i[u]=t[u*e+s];for(v(i,n,o,a,r),u=0;u<r;u++)t[u*e+s]=n[u]}for(u=0;u<r;u++){for(s=0;s<e;s++)i[s]=t[u*e+s];for(v(i,n,o,a,e),s=0;s<e;s++)t[u*e+s]=Math.sqrt(n[s])}}function v(t,e,r,i,n){i[r[0]=0]=-m,i[1]=+m;for(var o=1,a=0;o<n;o++){for(var s=(t[o]+o*o-(t[r[a]]+r[a]*r[a]))/(2*o-2*r[a]);s<=i[a];)a--,s=(t[o]+o*o-(t[r[a]]+r[a]*r[a]))/(2*o-2*r[a]);r[++a]=o,i[a]=s,i[a+1]=+m}for(a=o=0;o<n;o++){for(;i[a+1]<o;)a++;e[o]=(o-r[a])*(o-r[a])+t[r[a]]}}g.prototype.draw=function(t){this.ctx.clearRect(0,0,this.size,this.size),this.ctx.fillText(t,this.buffer,this.middle);for(var e=this.ctx.getImageData(0,0,this.size,this.size),r=new Uint8ClampedArray(this.size*this.size),i=0;i<this.size*this.size;i++){var n=e.data[4*i+3]/255;this.gridOuter[i]=1==n?0:0==n?m:Math.pow(Math.max(0,.5-n),2),this.gridInner[i]=1==n?m:0==n?0:Math.pow(Math.max(0,n-.5),2)}for(_(this.gridOuter,this.size,this.size,this.f,this.d,this.v,this.z),_(this.gridInner,this.size,this.size,this.f,this.d,this.v,this.z),i=0;i<this.size*this.size;i++)r[i]=Math.max(0,Math.min(255,Math.round(255-255*((this.gridOuter[i]-this.gridInner[i])/this.radius+this.cutoff))));return r},f.default=d;var x=function(t,e){this.requestManager=t,this.localIdeographFontFamily=e,this.entries={}};x.prototype.setURL=function(t){this.url=t},x.prototype.getGlyphs=function(e,r){var i,n=this,o=[];for(i in e)for(var a=0,s=e[i];a<s.length;a+=1)o.push({stack:i,id:s[a]});t.asyncAll(o,(function(t,e){var r=t.stack,i=t.id,o=n.entries[r];if(void 0===(t=(o=o||(n.entries[r]={glyphs:{},requests:{},ranges:{}})).glyphs[i])){if(t=n._tinySDF(o,r,i))return o.glyphs[i]=t,void e(null,{stack:r,id:i,glyph:t});var a,s=Math.floor(i/256);65535<256*s?e(new Error("glyphs > 65535 not supported")):o.ranges[s]?e(null,{stack:r,id:i,glyph:t}):((a=o.requests[s])||(a=o.requests[s]=[],x.loadGlyphRange(r,s,n.url,n.requestManager,(function(t,e){if(e){for(var r in e)n._doesCharSupportLocalGlyph(+r)||(o.glyphs[+r]=e[+r]);o.ranges[s]=!0}for(var i=0,u=a;i<u.length;i+=1)(0,u[i])(t,e);delete o.requests[s]}))),a.push((function(t,n){t?e(t):n&&e(null,{stack:r,id:i,glyph:n[i]||null})})))}else e(null,{stack:r,id:i,glyph:t})}),(function(t,e){if(t)r(t);else if(e){for(var i={},n=0,o=e;n<o.length;n+=1){var a=(u=o[n]).stack,s=u.id,u=u.glyph;(i[a]||(i[a]={}))[s]=u&&{id:u.id,bitmap:u.bitmap.clone(),metrics:u.metrics}}r(null,i)}}))},x.prototype._doesCharSupportLocalGlyph=function(e){return!!this.localIdeographFontFamily&&(t.isChar["CJK Unified Ideographs"](e)||t.isChar["Hangul Syllables"](e)||t.isChar.Hiragana(e)||t.isChar.Katakana(e))},x.prototype._tinySDF=function(e,r,i){var n=this.localIdeographFontFamily;if(n&&this._doesCharSupportLocalGlyph(i)){var o,a=e.tinySDF;return a||(o="400",/bold/i.test(r)?o="900":/medium/i.test(r)?o="500":/light/i.test(r)&&(o="200"),a=e.tinySDF=new x.TinySDF(24,3,8,.25,n,o)),{id:i,bitmap:new t.AlphaImage({width:30,height:30},a.draw(String.fromCharCode(i))),metrics:{width:24,height:24,left:0,top:-8,advance:24}}}},x.loadGlyphRange=function(e,r,i,n,o){var a=256*r;r=255+a,r=n.transformRequest(n.normalizeGlyphsURL(i).replace("{fontstack}",e).replace("{range}",a+"-"+r),t.ResourceType.Glyphs);t.getArrayBuffer(r,(function(e,r){if(e)o(e);else if(r){for(var i={},n=0,a=t.parseGlyphPBF(r);n<a.length;n+=1){var s=a[n];i[s.id]=s}o(null,i)}}))},x.TinySDF=f,(zi=function(){this.specification=t.styleSpec.light.position}).prototype.possiblyEvaluate=function(e,r){return t.sphericalToCartesian(e.expression.evaluate(r))},zi.prototype.interpolate=function(e,r,i){return{x:t.number(e.x,r.x,i),y:t.number(e.y,r.y,i),z:t.number(e.z,r.z,i)}};var b,w=new t.Properties({anchor:new t.DataConstantProperty(t.styleSpec.light.anchor),position:new zi,color:new t.DataConstantProperty(t.styleSpec.light.color),intensity:new t.DataConstantProperty(t.styleSpec.light.intensity)}),S=((b=t.Evented)&&(E.__proto__=b),((E.prototype=Object.create(b&&b.prototype)).constructor=E).prototype.getLight=function(){return this._transitionable.serialize()},E.prototype.setLight=function(e,r){if(void 0===r&&(r={}),!this._validate(t.validateLight,e,r))for(var i in e){var n=e[i];t.endsWith(i,"-transition")?this._transitionable.setTransition(i.slice(0,-"-transition".length),n):this._transitionable.setValue(i,n)}},E.prototype.updateTransitions=function(t){this._transitioning=this._transitionable.transitioned(t,this._transitioning)},E.prototype.hasTransition=function(){return this._transitioning.hasTransition()},E.prototype.recalculate=function(t){this.properties=this._transitioning.possiblyEvaluate(t)},E.prototype._validate=function(e,r,i){return(!i||!1!==i.validate)&&t.emitValidationErrors(this,e.call(t.validateStyle,t.extend({value:r,style:{glyphs:!0,sprite:!0},styleSpec:t.styleSpec})))},E),T=function(t,e){this.width=t,this.height=e,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}};function E(e){b.call(this),this._transitionable=new t.Transitionable(w),this.setLight(e),this._transitioning=this._transitionable.untransitioned()}T.prototype.getDash=function(t,e){var r=t.join(",")+String(e);return this.dashEntry[r]||(this.dashEntry[r]=this.addDash(t,e)),this.dashEntry[r]},T.prototype.getDashRanges=function(t,e,r){var i=[],n=t.length%2==1?-t[t.length-1]*r:0,o=t[0]*r,a=!0;i.push({left:n,right:o,isDash:a,zeroLength:0===t[0]});for(var s=t[0],u=1;u<t.length;u++){var l=t[u];i.push({left:s*r,right:(s+=l)*r,isDash:a=!a,zeroLength:0===l})}return i},T.prototype.addRoundDash=function(t,e,r){for(var i=e/2,n=-r;n<=r;n++)for(var o=this.width*(this.nextRow+r+n),a=0,s=t[a],u=0;u<this.width;u++){1<u/s.right&&(s=t[++a]);var l,c=Math.abs(u-s.left),p=Math.abs(u-s.right),h=Math.min(c,p);c=n/r*(1+i);l=s.isDash?(p=i-Math.abs(c),Math.sqrt(h*h+p*p)):i-Math.sqrt(h*h+c*c),this.data[o+u]=Math.max(0,Math.min(255,l+128))}},T.prototype.addRegularDash=function(t){for(var e=t.length-1;0<=e;--e){var r=t[e],i=t[e+1];r.zeroLength?t.splice(e,1):i&&i.isDash===r.isDash&&(i.left=r.left,t.splice(e,1))}var n=t[0],o=t[t.length-1];n.isDash===o.isDash&&(n.left=o.left-this.width,o.right=n.right+this.width);for(var a=this.width*this.nextRow,s=0,u=t[s],l=0;l<this.width;l++){1<l/u.right&&(u=t[++s]);var c=Math.abs(l-u.left),p=Math.abs(l-u.right);p=Math.min(c,p);this.data[a+l]=Math.max(0,Math.min(255,(u.isDash?p:-p)+128))}},T.prototype.addDash=function(e,r){var i=r?7:0,n=2*i+1;if(this.nextRow+n>this.height)return t.warnOnce("LineAtlas out of space"),null;for(var o,a,s=0,u=0;u<e.length;u++)s+=e[u];return 0!==s&&(o=this.width/s,a=this.getDashRanges(e,this.width,o),r?this.addRoundDash(a,o,i):this.addRegularDash(a)),i={y:(this.nextRow+i+.5)/this.height,height:2*i/this.height,width:s},this.nextRow+=n,this.dirty=!0,i},T.prototype.bind=function(t){t=t.gl,this.texture?(t.bindTexture(t.TEXTURE_2D,this.texture),this.dirty&&(this.dirty=!1,t.texSubImage2D(t.TEXTURE_2D,0,0,0,this.width,this.height,t.ALPHA,t.UNSIGNED_BYTE,this.data))):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.REPEAT),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texImage2D(t.TEXTURE_2D,0,t.ALPHA,this.width,this.height,0,t.ALPHA,t.UNSIGNED_BYTE,this.data))};var I=function e(r,i){this.workerPool=r,this.actors=[],this.currentActor=0,this.id=t.uniqueId();for(var n=this.workerPool.acquire(this.id),o=0;o<n.length;o++){var a=new e.Actor(n[o],i,this.id);a.name="Worker "+o,this.actors.push(a)}};function A(e,r,i){function n(n,o){if(n)return i(n);o&&(n=t.pick(t.extend(o,e),["tiles","minzoom","maxzoom","attribution","mapbox_logo","bounds","scheme","tileSize","encoding"]),o.vector_layers&&(n.vectorLayers=o.vector_layers,n.vectorLayerIds=n.vectorLayers.map((function(t){return t.id}))),n.tiles=r.canonicalizeTileset(n,e.url),i(null,n))}return e.url?t.getJSON(r.transformRequest(r.normalizeSourceURL(e.url),t.ResourceType.Source),n):t.browser.frame((function(){return n(null,e)}))}function C(e,r,i){this.bounds=t.LngLatBounds.convert(this.validateBounds(e)),this.minzoom=r||0,this.maxzoom=i||24}I.prototype.broadcast=function(e,r,i){t.asyncAll(this.actors,(function(t,i){t.send(e,r,i)}),i=i||function(){})},I.prototype.getActor=function(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]},I.prototype.remove=function(){this.actors.forEach((function(t){t.remove()})),this.actors=[],this.workerPool.release(this.id)},I.Actor=t.Actor,C.prototype.validateBounds=function(t){return Array.isArray(t)&&4===t.length?[Math.max(-180,t[0]),Math.max(-90,t[1]),Math.min(180,t[2]),Math.min(90,t[3])]:[-180,-90,180,90]},C.prototype.contains=function(e){var r=Math.pow(2,e.z),i=Math.floor(t.mercatorXfromLng(this.bounds.getWest())*r),n=Math.floor(t.mercatorYfromLat(this.bounds.getNorth())*r),o=Math.ceil(t.mercatorXfromLng(this.bounds.getEast())*r);r=Math.ceil(t.mercatorYfromLat(this.bounds.getSouth())*r);return e.x>=i&&e.x<o&&e.y>=n&&e.y<r};var P,M,k,z,L,B,D,R=((D=t.Evented)&&(Y.__proto__=D),((Y.prototype=Object.create(D&&D.prototype)).constructor=Y).prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=A(this._options,this.map._requestManager,(function(r,i){e._tileJSONRequest=null,e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):i&&(t.extend(e,i),i.bounds&&(e.tileBounds=new C(i.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(i.tiles,e.map._requestManager._customAccessToken),t.postMapLoadEvent(i.tiles,e.map._getMapId(),e.map._requestManager._skuToken,e.map._requestManager._customAccessToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},Y.prototype.loaded=function(){return this._loaded},Y.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},Y.prototype.onAdd=function(t){this.map=t,this.load()},Y.prototype.setSourceProperty=function(t){this._tileJSONRequest&&this._tileJSONRequest.cancel(),t(),this.map.style.sourceCaches[this.id].clearTiles(),this.load()},Y.prototype.setTiles=function(t){var e=this;return this.setSourceProperty((function(){e._options.tiles=t})),this},Y.prototype.setUrl=function(t){var e=this;return this.setSourceProperty((function(){e.url=t,e._options.url=t})),this},Y.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},Y.prototype.serialize=function(){return t.extend({},this._options)},Y.prototype.loadTile=function(e,r){var i=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme));function n(i,n){return delete e.request,e.aborted?r(null):i&&404!==i.status?r(i):(n&&n.resourceTiming&&(e.resourceTiming=n.resourceTiming),this.map._refreshExpiredTiles&&n&&e.setExpiryData(n),e.loadVectorData(n,this.map.painter),t.cacheEntryPossiblyAdded(this.dispatcher),r(null),void(e.reloadCallback&&(this.loadTile(e,e.reloadCallback),e.reloadCallback=null)))}(i={request:this.map._requestManager.transformRequest(i,t.ResourceType.Tile),uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,tileSize:this.tileSize*e.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId}).request.collectResourceTiming=this._collectResourceTiming,e.actor&&"expired"!==e.state?"loading"===e.state?e.reloadCallback=r:e.request=e.actor.send("reloadTile",i,n.bind(this)):(e.actor=this.dispatcher.getActor(),e.request=e.actor.send("loadTile",i,n.bind(this)))},Y.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.actor&&t.actor.send("abortTile",{uid:t.uid,type:this.type,source:this.id},void 0)},Y.prototype.unloadTile=function(t){t.unloadVectorData(),t.actor&&t.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id},void 0)},Y.prototype.hasTransition=function(){return!1},Y),O=((B=t.Evented)&&(J.__proto__=B),((J.prototype=Object.create(B&&B.prototype)).constructor=J).prototype.load=function(){var e=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=A(this._options,this.map._requestManager,(function(r,i){e._tileJSONRequest=null,e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):i&&(t.extend(e,i),i.bounds&&(e.tileBounds=new C(i.bounds,e.minzoom,e.maxzoom)),t.postTurnstileEvent(i.tiles),t.postMapLoadEvent(i.tiles,e.map._getMapId(),e.map._requestManager._skuToken),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})),e.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})))}))},J.prototype.loaded=function(){return this._loaded},J.prototype.onAdd=function(t){this.map=t,this.load()},J.prototype.onRemove=function(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)},J.prototype.serialize=function(){return t.extend({},this._options)},J.prototype.hasTile=function(t){return!this.tileBounds||this.tileBounds.contains(t.canonical)},J.prototype.loadTile=function(e,r){var i=this,n=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(n,t.ResourceType.Tile),(function(n,o){var a;delete e.request,e.aborted?(e.state="unloaded",r(null)):n?(e.state="errored",r(n)):o&&(i.map._refreshExpiredTiles&&e.setExpiryData(o),delete o.cacheControl,delete o.expires,n=(a=i.map.painter.context).gl,e.texture=i.map.painter.getTileTexture(o.width),e.texture?e.texture.update(o,{useMipmap:!0}):(e.texture=new t.Texture(a,o,n.RGBA,{useMipmap:!0}),e.texture.bind(n.LINEAR,n.CLAMP_TO_EDGE,n.LINEAR_MIPMAP_NEAREST),a.extTextureFilterAnisotropic&&n.texParameterf(n.TEXTURE_2D,a.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,a.extTextureFilterAnisotropicMax)),e.state="loaded",t.cacheEntryPossiblyAdded(i.dispatcher),r(null))}))},J.prototype.abortTile=function(t,e){t.request&&(t.request.cancel(),delete t.request),e()},J.prototype.unloadTile=function(t,e){t.texture&&this.map.painter.saveTileTexture(t.texture),e()},J.prototype.hasTransition=function(){return!1},J),F=((L=O)&&(K.__proto__=L),((K.prototype=Object.create(L&&L.prototype)).constructor=K).prototype.serialize=function(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}},K.prototype.loadTile=function(e,r){var i=this.map._requestManager.normalizeTileURL(e.tileID.canonical.url(this.tiles,this.scheme),this.tileSize);e.request=t.getImage(this.map._requestManager.transformRequest(i,t.ResourceType.Tile),function(i,n){delete e.request,e.aborted?(e.state="unloaded",r(null)):i?(e.state="errored",r(i)):n&&(this.map._refreshExpiredTiles&&e.setExpiryData(n),delete n.cacheControl,delete n.expires,n=t.window.ImageBitmap&&n instanceof t.window.ImageBitmap&&t.offscreenCanvasSupported()?n:t.browser.getImageData(n,1),n={uid:e.uid,coord:e.tileID,source:this.id,rawImageData:n,encoding:this.encoding},e.actor&&"expired"!==e.state||(e.actor=this.dispatcher.getActor(),e.actor.send("loadDEMTile",n,function(t,i){t&&(e.state="errored",r(t)),i&&(e.dem=i,e.needsHillshadePrepare=!0,e.state="loaded",r(null))}.bind(this))))}.bind(this)),e.neighboringTiles=this._getNeighboringTiles(e.tileID)},K.prototype._getNeighboringTiles=function(e){var r=e.canonical,i=Math.pow(2,r.z),n=(r.x-1+i)%i,o=0===r.x?e.wrap-1:e.wrap,a=(r.x+1+i)%i,s=r.x+1===i?e.wrap+1:e.wrap,u={};return u[new t.OverscaledTileID(e.overscaledZ,o,r.z,n,r.y).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y).key]={backfilled:!1},0<r.y&&(u[new t.OverscaledTileID(e.overscaledZ,o,r.z,n,r.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y-1).key]={backfilled:!1}),r.y+1<i&&(u[new t.OverscaledTileID(e.overscaledZ,o,r.z,n,r.y+1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,e.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},u[new t.OverscaledTileID(e.overscaledZ,s,r.z,a,r.y+1).key]={backfilled:!1}),u},K.prototype.unloadTile=function(t){t.demTexture&&this.map.painter.saveTileTexture(t.demTexture),t.fbo&&(t.fbo.destroy(),delete t.fbo),t.dem&&delete t.dem,delete t.neighboringTiles,t.state="unloaded",t.actor&&t.actor.send("removeDEMTile",{uid:t.uid,source:this.id})},K),j=((z=t.Evented)&&(X.__proto__=z),((X.prototype=Object.create(z&&z.prototype)).constructor=X).prototype.load=function(){var e=this;this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(r){r?e.fire(new t.ErrorEvent(r)):(r={dataType:"source",sourceDataType:"metadata"},e._collectResourceTiming&&e._resourceTiming&&0<e._resourceTiming.length&&(r.resourceTiming=e._resourceTiming,e._resourceTiming=[]),e.fire(new t.Event("data",r)))}))},X.prototype.onAdd=function(t){this.map=t,this.load()},X.prototype.setData=function(e){var r=this;return this._data=e,this.fire(new t.Event("dataloading",{dataType:"source"})),this._updateWorkerData((function(e){e?r.fire(new t.ErrorEvent(e)):(e={dataType:"source",sourceDataType:"content"},r._collectResourceTiming&&r._resourceTiming&&0<r._resourceTiming.length&&(e.resourceTiming=r._resourceTiming,r._resourceTiming=[]),r.fire(new t.Event("data",e)))})),this},X.prototype.getClusterExpansionZoom=function(t,e){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:t,source:this.id},e),this},X.prototype.getClusterChildren=function(t,e){return this.actor.send("geojson.getClusterChildren",{clusterId:t,source:this.id},e),this},X.prototype.getClusterLeaves=function(t,e,r,i){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:t,limit:e,offset:r},i),this},X.prototype._updateWorkerData=function(e){var r=this;this._loaded=!1;var i=t.extend({},this.workerOptions),n=this._data;"string"==typeof n?(i.request=this.map._requestManager.transformRequest(t.browser.resolveURL(n),t.ResourceType.Source),i.request.collectResourceTiming=this._collectResourceTiming):i.data=JSON.stringify(n),this.actor.send(this.type+".loadData",i,(function(t,n){r._removed||n&&n.abandoned||(r._loaded=!0,n&&n.resourceTiming&&n.resourceTiming[r.id]&&(r._resourceTiming=n.resourceTiming[r.id].slice(0)),r.actor.send(r.type+".coalesce",{source:i.source},null),e(t))}))},X.prototype.loaded=function(){return this._loaded},X.prototype.loadTile=function(e,r){var i=this,n=e.actor?"reloadTile":"loadTile";e.actor=this.actor,e.request=this.actor.send(n,{type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:t.browser.devicePixelRatio,showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId},(function(t,o){return delete e.request,e.unloadVectorData(),e.aborted?r(null):t?r(t):(e.loadVectorData(o,i.map.painter,"reloadTile"==n),r(null))}))},X.prototype.abortTile=function(t){t.request&&(t.request.cancel(),delete t.request),t.aborted=!0},X.prototype.unloadTile=function(t){t.unloadVectorData(),this.actor.send("removeTile",{uid:t.uid,type:this.type,source:this.id})},X.prototype.onRemove=function(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})},X.prototype.serialize=function(){return t.extend({},this._options,{type:this.type,data:this._data})},X.prototype.hasTransition=function(){return!1},X),U=t.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]),N=((k=t.Evented)&&(W.__proto__=k),((W.prototype=Object.create(k&&k.prototype)).constructor=W).prototype.load=function(e,r){var i=this;this._loaded=!1,this.fire(new t.Event("dataloading",{dataType:"source"})),this.url=this.options.url,t.getImage(this.map._requestManager.transformRequest(this.url,t.ResourceType.Image),(function(n,o){i._loaded=!0,n?i.fire(new t.ErrorEvent(n)):o&&(i.image=o,e&&(i.coordinates=e),r&&r(),i._finishLoading())}))},W.prototype.loaded=function(){return this._loaded},W.prototype.updateImage=function(t){var e=this;return this.image&&t.url&&(this.options.url=t.url,this.load(t.coordinates,(function(){e.texture=null}))),this},W.prototype._finishLoading=function(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"metadata"})))},W.prototype.onAdd=function(t){this.map=t,this.load()},W.prototype.setCoordinates=function(e){var r=this,i=(this.coordinates=e).map(t.MercatorCoordinate.fromLngLat);return this.tileID=function(){for(var e=1/0,r=1/0,n=-1/0,o=-1/0,a=0,s=i;a<s.length;a+=1){var u=s[a];e=Math.min(e,u.x),r=Math.min(r,u.y),n=Math.max(n,u.x),o=Math.max(o,u.y)}var l=Math.max(n-e,o-r),c=Math.max(0,Math.floor(-Math.log(l)/Math.LN2));l=Math.pow(2,c);return new t.CanonicalTileID(c,Math.floor((e+n)/2*l),Math.floor((r+o)/2*l))}(),this.minzoom=this.maxzoom=this.tileID.z,e=i.map((function(t){return r.tileID.getTilePoint(t)._round()})),this._boundsArray=new t.StructArrayLayout4i8,this._boundsArray.emplaceBack(e[0].x,e[0].y,0,0),this._boundsArray.emplaceBack(e[1].x,e[1].y,t.EXTENT,0),this._boundsArray.emplaceBack(e[3].x,e[3].y,0,t.EXTENT),this._boundsArray.emplaceBack(e[2].x,e[2].y,t.EXTENT,t.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new t.Event("data",{dataType:"source",sourceDataType:"content"})),this},W.prototype.prepare=function(){if(0!==Object.keys(this.tiles).length&&this.image){var e,r=this.map.painter.context,i=r.gl;for(e in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,U.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new t.Texture(r,this.image,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this.tiles){var n=this.tiles[e];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture)}}},W.prototype.loadTile=function(t,e){this.tileID&&this.tileID.equals(t.tileID.canonical)?(this.tiles[String(t.tileID.wrap)]=t).buckets={}:t.state="errored",e(null)},W.prototype.serialize=function(){return{type:"image",url:this.options.url,coordinates:this.coordinates}},W.prototype.hasTransition=function(){return!1},W),V=((M=N)&&(Z.__proto__=M),((Z.prototype=Object.create(M&&M.prototype)).constructor=Z).prototype.load=function(){var e=this;this._loaded=!1;var r=this.options;this.urls=[];for(var i=0,n=r.urls;i<n.length;i+=1)this.urls.push(this.map._requestManager.transformRequest(n[i],t.ResourceType.Source).url);t.getVideo(this.urls,(function(r,i){e._loaded=!0,r?e.fire(new t.ErrorEvent(r)):i&&(e.video=i,e.video.loop=!0,e.video.addEventListener("playing",(function(){e.map.triggerRepaint()})),e.map&&e.video.play(),e._finishLoading())}))},Z.prototype.pause=function(){this.video&&this.video.pause()},Z.prototype.play=function(){this.video&&this.video.play()},Z.prototype.seek=function(e){var r;this.video&&(e<(r=this.video.seekable).start(0)||e>r.end(0)?this.fire(new t.ErrorEvent(new t.ValidationError("sources."+this.id,null,"Playback for this video can be set only between the "+r.start(0)+" and "+r.end(0)+"-second mark."))):this.video.currentTime=e)},Z.prototype.getVideo=function(){return this.video},Z.prototype.onAdd=function(t){this.map||(this.map=t,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))},Z.prototype.prepare=function(){if(!(0===Object.keys(this.tiles).length||this.video.readyState<2)){var e,r=this.map.painter.context,i=r.gl;for(e in this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,U.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE),i.texSubImage2D(i.TEXTURE_2D,0,0,0,i.RGBA,i.UNSIGNED_BYTE,this.video)):(this.texture=new t.Texture(r,this.video,i.RGBA),this.texture.bind(i.LINEAR,i.CLAMP_TO_EDGE)),this.tiles){var n=this.tiles[e];"loaded"!==n.state&&(n.state="loaded",n.texture=this.texture)}}},Z.prototype.serialize=function(){return{type:"video",urls:this.urls,coordinates:this.coordinates}},Z.prototype.hasTransition=function(){return this.video&&!this.video.paused},Z),q=((P=N)&&(H.__proto__=P),((H.prototype=Object.create(P&&P.prototype)).constructor=H).prototype.load=function(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof t.window.HTMLCanvasElement?this.options.canvas:t.window.document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new t.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())},H.prototype.getCanvas=function(){return this.canvas},H.prototype.onAdd=function(t){this.map=t,this.load(),this.canvas&&this.animate&&this.play()},H.prototype.onRemove=function(){this.pause()},H.prototype.prepare=function(){var e=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,e=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,e=!0),!this._hasInvalidDimensions()&&0!==Object.keys(this.tiles).length){var r,i=this.map.painter.context,n=i.gl;for(r in this.boundsBuffer||(this.boundsBuffer=i.createVertexBuffer(this._boundsArray,U.members)),this.boundsSegments||(this.boundsSegments=t.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(e||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new t.Texture(i,this.canvas,n.RGBA,{premultiply:!0}),this.tiles){var o=this.tiles[r];"loaded"!==o.state&&(o.state="loaded",o.texture=this.texture)}}},H.prototype.serialize=function(){return{type:"canvas",coordinates:this.coordinates}},H.prototype.hasTransition=function(){return this._playing},H.prototype._hasInvalidDimensions=function(){for(var t=0,e=[this.canvas.width,this.canvas.height];t<e.length;t+=1){var r=e[t];if(isNaN(r)||r<=0)return!0}return!1},H),G={vector:R,raster:O,"raster-dem":F,geojson:j,video:V,image:N,canvas:q};function H(e,r,i,n){P.call(this,e,r,i,n),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some((function(t){return!Array.isArray(t)||2!==t.length||t.some((function(t){return"number"!=typeof t}))}))||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+e,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new t.ErrorEvent(new t.ValidationError("sources."+e,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new t.ErrorEvent(new t.ValidationError("sources."+e,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof t.window.HTMLCanvasElement||this.fire(new t.ErrorEvent(new t.ValidationError("sources."+e,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 t.ErrorEvent(new t.ValidationError("sources."+e,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate}function Z(t,e,r,i){M.call(this,t,e,r,i),this.roundZoom=!0,this.type="video",this.options=e}function W(t,e,r,i){k.call(this),this.id=t,this.dispatcher=r,this.coordinates=e.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=e}function X(e,r,i,n){z.call(this),this.id=e,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=i.getActor(),this.setEventedParent(n),this._data=r.data,this._options=t.extend({},r),this._collectResourceTiming=r.collectResourceTiming,this._resourceTiming=[],void 0!==r.maxzoom&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution),this.promoteId=r.promoteId,n=t.EXTENT/this.tileSize,this.workerOptions=t.extend({source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:(void 0!==r.buffer?r.buffer:128)*n,tolerance:(void 0!==r.tolerance?r.tolerance:.375)*n,extent:t.EXTENT,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1},superclusterOptions:{maxZoom:void 0!==r.clusterMaxZoom?Math.min(r.clusterMaxZoom,this.maxzoom-1):this.maxzoom-1,minPoints:Math.max(2,r.clusterMinPoints||2),extent:t.EXTENT,radius:(r.clusterRadius||50)*n,log:!1,generateId:r.generateId||!1},clusterProperties:r.clusterProperties,filter:r.filter},r.workerOptions)}function K(e,r,i,n){L.call(this,e,r,i,n),this.type="raster-dem",this.maxzoom=22,this._options=t.extend({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox"}function J(e,r,i,n){B.call(this),this.id=e,this.dispatcher=i,this.setEventedParent(n),this.type="raster",this.minzoom=0,this.maxzoom=22,this.roundZoom=!0,this.scheme="xyz",this.tileSize=512,this._loaded=!1,this._options=t.extend({type:"raster"},r),t.extend(this,t.pick(r,["url","scheme","tileSize"]))}function Y(e,r,i,n){if(D.call(this),this.id=e,this.dispatcher=i,this.type="vector",this.minzoom=0,this.maxzoom=22,this.scheme="xyz",this.tileSize=512,this.reparseOverscaled=!0,this.isTileClipped=!0,this._loaded=!1,t.extend(this,t.pick(r,["url","scheme","tileSize","promoteId"])),this._options=t.extend({type:"vector"},r),this._collectResourceTiming=r.collectResourceTiming,512!==this.tileSize)throw new Error("vector tile sources must have a tileSize of 512");this.setEventedParent(n)}function Q(e,r,i,n,o,a){var s=function(t,e,r){if(t)for(var i=0,n=t;i<n.length;i+=1){var o=e[n[i]];if(o&&o.source===r&&"fill-extrusion"===o.type)return!0}else for(var a in e){var s=e[a];if(s.source===r&&"fill-extrusion"===s.type)return!0}return!1}(o&&o.layers,r,e.id),u=a.maxPitchScaleFactor();(s=e.tilesIn(n,u,s)).sort($);for(var l,c,p=[],h=0,f=s;h<f.length;h+=1){var d=f[h];p.push({wrappedTileID:d.tileID.wrapped().key,queryResults:d.tile.queryRenderedFeatures(r,i,e._state,d.queryGeometry,d.cameraQueryGeometry,d.scale,o,a,u,(l=e.transform,c=d.tileID,d=void 0,d=t.identity([]),t.translate(d,d,[1,1,0]),t.scale(d,d,[.5*l.width,.5*l.height,1]),t.multiply(d,d,l.calculatePosMatrix(c.toUnwrapped()))))})}var m,y=function(){for(var t={},e={},r=0,i=p;r<i.length;r+=1){var n,o,a=(o=i[r]).queryResults,s=e[o=o.wrappedTileID]=e[o]||{};for(n in a)for(var u=a[n],l=s[n]=s[n]||{},c=t[n]=t[n]||[],h=0,f=u;h<f.length;h+=1){var d=f[h];l[d.featureIndex]||(l[d.featureIndex]=!0,c.push(d))}}return t}();for(m in y)y[m].forEach((function(t){var r=t.feature;t=e.getFeatureState(r.layer["source-layer"],r.id);r.source=r.layer.source,r.layer["source-layer"]&&(r.sourceLayer=r.layer["source-layer"]),r.state=t}));return y}function $(t,e){return t=t.tileID,e=e.tileID,t.overscaledZ-e.overscaledZ||t.canonical.y-e.canonical.y||t.wrap-e.wrap||t.canonical.x-e.canonical.x}function tt(t,e){this.max=t,this.onRemove=e,this.reset()}function et(t,e,r){var i=(this.context=t).gl;this.buffer=i.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),t.bindElementBuffer.set(this.buffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}function rt(t,e,r,i){this.length=e.length,this.attributes=r,this.itemSize=e.bytesPerElement,this.dynamicDraw=i,i=(this.context=t).gl,this.buffer=i.createBuffer(),t.bindVertexBuffer.set(this.buffer),i.bufferData(i.ARRAY_BUFFER,e.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete e.arrayBuffer}tt.prototype.reset=function(){for(var t in this.data)for(var e=0,r=this.data[t];e<r.length;e+=1){var i=r[e];i.timeout&&clearTimeout(i.timeout),this.onRemove(i.value)}return this.data={},this.order=[],this},tt.prototype.add=function(t,e,r){var i=this,n=t.wrapped().key;void 0===this.data[n]&&(this.data[n]=[]);var o,a={value:e,timeout:void 0};return void 0!==r&&(a.timeout=setTimeout((function(){i.remove(t,a)}),r)),this.data[n].push(a),this.order.push(n),this.order.length>this.max&&(o=this._getAndRemoveByKey(this.order[0]))&&this.onRemove(o),this},tt.prototype.has=function(t){return t.wrapped().key in this.data},tt.prototype.getAndRemove=function(t){return this.has(t)?this._getAndRemoveByKey(t.wrapped().key):null},tt.prototype._getAndRemoveByKey=function(t){var e=this.data[t].shift();return e.timeout&&clearTimeout(e.timeout),0===this.data[t].length&&delete this.data[t],this.order.splice(this.order.indexOf(t),1),e.value},tt.prototype.getByKey=function(t){return(t=this.data[t])?t[0].value:null},tt.prototype.get=function(t){return this.has(t)?this.data[t.wrapped().key][0].value:null},tt.prototype.remove=function(t,e){if(!this.has(t))return this;var r=t.wrapped().key;t=void 0===e?0:this.data[r].indexOf(e),e=this.data[r][t];return this.data[r].splice(t,1),e.timeout&&clearTimeout(e.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(e.value),this.order.splice(this.order.indexOf(r),1),this},tt.prototype.setMaxSize=function(t){for(this.max=t;this.order.length>this.max;){var e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this},tt.prototype.filter=function(t){var e,r=[];for(e in this.data)for(var i=0,n=this.data[e];i<n.length;i+=1){var o=n[i];t(o.value)||r.push(o)}for(var a=0,s=r;a<s.length;a+=1){var u=s[a];this.remove(u.value.tileID,u)}},et.prototype.bind=function(){this.context.bindElementBuffer.set(this.buffer)},et.prototype.updateData=function(t){var e=this.context.gl;this.context.unbindVAO(),this.bind(),e.bufferSubData(e.ELEMENT_ARRAY_BUFFER,0,t.arrayBuffer)},et.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)};var it={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};function nt(t,e,r,i){this.context=t,this.width=e,this.height=r,r=this.framebuffer=t.gl.createFramebuffer(),this.colorAttachment=new ge(t,r),i&&(this.depthAttachment=new _e(t,r))}rt.prototype.bind=function(){this.context.bindVertexBuffer.set(this.buffer)},rt.prototype.updateData=function(t){var e=this.context.gl;this.bind(),e.bufferSubData(e.ARRAY_BUFFER,0,t.arrayBuffer)},rt.prototype.enableAttributes=function(t,e){for(var r=0;r<this.attributes.length;r++){var i=e.attributes[this.attributes[r].name];void 0!==i&&t.enableVertexAttribArray(i)}},rt.prototype.setVertexAttribPointers=function(t,e,r){for(var i=0;i<this.attributes.length;i++){var n=this.attributes[i],o=e.attributes[n.name];void 0!==o&&t.vertexAttribPointer(o,n.components,t[it[n.type]],!1,this.itemSize,n.offset+this.itemSize*(r||0))}},rt.prototype.destroy=function(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)},(Li=function(t){this.gl=t.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}).prototype.get=function(){return this.current},Li.prototype.set=function(t){},Li.prototype.getDefault=function(){return this.default},Li.prototype.setDefault=function(){this.set(this.default)};var ot,at,st,ut,lt,ct,pt,ht,ft,dt,mt,yt,gt,_t,vt,xt,bt,wt,St,Tt,Et,It,At,Ct,Pt,Mt,kt,zt,Lt,Bt,Dt,Rt,Ot,Ft,jt=((Ft=Li)&&(Qe.__proto__=Ft),((Qe.prototype=Object.create(Ft&&Ft.prototype)).constructor=Qe).prototype.getDefault=function(){return t.Color.transparent},Qe.prototype.set=function(t){var e=this.current;t.r===e.r&&t.g===e.g&&t.b===e.b&&t.a===e.a&&!this.dirty||(this.gl.clearColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},Qe),Ut=((Ot=Li)&&(Ye.__proto__=Ot),((Ye.prototype=Object.create(Ot&&Ot.prototype)).constructor=Ye).prototype.getDefault=function(){return 1},Ye.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.clearDepth(t),this.current=t,this.dirty=!1)},Ye),Nt=((Rt=Li)&&(Je.__proto__=Rt),((Je.prototype=Object.create(Rt&&Rt.prototype)).constructor=Je).prototype.getDefault=function(){return 0},Je.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.clearStencil(t),this.current=t,this.dirty=!1)},Je),Vt=((Dt=Li)&&(Ke.__proto__=Dt),((Ke.prototype=Object.create(Dt&&Dt.prototype)).constructor=Ke).prototype.getDefault=function(){return[!0,!0,!0,!0]},Ke.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&!this.dirty||(this.gl.colorMask(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},Ke),qt=((Bt=Li)&&(Xe.__proto__=Bt),((Xe.prototype=Object.create(Bt&&Bt.prototype)).constructor=Xe).prototype.getDefault=function(){return!0},Xe.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.depthMask(t),this.current=t,this.dirty=!1)},Xe),Gt=((Lt=Li)&&(We.__proto__=Lt),((We.prototype=Object.create(Lt&&Lt.prototype)).constructor=We).prototype.getDefault=function(){return 255},We.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.stencilMask(t),this.current=t,this.dirty=!1)},We),Ht=((zt=Li)&&(Ze.__proto__=zt),((Ze.prototype=Object.create(zt&&zt.prototype)).constructor=Ze).prototype.getDefault=function(){return{func:this.gl.ALWAYS,ref:0,mask:255}},Ze.prototype.set=function(t){var e=this.current;t.func===e.func&&t.ref===e.ref&&t.mask===e.mask&&!this.dirty||(this.gl.stencilFunc(t.func,t.ref,t.mask),this.current=t,this.dirty=!1)},Ze),Zt=((kt=Li)&&(He.__proto__=kt),((He.prototype=Object.create(kt&&kt.prototype)).constructor=He).prototype.getDefault=function(){var t=this.gl;return[t.KEEP,t.KEEP,t.KEEP]},He.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&!this.dirty||(this.gl.stencilOp(t[0],t[1],t[2]),this.current=t,this.dirty=!1)},He),Wt=((Mt=Li)&&(Ge.__proto__=Mt),((Ge.prototype=Object.create(Mt&&Mt.prototype)).constructor=Ge).prototype.getDefault=function(){return!1},Ge.prototype.set=function(t){var e;t===this.current&&!this.dirty||(e=this.gl,t?e.enable(e.STENCIL_TEST):e.disable(e.STENCIL_TEST),this.current=t,this.dirty=!1)},Ge),Xt=((Pt=Li)&&(qe.__proto__=Pt),((qe.prototype=Object.create(Pt&&Pt.prototype)).constructor=qe).prototype.getDefault=function(){return[0,1]},qe.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&!this.dirty||(this.gl.depthRange(t[0],t[1]),this.current=t,this.dirty=!1)},qe),Kt=((Ct=Li)&&(Ve.__proto__=Ct),((Ve.prototype=Object.create(Ct&&Ct.prototype)).constructor=Ve).prototype.getDefault=function(){return!1},Ve.prototype.set=function(t){var e;t===this.current&&!this.dirty||(e=this.gl,t?e.enable(e.DEPTH_TEST):e.disable(e.DEPTH_TEST),this.current=t,this.dirty=!1)},Ve),Jt=((At=Li)&&(Ne.__proto__=At),((Ne.prototype=Object.create(At&&At.prototype)).constructor=Ne).prototype.getDefault=function(){return this.gl.LESS},Ne.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.depthFunc(t),this.current=t,this.dirty=!1)},Ne),Yt=((It=Li)&&(Ue.__proto__=It),((Ue.prototype=Object.create(It&&It.prototype)).constructor=Ue).prototype.getDefault=function(){return!1},Ue.prototype.set=function(t){var e;t===this.current&&!this.dirty||(e=this.gl,t?e.enable(e.BLEND):e.disable(e.BLEND),this.current=t,this.dirty=!1)},Ue),Qt=((Et=Li)&&(je.__proto__=Et),((je.prototype=Object.create(Et&&Et.prototype)).constructor=je).prototype.getDefault=function(){var t=this.gl;return[t.ONE,t.ZERO]},je.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&!this.dirty||(this.gl.blendFunc(t[0],t[1]),this.current=t,this.dirty=!1)},je),$t=((Tt=Li)&&(Fe.__proto__=Tt),((Fe.prototype=Object.create(Tt&&Tt.prototype)).constructor=Fe).prototype.getDefault=function(){return t.Color.transparent},Fe.prototype.set=function(t){var e=this.current;t.r===e.r&&t.g===e.g&&t.b===e.b&&t.a===e.a&&!this.dirty||(this.gl.blendColor(t.r,t.g,t.b,t.a),this.current=t,this.dirty=!1)},Fe),te=((St=Li)&&(Oe.__proto__=St),((Oe.prototype=Object.create(St&&St.prototype)).constructor=Oe).prototype.getDefault=function(){return this.gl.FUNC_ADD},Oe.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.blendEquation(t),this.current=t,this.dirty=!1)},Oe),ee=((wt=Li)&&(Re.__proto__=wt),((Re.prototype=Object.create(wt&&wt.prototype)).constructor=Re).prototype.getDefault=function(){return!1},Re.prototype.set=function(t){var e;t===this.current&&!this.dirty||(e=this.gl,t?e.enable(e.CULL_FACE):e.disable(e.CULL_FACE),this.current=t,this.dirty=!1)},Re),re=((bt=Li)&&(De.__proto__=bt),((De.prototype=Object.create(bt&&bt.prototype)).constructor=De).prototype.getDefault=function(){return this.gl.BACK},De.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.cullFace(t),this.current=t,this.dirty=!1)},De),ie=((xt=Li)&&(Be.__proto__=xt),((Be.prototype=Object.create(xt&&xt.prototype)).constructor=Be).prototype.getDefault=function(){return this.gl.CCW},Be.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.frontFace(t),this.current=t,this.dirty=!1)},Be),ne=((vt=Li)&&(Le.__proto__=vt),((Le.prototype=Object.create(vt&&vt.prototype)).constructor=Le).prototype.getDefault=function(){return null},Le.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.useProgram(t),this.current=t,this.dirty=!1)},Le),oe=((_t=Li)&&(ze.__proto__=_t),((ze.prototype=Object.create(_t&&_t.prototype)).constructor=ze).prototype.getDefault=function(){return this.gl.TEXTURE0},ze.prototype.set=function(t){t===this.current&&!this.dirty||(this.gl.activeTexture(t),this.current=t,this.dirty=!1)},ze),ae=((gt=Li)&&(ke.__proto__=gt),((ke.prototype=Object.create(gt&&gt.prototype)).constructor=ke).prototype.getDefault=function(){var t=this.gl;return[0,0,t.drawingBufferWidth,t.drawingBufferHeight]},ke.prototype.set=function(t){var e=this.current;t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&!this.dirty||(this.gl.viewport(t[0],t[1],t[2],t[3]),this.current=t,this.dirty=!1)},ke),se=((yt=Li)&&(Me.__proto__=yt),((Me.prototype=Object.create(yt&&yt.prototype)).constructor=Me).prototype.getDefault=function(){return null},Me.prototype.set=function(t){var e;t===this.current&&!this.dirty||((e=this.gl).bindFramebuffer(e.FRAMEBUFFER,t),this.current=t,this.dirty=!1)},Me),ue=((mt=Li)&&(Pe.__proto__=mt),((Pe.prototype=Object.create(mt&&mt.prototype)).constructor=Pe).prototype.getDefault=function(){return null},Pe.prototype.set=function(t){var e;t===this.current&&!this.dirty||((e=this.gl).bindRenderbuffer(e.RENDERBUFFER,t),this.current=t,this.dirty=!1)},Pe),le=((dt=Li)&&(Ce.__proto__=dt),((Ce.prototype=Object.create(dt&&dt.prototype)).constructor=Ce).prototype.getDefault=function(){return null},Ce.prototype.set=function(t){var e;t===this.current&&!this.dirty||((e=this.gl).bindTexture(e.TEXTURE_2D,t),this.current=t,this.dirty=!1)},Ce),ce=((ft=Li)&&(Ae.__proto__=ft),((Ae.prototype=Object.create(ft&&ft.prototype)).constructor=Ae).prototype.getDefault=function(){return null},Ae.prototype.set=function(t){var e;t===this.current&&!this.dirty||((e=this.gl).bindBuffer(e.ARRAY_BUFFER,t),this.current=t,this.dirty=!1)},Ae),pe=((ht=Li)&&(Ie.__proto__=ht),((Ie.prototype=Object.create(ht&&ht.prototype)).constructor=Ie).prototype.getDefault=function(){return null},Ie.prototype.set=function(t){var e=this.gl;e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,t),this.current=t,this.dirty=!1},Ie),he=((pt=Li)&&(Ee.__proto__=pt),((Ee.prototype=Object.create(pt&&pt.prototype)).constructor=Ee).prototype.getDefault=function(){return null},Ee.prototype.set=function(t){this.vao&&(t!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(t),this.current=t,this.dirty=!1)},Ee),fe=((ct=Li)&&(Te.__proto__=ct),((Te.prototype=Object.create(ct&&ct.prototype)).constructor=Te).prototype.getDefault=function(){return 4},Te.prototype.set=function(t){var e;t===this.current&&!this.dirty||((e=this.gl).pixelStorei(e.UNPACK_ALIGNMENT,t),this.current=t,this.dirty=!1)},Te),de=((lt=Li)&&(Se.__proto__=lt),((Se.prototype=Object.create(lt&&lt.prototype)).constructor=Se).prototype.getDefault=function(){return!1},Se.prototype.set=function(t){var e;t===this.current&&!this.dirty||((e=this.gl).pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,t),this.current=t,this.dirty=!1)},Se),me=((ut=Li)&&(we.__proto__=ut),((we.prototype=Object.create(ut&&ut.prototype)).constructor=we).prototype.getDefault=function(){return!1},we.prototype.set=function(t){var e;t===this.current&&!this.dirty||((e=this.gl).pixelStorei(e.UNPACK_FLIP_Y_WEBGL,t),this.current=t,this.dirty=!1)},we),ye=((st=Li)&&(be.__proto__=st),((be.prototype=Object.create(st&&st.prototype)).constructor=be).prototype.getDefault=function(){return null},be),ge=((at=ye)&&(xe.__proto__=at),((xe.prototype=Object.create(at&&at.prototype)).constructor=xe).prototype.setDirty=function(){this.dirty=!0},xe.prototype.set=function(t){var e;t===this.current&&!this.dirty||(this.context.bindFramebuffer.set(this.parent),(e=this.gl).framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,t,0),this.current=t,this.dirty=!1)},xe),_e=((ot=ye)&&(ve.__proto__=ot),((ve.prototype=Object.create(ot&&ot.prototype)).constructor=ve).prototype.set=function(t){var e;t===this.current&&!this.dirty||(this.context.bindFramebuffer.set(this.parent),(e=this.gl).framebufferRenderbuffer(e.FRAMEBUFFER,e.DEPTH_ATTACHMENT,e.RENDERBUFFER,t),this.current=t,this.dirty=!1)},ve);function ve(){ot.apply(this,arguments)}function xe(){at.apply(this,arguments)}function be(t,e){st.call(this,t),this.context=t,this.parent=e}function we(){ut.apply(this,arguments)}function Se(){lt.apply(this,arguments)}function Te(){ct.apply(this,arguments)}function Ee(t){pt.call(this,t),this.vao=t.extVertexArrayObject}function Ie(){ht.apply(this,arguments)}function Ae(){ft.apply(this,arguments)}function Ce(){dt.apply(this,arguments)}function Pe(){mt.apply(this,arguments)}function Me(){yt.apply(this,arguments)}function ke(){gt.apply(this,arguments)}function ze(){_t.apply(this,arguments)}function Le(){vt.apply(this,arguments)}function Be(){xt.apply(this,arguments)}function De(){bt.apply(this,arguments)}function Re(){wt.apply(this,arguments)}function Oe(){St.apply(this,arguments)}function Fe(){Tt.apply(this,arguments)}function je(){Et.apply(this,arguments)}function Ue(){It.apply(this,arguments)}function Ne(){At.apply(this,arguments)}function Ve(){Ct.apply(this,arguments)}function qe(){Pt.apply(this,arguments)}function Ge(){Mt.apply(this,arguments)}function He(){kt.apply(this,arguments)}function Ze(){zt.apply(this,arguments)}function We(){Lt.apply(this,arguments)}function Xe(){Bt.apply(this,arguments)}function Ke(){Dt.apply(this,arguments)}function Je(){Rt.apply(this,arguments)}function Ye(){Ot.apply(this,arguments)}function Qe(){Ft.apply(this,arguments)}nt.prototype.destroy=function(){var t,e=this.context.gl,r=this.colorAttachment.get();r&&e.deleteTexture(r),this.depthAttachment&&(t=this.depthAttachment.get())&&e.deleteRenderbuffer(t),e.deleteFramebuffer(this.framebuffer)};var $e=function(t,e,r){this.func=t,this.mask=e,this.range=r};$e.ReadOnly=!1,$e.ReadWrite=!0,$e.disabled=new $e(519,$e.ReadOnly,[0,1]);var tr=function(t,e,r,i,n,o){this.test=t,this.ref=e,this.mask=r,this.fail=i,this.depthFail=n,this.pass=o};tr.disabled=new tr({func:519,mask:0},0,0,7680,7680,7680);var er=function(t,e,r){this.blendFunction=t,this.blendColor=e,this.mask=r};er.disabled=new er(er.Replace=[1,0],t.Color.transparent,[!1,!1,!1,!1]),er.unblended=new er(er.Replace,t.Color.transparent,[!0,!0,!0,!0]),er.alphaBlended=new er([1,771],t.Color.transparent,[!0,!0,!0,!0]);var rr=function(t,e,r){this.enable=t,this.mode=e,this.frontFace=r};function ir(t){this.gl=t,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new jt(this),this.clearDepth=new Ut(this),this.clearStencil=new Nt(this),this.colorMask=new Vt(this),this.depthMask=new qt(this),this.stencilMask=new Gt(this),this.stencilFunc=new Ht(this),this.stencilOp=new Zt(this),this.stencilTest=new Wt(this),this.depthRange=new Xt(this),this.depthTest=new Kt(this),this.depthFunc=new Jt(this),this.blend=new Yt(this),this.blendFunc=new Qt(this),this.blendColor=new $t(this),this.blendEquation=new te(this),this.cullFace=new ee(this),this.cullFaceSide=new re(this),this.frontFace=new ie(this),this.program=new ne(this),this.activeTexture=new oe(this),this.viewport=new ae(this),this.bindFramebuffer=new se(this),this.bindRenderbuffer=new ue(this),this.bindTexture=new le(this),this.bindVertexBuffer=new ce(this),this.bindElementBuffer=new pe(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new he(this),this.pixelStoreUnpack=new fe(this),this.pixelStoreUnpackPremultiplyAlpha=new de(this),this.pixelStoreUnpackFlipY=new me(this),this.extTextureFilterAnisotropic=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=t.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=t.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(t.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=t.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=t.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE)}rr.disabled=new rr(!1,1029,2305),rr.backCCW=new rr(!0,1029,2305),ir.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()},ir.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},ir.prototype.createIndexBuffer=function(t,e){return new et(this,t,e)},ir.prototype.createVertexBuffer=function(t,e,r){return new rt(this,t,e,r)},ir.prototype.createRenderbuffer=function(t,e,r){var i=this.gl,n=i.createRenderbuffer();return this.bindRenderbuffer.set(n),i.renderbufferStorage(i.RENDERBUFFER,t,e,r),this.bindRenderbuffer.set(null),n},ir.prototype.createFramebuffer=function(t,e,r){return new nt(this,t,e,r)},ir.prototype.clear=function(t){var e=t.color,r=t.depth,i=this.gl;t=0;e&&(t|=i.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==r&&(t|=i.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(r),this.depthMask.set(!0)),i.clear(t)},ir.prototype.setCullFace=function(t){!1===t.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(t.mode),this.frontFace.set(t.frontFace))},ir.prototype.setDepthMode=function(t){t.func!==this.gl.ALWAYS||t.mask?(this.depthTest.set(!0),this.depthFunc.set(t.func),this.depthMask.set(t.mask),this.depthRange.set(t.range)):this.depthTest.set(!1)},ir.prototype.setStencilMode=function(t){t.test.func!==this.gl.ALWAYS||t.mask?(this.stencilTest.set(!0),this.stencilMask.set(t.mask),this.stencilOp.set([t.fail,t.depthFail,t.pass]),this.stencilFunc.set({func:t.test.func,ref:t.ref,mask:t.test.mask})):this.stencilTest.set(!1)},ir.prototype.setColorMode=function(e){t.deepEqual(e.blendFunction,er.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)},ir.prototype.unbindVAO=function(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)};var nr,or=((nr=t.Evented)&&(ar.__proto__=nr),((ar.prototype=Object.create(nr&&nr.prototype)).constructor=ar).prototype.onAdd=function(t){this.map=t,this._maxTileCacheSize=t?t._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(t)},ar.prototype.onRemove=function(t){this._source&&this._source.onRemove&&this._source.onRemove(t)},ar.prototype.loaded=function(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(var t in this._tiles){var e=this._tiles[t];if("loaded"!==e.state&&"errored"!==e.state)return!1}return!0},ar.prototype.getSource=function(){return this._source},ar.prototype.pause=function(){this._paused=!0},ar.prototype.resume=function(){var t;this._paused&&(t=this._shouldReloadOnResume,this._paused=!1,this._shouldReloadOnResume=!1,t&&this.reload(),this.transform&&this.update(this.transform))},ar.prototype._loadTile=function(t,e){return this._source.loadTile(t,e)},ar.prototype._unloadTile=function(t){if(this._source.unloadTile)return this._source.unloadTile(t,(function(){}))},ar.prototype._abortTile=function(t){if(this._source.abortTile)return this._source.abortTile(t,(function(){}))},ar.prototype.serialize=function(){return this._source.serialize()},ar.prototype.prepare=function(t){for(var e in this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null),this._tiles){var r=this._tiles[e];r.upload(t),r.prepare(this.map.style.imageManager)}},ar.prototype.getIds=function(){return t.values(this._tiles).map((function(t){return t.tileID})).sort(sr).map((function(t){return t.key}))},ar.prototype.getRenderableIds=function(e){var r,i=this,n=[];for(r in this._tiles)this._isIdRenderable(r,e)&&n.push(this._tiles[r]);return e?n.sort((function(e,r){var n=e.tileID,o=r.tileID;e=new t.Point(n.canonical.x,n.canonical.y)._rotate(i.transform.angle),r=new t.Point(o.canonical.x,o.canonical.y)._rotate(i.transform.angle);return n.overscaledZ-o.overscaledZ||r.y-e.y||r.x-e.x})).map((function(t){return t.tileID.key})):n.map((function(t){return t.tileID})).sort(sr).map((function(t){return t.key}))},ar.prototype.hasRenderableParent=function(t){return!!(t=this.findLoadedParent(t,0))&&this._isIdRenderable(t.tileID.key)},ar.prototype._isIdRenderable=function(t,e){return this._tiles[t]&&this._tiles[t].hasData()&&!this._coveredTiles[t]&&(e||!this._tiles[t].holdingForFade())},ar.prototype.reload=function(){if(this._paused)this._shouldReloadOnResume=!0;else for(var t in this._cache.reset(),this._tiles)"errored"!==this._tiles[t].state&&this._reloadTile(t,"reloading")},ar.prototype._reloadTile=function(t,e){var r=this._tiles[t];r&&("loading"!==r.state&&(r.state=e),this._loadTile(r,this._tileLoaded.bind(this,r,t,e)))},ar.prototype._tileLoaded=function(e,r,i,n){if(n)return e.state="errored",void(404!==n.status?this._source.fire(new t.ErrorEvent(n,{tile:e})):this.update(this.transform));e.timeAdded=t.browser.now(),"expired"===i&&(e.refreshedUponExpiration=!0),this._setTileReloadTimer(r,e),"raster-dem"===this.getSource().type&&e.dem&&this._backfillDEM(e),this._state.initializeTileState(e,this.map?this.map.painter:null),this._source.fire(new t.Event("data",{dataType:"source",tile:e,coord:e.tileID}))},ar.prototype._backfillDEM=function(t){for(var e=this.getRenderableIds(),r=0;r<e.length;r++){var i=e[r];t.neighboringTiles&&t.neighboringTiles[i]&&(n(t,i=this.getTileByID(i)),n(i,t))}function n(t,e){t.needsHillshadePrepare=!0;var r=e.tileID.canonical.x-t.tileID.canonical.x,i=e.tileID.canonical.y-t.tileID.canonical.y,n=Math.pow(2,t.tileID.canonical.z),o=e.tileID.key;0===r&&0==i||1<Math.abs(i)||(1<Math.abs(r)&&(1===Math.abs(r+n)?r+=n:1===Math.abs(r-n)&&(r-=n)),e.dem&&t.dem&&(t.dem.backfillBorder(e.dem,r,i),t.neighboringTiles&&t.neighboringTiles[o]&&(t.neighboringTiles[o].backfilled=!0)))}},ar.prototype.getTile=function(t){return this.getTileByID(t.key)},ar.prototype.getTileByID=function(t){return this._tiles[t]},ar.prototype._retainLoadedChildren=function(t,e,r,i){for(var n in this._tiles){var o=this._tiles[n];if(!(i[n]||!o.hasData()||o.tileID.overscaledZ<=e||o.tileID.overscaledZ>r)){for(var a=o.tileID;o&&o.tileID.overscaledZ>e+1;){var s=o.tileID.scaledTo(o.tileID.overscaledZ-1);(o=this._tiles[s.key])&&o.hasData()&&(a=s)}for(var u=a;u.overscaledZ>e;)if(t[(u=u.scaledTo(u.overscaledZ-1)).key]){i[a.key]=a;break}}}},ar.prototype.findLoadedParent=function(t,e){if(t.key in this._loadedParentTiles){var r=this._loadedParentTiles[t.key];return r&&r.tileID.overscaledZ>=e?r:null}for(var i=t.overscaledZ-1;e<=i;i--){var n=t.scaledTo(i);if(n=this._getLoadedTile(n))return n}},ar.prototype._getLoadedTile=function(t){var e=this._tiles[t.key];return e&&e.hasData()?e:this._cache.getByKey(t.wrapped().key)},ar.prototype.updateCacheSize=function(t){var e=Math.ceil(t.width/this._source.tileSize)+1;t=Math.ceil(t.height/this._source.tileSize)+1,t=Math.floor(e*t*5),t="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,t):t;this._cache.setMaxSize(t)},ar.prototype.handleWrapJump=function(t){var e=Math.round((t-(void 0===this._prevLng?t:this._prevLng))/360);if(this._prevLng=t,e){var r,i,n,o={};for(r in this._tiles){var a=this._tiles[r];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+e),o[a.tileID.key]=a}for(i in this._tiles=o,this._timers)clearTimeout(this._timers[i]),delete this._timers[i];for(n in this._tiles)this._setTileReloadTimer(n,this._tiles[n])}},ar.prototype.update=function(e){var r,i=this;if(this.transform=e,this._sourceLoaded&&!this._paused){this.updateCacheSize(e),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used?this._source.tileID?r=e.getVisibleUnwrappedCoordinates(this._source.tileID).map((function(e){return new t.OverscaledTileID(e.canonical.z,e.wrap,e.canonical.z,e.canonical.x,e.canonical.y)})):(r=e.coveringTiles({tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled}),this._source.hasTile&&(r=r.filter((function(t){return i._source.hasTile(t)})))):r=[];var n,o=e.coveringZoomLevel(this._source),a=Math.max(o-ar.maxOverzooming,this._source.minzoom),s=(e=Math.max(o+ar.maxUnderzooming,this._source.minzoom),this._updateRetainedTiles(r,o));if(ur(this._source.type)){for(var u,l={},c={},p=0,h=Object.keys(s);p<h.length;p+=1){var f=h[p],d=s[f],m=this._tiles[f];!m||m.fadeEndTime&&m.fadeEndTime<=t.browser.now()||((m=this.findLoadedParent(d,a))&&(this._addTile(m.tileID),l[m.tileID.key]=m.tileID),c[f]=d)}for(u in this._retainLoadedChildren(c,o,e,s),l)s[u]||(this._coveredTiles[u]=!0,s[u]=l[u])}for(n in s)this._tiles[n].clearFadeHold();for(var y=0,g=t.keysDifference(this._tiles,s);y<g.length;y+=1){var _=g[y],v=this._tiles[_];v.hasSymbolBuckets&&!v.holdingForFade()?v.setHoldDuration(this.map._fadeDuration):v.hasSymbolBuckets&&!v.symbolFadeFinished()||this._removeTile(_)}this._updateLoadedParentTileCache()}},ar.prototype.releaseSymbolFadeTiles=function(){for(var t in this._tiles)this._tiles[t].holdingForFade()&&this._removeTile(t)},ar.prototype._updateRetainedTiles=function(t,e){for(var r={},i={},n=Math.max(e-ar.maxOverzooming,this._source.minzoom),o=Math.max(e+ar.maxUnderzooming,this._source.minzoom),a={},s=0,u=t;s<u.length;s+=1){var l=u[s],c=this._addTile(l);r[l.key]=l,c.hasData()||e<this._source.maxzoom&&(a[l.key]=l)}this._retainLoadedChildren(a,e,o,r);for(var p=0,h=t;p<h.length;p+=1){var f=h[p],d=this._tiles[f.key];if(!d.hasData()){if(e+1>this._source.maxzoom){var m=f.children(this._source.maxzoom)[0],y=this.getTile(m);if(y&&y.hasData()){r[m.key]=m;continue}}else if(r[(m=f.children(this._source.maxzoom))[0].key]&&r[m[1].key]&&r[m[2].key]&&r[m[3].key])continue;for(var g=d.wasRequested(),_=f.overscaledZ-1;n<=_;--_){var v=f.scaledTo(_);if(i[v.key])break;if(i[v.key]=!0,!(d=this.getTile(v))&&g&&(d=this._addTile(v)),d&&(r[v.key]=v,g=d.wasRequested(),d.hasData()))break}}}return r},ar.prototype._updateLoadedParentTileCache=function(){for(var t in this._loadedParentTiles={},this._tiles){for(var e=[],r=void 0,i=this._tiles[t].tileID;0<i.overscaledZ;){if(i.key in this._loadedParentTiles){r=this._loadedParentTiles[i.key];break}e.push(i.key);var n=i.scaledTo(i.overscaledZ-1);if(r=this._getLoadedTile(n))break;i=n}for(var o=0,a=e;o<a.length;o+=1)this._loadedParentTiles[a[o]]=r}},ar.prototype._addTile=function(e){var r=this._tiles[e.key];if(r)return r;(r=this._cache.getAndRemove(e))&&(this._setTileReloadTimer(e.key,r),r.tileID=e,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[e.key]&&(clearTimeout(this._cacheTimers[e.key]),delete this._cacheTimers[e.key],this._setTileReloadTimer(e.key,r)));var i=Boolean(r);return i||(r=new t.Tile(e,this._source.tileSize*e.overscaleFactor()),this._loadTile(r,this._tileLoaded.bind(this,r,e.key,r.state))),r?(r.uses++,this._tiles[e.key]=r,i||this._source.fire(new t.Event("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r):null},ar.prototype._setTileReloadTimer=function(t,e){var r=this;t in this._timers&&(clearTimeout(this._timers[t]),delete this._timers[t]),(e=e.getExpiryTimeout())&&(this._timers[t]=setTimeout((function(){r._reloadTile(t,"expired"),delete r._timers[t]}),e))},ar.prototype._removeTile=function(t){var e=this._tiles[t];e&&(e.uses--,delete this._tiles[t],this._timers[t]&&(clearTimeout(this._timers[t]),delete this._timers[t]),0<e.uses||(e.hasData()&&"reloading"!==e.state?this._cache.add(e.tileID,e,e.getExpiryTimeout()):(e.aborted=!0,this._abortTile(e),this._unloadTile(e))))},ar.prototype.clearTiles=function(){for(var t in this._shouldReloadOnResume=!1,this._paused=!1,this._tiles)this._removeTile(t);this._cache.reset()},ar.prototype.tilesIn=function(e,r,i){var n=this,o=[],a=this.transform;if(!a)return o;i=i?a.getCameraQueryGeometry(e):e;for(var s=e.map((function(t){return a.pointCoordinate(t)})),u=i.map((function(t){return a.pointCoordinate(t)})),l=this.getIds(),c=1/0,p=1/0,h=-1/0,f=-1/0,d=0,m=u;d<m.length;d+=1){var y=m[d];c=Math.min(c,y.x),p=Math.min(p,y.y),h=Math.max(h,y.x),f=Math.max(f,y.y)}for(var g=0;g<l.length;g++)!function(e){var i,d,m,y=n._tiles[l[e]];y.holdingForFade()||(i=y.tileID,d=Math.pow(2,a.zoom-y.tileID.overscaledZ),m=r*y.queryPadding*t.EXTENT/y.tileSize/d,(e=[i.getTilePoint(new t.MercatorCoordinate(c,p)),i.getTilePoint(new t.MercatorCoordinate(h,f))])[0].x-m<t.EXTENT&&e[0].y-m<t.EXTENT&&0<=e[1].x+m&&0<=e[1].y+m&&(e=s.map((function(t){return i.getTilePoint(t)})),m=u.map((function(t){return i.getTilePoint(t)})),o.push({tile:y,tileID:i,queryGeometry:e,cameraQueryGeometry:m,scale:d})))}(g);return o},ar.prototype.getVisibleCoordinates=function(t){for(var e=this,r=0,i=t=this.getRenderableIds(t).map((function(t){return e._tiles[t].tileID}));r<i.length;r+=1){var n=i[r];n.posMatrix=this.transform.calculatePosMatrix(n.toUnwrapped())}return t},ar.prototype.hasTransition=function(){if(this._source.hasTransition())return!0;if(ur(this._source.type))for(var e in this._tiles){var r=this._tiles[e];if(void 0!==r.fadeEndTime&&r.fadeEndTime>=t.browser.now())return!0}return!1},ar.prototype.setFeatureState=function(t,e,r){this._state.updateState(t=t||"_geojsonTileLayer",e,r)},ar.prototype.removeFeatureState=function(t,e,r){this._state.removeFeatureState(t=t||"_geojsonTileLayer",e,r)},ar.prototype.getFeatureState=function(t,e){return this._state.getState(t=t||"_geojsonTileLayer",e)},ar.prototype.setDependencies=function(t,e,r){(t=this._tiles[t])&&t.setDependencies(e,r)},ar.prototype.reloadTilesForDependencies=function(t,e){for(var r in this._tiles)this._tiles[r].hasDependency(t,e)&&this._reloadTile(r,"reloading");this._cache.filter((function(r){return!r.hasDependency(t,e)}))},ar);function ar(e,r,i){var n=this;nr.call(this),this.id=e,this.dispatcher=i,this.on("data",(function(t){"source"===t.dataType&&"metadata"===t.sourceDataType&&(n._sourceLoaded=!0),n._sourceLoaded&&!n._paused&&"source"===t.dataType&&"content"===t.sourceDataType&&(n.reload(),n.transform&&n.update(n.transform))})),this.on("error",(function(){n._sourceErrored=!0})),this._source=function(e,n){if((n=new G[r.type](e,r,i,n)).id!==e)throw new Error("Expected Source id to be "+e+" instead of "+n.id);return t.bindAll(["load","abort","unload","serialize","prepare"],n),n}(e,this),this._tiles={},this._cache=new tt(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new t.SourceFeatureState}function sr(t,e){var r=Math.abs(2*t.wrap)-(t.wrap<0),i=Math.abs(2*e.wrap)-(e.wrap<0);return t.overscaledZ-e.overscaledZ||i-r||e.canonical.y-t.canonical.y||e.canonical.x-t.canonical.x}function ur(t){return"raster"===t||"image"===t||"video"===t}function lr(){return new t.window.Worker(na.workerUrl)}or.maxOverzooming=10,or.maxUnderzooming=3;var cr="mapboxgl_preloaded_worker_pool",pr=function(){this.active={}};pr.prototype.acquire=function(t){if(!this.workers)for(this.workers=[];this.workers.length<pr.workerCount;)this.workers.push(new lr);return this.active[t]=!0,this.workers.slice()},pr.prototype.release=function(t){delete this.active[t],0===this.numActive()&&(this.workers.forEach((function(t){t.terminate()})),this.workers=null)},pr.prototype.isPreloaded=function(){return!!this.active[cr]},pr.prototype.numActive=function(){return Object.keys(this.active).length};var hr,fr=Math.floor(t.browser.hardwareConcurrency/2);function dr(){return hr=hr||new pr}function mr(e){e=e.slice();for(var r=Object.create(null),i=0;i<e.length;i++)r[e[i].id]=e[i];for(var n=0;n<e.length;n++)"ref"in e[n]&&(e[n]=function(e,r){var i,n={};for(i in e)"ref"!==i&&(n[i]=e[i]);return t.refProperties.forEach((function(t){t in r&&(n[t]=r[t])})),n}(e[n],r[e[n].ref]));return e}pr.workerCount=Math.max(Math.min(fr,6),1);var yr={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 gr(t,e,r){r.push({command:yr.addSource,args:[t,e[t]]})}function _r(t,e,r){e.push({command:yr.removeSource,args:[t]}),r[t]=!0}function vr(e,r,i,n,o,a){for(var s in r=r||{},e=e||{})e.hasOwnProperty(s)&&(t.deepEqual(e[s],r[s])||i.push({command:a,args:[n,s,r[s],o]}));for(s in r)r.hasOwnProperty(s)&&!e.hasOwnProperty(s)&&(t.deepEqual(e[s],r[s])||i.push({command:a,args:[n,s,r[s],o]}))}function xr(t){return t.id}function br(t,e){return t[e.id]=e,t}function wr(t,e){this.reset(t,e)}function Sr(t,e,r){var i=this.boxCells=[],n=this.circleCells=[];this.xCellCount=Math.ceil(t/r),this.yCellCount=Math.ceil(e/r);for(var o=0;o<this.xCellCount*this.yCellCount;o++)i.push([]),n.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=t,this.height=e,this.xScale=this.xCellCount/t,this.yScale=this.yCellCount/e,this.boxUid=0,this.circleUid=0}function Tr(e,r,i,n,o){var a=t.create();return r?(t.scale(a,a,[1/o,1/o,1]),i||t.rotateZ(a,a,n.angle)):t.multiply(a,n.labelPlaneMatrix,e),a}function Er(e,r,i,n,o){return r?(e=t.clone(e),t.scale(e,e,[o,o,1]),i||t.rotateZ(e,e,-n.angle),e):n.glCoordMatrix}function Ir(e,r){return Dr(e=[e.x,e.y,0,1],e,r),r=e[3],{point:new t.Point(e[0]/r,e[1]/r),signedDistanceFromCamera:r}}function Ar(t,e){return.5+t/e*.5}function Cr(t,e,r,i,n,o,a,s,u,l,c){var p=s.glyphStartIndex+s.numGlyphs,h=s.lineStartIndex,f=s.lineStartIndex+s.lineLength,d=e.getoffsetX(s.glyphStartIndex);p=e.getoffsetX(p-1);return(d=zr(t*d,r,i,n,o,a,s.segment,h,f,u,l,c))&&(c=zr(t*p,r,i,n,o,a,s.segment,h,f,u,l,c))?{first:d,last:c}:null}function Pr(e,r,i,n){return e===t.WritingMode.horizontal&&Math.abs(i.y-r.y)>Math.abs(i.x-r.x)*n?{useVertical:!0}:(e===t.WritingMode.vertical?r.y<i.y:r.x>i.x)?{needsFlipping:!0}:null}function Mr(e,r,i,n,o,a,s,u,l,c,p,h,f,d){var m,y=r/24,g=e.lineOffsetX*y,_=e.lineOffsetY*y;if(1<e.numGlyphs){var v=e.glyphStartIndex+e.numGlyphs,x=e.lineStartIndex,b=e.lineStartIndex+e.lineLength;if(!(S=Cr(y,u,g,_,i,p,h,e,l,a,f)))return{notEnoughRoom:!0};if(r=Ir(S.first.point,s).point,s=Ir(S.last.point,s).point,n&&!i&&(s=Pr(e.writingMode,r,s,d)))return s;m=[S.first];for(var w=e.glyphStartIndex+1;w<v-1;w++)m.push(zr(y*u.getoffsetX(w),g,_,i,p,h,e.segment,x,b,l,a,f));m.push(S.last)}else{if(n&&!i){var S=Ir(h,o).point,T=(n=e.lineStartIndex+e.segment+1,0<(n=Ir(T=new t.Point(l.getx(n),l.gety(n)),o)).signedDistanceFromCamera?n.point:kr(h,T,S,1,o));if(T=Pr(e.writingMode,S,T,d))return T}if(!(T=zr(y*u.getoffsetX(e.glyphStartIndex),g,_,i,p,h,e.segment,e.lineStartIndex,e.lineStartIndex+e.lineLength,l,a,f)))return{notEnoughRoom:!0};m=[T]}for(var E=0,I=m;E<I.length;E+=1){var A=I[E];t.addDynamicAttributes(c,A.point,A.angle)}return{}}function kr(t,e,r,i,n){return n=Ir(t.add(t.sub(e)._unit()),n).point,n=r.sub(n),r.add(n._mult(i/n.mag()))}function zr(e,r,i,n,o,a,s,u,l,c,p,h){var f=0<(e=n?e-r:e+r)?1:-1;r=0;n&&(f*=-1,r=Math.PI),f<0&&(r+=Math.PI);for(var d=0<f?u+s:u+s+1,m=o,y=o,g=0,_=0,v=Math.abs(e),x=[];g+_<=v;){if((d+=f)<u||l<=d)return null;var b,w;y=m;x.push(m),void 0===(m=h[d])&&(m=0<(w=Ir(b=new t.Point(c.getx(d),c.gety(d)),p)).signedDistanceFromCamera?h[d]=w.point:(w=d-f,kr(0===g?a:new t.Point(c.getx(w),c.gety(w)),b,y,v-g+1,p))),g+=_,_=y.dist(m)}return o=(v-g)/_,(o=(e=m.sub(y)).mult(o)._add(y))._add(e._unit()._perp()._mult(i*f)),r+=Math.atan2(m.y-y.y,m.x-y.x),x.push(o),{point:o,angle:r,path:x}}wr.prototype.reset=function(t,e){this.points=t||[],this._distances=[0];for(var r=1;r<this.points.length;r++)this._distances[r]=this._distances[r-1]+this.points[r].dist(this.points[r-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(e||0,.5*this.length),this.paddedLength=this.length-2*this.padding},wr.prototype.lerp=function(e){if(1===this.points.length)return this.points[0];e=t.clamp(e,0,1);for(var r=1,i=this._distances[r],n=e*this.paddedLength+this.padding;i<n&&r<this._distances.length;)i=this._distances[++r];var o=r-1,a=this._distances[o];e=0<(e=i-a)?(n-a)/e:0;return this.points[o].mult(1-e).add(this.points[r].mult(e))},Sr.prototype.keysLength=function(){return this.boxKeys.length+this.circleKeys.length},Sr.prototype.insert=function(t,e,r,i,n){this._forEachCell(e,r,i,n,this._insertBoxCell,this.boxUid++),this.boxKeys.push(t),this.bboxes.push(e),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)},Sr.prototype.insertCircle=function(t,e,r,i){this._forEachCell(e-i,r-i,e+i,r+i,this._insertCircleCell,this.circleUid++),this.circleKeys.push(t),this.circles.push(e),this.circles.push(r),this.circles.push(i)},Sr.prototype._insertBoxCell=function(t,e,r,i,n,o){this.boxCells[n].push(o)},Sr.prototype._insertCircleCell=function(t,e,r,i,n,o){this.circleCells[n].push(o)},Sr.prototype._query=function(t,e,r,i,n,o){if(r<0||t>this.width||i<0||e>this.height)return!n&&[];var a=[];if(t<=0&&e<=0&&this.width<=r&&this.height<=i){if(n)return!0;for(var s=0;s<this.boxKeys.length;s++)a.push({key:this.boxKeys[s],x1:this.bboxes[4*s],y1:this.bboxes[4*s+1],x2:this.bboxes[4*s+2],y2:this.bboxes[4*s+3]});for(var u=0;u<this.circleKeys.length;u++){var l=this.circles[3*u],c=this.circles[3*u+1],p=this.circles[3*u+2];a.push({key:this.circleKeys[u],x1:l-p,y1:c-p,x2:l+p,y2:c+p})}return o?a.filter(o):a}return this._forEachCell(t,e,r,i,this._queryCell,a,{hitTest:n,seenUids:{box:{},circle:{}}},o),n?0<a.length:a},Sr.prototype._queryCircle=function(t,e,r,i,n){var o=t-r,a=t+r,s=e-r,u=e+r;if(a<0||o>this.width||u<0||s>this.height)return!i&&[];var l=[];return this._forEachCell(o,s,a,u,this._queryCellCircle,l,{hitTest:i,circle:{x:t,y:e,radius:r},seenUids:{box:{},circle:{}}},n),i?0<l.length:l},Sr.prototype.query=function(t,e,r,i,n){return this._query(t,e,r,i,!1,n)},Sr.prototype.hitTest=function(t,e,r,i,n){return this._query(t,e,r,i,!0,n)},Sr.prototype.hitTestCircle=function(t,e,r,i){return this._queryCircle(t,e,r,!0,i)},Sr.prototype._queryCell=function(t,e,r,i,n,o,a,s){var u=a.seenUids,l=this.boxCells[n];if(null!==l)for(var c=this.bboxes,p=0,h=l;p<h.length;p+=1){var f=h[p];if(!u.box[f]){u.box[f]=!0;var d=4*f;if(t<=c[2+d]&&e<=c[3+d]&&r>=c[0+d]&&i>=c[1+d]&&(!s||s(this.boxKeys[f]))){if(a.hitTest)return o.push(!0),!0;o.push({key:this.boxKeys[f],x1:c[d],y1:c[1+d],x2:c[2+d],y2:c[3+d]})}}}if(null!==(n=this.circleCells[n]))for(var m=this.circles,y=0,g=n;y<g.length;y+=1){var _=g[y];if(!u.circle[_]){u.circle[_]=!0;var v=3*_;if(this._circleAndRectCollide(m[v],m[1+v],m[2+v],t,e,r,i)&&(!s||s(this.circleKeys[_]))){if(a.hitTest)return o.push(!0),!0;var x=m[v],b=m[1+v];v=m[2+v];o.push({key:this.circleKeys[_],x1:x-v,y1:b-v,x2:x+v,y2:b+v})}}}},Sr.prototype._queryCellCircle=function(t,e,r,i,n,o,a,s){var u=a.circle,l=a.seenUids;if(null!==(a=this.boxCells[n]))for(var c=this.bboxes,p=0,h=a;p<h.length;p+=1){var f=h[p];if(!l.box[f]){l.box[f]=!0;var d=4*f;if(this._circleAndRectCollide(u.x,u.y,u.radius,c[0+d],c[1+d],c[2+d],c[3+d])&&(!s||s(this.boxKeys[f])))return o.push(!0),!0}}if(null!==(n=this.circleCells[n]))for(var m=this.circles,y=0,g=n;y<g.length;y+=1){var _=g[y];if(!l.circle[_]){l.circle[_]=!0;var v=3*_;if(this._circlesCollide(m[v],m[1+v],m[2+v],u.x,u.y,u.radius)&&(!s||s(this.circleKeys[_])))return o.push(!0),!0}}},Sr.prototype._forEachCell=function(t,e,r,i,n,o,a,s){for(var u=this._convertToXCellCoord(t),l=this._convertToYCellCoord(e),c=this._convertToXCellCoord(r),p=this._convertToYCellCoord(i),h=u;h<=c;h++)for(var f=l;f<=p;f++)if(n.call(this,t,e,r,i,this.xCellCount*f+h,o,a,s))return},Sr.prototype._convertToXCellCoord=function(t){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(t*this.xScale)))},Sr.prototype._convertToYCellCoord=function(t){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(t*this.yScale)))},Sr.prototype._circlesCollide=function(t,e,r,i,n,o){return(t=i-t)*t+(e=n-e)*e<(o=r+o)*o},Sr.prototype._circleAndRectCollide=function(t,e,r,i,n,o,a){return!((o=(o-i)/2)+r<(i=Math.abs(t-(i+o))))&&(!((a=(a-n)/2)+r<(n=Math.abs(e-(n+a))))&&(i<=o||n<=a||(o=i-o)*o+(a=n-a)*a<=r*r))};var Lr=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function Br(t,e){for(var r=0;r<t;r++){var i=e.length;e.resize(i+4),e.float32.set(Lr,3*i)}}function Dr(t,e,r){var i=e[0];e=e[1];return t[0]=r[0]*i+r[4]*e+r[12],t[1]=r[1]*i+r[5]*e+r[13],t[3]=r[3]*i+r[7]*e+r[15],t}function Rr(t,e,r){void 0===e&&(e=new Sr(t.width+200,t.height+200,25)),void 0===r&&(r=new Sr(t.width+200,t.height+200,25)),this.transform=t,this.grid=e,this.ignoredGrid=r,this.pitchfactor=Math.cos(t._pitch)*t.cameraToCenterDistance,this.screenRightBoundary=t.width+100,this.screenBottomBoundary=t.height+100,this.gridRightBoundary=t.width+200,this.gridBottomBoundary=t.height+200}function Or(e,r,i){return r*(t.EXTENT/(e.tileSize*Math.pow(2,i-e.tileID.overscaledZ)))}function Fr(t,e,r,i){this.opacity=t?Math.max(0,Math.min(1,t.opacity+(t.placed?e:-e))):i&&r?1:0,this.placed=r}function jr(t,e,r,i,n){this.text=new Fr(t?t.text:null,e,r,n),this.icon=new Fr(t?t.icon:null,e,i,n)}function Ur(t,e,r){this.text=t,this.icon=e,this.skipFade=r}function Nr(){this.invProjMatrix=t.create(),this.viewportMatrix=t.create(),this.circles=[]}function Vr(t,e,r,i,n){this.bucketInstanceId=t,this.featureIndex=e,this.sourceLayerIndex=r,this.bucketIndex=i,this.tileID=n}function qr(t){this.crossSourceCollisions=t,this.maxGroupID=0,this.collisionGroups={}}function Gr(e,r,i,n,o){var a=t.getAnchorAlignment(e);r=-(a.horizontalAlign-.5)*r,i=-(a.verticalAlign-.5)*i,n=t.evaluateVariableOffset(e,n);return new t.Point(r+n[0]*o,i+n[1]*o)}function Hr(e,r,i,n,o,a){var s=e.x1,u=e.x2,l=e.y1,c=e.y2,p=e.anchorPointX;e=e.anchorPointY,i=new t.Point(r,i);return n&&i._rotate(o?a:-a),{x1:s+i.x,y1:l+i.y,x2:u+i.x,y2:c+i.y,anchorPointX:p,anchorPointY:e}}function Zr(t,e,r,i){this.transform=t.clone(),this.collisionIndex=new Rr(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=e,this.retainedQueryData={},this.collisionGroups=new qr(r),this.collisionCircleArrays={},(this.prevPlacement=i)&&(i.prevPlacement=void 0),this.placedOrientations={}}function Wr(t,e,r,i,n){t.emplaceBack(e?1:0,r?1:0,i||0,n||0),t.emplaceBack(e?1:0,r?1:0,i||0,n||0),t.emplaceBack(e?1:0,r?1:0,i||0,n||0),t.emplaceBack(e?1:0,r?1:0,i||0,n||0)}Rr.prototype.placeCollisionBox=function(t,e,r,i,n){var o=r*(s=this.projectAndGetPerspectiveRatio(i,t.anchorPointX,t.anchorPointY)).perspectiveRatio,a=t.x1*o+s.point.x,s=(i=t.y1*o+s.point.y,r=t.x2*o+s.point.x,t.y2*o+s.point.y);return!this.isInsideGrid(a,i,r,s)||!e&&this.grid.hitTest(a,i,r,s,n)?{box:[],offscreen:!1}:{box:[a,i,r,s],offscreen:this.isOffscreen(a,i,r,s)}},Rr.prototype.placeCollisionCircles=function(e,r,i,n,o,a,s,u,l,c,p,h,f){var d=[],m=new t.Point(r.anchorX,r.anchorY),y=(a=Ir(m,a),a=Ar(this.transform.cameraToCenterDistance,a.signedDistanceFromCamera),c=(c?o/a:o*a)/t.ONE_EM,o=Ir(m,s).point,!1),g=!1,_=!0;if(s=Cr(c,n,r.lineOffsetX*c,r.lineOffsetY*c,!1,o,m,r,i,s,{})){for(var v=.5*h*a+f,x=(a=new t.Point(-100,-100),f=new t.Point(this.screenRightBoundary,this.screenBottomBoundary),new wr),b=s.first,w=s.last,S=[],T=b.path.length-1;1<=T;T--)S.push(b.path[T]);for(var E=1;E<w.path.length;E++)S.push(w.path[E]);var I=2.5*v;u&&(S=(A=S.map((function(t){return Ir(t,u)}))).some((function(t){return t.signedDistanceFromCamera<=0}))?[]:A.map((function(t){return t.point})));var A=[];if(0<S.length){for(var C=S[0].clone(),P=S[0].clone(),M=1;M<S.length;M++)C.x=Math.min(C.x,S[M].x),C.y=Math.min(C.y,S[M].y),P.x=Math.max(P.x,S[M].x),P.y=Math.max(P.y,S[M].y);A=C.x>=a.x&&P.x<=f.x&&C.y>=a.y&&P.y<=f.y?[S]:P.x<a.x||C.x>f.x||P.y<a.y||C.y>f.y?[]:t.clipLine([S],a.x,a.y,f.x,f.y)}for(var k,z=0,L=A;z<L.length;z+=1){x.reset(L[z],.25*v),k=x.length<=.5*v?1:Math.ceil(x.paddedLength/I)+1;for(var B=0;B<k;B++){var D=B/Math.max(k-1,1),R=(U=x.lerp(D)).x+100,O=U.y+100;d.push(R,O,v,0);var F=R-v,j=O-v,U=(D=R+v,O+v);_=_&&this.isOffscreen(F,j,D,U),g=g||this.isInsideGrid(F,j,D,U);if(!e&&this.grid.hitTestCircle(R,O,v,p)&&(y=!0,!l))return{circles:[],offscreen:!1,collisionDetected:y}}}}return{circles:!l&&y||!g?[]:d,offscreen:_,collisionDetected:y}},Rr.prototype.queryRenderedSymbols=function(e){if(0===e.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};for(var r=[],i=1/0,n=1/0,o=-1/0,a=-1/0,s=0,u=e;s<u.length;s+=1){var l=u[s];l=new t.Point(l.x+100,l.y+100),i=Math.min(i,l.x),n=Math.min(n,l.y),o=Math.max(o,l.x),a=Math.max(a,l.y);r.push(l)}for(var c={},p={},h=0,f=this.grid.query(i,n,o,a).concat(this.ignoredGrid.query(i,n,o,a));h<f.length;h+=1){var d=f[h],m=d.key;void 0===c[m.bucketInstanceId]&&(c[m.bucketInstanceId]={}),c[m.bucketInstanceId][m.featureIndex]||(d=[new t.Point(d.x1,d.y1),new t.Point(d.x2,d.y1),new t.Point(d.x2,d.y2),new t.Point(d.x1,d.y2)],t.polygonIntersectsPolygon(r,d)&&(c[m.bucketInstanceId][m.featureIndex]=!0,void 0===p[m.bucketInstanceId]&&(p[m.bucketInstanceId]=[]),p[m.bucketInstanceId].push(m.featureIndex)))}return p},Rr.prototype.insertCollisionBox=function(t,e,r,i,n){(e?this.ignoredGrid:this.grid).insert({bucketInstanceId:r,featureIndex:i,collisionGroupID:n},t[0],t[1],t[2],t[3])},Rr.prototype.insertCollisionCircles=function(t,e,r,i,n){for(var o=e?this.ignoredGrid:this.grid,a={bucketInstanceId:r,featureIndex:i,collisionGroupID:n},s=0;s<t.length;s+=4)o.insertCircle(a,t[s],t[s+1],t[s+2])},Rr.prototype.projectAndGetPerspectiveRatio=function(e,r,i){return Dr(i=[r,i,0,1],i,e),{point:new t.Point((i[0]/i[3]+1)/2*this.transform.width+100,(-i[1]/i[3]+1)/2*this.transform.height+100),perspectiveRatio:.5+this.transform.cameraToCenterDistance/i[3]*.5}},Rr.prototype.isOffscreen=function(t,e,r,i){return r<100||t>=this.screenRightBoundary||i<100||e>this.screenBottomBoundary},Rr.prototype.isInsideGrid=function(t,e,r,i){return 0<=r&&t<this.gridRightBoundary&&0<=i&&e<this.gridBottomBoundary},Rr.prototype.getViewportMatrix=function(){var e=t.identity([]);return t.translate(e,e,[-100,-100,0]),e},Fr.prototype.isHidden=function(){return 0===this.opacity&&!this.placed},jr.prototype.isHidden=function(){return this.text.isHidden()&&this.icon.isHidden()},qr.prototype.get=function(t){return this.crossSourceCollisions?{ID:0,predicate:null}:(this.collisionGroups[t]||(e=++this.maxGroupID,this.collisionGroups[t]={ID:e,predicate:function(t){return t.collisionGroupID===e}}),this.collisionGroups[t]);var e},Zr.prototype.getBucketParts=function(e,r,i,n){var o=i.getBucket(r),a=i.latestFeatureIndex;if(o&&a&&r.id===o.layerIds[0]){var s=i.collisionBoxArray,u=o.layers[0].layout,l=Math.pow(2,this.transform.zoom-i.tileID.overscaledZ),c=i.tileSize/t.EXTENT,p=this.transform.calculatePosMatrix(i.tileID.toUnwrapped()),h="map"===u.get("text-pitch-alignment"),f="map"===u.get("text-rotation-alignment"),d=Or(i,1,this.transform.zoom),m=Tr(p,h,f,this.transform,d);r=null;h&&(d=Er(p,h,f,this.transform,d),r=t.multiply([],this.transform.labelPlaneMatrix,d)),this.retainedQueryData[o.bucketInstanceId]=new Vr(o.bucketInstanceId,a,o.sourceLayerIndex,o.index,i.tileID);var y={bucket:o,layout:u,posMatrix:p,textLabelPlaneMatrix:m,labelToScreenMatrix:r,scale:l,textPixelRatio:c,holdingForFade:i.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:t.evaluateSizeForZoom(o.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(o.sourceID)};if(n)for(var g=0,_=o.sortKeyRanges;g<_.length;g+=1){var v=_[g];e.push({sortKey:v.sortKey,symbolInstanceStart:v.symbolInstanceStart,symbolInstanceEnd:v.symbolInstanceEnd,parameters:y})}else e.push({symbolInstanceStart:0,symbolInstanceEnd:o.symbolInstances.length,parameters:y})}},Zr.prototype.attemptAnchorPlacement=function(t,e,r,i,n,o,a,s,u,l,c,p,h,f,d){var m,y=[p.textOffset0,p.textOffset1],g=Gr(t,r,i,y,n);e=this.collisionIndex.placeCollisionBox(Hr(e,g.x,g.y,o,a,this.transform.angle),c,s,u,l.predicate);if(!d||0!==this.collisionIndex.placeCollisionBox(Hr(d,g.x,g.y,o,a,this.transform.angle),c,s,u,l.predicate).box.length)return 0<e.box.length?(this.prevPlacement&&this.prevPlacement.variableOffsets[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID]&&this.prevPlacement.placements[p.crossTileID].text&&(m=this.prevPlacement.variableOffsets[p.crossTileID].anchor),this.variableOffsets[p.crossTileID]={textOffset:y,width:r,height:i,anchor:t,textBoxScale:n,prevAnchor:m},this.markUsedJustification(h,t,p,f),h.allowVerticalPlacement&&(this.markUsedOrientation(h,f,p),this.placedOrientations[p.crossTileID]=f),{shift:g,placedGlyphBoxes:e}):void 0},Zr.prototype.placeLayerBucketPart=function(e,r,i){var n=this,o=(w=e.parameters).bucket,a=w.layout,s=w.posMatrix,u=w.textLabelPlaneMatrix,l=w.labelToScreenMatrix,c=w.textPixelRatio,p=w.holdingForFade,h=w.collisionBoxArray,f=w.partiallyEvaluatedTextSize,d=w.collisionGroup,m=a.get("text-optional"),y=a.get("icon-optional"),g=a.get("text-allow-overlap"),_=a.get("icon-allow-overlap"),v="map"===a.get("text-rotation-alignment"),x="map"===a.get("text-pitch-alignment"),b="none"!==a.get("icon-text-fit"),w="viewport-y"===a.get("symbol-z-order"),S=g&&(_||!o.hasIconData()||y),T=_&&(g||!o.hasTextData()||m);function E(e,h){if(!r[e.crossTileID])if(p)n.placements[e.crossTileID]=new Ur(!1,!1,!1);else{var w=!1,E=!1,I=!0,A=null,C={box:null,offscreen:null},P={box:null,offscreen:null},M=null,k=null,z=0,L=0,B=0;h.textFeatureIndex?z=h.textFeatureIndex:e.useRuntimeCollisionCircles&&(z=e.featureIndex),h.verticalTextFeatureIndex&&(L=h.verticalTextFeatureIndex);var D,R,O,F,j,U,N,V,q=h.textBox;q&&(V=function(r){var i=t.WritingMode.horizontal;return!o.allowVerticalPlacement||r||!n.prevPlacement||(r=n.prevPlacement.placedOrientations[e.crossTileID])&&(n.placedOrientations[e.crossTileID]=r,n.markUsedOrientation(o,i=r,e)),i},N=function(r,i){if(o.allowVerticalPlacement&&0<e.numVerticalGlyphVertices&&h.verticalTextBox)for(var n=0,a=o.writingModes;n<a.length&&(a[n]===t.WritingMode.vertical?(C=i(),P=C):C=r(),!(C&&C.box&&C.box.length));n+=1);else C=r()},a.get("text-variable-anchor")?(D=a.get("text-variable-anchor"),n.prevPlacement&&n.prevPlacement.variableOffsets[e.crossTileID]&&(R=n.prevPlacement.variableOffsets[e.crossTileID],0<D.indexOf(R.anchor)&&(D=D.filter((function(t){return t!==R.anchor}))).unshift(R.anchor)),O=function(t,r,i){for(var a=t.x2-t.x1,u=t.y2-t.y1,l=e.textBoxScale,p=b&&!_?r:null,h={box:[],offscreen:!1},f=g?2*D.length:D.length,m=0;m<f;++m){var y=n.attemptAnchorPlacement(D[m%D.length],t,a,u,l,v,x,c,s,d,m>=D.length,e,o,i,p);if(y&&(h=y.placedGlyphBoxes)&&h.box&&h.box.length){w=!0,A=y.shift;break}}return h},N((function(){return O(q,h.iconBox,t.WritingMode.horizontal)}),(function(){var r=h.verticalTextBox;return o.allowVerticalPlacement&&!(C&&C.box&&C.box.length)&&0<e.numVerticalGlyphVertices&&r?O(r,h.verticalIconBox,t.WritingMode.vertical):{box:null,offscreen:null}})),C&&(w=C.box,I=C.offscreen),F=V(C&&C.box),w||!n.prevPlacement||(j=n.prevPlacement.variableOffsets[e.crossTileID])&&(n.variableOffsets[e.crossTileID]=j,n.markUsedJustification(o,j.anchor,e,F))):(U=function(t,r){return(t=n.collisionIndex.placeCollisionBox(t,g,c,s,d.predicate))&&t.box&&t.box.length&&(n.markUsedOrientation(o,r,e),n.placedOrientations[e.crossTileID]=r),t},N((function(){return U(q,t.WritingMode.horizontal)}),(function(){var r=h.verticalTextBox;return o.allowVerticalPlacement&&0<e.numVerticalGlyphVertices&&r?U(r,t.WritingMode.vertical):{box:null,offscreen:null}})),V(C&&C.box&&C.box.length))),w=(F=C)&&F.box&&0<F.box.length,I=F&&F.offscreen,e.useRuntimeCollisionCircles&&(N=o.text.placedSymbolArray.get(e.centerJustifiedTextSymbolIndex),V=t.evaluateSizeForFeature(o.textSizeData,f,N),G=a.get("text-padding"),M=n.collisionIndex.placeCollisionCircles(g,N,o.lineVertexArray,o.glyphOffsetArray,V,s,u,l,i,x,d.predicate,e.collisionCircleDiameter,G),w=g||0<M.circles.length&&!M.collisionDetected,I=I&&M.offscreen),h.iconFeatureIndex&&(B=h.iconFeatureIndex),h.iconBox&&(H=function(t){return t=b&&A?Hr(t,A.x,A.y,v,x,n.transform.angle):t,n.collisionIndex.placeCollisionBox(t,_,c,s,d.predicate)},E=P&&P.box&&P.box.length&&h.verticalIconBox?0<(k=H(h.verticalIconBox)).box.length:0<(k=H(h.iconBox)).box.length,I=I&&k.offscreen);var G=m||0===e.numHorizontalGlyphVertices&&0===e.numVerticalGlyphVertices,H=y||0===e.numIconVertices;if(G||H?H?G||(E=E&&w):w=E&&w:E=w=E&&w,w&&F&&F.box&&n.collisionIndex.insertCollisionBox(F.box,a.get("text-ignore-placement"),o.bucketInstanceId,P&&P.box&&L?L:z,d.ID),E&&k&&n.collisionIndex.insertCollisionBox(k.box,a.get("icon-ignore-placement"),o.bucketInstanceId,B,d.ID),M&&(w&&n.collisionIndex.insertCollisionCircles(M.circles,a.get("text-ignore-placement"),o.bucketInstanceId,z,d.ID),i)){z=o.bucketInstanceId;var Z=n.collisionCircleArrays[z];void 0===Z&&(Z=n.collisionCircleArrays[z]=new Nr);for(var W=0;W<M.circles.length;W+=4)Z.circles.push(M.circles[W+0]),Z.circles.push(M.circles[W+1]),Z.circles.push(M.circles[W+2]),Z.circles.push(M.collisionDetected?1:0)}n.placements[e.crossTileID]=new Ur(w||S,E||T,I||o.justReloaded),r[e.crossTileID]=!0}}if(!o.collisionArrays&&h&&o.deserializeCollisionBoxes(h),w)for(var I=o.getSortedSymbolIndexes(this.transform.angle),A=I.length-1;0<=A;--A){var C=I[A];E(o.symbolInstances.get(C),o.collisionArrays[C])}else for(var P=e.symbolInstanceStart;P<e.symbolInstanceEnd;P++)E(o.symbolInstances.get(P),o.collisionArrays[P]);i&&o.bucketInstanceId in this.collisionCircleArrays&&(w=this.collisionCircleArrays[o.bucketInstanceId],t.invert(w.invProjMatrix,s),w.viewportMatrix=this.collisionIndex.getViewportMatrix()),o.justReloaded=!1},Zr.prototype.markUsedJustification=function(e,r,i,n){for(var o=n===t.WritingMode.vertical?i.verticalPlacedTextSymbolIndex:{left:i.leftJustifiedTextSymbolIndex,center:i.centerJustifiedTextSymbolIndex,right:i.rightJustifiedTextSymbolIndex}[t.getAnchorJustification(r)],a=0,s=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex,i.verticalPlacedTextSymbolIndex];a<s.length;a+=1){var u=s[a];0<=u&&(e.text.placedSymbolArray.get(u).crossTileID=0<=o&&u!==o?0:i.crossTileID)}},Zr.prototype.markUsedOrientation=function(e,r,i){for(var n=r===t.WritingMode.horizontal||r===t.WritingMode.horizontalOnly?r:0,o=(r=r===t.WritingMode.vertical?r:0,0),a=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex];o<a.length;o+=1)e.text.placedSymbolArray.get(a[o]).placedOrientation=n;i.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).placedOrientation=r)},Zr.prototype.commit=function(t){this.commitTime=t,this.zoomAtLastRecencyCheck=this.transform.zoom;var e=this.prevPlacement,r=!1;this.prevZoomAdjustment=e?e.zoomAdjustment(this.transform.zoom):0;var i,n,o,a,s=e?e.symbolFadeChange(t):1,u=e?e.opacities:{},l=e?e.variableOffsets:{},c=e?e.placedOrientations:{};for(i in this.placements){var p=this.placements[i],h=u[i];r=h?(this.opacities[i]=new jr(h,s,p.text,p.icon),r||p.text!==h.text.placed||p.icon!==h.icon.placed):(this.opacities[i]=new jr(null,s,p.text,p.icon,p.skipFade),r||p.text||p.icon)}for(n in u){var f,d=u[n];this.opacities[n]||(f=new jr(d,s,!1,!1)).isHidden()||(this.opacities[n]=f,r=r||d.text.placed||d.icon.placed)}for(o in l)this.variableOffsets[o]||!this.opacities[o]||this.opacities[o].isHidden()||(this.variableOffsets[o]=l[o]);for(a in c)this.placedOrientations[a]||!this.opacities[a]||this.opacities[a].isHidden()||(this.placedOrientations[a]=c[a]);r?this.lastPlacementChangeTime=t:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=e?e.lastPlacementChangeTime:t)},Zr.prototype.updateLayerOpacities=function(t,e){for(var r={},i=0,n=e;i<n.length;i+=1){var o=n[i],a=o.getBucket(t);a&&o.latestFeatureIndex&&t.id===a.layerIds[0]&&this.updateBucketOpacities(a,r,o.collisionBoxArray)}},Zr.prototype.updateBucketOpacities=function(e,r,i){var n=this;e.hasTextData()&&e.text.opacityVertexArray.clear(),e.hasIconData()&&e.icon.opacityVertexArray.clear(),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexArray.clear(),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexArray.clear();var o=e.layers[0].layout,a=new jr(null,0,!1,!1,!0),s=o.get("text-allow-overlap"),u=o.get("icon-allow-overlap"),l=o.get("text-variable-anchor"),c="map"===o.get("text-rotation-alignment"),p="map"===o.get("text-pitch-alignment"),h="none"!==o.get("icon-text-fit"),f=new jr(null,0,s&&(u||!e.hasIconData()||o.get("icon-optional")),u&&(s||!e.hasTextData()||o.get("text-optional")),!0);!e.collisionArrays&&i&&(e.hasIconCollisionBoxData()||e.hasTextCollisionBoxData())&&e.deserializeCollisionBoxes(i);for(var d=function(t,e,r){for(var i=0;i<e/4;i++)t.opacityVertexArray.emplaceBack(r)},m=0;m<e.symbolInstances.length;m++)!function(i){var o=e.symbolInstances.get(i),s=o.numHorizontalGlyphVertices,u=o.numVerticalGlyphVertices,m=o.crossTileID,y=n.opacities[m];r[m]?y=a:y||(n.opacities[m]=y=f),r[m]=!0;var g,_,v,x=0<o.numIconVertices,b=n.placedOrientations[o.crossTileID],w=b===t.WritingMode.vertical,S=b===t.WritingMode.horizontal||b===t.WritingMode.horizontalOnly;(0<s||0<u)&&(_=ei(y.text),d(e.text,s,w?ii:_),d(e.text,u,S?ii:_),g=y.text.isHidden(),[o.rightJustifiedTextSymbolIndex,o.centerJustifiedTextSymbolIndex,o.leftJustifiedTextSymbolIndex].forEach((function(t){0<=t&&(e.text.placedSymbolArray.get(t).hidden=g||w?1:0)})),0<=o.verticalPlacedTextSymbolIndex&&(e.text.placedSymbolArray.get(o.verticalPlacedTextSymbolIndex).hidden=g||S?1:0),(_=n.variableOffsets[o.crossTileID])&&n.markUsedJustification(e,_.anchor,o,b),(b=n.placedOrientations[o.crossTileID])&&(n.markUsedJustification(e,"left",o,b),n.markUsedOrientation(e,b,o))),x&&(v=ei(y.icon),x=!(h&&o.verticalPlacedIconSymbolIndex&&w),0<=o.placedIconSymbolIndex&&(d(e.icon,o.numIconVertices,x?v:ii),e.icon.placedSymbolArray.get(o.placedIconSymbolIndex).hidden=y.icon.isHidden()),0<=o.verticalPlacedIconSymbolIndex&&(d(e.icon,o.numVerticalIconVertices,x?ii:v),e.icon.placedSymbolArray.get(o.verticalPlacedIconSymbolIndex).hidden=y.icon.isHidden())),!e.hasIconCollisionBoxData()&&!e.hasTextCollisionBoxData()||(v=e.collisionArrays[i])&&(o=new t.Point(0,0),(v.textBox||v.verticalTextBox)&&(i=!0,l&&((m=n.variableOffsets[m])?(o=Gr(m.anchor,m.width,m.height,m.textOffset,m.textBoxScale),c&&o._rotate(p?n.transform.angle:-n.transform.angle)):i=!1),v.textBox&&Wr(e.textCollisionBox.collisionVertexArray,y.text.placed,!i||w,o.x,o.y),v.verticalTextBox&&Wr(e.textCollisionBox.collisionVertexArray,y.text.placed,!i||S,o.x,o.y)),S=Boolean(!S&&v.verticalIconBox),v.iconBox&&Wr(e.iconCollisionBox.collisionVertexArray,y.icon.placed,S,h?o.x:0,h?o.y:0),v.verticalIconBox&&Wr(e.iconCollisionBox.collisionVertexArray,y.icon.placed,!S,h?o.x:0,h?o.y:0))}(m);e.sortFeatures(this.transform.angle),this.retainedQueryData[e.bucketInstanceId]&&(this.retainedQueryData[e.bucketInstanceId].featureSortOrder=e.featureSortOrder),e.hasTextData()&&e.text.opacityVertexBuffer&&e.text.opacityVertexBuffer.updateData(e.text.opacityVertexArray),e.hasIconData()&&e.icon.opacityVertexBuffer&&e.icon.opacityVertexBuffer.updateData(e.icon.opacityVertexArray),e.hasIconCollisionBoxData()&&e.iconCollisionBox.collisionVertexBuffer&&e.iconCollisionBox.collisionVertexBuffer.updateData(e.iconCollisionBox.collisionVertexArray),e.hasTextCollisionBoxData()&&e.textCollisionBox.collisionVertexBuffer&&e.textCollisionBox.collisionVertexBuffer.updateData(e.textCollisionBox.collisionVertexArray),e.bucketInstanceId in this.collisionCircleArrays&&(i=this.collisionCircleArrays[e.bucketInstanceId],e.placementInvProjMatrix=i.invProjMatrix,e.placementViewportMatrix=i.viewportMatrix,e.collisionCircleArray=i.circles,delete this.collisionCircleArrays[e.bucketInstanceId])},Zr.prototype.symbolFadeChange=function(t){return 0===this.fadeDuration?1:(t-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment},Zr.prototype.zoomAdjustment=function(t){return Math.max(0,(this.transform.zoom-t)/1.5)},Zr.prototype.hasTransitions=function(t){return this.stale||t-this.lastPlacementChangeTime<this.fadeDuration},Zr.prototype.stillRecent=function(t,e){var r=this.zoomAtLastRecencyCheck===e?1-this.zoomAdjustment(e):1;return this.zoomAtLastRecencyCheck=e,this.commitTime+this.fadeDuration*r>t},Zr.prototype.setStale=function(){this.stale=!0};var Xr=Math.pow(2,25),Kr=Math.pow(2,24),Jr=Math.pow(2,17),Yr=Math.pow(2,16),Qr=Math.pow(2,9),$r=Math.pow(2,8),ti=Math.pow(2,1);function ei(t){if(0===t.opacity&&!t.placed)return 0;if(1===t.opacity&&t.placed)return 4294967295;var e=t.placed?1:0;return(t=Math.floor(127*t.opacity))*Xr+e*Kr+t*Jr+e*Yr+t*Qr+e*$r+t*ti+e}function ri(t){this._sortAcrossTiles="viewport-y"!==t.layout.get("symbol-z-order")&&!t.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}var ii=0;function ni(t,e,r,i,n,o,a){this.placement=new Zr(t,n,o,a),this._currentPlacementIndex=e.length-1,this._forceFullPlacement=r,this._showCollisionBoxes=i,this._done=!1}function oi(t,e,r){this.tileID=t,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(var i=0;i<e.length;i++){var n=e.get(i),o=n.key;this.indexedSymbolInstances[o]||(this.indexedSymbolInstances[o]=[]),this.indexedSymbolInstances[o].push({crossTileID:n.crossTileID,coord:this.getScaledCoordinates(n,t)})}}ri.prototype.continuePlacement=function(t,e,r,i,n){for(var o=this._bucketParts;this._currentTileIndex<t.length;)if(e.getBucketParts(o,i,t[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,n())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,o.sort((function(t,e){return t.sortKey-e.sortKey})));this._currentPartIndex<o.length;)if(e.placeLayerBucketPart(o[this._currentPartIndex],this._seenCrossTileIDs,r),this._currentPartIndex++,n())return!0;return!1},ni.prototype.isDone=function(){return this._done},ni.prototype.continuePlacement=function(e,r,i){for(var n=this,o=t.browser.now(),a=function(){var e=t.browser.now()-o;return!n._forceFullPlacement&&2<e};0<=this._currentPlacementIndex;){var s=r[e[this._currentPlacementIndex]],u=this.placement.collisionIndex.transform.zoom;if("symbol"===s.type&&(!s.minzoom||s.minzoom<=u)&&(!s.maxzoom||s.maxzoom>u)){if(this._inProgressLayer||(this._inProgressLayer=new ri(s)),this._inProgressLayer.continuePlacement(i[s.source],this.placement,this._showCollisionBoxes,s,a))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0},ni.prototype.commit=function(t){return this.placement.commit(t),this.placement};var ai=512/t.EXTENT/2;function si(){this.maxCrossTileID=0}function ui(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}oi.prototype.getScaledCoordinates=function(e,r){var i=ai/Math.pow(2,r.canonical.z-this.tileID.canonical.z);return{x:Math.floor((r.canonical.x*t.EXTENT+e.anchorX)*i),y:Math.floor((r.canonical.y*t.EXTENT+e.anchorY)*i)}},oi.prototype.findMatches=function(t,e,r){for(var i=this.tileID.canonical.z<e.canonical.z?1:Math.pow(2,this.tileID.canonical.z-e.canonical.z),n=0;n<t.length;n++){var o=t.get(n);if(!o.crossTileID){var a=this.indexedSymbolInstances[o.key];if(a)for(var s=this.getScaledCoordinates(o,e),u=0,l=a;u<l.length;u+=1){var c=l[u];if(Math.abs(c.coord.x-s.x)<=i&&Math.abs(c.coord.y-s.y)<=i&&!r[c.crossTileID]){r[c.crossTileID]=!0,o.crossTileID=c.crossTileID;break}}}}},si.prototype.generate=function(){return++this.maxCrossTileID},ui.prototype.handleWrapJump=function(t){var e=Math.round((t-this.lng)/360);if(0!==e)for(var r in this.indexes){var i,n=this.indexes[r],o={};for(i in n){var a=n[i];a.tileID=a.tileID.unwrapTo(a.tileID.wrap+e),o[a.tileID.key]=a}this.indexes[r]=o}this.lng=t},ui.prototype.addBucket=function(t,e,r){if(this.indexes[t.overscaledZ]&&this.indexes[t.overscaledZ][t.key]){if(this.indexes[t.overscaledZ][t.key].bucketInstanceId===e.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(t.overscaledZ,this.indexes[t.overscaledZ][t.key])}for(var i=0;i<e.symbolInstances.length;i++)e.symbolInstances.get(i).crossTileID=0;this.usedCrossTileIDs[t.overscaledZ]||(this.usedCrossTileIDs[t.overscaledZ]={});var n,o=this.usedCrossTileIDs[t.overscaledZ];for(n in this.indexes){var a=this.indexes[n];if(Number(n)>t.overscaledZ)for(var s in a){var u=a[s];u.tileID.isChildOf(t)&&u.findMatches(e.symbolInstances,t,o)}else{var l=a[t.scaledTo(Number(n)).key];l&&l.findMatches(e.symbolInstances,t,o)}}for(var c=0;c<e.symbolInstances.length;c++){var p=e.symbolInstances.get(c);p.crossTileID||(p.crossTileID=r.generate(),o[p.crossTileID]=!0)}return void 0===this.indexes[t.overscaledZ]&&(this.indexes[t.overscaledZ]={}),this.indexes[t.overscaledZ][t.key]=new oi(t,e.symbolInstances,e.bucketInstanceId),!0},ui.prototype.removeBucketCrossTileIDs=function(t,e){for(var r in e.indexedSymbolInstances)for(var i=0,n=e.indexedSymbolInstances[r];i<n.length;i+=1)delete this.usedCrossTileIDs[t][n[i].crossTileID]},ui.prototype.removeStaleBuckets=function(t){var e,r=!1;for(e in this.indexes){var i,n=this.indexes[e];for(i in n)t[n[i].bucketInstanceId]||(this.removeBucketCrossTileIDs(e,n[i]),delete n[i],r=!0)}return r};var li=function(){this.layerIndexes={},this.crossTileIDs=new si,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}};function ci(e,r){return t.emitValidationErrors(e,r&&r.filter((function(t){return"source.canvas"!==t.identifier})))}li.prototype.addLayer=function(t,e,r){var i=this.layerIndexes[t.id];void 0===i&&(i=this.layerIndexes[t.id]=new ui);var n=!1,o={};i.handleWrapJump(r);for(var a=0,s=e;a<s.length;a+=1){var u=s[a],l=u.getBucket(t);l&&t.id===l.layerIds[0]&&(l.bucketInstanceId||(l.bucketInstanceId=++this.maxBucketInstanceId),i.addBucket(u.tileID,l,this.crossTileIDs)&&(n=!0),o[l.bucketInstanceId]=!0)}return i.removeStaleBuckets(o)&&(n=!0),n},li.prototype.pruneUnusedLayers=function(t){var e,r={};for(e in t.forEach((function(t){r[t]=!0})),this.layerIndexes)r[e]||delete this.layerIndexes[e]};var pi,hi=t.pick(yr,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),fi=t.pick(yr,["setCenter","setZoom","setBearing","setPitch"]),di=function(){var e,r={},i=t.styleSpec.$version;for(e in t.styleSpec.$root){var n,o=t.styleSpec.$root[e];o.required&&null!=(n="version"===e?i:"array"===o.type?[]:{})&&(r[e]=n)}return r}(),mi=((pi=t.Evented)&&(yi.__proto__=pi),((yi.prototype=Object.create(pi&&pi.prototype)).constructor=yi).prototype.loadURL=function(e,r){var i=this;void 0===r&&(r={}),this.fire(new t.Event("dataloading",{dataType:"style"}));var n="boolean"==typeof r.validate?r.validate:!t.isMapboxURL(e);e=this.map._requestManager.normalizeStyleURL(e,r.accessToken),e=this.map._requestManager.transformRequest(e,t.ResourceType.Style),this._request=t.getJSON(e,(function(e,r){i._request=null,e?i.fire(new t.ErrorEvent(e)):r&&i._load(r,n)}))},yi.prototype.loadJSON=function(e,r){var i=this;void 0===r&&(r={}),this.fire(new t.Event("dataloading",{dataType:"style"})),this._request=t.browser.frame((function(){i._request=null,i._load(e,!1!==r.validate)}))},yi.prototype.loadEmpty=function(){this.fire(new t.Event("dataloading",{dataType:"style"})),this._load(di,!1)},yi.prototype._load=function(e,r){if(!r||!ci(this,t.validateStyle(e))){for(var i in this._loaded=!0,(this.stylesheet=e).sources)this.addSource(i,e.sources[i],{validate:!1});e.sprite?this._loadSprite(e.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(e.glyphs),r=mr(this.stylesheet.layers),this._order=r.map((function(t){return t.id})),this._layers={},this._serializedLayers={};for(var n=0,o=r;n<o.length;n+=1){var a=o[n];(a=t.createStyleLayer(a)).setEventedParent(this,{layer:{id:a.id}}),this._layers[a.id]=a,this._serializedLayers[a.id]=a.serialize()}this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new S(this.stylesheet.light),this.fire(new t.Event("data",{dataType:"style"})),this.fire(new t.Event("style.load"))}},yi.prototype._loadSprite=function(e){var r,i,n,o,a,s,u,l,c=this;function p(){if(s)n(s);else if(o&&a){var e,r=t.browser.getImageData(a),i={};for(e in o){var u=(g=o[e]).width,l=g.height,c=g.x,p=g.y,h=g.sdf,f=g.pixelRatio,d=g.stretchX,m=g.stretchY,y=g.content,g=new t.RGBAImage({width:u,height:l});t.RGBAImage.copy(r,g,{x:c,y:p},{x:0,y:0},{width:u,height:l}),i[e]={data:g,pixelRatio:f,sdf:h,stretchX:d,stretchY:m,content:y}}n(null,i)}}this._spriteRequest=(r=e,i=this.map._requestManager,n=function(e,r){if(c._spriteRequest=null,e)c.fire(new t.ErrorEvent(e));else if(r)for(var i in r)c.imageManager.addImage(i,r[i]);c.imageManager.setLoaded(!0),c._availableImages=c.imageManager.listImages(),c.dispatcher.broadcast("setImages",c._availableImages),c.fire(new t.Event("data",{dataType:"style"}))},e=1<t.browser.devicePixelRatio?"@2x":"",u=t.getJSON(i.transformRequest(i.normalizeSpriteURL(r,e,".json"),t.ResourceType.SpriteJSON),(function(t,e){u=null,s||(s=t,o=e,p())})),l=t.getImage(i.transformRequest(i.normalizeSpriteURL(r,e,".png"),t.ResourceType.SpriteImage),(function(t,e){l=null,s||(s=t,a=e,p())})),{cancel:function(){u&&(u.cancel(),u=null),l&&(l.cancel(),l=null)}})},yi.prototype._validateLayer=function(e){var r,i=this.sourceCaches[e.source];i&&(!(r=e.sourceLayer)||("geojson"===(i=i.getSource()).type||i.vectorLayerIds&&-1===i.vectorLayerIds.indexOf(r))&&this.fire(new t.ErrorEvent(new Error('Source layer "'+r+'" does not exist on source "'+i.id+'" as specified by style layer "'+e.id+'"'))))},yi.prototype.loaded=function(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(var t in this.sourceCaches)if(!this.sourceCaches[t].loaded())return!1;return!!this.imageManager.isLoaded()},yi.prototype._serializeLayers=function(t){for(var e=[],r=0,i=t;r<i.length;r+=1){var n=this._layers[i[r]];"custom"!==n.type&&e.push(n.serialize())}return e},yi.prototype.hasTransitions=function(){if(this.light&&this.light.hasTransition())return!0;for(var t in this.sourceCaches)if(this.sourceCaches[t].hasTransition())return!0;for(var e in this._layers)if(this._layers[e].hasTransition())return!0;return!1},yi.prototype._checkLoaded=function(){if(!this._loaded)throw new Error("Style is not done loading")},yi.prototype.update=function(e){if(this._loaded){var r=this._changed;if(this._changed){var i,n,o=Object.keys(this._updatedLayers),a=Object.keys(this._removedLayers);for(i in(o.length||a.length)&&this._updateWorkerLayers(o,a),this._updatedSources){var s=this._updatedSources[i];"reload"===s?this._reloadSource(i):"clear"===s&&this._clearSource(i)}for(n in this._updateTilesForChangedImages(),this._updatedPaintProps)this._layers[n].updateTransitions(e);this.light.updateTransitions(e),this._resetUpdates()}var u,l={};for(u in this.sourceCaches){var c=this.sourceCaches[u];l[u]=c.used,c.used=!1}for(var p,h=0,f=this._order;h<f.length;h+=1){var d=this._layers[f[h]];d.recalculate(e,this._availableImages),!d.isHidden(e.zoom)&&d.source&&(this.sourceCaches[d.source].used=!0)}for(p in l){var m=this.sourceCaches[p];l[p]!==m.used&&m.fire(new t.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:p}))}this.light.recalculate(e),this.z=e.zoom,r&&this.fire(new t.Event("data",{dataType:"style"}))}},yi.prototype._updateTilesForChangedImages=function(){var t=Object.keys(this._changedImages);if(t.length){for(var e in this.sourceCaches)this.sourceCaches[e].reloadTilesForDependencies(["icons","patterns"],t);this._changedImages={}}},yi.prototype._updateWorkerLayers=function(t,e){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(t),removedIds:e})},yi.prototype._resetUpdates=function(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}},yi.prototype.setState=function(e){var r=this;if(this._checkLoaded(),ci(this,t.validateStyle(e)))return!1;(e=t.clone$1(e)).layers=mr(e.layers);var i=function(e,r){if(!e)return[{command:yr.setStyle,args:[r]}];var i=[];try{if(!t.deepEqual(e.version,r.version))return[{command:yr.setStyle,args:[r]}];t.deepEqual(e.center,r.center)||i.push({command:yr.setCenter,args:[r.center]}),t.deepEqual(e.zoom,r.zoom)||i.push({command:yr.setZoom,args:[r.zoom]}),t.deepEqual(e.bearing,r.bearing)||i.push({command:yr.setBearing,args:[r.bearing]}),t.deepEqual(e.pitch,r.pitch)||i.push({command:yr.setPitch,args:[r.pitch]}),t.deepEqual(e.sprite,r.sprite)||i.push({command:yr.setSprite,args:[r.sprite]}),t.deepEqual(e.glyphs,r.glyphs)||i.push({command:yr.setGlyphs,args:[r.glyphs]}),t.deepEqual(e.transition,r.transition)||i.push({command:yr.setTransition,args:[r.transition]}),t.deepEqual(e.light,r.light)||i.push({command:yr.setLight,args:[r.light]});var n={},o=[];!function(e,r,i,n){var o,a,s,u;for(o in r=r||{},e=e||{})e.hasOwnProperty(o)&&(r.hasOwnProperty(o)||_r(o,i,n));for(o in r)r.hasOwnProperty(o)&&(e.hasOwnProperty(o)?t.deepEqual(e[o],r[o])||("geojson"===e[o].type&&"geojson"===r[o].type&&function(e,r,i){for(var n in e[i])if(e[i].hasOwnProperty(n)&&"data"!==n&&!t.deepEqual(e[i][n],r[i][n]))return;for(n in r[i])if(r[i].hasOwnProperty(n)&&"data"!==n&&!t.deepEqual(e[i][n],r[i][n]))return;return 1}(e,r,o)?i.push({command:yr.setGeoJSONSourceData,args:[o,r[o].data]}):(s=r,_r(a=o,u=i,n),gr(a,s,u))):gr(o,r,i))}(e.sources,r.sources,o,n);var a=[];e.layers&&e.layers.forEach((function(t){n[t.source]?i.push({command:yr.removeLayer,args:[t.id]}):a.push(t)})),i=i.concat(o),function(e,r,i){r=r||[];for(var n,o,a,s,u,l=(e=e||[]).map(xr),c=r.map(xr),p=e.reduce(br,{}),h=r.reduce(br,{}),f=l.slice(),d=Object.create(null),m=0,y=0;m<l.length;m++)h.hasOwnProperty(n=l[m])?y++:(i.push({command:yr.removeLayer,args:[n]}),f.splice(f.indexOf(n,y),1));for(y=m=0;m<c.length;m++)f[f.length-1-m]!==(n=c[c.length-1-m])&&(p.hasOwnProperty(n)?(i.push({command:yr.removeLayer,args:[n]}),f.splice(f.lastIndexOf(n,f.length-y),1)):y++,i.push({command:yr.addLayer,args:[h[n],s=f[f.length-m]]}),f.splice(f.length-m,0,n),d[n]=!0);for(m=0;m<c.length;m++)if(o=p[n=c[m]],a=h[n],!d[n]&&!t.deepEqual(o,a))if(t.deepEqual(o.source,a.source)&&t.deepEqual(o["source-layer"],a["source-layer"])&&t.deepEqual(o.type,a.type)){for(u in vr(o.layout,a.layout,i,n,null,yr.setLayoutProperty),vr(o.paint,a.paint,i,n,null,yr.setPaintProperty),t.deepEqual(o.filter,a.filter)||i.push({command:yr.setFilter,args:[n,a.filter]}),t.deepEqual(o.minzoom,a.minzoom)&&t.deepEqual(o.maxzoom,a.maxzoom)||i.push({command:yr.setLayerZoomRange,args:[n,a.minzoom,a.maxzoom]}),o)o.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?vr(o[u],a[u],i,n,u.slice(6),yr.setPaintProperty):t.deepEqual(o[u],a[u])||i.push({command:yr.setLayerProperty,args:[n,u,a[u]]}));for(u in a)a.hasOwnProperty(u)&&!o.hasOwnProperty(u)&&"layout"!==u&&"paint"!==u&&"filter"!==u&&"metadata"!==u&&"minzoom"!==u&&"maxzoom"!==u&&(0===u.indexOf("paint.")?vr(o[u],a[u],i,n,u.slice(6),yr.setPaintProperty):t.deepEqual(o[u],a[u])||i.push({command:yr.setLayerProperty,args:[n,u,a[u]]}))}else i.push({command:yr.removeLayer,args:[n]}),s=f[f.lastIndexOf(n)+1],i.push({command:yr.addLayer,args:[a,s]})}(a,r.layers,i)}catch(e){console.warn("Unable to compute style diff:",e),i=[{command:yr.setStyle,args:[r]}]}return i}(this.serialize(),e).filter((function(t){return!(t.command in fi)}));if(0===i.length)return!1;var n=i.filter((function(t){return!(t.command in hi)}));if(0<n.length)throw new Error("Unimplemented: "+n.map((function(t){return t.command})).join(", ")+".");return i.forEach((function(t){"setTransition"!==t.command&&r[t.command].apply(r,t.args)})),this.stylesheet=e,!0},yi.prototype.addImage=function(e,r){if(this.getImage(e))return this.fire(new t.ErrorEvent(new Error("An image with this name already exists.")));this.imageManager.addImage(e,r),this._afterImageUpdated(e)},yi.prototype.updateImage=function(t,e){this.imageManager.updateImage(t,e)},yi.prototype.getImage=function(t){return this.imageManager.getImage(t)},yi.prototype.removeImage=function(e){if(!this.getImage(e))return this.fire(new t.ErrorEvent(new Error("No image with this name exists.")));this.imageManager.removeImage(e),this._afterImageUpdated(e)},yi.prototype._afterImageUpdated=function(e){this._availableImages=this.imageManager.listImages(),this._changedImages[e]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new t.Event("data",{dataType:"style"}))},yi.prototype.listImages=function(){return this._checkLoaded(),this.imageManager.listImages()},yi.prototype.addSource=function(e,r,i){var n,o=this;if(void 0===i&&(i={}),this._checkLoaded(),void 0!==this.sourceCaches[e])throw new Error("There is already a source with this ID");if(!r.type)throw new Error("The type property must be defined, but only the following properties were given: "+Object.keys(r).join(", ")+".");0<=["vector","raster","geojson","video","image"].indexOf(r.type)&&this._validate(t.validateStyle.source,"sources."+e,r,null,i)||(this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0),(n=this.sourceCaches[e]=new or(e,r,this.dispatcher)).style=this,n.setEventedParent(this,(function(){return{isSourceLoaded:o.loaded(),source:n.serialize(),sourceId:e}})),n.onAdd(this.map),this._changed=!0)},yi.prototype.removeSource=function(e){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error("There is no source with this ID");for(var r in this._layers)if(this._layers[r].source===e)return this.fire(new t.ErrorEvent(new Error('Source "'+e+'" cannot be removed while layer "'+r+'" is using it.')));var i=this.sourceCaches[e];delete this.sourceCaches[e],delete this._updatedSources[e],i.fire(new t.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:e})),i.setEventedParent(null),i.clearTiles(),i.onRemove&&i.onRemove(this.map),this._changed=!0},yi.prototype.setGeoJSONSourceData=function(t,e){this._checkLoaded(),this.sourceCaches[t].getSource().setData(e),this._changed=!0},yi.prototype.getSource=function(t){return this.sourceCaches[t]&&this.sourceCaches[t].getSource()},yi.prototype.addLayer=function(e,r,i){void 0===i&&(i={}),this._checkLoaded();var n,o=e.id;if(this.getLayer(o))this.fire(new t.ErrorEvent(new Error('Layer with id "'+o+'" already exists on this map')));else{if("custom"===e.type){if(ci(this,t.validateCustomStyleLayer(e)))return;n=t.createStyleLayer(e)}else{if("object"==typeof e.source&&(this.addSource(o,e.source),e=t.clone$1(e),e=t.extend(e,{source:o})),this._validate(t.validateStyle.layer,"layers."+o,e,{arrayIndex:-1},i))return;n=t.createStyleLayer(e),this._validateLayer(n),n.setEventedParent(this,{layer:{id:o}}),this._serializedLayers[n.id]=n.serialize()}e=r?this._order.indexOf(r):this._order.length,r&&-1===e?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(e,0,o),this._layerOrderChanged=!0,this._layers[o]=n,this._removedLayers[o]&&n.source&&"custom"!==n.type&&(e=this._removedLayers[o],delete this._removedLayers[o],e.type!==n.type?this._updatedSources[n.source]="clear":(this._updatedSources[n.source]="reload",this.sourceCaches[n.source].pause())),this._updateLayer(n),n.onAdd&&n.onAdd(this.map))}},yi.prototype.moveLayer=function(e,r){var i;this._checkLoaded(),this._changed=!0,this._layers[e]?e!==r&&(i=this._order.indexOf(e),this._order.splice(i,1),i=r?this._order.indexOf(r):this._order.length,r&&-1===i?this.fire(new t.ErrorEvent(new Error('Layer with id "'+r+'" does not exist on this map.'))):(this._order.splice(i,0,e),this._layerOrderChanged=!0)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be moved.")))},yi.prototype.removeLayer=function(e){this._checkLoaded();var r,i=this._layers[e];i?(i.setEventedParent(null),r=this._order.indexOf(e),this._order.splice(r,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[e]=i,delete this._layers[e],delete this._serializedLayers[e],delete this._updatedLayers[e],delete this._updatedPaintProps[e],i.onRemove&&i.onRemove(this.map)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be removed.")))},yi.prototype.getLayer=function(t){return this._layers[t]},yi.prototype.hasLayer=function(t){return t in this._layers},yi.prototype.setLayerZoomRange=function(e,r,i){this._checkLoaded();var n=this.getLayer(e);n?n.minzoom===r&&n.maxzoom===i||(null!=r&&(n.minzoom=r),null!=i&&(n.maxzoom=i),this._updateLayer(n)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot have zoom extent.")))},yi.prototype.setFilter=function(e,r,i){void 0===i&&(i={}),this._checkLoaded();var n=this.getLayer(e);if(n){if(!t.deepEqual(n.filter,r))return null==r?(n.filter=void 0,void this._updateLayer(n)):void(this._validate(t.validateStyle.filter,"layers."+n.id+".filter",r,null,i)||(n.filter=t.clone$1(r),this._updateLayer(n)))}else this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be filtered.")))},yi.prototype.getFilter=function(e){return t.clone$1(this.getLayer(e).filter)},yi.prototype.setLayoutProperty=function(e,r,i,n){void 0===n&&(n={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getLayoutProperty(r),i)||(o.setLayoutProperty(r,i,n),this._updateLayer(o)):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},yi.prototype.getLayoutProperty=function(e,r){var i=this.getLayer(e);if(i)return i.getLayoutProperty(r);this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style.")))},yi.prototype.setPaintProperty=function(e,r,i,n){void 0===n&&(n={}),this._checkLoaded();var o=this.getLayer(e);o?t.deepEqual(o.getPaintProperty(r),i)||(o.setPaintProperty(r,i,n)&&this._updateLayer(o),this._changed=!0,this._updatedPaintProps[e]=!0):this.fire(new t.ErrorEvent(new Error("The layer '"+e+"' does not exist in the map's style and cannot be styled.")))},yi.prototype.getPaintProperty=function(t,e){return this.getLayer(t).getPaintProperty(e)},yi.prototype.setFeatureState=function(e,r){this._checkLoaded();var i,n=e.source,o=e.sourceLayer,a=this.sourceCaches[n];void 0!==a?"geojson"===(i=a.getSource().type)&&o?this.fire(new t.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==i||o?(void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),a.setFeatureState(o,e.id,r)):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types."))):this.fire(new t.ErrorEvent(new Error("The source '"+n+"' does not exist in the map's style.")))},yi.prototype.removeFeatureState=function(e,r){this._checkLoaded();var i,n,o=e.source,a=this.sourceCaches[o];void 0!==a?(n="vector"===(i=a.getSource().type)?e.sourceLayer:void 0,"vector"!==i||n?r&&"string"!=typeof e.id&&"number"!=typeof e.id?this.fire(new t.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):a.removeFeatureState(n,e.id,r):this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))):this.fire(new t.ErrorEvent(new Error("The source '"+o+"' does not exist in the map's style.")))},yi.prototype.getFeatureState=function(e){this._checkLoaded();var r=e.source,i=e.sourceLayer,n=this.sourceCaches[r];if(void 0!==n){if("vector"!==n.getSource().type||i)return void 0===e.id&&this.fire(new t.ErrorEvent(new Error("The feature id parameter must be provided."))),n.getFeatureState(i,e.id);this.fire(new t.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}else this.fire(new t.ErrorEvent(new Error("The source '"+r+"' does not exist in the map's style.")))},yi.prototype.getTransition=function(){return t.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)},yi.prototype.serialize=function(){return t.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:t.mapObject(this.sourceCaches,(function(t){return t.serialize()})),layers:this._serializeLayers(this._order)},(function(t){return void 0!==t}))},yi.prototype._updateLayer=function(t){this._updatedLayers[t.id]=!0,t.source&&!this._updatedSources[t.source]&&"raster"!==this.sourceCaches[t.source].getSource().type&&(this._updatedSources[t.source]="reload",this.sourceCaches[t.source].pause()),this._changed=!0},yi.prototype._flattenAndSortRenderedFeatures=function(t){for(var e=this,r=function(t){return"fill-extrusion"===e._layers[t].type},i={},n=[],o=this._order.length-1;0<=o;o--){var a=this._order[o];if(r(a)){i[a]=o;for(var s=0,u=t;s<u.length;s+=1){var l=u[s][a];if(l)for(var c=0,p=l;c<p.length;c+=1)n.push(p[c])}}}n.sort((function(t,e){return e.intersectionZ-t.intersectionZ}));for(var h=[],f=this._order.length-1;0<=f;f--){var d=this._order[f];if(r(d))for(var m=n.length-1;0<=m;m--){var y=n[m].feature;if(i[y.layer.id]<f)break;h.push(y),n.pop()}else for(var g=0,_=t;g<_.length;g+=1){var v=_[g][d];if(v)for(var x=0,b=v;x<b.length;x+=1)h.push(b[x].feature)}}return h},yi.prototype.queryRenderedFeatures=function(e,r,i){r&&r.filter&&this._validate(t.validateStyle.filter,"queryRenderedFeatures.filter",r.filter,null,r);var n={};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new t.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(var o=0,a=r.layers;o<a.length;o+=1){var s=a[o],u=this._layers[s];if(!u)return this.fire(new t.ErrorEvent(new Error("The layer '"+s+"' does not exist in the map's style and cannot be queried for features."))),[];n[u.source]=!0}}var l,c=[];for(l in r.availableImages=this._availableImages,this.sourceCaches)r.layers&&!n[l]||c.push(Q(this.sourceCaches[l],this._layers,this._serializedLayers,e,r,i));return this.placement&&c.push(function(t,r,i,n,o,a){for(var s={},u=o.queryRenderedSymbols(e),l=[],c=0,p=Object.keys(u).map(Number);c<p.length;c+=1)l.push(a[p[c]]);l.sort($);for(var h=0,f=l;h<f.length;h+=1)!function(){var e,i=f[h],o=i.featureIndex.lookupSymbolFeatures(u[i.bucketInstanceId],r,i.bucketIndex,i.sourceLayerIndex,n.filter,n.layers,n.availableImages,t);for(e in o){var a=s[e]=s[e]||[],l=o[e];l.sort((function(t,e){var r=i.featureSortOrder;if(r){var n=r.indexOf(t.featureIndex);return r.indexOf(e.featureIndex)-n}return e.featureIndex-t.featureIndex}));for(var c=0,p=l;c<p.length;c+=1)a.push(p[c])}}();for(var d in s)!function(e){s[e].forEach((function(r){var n=r.feature;r=i[t[e].source].getFeatureState(n.layer["source-layer"],n.id);n.source=n.layer.source,n.layer["source-layer"]&&(n.sourceLayer=n.layer["source-layer"]),n.state=r}))}(d);return s}(this._layers,this._serializedLayers,this.sourceCaches,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(c)},yi.prototype.querySourceFeatures=function(e,r){return r&&r.filter&&this._validate(t.validateStyle.filter,"querySourceFeatures.filter",r.filter,null,r),(e=this.sourceCaches[e])?function(t,e){for(var r=t.getRenderableIds().map((function(e){return t.getTileByID(e)})),i=[],n={},o=0;o<r.length;o++){var a=r[o],s=a.tileID.canonical.key;n[s]||(n[s]=!0,a.querySourceFeatures(i,e))}return i}(e,r):[]},yi.prototype.addSourceType=function(t,e,r){return yi.getSourceType(t)?r(new Error('A source type called "'+t+'" already exists.')):(yi.setSourceType(t,e),e.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:t,url:e.workerSourceURL},r):r(null,null))},yi.prototype.getLight=function(){return this.light.getLight()},yi.prototype.setLight=function(e,r){void 0===r&&(r={}),this._checkLoaded();var i,n,o=this.light.getLight(),a=!1;for(i in e)if(!t.deepEqual(e[i],o[i])){a=!0;break}a&&(n={now:t.browser.now(),transition:t.extend({duration:300,delay:0},this.stylesheet.transition)},this.light.setLight(e,r),this.light.updateTransitions(n))},yi.prototype._validate=function(e,r,i,n,o){return void 0===o&&(o={}),(!o||!1!==o.validate)&&ci(this,e.call(t.validateStyle,t.extend({key:r,style:this.serialize(),value:i,styleSpec:t.styleSpec},n)))},yi.prototype._remove=function(){for(var e in this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),t.evented.off("pluginStateChange",this._rtlTextPluginCallback),this._layers)this._layers[e].setEventedParent(null);for(var r in this.sourceCaches)this.sourceCaches[r].clearTiles(),this.sourceCaches[r].setEventedParent(null);this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()},yi.prototype._clearSource=function(t){this.sourceCaches[t].clearTiles()},yi.prototype._reloadSource=function(t){this.sourceCaches[t].resume(),this.sourceCaches[t].reload()},yi.prototype._updateSources=function(t){for(var e in this.sourceCaches)this.sourceCaches[e].update(t)},yi.prototype._generateCollisionBoxes=function(){for(var t in this.sourceCaches)this._reloadSource(t)},yi.prototype._updatePlacement=function(e,r,i,n,o){void 0===o&&(o=!1);for(var a=!1,s=!1,u={},l=0,c=this._order;l<c.length;l+=1){var p,h=this._layers[c[l]];"symbol"===h.type&&(u[h.source]||(p=this.sourceCaches[h.source],u[h.source]=p.getRenderableIds(!0).map((function(t){return p.getTileByID(t)})).sort((function(t,e){return e.tileID.overscaledZ-t.tileID.overscaledZ||(t.tileID.isLessThan(e.tileID)?-1:1)}))),h=this.crossTileSymbolIndex.addLayer(h,u[h.source],e.center.lng),a=a||h)}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((o=o||this._layerOrderChanged||0===i)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(t.browser.now(),e.zoom))&&(this.pauseablePlacement=new ni(e,this._order,o,r,i,n,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,u),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(t.browser.now()),s=!0),a&&this.pauseablePlacement.placement.setStale()),s||a)for(var f=0,d=this._order;f<d.length;f+=1){var m=this._layers[d[f]];"symbol"===m.type&&this.placement.updateLayerOpacities(m,u[m.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(t.browser.now())},yi.prototype._releaseSymbolFadeTiles=function(){for(var t in this.sourceCaches)this.sourceCaches[t].releaseSymbolFadeTiles()},yi.prototype.getImages=function(t,e,r){this.imageManager.getImages(e.icons,r),this._updateTilesForChangedImages(),(r=this.sourceCaches[e.source])&&r.setDependencies(e.tileID.key,e.type,e.icons)},yi.prototype.getGlyphs=function(t,e,r){this.glyphManager.getGlyphs(e.stacks,r)},yi.prototype.getResource=function(e,r,i){return t.makeRequest(r,i)},yi);function yi(e,r){var i=this;void 0===r&&(r={}),pi.call(this),this.map=e,this.dispatcher=new I(dr(),this),this.imageManager=new h,this.imageManager.setEventedParent(this),this.glyphManager=new x(e._requestManager,r.localIdeographFontFamily),this.lineAtlas=new T(256,512),this.crossTileSymbolIndex=new li,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new t.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",t.getReferrer());var n=this;this._rtlTextPluginCallback=yi.registerForPluginStateChange((function(e){n.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:e.pluginStatus,pluginURL:e.pluginURL},(function(e,r){if(t.triggerPluginCompletionEvent(e),r&&r.every((function(t){return t})))for(var i in n.sourceCaches)n.sourceCaches[i].reload()}))})),this.on("data",(function(t){if("source"===t.dataType&&"metadata"===t.sourceDataType&&(t=i.sourceCaches[t.sourceId])){var e=t.getSource();if(e&&e.vectorLayerIds)for(var r in i._layers){var n=i._layers[r];n.source===e.id&&i._validateLayer(n)}}}))}mi.getSourceType=function(t){return G[t]},mi.setSourceType=function(t,e){G[t]=e},mi.registerForPluginStateChange=t.registerForPluginStateChange;var gi=t.createLayout([{name:"a_pos",type:"Int16",components:2}]),_i=Bi("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif","#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 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\n);}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;}"),vi=Bi("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),xi=Bi("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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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);}"),bi=Bi("varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 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);}"),wi=Bi("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);}"),Si=Bi("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 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;}"),Ti=Bi("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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}","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;}"),Ei=Bi("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;}"),Ii=Bi("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);}"),Ai=Bi("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);}"),Ci=Bi("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"),Pi=Bi("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"),Mi=Bi("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;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 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;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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;}"),ki=Bi("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 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;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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);}"),zi=(d=Bi("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 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;}"),f=Bi("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;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 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\n? a_pos\n: 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;}"),Bi("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform 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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}")),Li=(R=Bi("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;\n#define PI 3.141592653589793\nvoid 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;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),O=Bi("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat 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);}"),F=Bi("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;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat 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);}"),j=Bi("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;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 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;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat 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;}"),V=Bi("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;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat 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);}"),q=Bi("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);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","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;}"),Bi("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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));}"));ye=Bi("#define SDF_PX 8.0\nuniform 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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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);}"),fr=Bi("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform 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;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}","const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 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 ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_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 Bi(t,e){var r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,i=e.match(/attribute ([\w]+) ([\w]+)/g),n=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=(n=o?o.concat(n):n,{});return{fragmentSource:t=t.replace(r,(function(t,e,r,i,n){return a[n]=!0,"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nvarying "+r+" "+i+" "+n+";\n#else\nuniform "+r+" "+i+" u_"+n+";\n#endif\n":"\n#ifdef HAS_UNIFORM_u_"+n+"\n "+r+" "+i+" "+n+" = u_"+n+";\n#endif\n"})),vertexSource:e=e.replace(r,(function(t,e,r,i,n){var o="float"===i?"vec2":"vec4",s=n.match(/color/)?"color":o;return a[n]?"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nuniform lowp float u_"+n+"_t;\nattribute "+r+" "+o+" a_"+n+";\nvarying "+r+" "+i+" "+n+";\n#else\nuniform "+r+" "+i+" u_"+n+";\n#endif\n":"vec4"==s?"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+n+" = a_"+n+";\n#else\n "+r+" "+i+" "+n+" = u_"+n+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+n+" = unpack_mix_"+s+"(a_"+n+", u_"+n+"_t);\n#else\n "+r+" "+i+" "+n+" = u_"+n+";\n#endif\n":"define"===e?"\n#ifndef HAS_UNIFORM_u_"+n+"\nuniform lowp float u_"+n+"_t;\nattribute "+r+" "+o+" a_"+n+";\n#else\nuniform "+r+" "+i+" u_"+n+";\n#endif\n":"vec4"==s?"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+r+" "+i+" "+n+" = a_"+n+";\n#else\n "+r+" "+i+" "+n+" = u_"+n+";\n#endif\n":"\n#ifndef HAS_UNIFORM_u_"+n+"\n "+r+" "+i+" "+n+" = unpack_mix_"+s+"(a_"+n+", u_"+n+"_t);\n#else\n "+r+" "+i+" "+n+" = u_"+n+";\n#endif\n"})),staticAttributes:i,staticUniforms:n}}function Di(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}var Ri=Object.freeze({__proto__:null,prelude:_i,background:vi,backgroundPattern:xi,circle:bi,clippingMask:wi,heatmap:Si,heatmapTexture:Ti,collisionBox:Ei,collisionCircle:Ii,debug:Ai,fill:Ci,fillOutline:Pi,fillOutlinePattern:Mi,fillPattern:ki,fillExtrusion:d,fillExtrusionPattern:f,hillshadePrepare:zi,hillshade:R,line:O,lineGradient:F,linePattern:j,lineSDF:V,raster:q,symbolIcon:Li,symbolSDF:ye,symbolTextAndIcon:fr});function Oi(t){for(var e,r=[],i=0;i<t.length;i++)null!==t[i]&&(e=t[i].split(" "),r.push(e.pop()));return r}function Fi(t,e,r,i,n,o){var a=t.gl;this.program=a.createProgram();for(var s=Oi(r.staticAttributes),u=i?i.getBinderAttributes():[],l=s.concat(u),c=(s=r.staticUniforms?Oi(r.staticUniforms):[],u=i?i.getBinderUniforms():[],[]),p=0,h=s.concat(u);p<h.length;p+=1){var f=h[p];c.indexOf(f)<0&&c.push(f)}if(u=i?i.defines():[],o&&u.push("#define OVERDRAW_INSPECTOR;"),o=u.concat(_i.fragmentSource,r.fragmentSource).join("\n"),u=u.concat(_i.vertexSource,r.vertexSource).join("\n"),r=a.createShader(a.FRAGMENT_SHADER),a.isContextLost())this.failedToCreate=!0;else if(a.shaderSource(r,o),a.compileShader(r),a.attachShader(this.program,r),o=a.createShader(a.VERTEX_SHADER),a.isContextLost())this.failedToCreate=!0;else{a.shaderSource(o,u),a.compileShader(o),a.attachShader(this.program,o),this.attributes={};var d={};this.numAttributes=l.length;for(var m=0;m<this.numAttributes;m++)l[m]&&(a.bindAttribLocation(this.program,m,l[m]),this.attributes[l[m]]=m);a.linkProgram(this.program),a.deleteShader(o),a.deleteShader(r);for(var y=0;y<c.length;y++){var g,_=c[y];!_||d[_]||(g=a.getUniformLocation(this.program,_))&&(d[_]=g)}this.fixedUniforms=n(t,d),this.binderUniforms=i?i.getUniforms(t,d):[]}}function ji(t,e,r){var i=1/Or(r,1,e.transform.tileZoom),n=Math.pow(2,r.tileID.overscaledZ);n=(e=r.tileSize*Math.pow(2,e.transform.tileZoom)/n)*(r.tileID.canonical.x+r.tileID.wrap*n),e*=r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[i,t.fromScale,t.toScale],u_fade:t.t,u_pixel_coord_upper:[n>>16,e>>16],u_pixel_coord_lower:[65535&n,65535&e]}}function Ui(e,r,i,n){var o=r.style.light,a=[(s=o.properties.get("position")).x,s.y,s.z],s=t.create$1();return"viewport"===o.properties.get("anchor")&&t.fromRotation(s,-r.transform.angle),t.transformMat3(a,a,s),s=o.properties.get("color"),{u_matrix:e,u_lightpos:a,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[s.r,s.g,s.b],u_vertical_gradient:+i,u_opacity:n}}function Ni(t){return{u_matrix:t}}function Vi(e,r,i,n){return t.extend(Ni(e),ji(i,r,n))}function qi(t){return{u_matrix:t}}function Gi(e,r,i){var n=e.transform;return{u_matrix:Wi(e,r,i),u_ratio:1/Or(r,1,n.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_units_to_pixels:[1/n.pixelsToGLUnits[0],1/n.pixelsToGLUnits[1]]}}Di.prototype.bind=function(t,e,r,i,n,o,a,s){this.context=t;for(var u=this.boundPaintVertexBuffers.length!==i.length,l=0;!u&&l<i.length;l++)this.boundPaintVertexBuffers[l]!==i[l]&&(u=!0);t.extVertexArrayObject&&this.vao&&this.boundProgram===e&&this.boundLayoutVertexBuffer===r&&!u&&this.boundIndexBuffer===n&&this.boundVertexOffset===o&&this.boundDynamicVertexBuffer===a&&this.boundDynamicVertexBuffer2===s?(t.bindVertexArrayOES.set(this.vao),a&&a.bind(),n&&n.dynamicDraw&&n.bind(),s&&s.bind()):this.freshBind(e,r,i,n,o,a,s)},Di.prototype.freshBind=function(t,e,r,i,n,o,a){var s,u=t.numAttributes,l=this.context,c=l.gl;if(l.extVertexArrayObject)this.vao&&this.destroy(),this.vao=l.extVertexArrayObject.createVertexArrayOES(),l.bindVertexArrayOES.set(this.vao),s=0,this.boundProgram=t,this.boundLayoutVertexBuffer=e,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=i,this.boundVertexOffset=n,this.boundDynamicVertexBuffer=o,this.boundDynamicVertexBuffer2=a;else{s=l.currentNumAttributes||0;for(var p=u;p<s;p++)c.disableVertexAttribArray(p)}e.enableAttributes(c,t);for(var h=0,f=r;h<f.length;h+=1)f[h].enableAttributes(c,t);o&&o.enableAttributes(c,t),a&&a.enableAttributes(c,t),e.bind(),e.setVertexAttribPointers(c,t,n);for(var d=0,m=r;d<m.length;d+=1){var y=m[d];y.bind(),y.setVertexAttribPointers(c,t,n)}o&&(o.bind(),o.setVertexAttribPointers(c,t,n)),i&&i.bind(),a&&(a.bind(),a.setVertexAttribPointers(c,t,n)),l.currentNumAttributes=u},Di.prototype.destroy=function(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)},Fi.prototype.draw=function(t,e,r,i,n,o,a,s,u,l,c,p,h,f,d,m){var y=t.gl;if(!this.failedToCreate){for(var g in t.program.set(this.program),t.setDepthMode(r),t.setStencilMode(i),t.setColorMode(n),t.setCullFace(o),this.fixedUniforms)this.fixedUniforms[g].set(a[g]);f&&f.setUniforms(t,this.binderUniforms,p,{zoom:h});for(var _=((h={})[y.LINES]=2,h[y.TRIANGLES]=3,h[y.LINE_STRIP]=1,h[e]),v=0,x=c.get();v<x.length;v+=1){var b=x[v],w=b.vaos||(b.vaos={});(w[s]||(w[s]=new Di)).bind(t,this,u,f?f.getPaintVertexBuffers():[],l,b.vertexOffset,d,m),y.drawElements(e,b.primitiveLength*_,y.UNSIGNED_SHORT,b.primitiveOffset*_*2)}}};var Hi=function(t,e,r){return void 0===r&&(r=1),{u_matrix:t,u_color:e,u_overlay:0,u_overlay_scale:r}};function Zi(t,e){return 1/Or(t,1,e.tileZoom)}function Wi(t,e,r){return t.translatePosMatrix(e.tileID.posMatrix,e,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}function Xi(t,e,r,i,n){return{u_matrix:t,u_tl_parent:e,u_scale_parent:r,u_buffer_scale:1,u_fade_t:i.mix,u_opacity:i.opacity*n.paint.get("raster-opacity"),u_image0:0,u_image1:1,u_brightness_low:n.paint.get("raster-brightness-min"),u_brightness_high:n.paint.get("raster-brightness-max"),u_saturation_factor:0<(i=n.paint.get("raster-saturation"))?1-1/(1.001-i):-i,u_contrast_factor:0<(i=n.paint.get("raster-contrast"))?1/(1-i):1+i,u_spin_weights:function(t){t*=Math.PI/180;var e=Math.sin(t);return[(2*(t=Math.cos(t))+1)/3,(-Math.sqrt(3)*e-t+1)/3,(Math.sqrt(3)*e-t+1)/3]}(n.paint.get("raster-hue-rotate"))}}function Ki(t,e,r,i,n,o,a,s,u,l){var c=n.transform;return{u_is_size_zoom_constant:+("constant"===t||"source"===t),u_is_size_feature_constant:+("constant"===t||"camera"===t),u_size_t:e?e.uSizeT:0,u_size:e?e.uSize:0,u_camera_to_center_distance:c.cameraToCenterDistance,u_pitch:c.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:c.width/c.height,u_fade_change:n.options.fadeDuration?n.symbolFadeChange:1,u_matrix:o,u_label_plane_matrix:a,u_coord_matrix:s,u_is_text:+u,u_pitch_with_map:+i,u_texsize:l,u_texture:0}}function Ji(e,r,i,n,o,a,s,u,l,c,p){var h=o.transform;return t.extend(Ki(e,r,i,n,o,a,s,u,l,c),{u_gamma_scale:n?Math.cos(h._pitch)*h.cameraToCenterDistance:1,u_device_pixel_ratio:t.browser.devicePixelRatio,u_is_halo:+p})}var Yi,Qi={fillExtrusion:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fillExtrusionPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_lightpos:new t.Uniform3f(e,r.u_lightpos),u_lightintensity:new t.Uniform1f(e,r.u_lightintensity),u_lightcolor:new t.Uniform3f(e,r.u_lightcolor),u_vertical_gradient:new t.Uniform1f(e,r.u_vertical_gradient),u_height_factor:new t.Uniform1f(e,r.u_height_factor),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade),u_opacity:new t.Uniform1f(e,r.u_opacity)}},fill:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},fillPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},fillOutline:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world)}},fillOutlinePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_texsize:new t.Uniform2f(e,r.u_texsize),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},circle:function(e,r){return{u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_scale_with_map:new t.Uniform1i(e,r.u_scale_with_map),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},collisionBox:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pixels_to_tile_units:new t.Uniform1f(e,r.u_pixels_to_tile_units),u_extrude_scale:new t.Uniform2f(e,r.u_extrude_scale),u_overscale_factor:new t.Uniform1f(e,r.u_overscale_factor)}},collisionCircle:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_inv_matrix:new t.UniformMatrix4f(e,r.u_inv_matrix),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_viewport_size:new t.Uniform2f(e,r.u_viewport_size)}},debug:function(e,r){return{u_color:new t.UniformColor(e,r.u_color),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_overlay:new t.Uniform1i(e,r.u_overlay),u_overlay_scale:new t.Uniform1f(e,r.u_overlay_scale)}},clippingMask:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmap:function(e,r){return{u_extrude_scale:new t.Uniform1f(e,r.u_extrude_scale),u_intensity:new t.Uniform1f(e,r.u_intensity),u_matrix:new t.UniformMatrix4f(e,r.u_matrix)}},heatmapTexture:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_world:new t.Uniform2f(e,r.u_world),u_image:new t.Uniform1i(e,r.u_image),u_color_ramp:new t.Uniform1i(e,r.u_color_ramp),u_opacity:new t.Uniform1f(e,r.u_opacity)}},hillshade:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_latrange:new t.Uniform2f(e,r.u_latrange),u_light:new t.Uniform2f(e,r.u_light),u_shadow:new t.UniformColor(e,r.u_shadow),u_highlight:new t.UniformColor(e,r.u_highlight),u_accent:new t.UniformColor(e,r.u_accent)}},hillshadePrepare:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_image:new t.Uniform1i(e,r.u_image),u_dimension:new t.Uniform2f(e,r.u_dimension),u_zoom:new t.Uniform1f(e,r.u_zoom),u_unpack:new t.Uniform4f(e,r.u_unpack)}},line:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels)}},lineGradient:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_image:new t.Uniform1i(e,r.u_image),u_image_height:new t.Uniform1f(e,r.u_image_height)}},linePattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_texsize:new t.Uniform2f(e,r.u_texsize),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_image:new t.Uniform1i(e,r.u_image),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_scale:new t.Uniform3f(e,r.u_scale),u_fade:new t.Uniform1f(e,r.u_fade)}},lineSDF:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_ratio:new t.Uniform1f(e,r.u_ratio),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_units_to_pixels:new t.Uniform2f(e,r.u_units_to_pixels),u_patternscale_a:new t.Uniform2f(e,r.u_patternscale_a),u_patternscale_b:new t.Uniform2f(e,r.u_patternscale_b),u_sdfgamma:new t.Uniform1f(e,r.u_sdfgamma),u_image:new t.Uniform1i(e,r.u_image),u_tex_y_a:new t.Uniform1f(e,r.u_tex_y_a),u_tex_y_b:new t.Uniform1f(e,r.u_tex_y_b),u_mix:new t.Uniform1f(e,r.u_mix)}},raster:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_tl_parent:new t.Uniform2f(e,r.u_tl_parent),u_scale_parent:new t.Uniform1f(e,r.u_scale_parent),u_buffer_scale:new t.Uniform1f(e,r.u_buffer_scale),u_fade_t:new t.Uniform1f(e,r.u_fade_t),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image0:new t.Uniform1i(e,r.u_image0),u_image1:new t.Uniform1i(e,r.u_image1),u_brightness_low:new t.Uniform1f(e,r.u_brightness_low),u_brightness_high:new t.Uniform1f(e,r.u_brightness_high),u_saturation_factor:new t.Uniform1f(e,r.u_saturation_factor),u_contrast_factor:new t.Uniform1f(e,r.u_contrast_factor),u_spin_weights:new t.Uniform3f(e,r.u_spin_weights)}},symbolIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture)}},symbolSDF:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texture:new t.Uniform1i(e,r.u_texture),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},symbolTextAndIcon:function(e,r){return{u_is_size_zoom_constant:new t.Uniform1i(e,r.u_is_size_zoom_constant),u_is_size_feature_constant:new t.Uniform1i(e,r.u_is_size_feature_constant),u_size_t:new t.Uniform1f(e,r.u_size_t),u_size:new t.Uniform1f(e,r.u_size),u_camera_to_center_distance:new t.Uniform1f(e,r.u_camera_to_center_distance),u_pitch:new t.Uniform1f(e,r.u_pitch),u_rotate_symbol:new t.Uniform1i(e,r.u_rotate_symbol),u_aspect_ratio:new t.Uniform1f(e,r.u_aspect_ratio),u_fade_change:new t.Uniform1f(e,r.u_fade_change),u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_label_plane_matrix:new t.UniformMatrix4f(e,r.u_label_plane_matrix),u_coord_matrix:new t.UniformMatrix4f(e,r.u_coord_matrix),u_is_text:new t.Uniform1i(e,r.u_is_text),u_pitch_with_map:new t.Uniform1i(e,r.u_pitch_with_map),u_texsize:new t.Uniform2f(e,r.u_texsize),u_texsize_icon:new t.Uniform2f(e,r.u_texsize_icon),u_texture:new t.Uniform1i(e,r.u_texture),u_texture_icon:new t.Uniform1i(e,r.u_texture_icon),u_gamma_scale:new t.Uniform1f(e,r.u_gamma_scale),u_device_pixel_ratio:new t.Uniform1f(e,r.u_device_pixel_ratio),u_is_halo:new t.Uniform1i(e,r.u_is_halo)}},background:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_color:new t.UniformColor(e,r.u_color)}},backgroundPattern:function(e,r){return{u_matrix:new t.UniformMatrix4f(e,r.u_matrix),u_opacity:new t.Uniform1f(e,r.u_opacity),u_image:new t.Uniform1i(e,r.u_image),u_pattern_tl_a:new t.Uniform2f(e,r.u_pattern_tl_a),u_pattern_br_a:new t.Uniform2f(e,r.u_pattern_br_a),u_pattern_tl_b:new t.Uniform2f(e,r.u_pattern_tl_b),u_pattern_br_b:new t.Uniform2f(e,r.u_pattern_br_b),u_texsize:new t.Uniform2f(e,r.u_texsize),u_mix:new t.Uniform1f(e,r.u_mix),u_pattern_size_a:new t.Uniform2f(e,r.u_pattern_size_a),u_pattern_size_b:new t.Uniform2f(e,r.u_pattern_size_b),u_scale_a:new t.Uniform1f(e,r.u_scale_a),u_scale_b:new t.Uniform1f(e,r.u_scale_b),u_pixel_coord_upper:new t.Uniform2f(e,r.u_pixel_coord_upper),u_pixel_coord_lower:new t.Uniform2f(e,r.u_pixel_coord_lower),u_tile_units_to_pixels:new t.Uniform1f(e,r.u_tile_units_to_pixels)}}};function $i(e,r,i,n,o,a,s){for(var u=e.context,l=u.gl,c=e.useProgram("collisionBox"),p=[],h=0,f=0,d=0;d<n.length;d++){var m,y,g,_,v=n[d],x=r.getTile(v),b=x.getBucket(i);b&&(m=v.posMatrix,0===o[0]&&0===o[1]||(m=e.translatePosMatrix(v.posMatrix,x,o,a)),y=s?b.textCollisionBox:b.iconCollisionBox,0<(v=b.collisionCircleArray).length&&(g=t.create(),_=m,t.mul(g,b.placementInvProjMatrix,e.transform.glCoordMatrix),t.mul(g,g,b.placementViewportMatrix),p.push({circleArray:v,circleOffset:f,transform:_,invTransform:g}),f=h+=v.length/4),y&&c.draw(u,l.LINES,$e.disabled,tr.disabled,e.colorModeForRenderPass(),rr.disabled,(_=m,m=v=void 0,v=Or(x=x,1,(g=e.transform).zoom),m=Math.pow(2,g.zoom-x.tileID.overscaledZ),x=x.tileID.overscaleFactor(),{u_matrix:_,u_camera_to_center_distance:g.cameraToCenterDistance,u_pixels_to_tile_units:v,u_extrude_scale:[g.pixelsToGLUnits[0]/(v*m),g.pixelsToGLUnits[1]/(v*m)],u_overscale_factor:x}),i.id,y.layoutVertexBuffer,y.indexBuffer,y.segments,null,e.transform.zoom,null,null,y.collisionVertexBuffer))}if(s&&p.length){var w=e.useProgram("collisionCircle"),S=new t.StructArrayLayout2f1f2i16;S.resize(4*h),S._trim();for(var T=0,E=0,I=p;E<I.length;E+=1)for(var A=I[E],C=0;C<A.circleArray.length/4;C++){var P=4*C,M=A.circleArray[0+P],k=A.circleArray[1+P],z=A.circleArray[2+P];P=A.circleArray[3+P];S.emplace(T++,M,k,z,P,0),S.emplace(T++,M,k,z,P,1),S.emplace(T++,M,k,z,P,2),S.emplace(T++,M,k,z,P,3)}(!Yi||Yi.length<2*h)&&(Yi=function(){var e=2*h,r=new t.StructArrayLayout3ui6;r.resize(e),r._trim();for(var i=0;i<e;i++){var n=6*i;r.uint16[0+n]=4*i+0,r.uint16[1+n]=4*i+1,r.uint16[2+n]=4*i+2,r.uint16[3+n]=4*i+2,r.uint16[4+n]=4*i+3,r.uint16[5+n]=4*i+0}return r}());for(var L=u.createIndexBuffer(Yi,!0),B=u.createVertexBuffer(S,t.collisionCircleLayout.members,!0),D=0,R=p;D<R.length;D+=1){var O=R[D],F={u_matrix:O.transform,u_inv_matrix:O.invTransform,u_camera_to_center_distance:(F=e.transform).cameraToCenterDistance,u_viewport_size:[F.width,F.height]};w.draw(u,l.TRIANGLES,$e.disabled,tr.disabled,e.colorModeForRenderPass(),rr.disabled,F,i.id,B,L,t.SegmentVector.simpleSegment(0,2*O.circleOffset,O.circleArray.length,O.circleArray.length/2),null,e.transform.zoom,null,null,null)}B.destroy(),L.destroy()}}var tn=t.identity(new Float32Array(16));function en(e,r,i,n,o,a,s,u,l,c,p){var h=e.text.placedSymbolArray,f=e.text.dynamicLayoutVertexArray,d=e.icon.dynamicLayoutVertexArray,m={};f.clear();for(var y,g,_,v,x=0;x<h.length;x++){var b=h.get(x);if(I=b.hidden||!b.crossTileID||e.allowVerticalPlacement&&!b.placedOrientation?null:n[b.crossTileID]){var w=new t.Point(b.anchorX,b.anchorY),S=Ir(w,i?u:s),T=Ar(a.cameraToCenterDistance,S.signedDistanceFromCamera),E=o.evaluateSizeForFeature(e.textSizeData,c,b)*T/t.ONE_EM;i&&(E*=e.tilePixelRatio/l);for(var I=(y=I.anchor,g=I.width,_=I.height,v=I.textOffset,T=I.textBoxScale,I=E,E=void 0,g=-((E=t.getAnchorAlignment(y)).horizontalAlign-.5)*g,_=-(E.verticalAlign-.5)*_,v=t.evaluateVariableOffset(y,v),new t.Point((g/T+v[0])*I,(_/T+v[1])*I)),A=i?Ir(w.add(I),s).point:S.point.add(r?I.rotate(-a.angle):I),C=e.allowVerticalPlacement&&b.placedOrientation===t.WritingMode.vertical?Math.PI/2:0,P=0;P<b.numGlyphs;P++)t.addDynamicAttributes(f,A,C);p&&0<=b.associatedIconIndex&&(m[b.associatedIconIndex]={shiftedAnchor:A,angle:C})}else Br(b.numGlyphs,f)}if(p){d.clear();for(var M=e.icon.placedSymbolArray,k=0;k<M.length;k++){var z=M.get(k);if(z.hidden)Br(z.numGlyphs,d);else{var L=m[k];if(L)for(var B=0;B<z.numGlyphs;B++)t.addDynamicAttributes(d,L.shiftedAnchor,L.angle);else Br(z.numGlyphs,d)}}e.icon.dynamicLayoutVertexBuffer.updateData(d)}e.text.dynamicLayoutVertexBuffer.updateData(f)}function rn(e,r,i,n,o,a,s,u,l,c,p,h){for(var f=e.context,d=f.gl,m=e.transform,y="map"===u,g="map"===l,_=y&&"point"!==i.layout.get("symbol-placement"),v=y&&!g&&!_,x=!i.layout.get("symbol-sort-key").isConstant(),b=!1,w=e.depthModeForSublayer(0,$e.ReadOnly),S=i.layout.get("text-variable-anchor"),T=[],E=0,I=n;E<I.length;E+=1){var A=I[E],C=r.getTile(A),P=C.getBucket(i);if(P){var M=o?P.text:P.icon;if(M&&M.segments.get().length){var k=M.programConfigurations.get(i.id),z=o||P.sdfIcons,L=o?P.textSizeData:P.iconSizeData,B=g||0!==m.pitch,D=e.useProgram((K=z,X=o,P.iconsInText&&X?"symbolTextAndIcon":K?"symbolSDF":"symbolIcon"),k),R=t.evaluateSizeForZoom(L,m.zoom),O=void 0,F=[0,0],j=void 0,U=void 0,N=null,V=void 0;o?(j=C.glyphAtlasTexture,U=d.LINEAR,O=C.glyphAtlasTexture.size,P.iconsInText&&(F=C.imageAtlasTexture.size,N=C.imageAtlasTexture,V=B||e.options.rotating||e.options.zooming||"composite"===L.kind||"camera"===L.kind?d.LINEAR:d.NEAREST)):(J=1!==i.layout.get("icon-size").constantOr(0)||P.iconsNeedLinear,j=C.imageAtlasTexture,U=z||e.options.rotating||e.options.zooming||J||B?d.LINEAR:d.NEAREST,O=C.imageAtlasTexture.size);var q=Or(C,1,e.transform.zoom),G=Tr(A.posMatrix,g,y,e.transform,q),H=Er(A.posMatrix,g,y,e.transform,q),Z=S&&P.hasTextData(),W="none"!==i.layout.get("icon-text-fit")&&Z&&P.hasIconData();_&&function(e,r,i,n,o,a,s,u){var l=n?e.textSizeData:e.iconSizeData,c=t.evaluateSizeForZoom(l,i.transform.zoom),p=[256/i.width*2+1,256/i.height*2+1],h=(n?e.text:e.icon).dynamicLayoutVertexArray;h.clear();for(var f=e.lineVertexArray,d=(n?e.text:e.icon).placedSymbolArray,m=i.transform.width/i.transform.height,y=!1,g=0;g<d.length;g++){var _,v,x,b,w,S=d.get(g);S.hidden||S.writingMode===t.WritingMode.vertical&&!y?Br(S.numGlyphs,h):(y=!1,x=[S.anchorX,S.anchorY,0,1],t.transformMat4(x,x,r),v=p,b=void 0,b=(_=x)[0]/_[3],_=_[1]/_[3],b>=-v[0]&&b<=v[0]&&_>=-v[1]&&_<=v[1]?(w=Ar(i.transform.cameraToCenterDistance,x[3]),b=t.evaluateSizeForFeature(l,c,S),_=s?b/w:b*w,x=Ir(v=new t.Point(S.anchorX,S.anchorY),o).point,y=(w=Mr(S,_,!(b={}),u,r,o,a,e.glyphOffsetArray,f,h,x,v,b,m)).useVertical,(w.notEnoughRoom||y||w.needsFlipping&&Mr(S,_,!0,u,r,o,a,e.glyphOffsetArray,f,h,x,v,b,m).notEnoughRoom)&&Br(S.numGlyphs,h)):Br(S.numGlyphs,h))}(n?e.text:e.icon).dynamicLayoutVertexBuffer.updateData(h)}(P,A.posMatrix,e,o,G,H,g,c);var X=e.translatePosMatrix(A.posMatrix,C,a,s),K=_||o&&S||W?tn:G,J=(k=e.translatePosMatrix(H,C,a,s,!0),z&&0!==i.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1)),Y={program:D,buffers:M,uniformValues:z?P.iconsInText?(B=L.kind,q=R,Z=v,A=g,W=e,G=X,H=K,C=k,D=O,F=F,t.extend(Ji(B,q,Z,A,W,G,H,C,!0,D,!0),{u_texsize_icon:F,u_texture_icon:1})):Ji(L.kind,R,v,g,e,X,K,k,o,O,!0):Ki(L.kind,R,v,g,e,X,K,k,o,O),atlasTexture:j,atlasTextureIcon:N,atlasInterpolation:U,atlasInterpolationIcon:V,isSDF:z,hasHalo:J};if(x&&P.canOverlap){b=!0;for(var Q=0,$=M.segments.get();Q<$.length;Q+=1){var tt=$[Q];T.push({segments:new t.SegmentVector([tt]),sortKey:tt.sortKey,state:Y})}}else T.push({segments:M.segments,sortKey:0,state:Y})}}}b&&T.sort((function(t,e){return t.sortKey-e.sortKey}));for(var et=0,rt=T;et<rt.length;et+=1){var it,nt=rt[et],ot=nt.state;f.activeTexture.set(d.TEXTURE0),ot.atlasTexture.bind(ot.atlasInterpolation,d.CLAMP_TO_EDGE),ot.atlasTextureIcon&&(f.activeTexture.set(d.TEXTURE1),ot.atlasTextureIcon&&ot.atlasTextureIcon.bind(ot.atlasInterpolationIcon,d.CLAMP_TO_EDGE)),ot.isSDF&&(it=ot.uniformValues,ot.hasHalo&&(it.u_is_halo=1,nn(ot.buffers,nt.segments,i,e,ot.program,w,p,h,it)),it.u_is_halo=0),nn(ot.buffers,nt.segments,i,e,ot.program,w,p,h,ot.uniformValues)}}function nn(t,e,r,i,n,o,a,s,u){var l=i.context;n.draw(l,l.gl.TRIANGLES,o,a,s,rr.disabled,u,r.id,t.layoutVertexBuffer,t.indexBuffer,e,r.paint,i.transform.zoom,t.programConfigurations.get(r.id),t.dynamicLayoutVertexBuffer,t.opacityVertexBuffer)}function on(e,r,i,n,o,a,s){for(var u,l,c,p,h=e.context.gl,f=i.paint.get("fill-pattern"),d=f&&f.constantOr(1),m=i.getCrossfadeParameters(),y=s?(u=d&&!i.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",h.LINES):(u=d?"fillPattern":"fill",h.TRIANGLES),g=0,_=n;g<_.length;g+=1){var v,x,b,w,S,T,E,I,A,C=_[g],P=r.getTile(C);d&&!P.patternsLoaded()||(v=P.getBucket(i))&&(x=v.programConfigurations.get(i.id),b=e.useProgram(u,x),d&&(e.context.activeTexture.set(h.TEXTURE0),P.imageAtlasTexture.bind(h.LINEAR,h.CLAMP_TO_EDGE),x.updatePaintBuffers(m)),(w=f.constantOr(null))&&P.imageAtlas&&(T=(S=P.imageAtlas).patternPositions[w.to.toString()],E=S.patternPositions[w.from.toString()],T&&E&&x.setConstantPatternPositions(T,E)),A=e.translatePosMatrix(C.posMatrix,P,i.paint.get("fill-translate"),i.paint.get("fill-translate-anchor")),A=s?(l=v.indexBuffer2,c=v.segments2,I=[h.drawingBufferWidth,h.drawingBufferHeight],"fillOutlinePattern"===u&&d?(p=A,S=e,w=m,T=P,E=I,t.extend(Vi(p,S,w,T),{u_world:E})):{u_matrix:A,u_world:I}):(l=v.indexBuffer,c=v.segments,d?Vi(A,e,m,P):Ni(A)),b.draw(e.context,y,o,e.stencilModeForClipping(C),a,rr.disabled,A,i.id,v.layoutVertexBuffer,l,c,i.paint,e.transform.zoom,x))}}function an(e,r,i,n,o,a,s){for(var u,l=e.context,c=l.gl,p=i.paint.get("fill-extrusion-pattern"),h=p.constantOr(1),f=i.getCrossfadeParameters(),d=i.paint.get("fill-extrusion-opacity"),m=0,y=n;m<y.length;m+=1){var g,_,v,x,b,w,S,T,E=y[m],I=r.getTile(E),A=I.getBucket(i);A&&(g=A.programConfigurations.get(i.id),_=e.useProgram(h?"fillExtrusionPattern":"fillExtrusion",g),h&&(e.context.activeTexture.set(c.TEXTURE0),I.imageAtlasTexture.bind(c.LINEAR,c.CLAMP_TO_EDGE),g.updatePaintBuffers(f)),(v=p.constantOr(null))&&I.imageAtlas&&(b=(x=I.imageAtlas).patternPositions[v.to.toString()],w=x.patternPositions[v.from.toString()],b&&w&&g.setConstantPatternPositions(b,w)),S=e.translatePosMatrix(E.posMatrix,I,i.paint.get("fill-extrusion-translate"),i.paint.get("fill-extrusion-translate-anchor")),T=i.paint.get("fill-extrusion-vertical-gradient"),T=h?(u=S,x=e,v=T,b=d,w=E,E=f,I=I,t.extend(Ui(u,x,v,b),ji(E,x,I),{u_height_factor:-Math.pow(2,w.overscaledZ)/I.tileSize/8})):Ui(S,e,T,d),_.draw(l,l.gl.TRIANGLES,o,a,s,rr.backCCW,T,i.id,A.layoutVertexBuffer,A.indexBuffer,A.segments,i.paint,e.transform.zoom,g))}}var sn=new t.Color(1,0,0,1),un=new t.Color(0,1,0,1),ln=new t.Color(0,0,1,1),cn=new t.Color(1,0,1,1),pn=new t.Color(0,1,1,1);function hn(t,e,r,i){dn(t,0,e+r/2,t.transform.width,r,i)}function fn(t,e,r,i){dn(t,e-r/2,0,r,t.transform.height,i)}function dn(e,r,i,n,o,a){var s=e.context;(e=s.gl).enable(e.SCISSOR_TEST),e.scissor(r*t.browser.devicePixelRatio,i*t.browser.devicePixelRatio,n*t.browser.devicePixelRatio,o*t.browser.devicePixelRatio),s.clear({color:a}),e.disable(e.SCISSOR_TEST)}function mn(e,r,i){var n=e.context,o=n.gl,a=i.posMatrix,s=e.useProgram("debug"),u=$e.disabled,l=tr.disabled,c=e.colorModeForRenderPass();n.activeTexture.set(o.TEXTURE0),e.emptyTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE),s.draw(n,o.LINE_STRIP,u,l,c,rr.disabled,Hi(a,t.Color.red),"$debug",e.debugBuffer,e.tileBorderIndexBuffer,e.debugSegments);var p=r.getTileByID(i.key).latestRawTileData;c=Math.floor((p&&p.byteLength||0)/1024),p=r.getTile(i).tileSize,r=512/Math.min(p,512)*(i.overscaledZ/e.transform.zoom)*.5,p=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(p+=" => "+i.overscaledZ),function(t,e){t.initDebugOverlayCanvas();var r=t.debugOverlayCanvas,i=t.context.gl,n=t.debugOverlayCanvas.getContext("2d");n.clearRect(0,0,r.width,r.height),n.shadowColor="white",n.shadowBlur=2,n.lineWidth=1.5,n.strokeStyle="white",n.textBaseline="top",n.font="bold 36px Open Sans, sans-serif",n.fillText(e,5,5),n.strokeText(e,5,5),t.debugOverlayTexture.update(r),t.debugOverlayTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}(e,p+" "+c+"kb"),s.draw(n,o.TRIANGLES,u,l,er.alphaBlended,rr.disabled,Hi(a,t.Color.transparent,r),"$debug",e.debugBuffer,e.quadTriangleIndexBuffer,e.debugSegments)}function yn(t,e){this.context=new ir(t),this.transform=e,this._tileTextures={},this.setup(),this.numSublayers=or.maxUnderzooming+or.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new li,this.gpuTimers={}}var gn={symbol:function(e,r,i,n,o){var a,s;"translucent"===e.renderPass&&(a=tr.disabled,s=e.colorModeForRenderPass(),i.layout.get("text-variable-anchor")&&function(e,r,i,n,o,a,s){for(var u=r.transform,l="map"===o,c="map"===a,p=0,h=e;p<h.length;p+=1){var f,d,m,y=h[p],g=n.getTile(y),_=g.getBucket(i);_&&_.text&&_.text.segments.get().length&&(f=t.evaluateSizeForZoom(_.textSizeData,u.zoom),m=Or(g,1,r.transform.zoom),d=Tr(y.posMatrix,c,l,r.transform,m),m="none"!==i.layout.get("icon-text-fit")&&_.hasIconData(),f&&(g=Math.pow(2,u.zoom-g.tileID.overscaledZ),en(_,l,c,s,t.symbolSize,u,d,y.posMatrix,g,f,m)))}}(n,e,i,r,i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),o),0!==i.paint.get("icon-opacity").constantOr(1)&&rn(e,r,i,n,!1,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),i.layout.get("icon-rotation-alignment"),i.layout.get("icon-pitch-alignment"),i.layout.get("icon-keep-upright"),a,s),0!==i.paint.get("text-opacity").constantOr(1)&&rn(e,r,i,n,!0,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),i.layout.get("text-keep-upright"),a,s),r.map.showCollisionBoxes&&($i(e,r,i,n,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),!0),$i(e,r,i,n,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),!1)))},circle:function(e,r,i,n){if("translucent"===e.renderPass){var o=i.paint.get("circle-opacity"),a=i.paint.get("circle-stroke-width"),s=i.paint.get("circle-stroke-opacity"),u=!i.layout.get("circle-sort-key").isConstant();if(0!==o.constantOr(1)||0!==a.constantOr(1)&&0!==s.constantOr(1)){for(var l=e.context,c=l.gl,p=e.depthModeForSublayer(0,$e.ReadOnly),h=tr.disabled,f=e.colorModeForRenderPass(),d=[],m=0;m<n.length;m++){var y=n[m],g=r.getTile(y),_=g.getBucket(i);if(_){var v=_.programConfigurations.get(i.id),x={programConfiguration:v,program:e.useProgram("circle",v),layoutVertexBuffer:_.layoutVertexBuffer,indexBuffer:_.indexBuffer,uniformValues:(C=y,P=g,M=i,y=v=k=void 0,y=(g=e).transform,v="map"===M.paint.get("circle-pitch-alignment")?(k=!0,[v=Or(P,1,y.zoom),v]):(k=!1,y.pixelsToGLUnits),{u_camera_to_center_distance:y.cameraToCenterDistance,u_scale_with_map:+("map"===M.paint.get("circle-pitch-scale")),u_matrix:g.translatePosMatrix(C.posMatrix,P,M.paint.get("circle-translate"),M.paint.get("circle-translate-anchor")),u_pitch_with_map:+k,u_device_pixel_ratio:t.browser.devicePixelRatio,u_extrude_scale:v})};if(u)for(var b=0,w=_.segments.get();b<w.length;b+=1){var S=w[b];d.push({segments:new t.SegmentVector([S]),sortKey:S.sortKey,state:x})}else d.push({segments:_.segments,sortKey:0,state:x})}}u&&d.sort((function(t,e){return t.sortKey-e.sortKey}));for(var T=0,E=d;T<E.length;T+=1){var I=E[T],A=I.state;A.program.draw(l,c.TRIANGLES,p,h,f,rr.disabled,A.uniformValues,i.id,A.layoutVertexBuffer,A.indexBuffer,I.segments,i.paint,e.transform.zoom,A.programConfiguration)}}}var C,P,M,k},heatmap:function(e,r,i,n){if(0!==i.paint.get("heatmap-opacity"))if("offscreen"===e.renderPass){var o=e.context,a=o.gl,s=tr.disabled,u=new er([a.ONE,a.ONE],t.Color.transparent,[!0,!0,!0,!0]);!function(t,e,r){var i=t.gl;t.activeTexture.set(i.TEXTURE1),t.viewport.set([0,0,e.width/4,e.height/4]);var n,o=r.heatmapFbo;o?(i.bindTexture(i.TEXTURE_2D,o.colorAttachment.get()),t.bindFramebuffer.set(o.framebuffer)):(n=i.createTexture(),i.bindTexture(i.TEXTURE_2D,n),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_S,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_WRAP_T,i.CLAMP_TO_EDGE),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MIN_FILTER,i.LINEAR),i.texParameteri(i.TEXTURE_2D,i.TEXTURE_MAG_FILTER,i.LINEAR),o=r.heatmapFbo=t.createFramebuffer(e.width/4,e.height/4,!1),r=n,n=o,(o=t.gl).texImage2D(o.TEXTURE_2D,0,o.RGBA,e.width/4,e.height/4,0,o.RGBA,t.extRenderToTextureHalfFloat?t.extTextureHalfFloat.HALF_FLOAT_OES:o.UNSIGNED_BYTE,null),n.colorAttachment.set(r))}(o,e,i),o.clear({color:t.Color.transparent});for(var l=0;l<n.length;l++){var c,p,h=n[l];r.hasRenderableParent(h)||(c=(x=r.getTile(h)).getBucket(i))&&(p=c.programConfigurations.get(i.id),e.useProgram("heatmap",p).draw(o,a.TRIANGLES,$e.disabled,s,u,rr.disabled,(_=h.posMatrix,v=x,h=e.transform.zoom,x=i.paint.get("heatmap-intensity"),{u_matrix:_,u_extrude_scale:Or(v,1,h),u_intensity:x}),i.id,c.layoutVertexBuffer,c.indexBuffer,c.segments,i.paint,e.transform.zoom,p))}o.viewport.set([0,0,e.width,e.height])}else"translucent"===e.renderPass&&(e.context.setColorMode(e.colorModeForRenderPass()),d=i,y=(m=(f=e).context).gl,(g=d.heatmapFbo)&&(m.activeTexture.set(y.TEXTURE0),y.bindTexture(y.TEXTURE_2D,g.colorAttachment.get()),m.activeTexture.set(y.TEXTURE1),(d.colorRampTexture||(d.colorRampTexture=new t.Texture(m,d.colorRamp,y.RGBA))).bind(y.LINEAR,y.CLAMP_TO_EDGE),f.useProgram("heatmapTexture").draw(m,y.TRIANGLES,$e.disabled,tr.disabled,f.colorModeForRenderPass(),rr.disabled,function(e,r){var i=t.create();return t.ortho(i,0,e.width,e.height,0,0,1),{u_matrix:i,u_world:[(e=e.context.gl).drawingBufferWidth,e.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:r.paint.get("heatmap-opacity")}}(f,d),d.id,f.viewportBuffer,f.quadTriangleIndexBuffer,f.viewportSegments,d.paint,f.transform.zoom)));var f,d,m,y,g,_,v,x},line:function(e,r,i,n){if("translucent"===e.renderPass){var o=i.paint.get("line-opacity"),a=i.paint.get("line-width");if(0!==o.constantOr(1)&&0!==a.constantOr(1))for(var s=e.depthModeForSublayer(0,$e.ReadOnly),u=e.colorModeForRenderPass(),l=i.paint.get("line-dasharray"),c=i.paint.get("line-pattern"),p=c.constantOr(1),h=i.paint.get("line-gradient"),f=i.getCrossfadeParameters(),d=p?"linePattern":l?"lineSDF":h?"lineGradient":"line",m=e.context,y=m.gl,g=!0,_=0,v=n;_<v.length;_+=1){var x,b,w,S,T=v[_],E=r.getTile(T);p&&!E.patternsLoaded()||(x=E.getBucket(i))&&(b=x.programConfigurations.get(i.id),P=e.context.program.get(),w=e.useProgram(d,b),S=g||w.program!==P,(P=c.constantOr(null))&&E.imageAtlas&&(M=(k=E.imageAtlas).patternPositions[P.to.toString()],k=k.patternPositions[P.from.toString()],M&&k&&b.setConstantPatternPositions(M,k)),I=p?(D=i,R=f,F=O=void 0,F=Zi(B=E,O=(L=e).transform),{u_matrix:Wi(L,B,D),u_texsize:B.imageAtlasTexture.size,u_ratio:1/Or(B,1,O.zoom),u_device_pixel_ratio:t.browser.devicePixelRatio,u_image:0,u_scale:[F,R.fromScale,R.toScale],u_fade:R.t,u_units_to_pixels:[1/O.pixelsToGLUnits[0],1/O.pixelsToGLUnits[1]]}):l?(P=E,M=i,k=l,z=f,B=R=F=B=D=L=void 0,L=(O=e).lineAtlas,D=Zi(P,O.transform),B="round"===M.layout.get("line-cap"),F=L.getDash(k.from,B),R=L.getDash(k.to,B),k=F.width*z.fromScale,B=R.width*z.toScale,t.extend(Gi(O,P,M),{u_patternscale_a:[D/k,-F.height/2],u_patternscale_b:[D/B,-R.height/2],u_sdfgamma:L.width/(256*Math.min(k,B)*t.browser.devicePixelRatio)/2,u_image:0,u_tex_y_a:F.y,u_tex_y_b:R.y,u_mix:z.t})):h?(z=e,I=E,A=i,C=x.lineClipsArray.length,t.extend(Gi(z,I,A),{u_image:0,u_image_height:C})):Gi(e,E,i),p?(m.activeTexture.set(y.TEXTURE0),E.imageAtlasTexture.bind(y.LINEAR,y.CLAMP_TO_EDGE),b.updatePaintBuffers(f)):l&&(S||e.lineAtlas.dirty)?(m.activeTexture.set(y.TEXTURE0),e.lineAtlas.bind(m)):h&&(C=(A=x.gradients[i.id]).texture,i.gradientVersion!==A.version&&(E=256,i.stepInterpolant&&(S=r.getSource().maxzoom,S=T.canonical.z===S?Math.ceil(1<<e.transform.maxZoom-T.canonical.z):1,E=t.clamp(t.nextPowerOfTwo(x.maxLineLength/t.EXTENT*1024*S),256,m.maxTextureSize)),A.gradient=t.renderColorRamp({expression:i.gradientExpression(),evaluationKey:"lineProgress",resolution:E,image:A.gradient||void 0,clips:x.lineClipsArray}),A.texture?A.texture.update(A.gradient):A.texture=new t.Texture(m,A.gradient,y.RGBA),A.version=i.gradientVersion,C=A.texture),m.activeTexture.set(y.TEXTURE0),C.bind(i.stepInterpolant?y.NEAREST:y.LINEAR,y.CLAMP_TO_EDGE)),w.draw(m,y.TRIANGLES,s,e.stencilModeForClipping(T),u,rr.disabled,I,i.id,x.layoutVertexBuffer,x.indexBuffer,x.segments,i.paint,e.transform.zoom,b,x.layoutVertexBuffer2),g=!1)}}var I,A,C,P,M,k,z,L,B,D,R,O,F},fill:function(e,r,i,n){var o,a,s,u=i.paint.get("fill-color"),l=i.paint.get("fill-opacity");0!==l.constantOr(1)&&(o=e.colorModeForRenderPass(),a=i.paint.get("fill-pattern"),l=e.opaquePassEnabledForLayer()&&!a.constantOr(1)&&1===u.constantOr(t.Color.transparent).a&&1===l.constantOr(0)?"opaque":"translucent",e.renderPass===l&&(s=e.depthModeForSublayer(1,"opaque"===e.renderPass?$e.ReadWrite:$e.ReadOnly),on(e,r,i,n,s,o,!1)),"translucent"===e.renderPass&&i.paint.get("fill-antialias")&&(s=e.depthModeForSublayer(i.getPaintProperty("fill-outline-color")?2:0,$e.ReadOnly),on(e,r,i,n,s,o,!0)))},"fill-extrusion":function(t,e,r,i){var n,o=r.paint.get("fill-extrusion-opacity");0!==o&&"translucent"===t.renderPass&&(n=new $e(t.context.gl.LEQUAL,$e.ReadWrite,t.depthRangeFor3D),1!==o||r.paint.get("fill-extrusion-pattern").constantOr(1)?(an(t,e,r,i,n,tr.disabled,er.disabled),an(t,e,r,i,n,t.stencilModeFor3D(),t.colorModeForRenderPass())):(o=t.colorModeForRenderPass(),an(t,e,r,i,n,tr.disabled,o)))},hillshade:function(e,r,i,n){if("offscreen"===e.renderPass||"translucent"===e.renderPass){for(var o=e.context,a=e.depthModeForSublayer(0,$e.ReadOnly),s=e.colorModeForRenderPass(),u=(n="translucent"===e.renderPass?e.stencilConfigForOverlap(n):[{},n])[0],l=0,c=n[1];l<c.length;l+=1){var p=c[l],h=r.getTile(p);h.needsHillshadePrepare&&"offscreen"===e.renderPass?(d=h,m=i,y=a,g=tr.disabled,_=s,E=T=S=w=b=x=v=void 0,T=(S=(f=e).context).gl,(E=d.dem)&&E.data&&(v=E.dim,x=E.stride,w=E.getPixels(),S.activeTexture.set(T.TEXTURE1),S.pixelStoreUnpackPremultiplyAlpha.set(!1),d.demTexture=d.demTexture||f.getTileTexture(x),d.demTexture?((b=d.demTexture).update(w,{premultiply:!1}),b.bind(T.NEAREST,T.CLAMP_TO_EDGE)):(d.demTexture=new t.Texture(S,w,T.RGBA,{premultiply:!1}),d.demTexture.bind(T.NEAREST,T.CLAMP_TO_EDGE)),S.activeTexture.set(T.TEXTURE0),(b=d.fbo)||((w=new t.Texture(S,{width:v,height:v,data:null},T.RGBA)).bind(T.LINEAR,T.CLAMP_TO_EDGE),(b=d.fbo=S.createFramebuffer(v,v,!0)).colorAttachment.set(w.texture)),S.bindFramebuffer.set(b.framebuffer),S.viewport.set([0,0,v,v]),f.useProgram("hillshadePrepare").draw(S,T.TRIANGLES,y,g,_,rr.disabled,(y=d.tileID,_=(g=E).stride,E=t.create(),t.ortho(E,0,t.EXTENT,-t.EXTENT,0,0,1),t.translate(E,E,[0,-t.EXTENT,0]),{u_matrix:E,u_image:1,u_dimension:[_,_],u_zoom:y.overscaledZ,u_unpack:g.getUnpackVector()}),m.id,f.rasterBoundsBuffer,f.quadTriangleIndexBuffer,f.rasterBoundsSegments),d.needsHillshadePrepare=!1)):"translucent"===e.renderPass&&(T=e,E=h,_=i,y=a,g=u[p.overscaledZ],m=s,p=h=d=f=void 0,h=(d=T.context).gl,(p=E.fbo)&&(f=T.useProgram("hillshade"),d.activeTexture.set(h.TEXTURE0),h.bindTexture(h.TEXTURE_2D,p.colorAttachment.get()),E=function(e,r,i){var n=i.paint.get("hillshade-shadow-color"),o=i.paint.get("hillshade-highlight-color"),a=i.paint.get("hillshade-accent-color"),s=i.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===i.paint.get("hillshade-illumination-anchor")&&(s-=e.transform.angle);var u=!e.options.moving;return{u_matrix:e.transform.calculatePosMatrix(r.tileID.toUnwrapped(),u),u_image:0,u_latrange:(u=r.tileID,r=Math.pow(2,u.canonical.z),u=u.canonical.y,[new t.MercatorCoordinate(0,u/r).toLngLat().lat,new t.MercatorCoordinate(0,(u+1)/r).toLngLat().lat]),u_light:[i.paint.get("hillshade-exaggeration"),s],u_shadow:n,u_highlight:o,u_accent:a}}(T,E,_),f.draw(d,h.TRIANGLES,y,g,m,rr.disabled,E,_.id,T.rasterBoundsBuffer,T.quadTriangleIndexBuffer,T.rasterBoundsSegments)))}o.viewport.set([0,0,e.width,e.height])}var f,d,m,y,g,_,v,x,b,w,S,T,E},raster:function(e,r,i,n){if("translucent"===e.renderPass&&0!==i.paint.get("raster-opacity")&&n.length)for(var o=e.context,a=o.gl,s=r.getSource(),u=e.useProgram("raster"),l=e.colorModeForRenderPass(),c=(n=s instanceof N?[{},n]:e.stencilConfigForOverlap(n))[0],p=(n=n[1])[n.length-1].overscaledZ,h=!e.options.moving,f=0,d=n;f<d.length;f+=1){var m=d[f],y=e.depthModeForSublayer(m.overscaledZ-p,1===i.paint.get("raster-opacity")?$e.ReadWrite:$e.ReadOnly,a.LESS),g=r.getTile(m),_=e.transform.calculatePosMatrix(m.toUnwrapped(),h);g.registerFadeDuration(i.paint.get("raster-fade-duration"));var v=r.findLoadedParent(m,0),x=function(e,r,i,n,o){if(0<(s=n.paint.get("raster-fade-duration"))){var a=t.browser.now(),s=(n=(a-e.timeAdded)/s,r?(a-r.timeAdded)/s:-1);i=i.getSource(),i=o.coveringZoomLevel({tileSize:i.tileSize,roundZoom:i.roundZoom}),s=(i=!r||Math.abs(r.tileID.overscaledZ-i)>Math.abs(e.tileID.overscaledZ-i))&&e.refreshedUponExpiration?1:t.clamp(i?n:1-s,0,1);return e.refreshedUponExpiration&&1<=n&&(e.refreshedUponExpiration=!1),r?{opacity:1,mix:1-s}:{opacity:s,mix:0}}return{opacity:1,mix:0}}(g,v,r,i,e.transform),b=void 0,w=void 0,S="nearest"===i.paint.get("raster-resampling")?a.NEAREST:a.LINEAR;o.activeTexture.set(a.TEXTURE0),g.texture.bind(S,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),o.activeTexture.set(a.TEXTURE1),v?(v.texture.bind(S,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),b=Math.pow(2,v.tileID.overscaledZ-g.tileID.overscaledZ),w=[g.tileID.canonical.x*b%1,g.tileID.canonical.y*b%1]):g.texture.bind(S,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),x=Xi(_,w||[0,0],b||1,x,i),s instanceof N?u.draw(o,a.TRIANGLES,y,tr.disabled,l,rr.disabled,x,i.id,s.boundsBuffer,e.quadTriangleIndexBuffer,s.boundsSegments):u.draw(o,a.TRIANGLES,y,c[m.overscaledZ],l,rr.disabled,x,i.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}},background:function(e,r,i){var n,o,a,s,u,l,c,p,h,f,d=i.paint.get("background-color"),m=i.paint.get("background-opacity");if(0!==m){var y=e.context,g=y.gl,_=(E=e.transform).tileSize,v=i.paint.get("background-pattern");if(!e.isPatternMissing(v)){var x=!v&&1===d.a&&1===m&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass===x){var b=tr.disabled,w=e.depthModeForSublayer(0,"opaque"==x?$e.ReadWrite:$e.ReadOnly),S=e.colorModeForRenderPass(),T=e.useProgram(v?"backgroundPattern":"background"),E=E.coveringTiles({tileSize:_});v&&(y.activeTexture.set(g.TEXTURE0),e.imageManager.bind(e.context));for(var I=i.getCrossfadeParameters(),A=0,C=E;A<C.length;A+=1){var P=C[A],M=e.transform.calculatePosMatrix(P.toUnwrapped());M=v?(n=M,o=m,a=e,s=v,u={tileID:P,tileSize:_},l=I,P=h=c=void 0,t.extend((c=s,p=l,f=u,P=(h=a).imageManager.getPattern(c.from.toString()),s=h.imageManager.getPattern(c.to.toString()),u=(l=h.imageManager.getPixelSize()).width,a=l.height,c=Math.pow(2,f.tileID.overscaledZ),c=(l=f.tileSize*Math.pow(2,h.transform.tileZoom)/c)*(f.tileID.canonical.x+f.tileID.wrap*c),l*=f.tileID.canonical.y,{u_image:0,u_pattern_tl_a:P.tl,u_pattern_br_a:P.br,u_pattern_tl_b:s.tl,u_pattern_br_b:s.br,u_texsize:[u,a],u_mix:p.t,u_pattern_size_a:P.displaySize,u_pattern_size_b:s.displaySize,u_scale_a:p.fromScale,u_scale_b:p.toScale,u_tile_units_to_pixels:1/Or(f,1,h.transform.tileZoom),u_pixel_coord_upper:[c>>16,l>>16],u_pixel_coord_lower:[65535&c,65535&l]}),{u_matrix:n,u_opacity:o})):{u_matrix:M,u_opacity:m,u_color:d};T.draw(y,g.TRIANGLES,w,b,S,rr.disabled,M,i.id,e.tileExtentBuffer,e.quadTriangleIndexBuffer,e.tileExtentSegments)}}}}},debug:function(t,e,r){for(var i=0;i<r.length;i++)mn(t,e,r[i])},custom:function(t,e,r){var i,n=t.context;r=r.implementation;"offscreen"===t.renderPass?(i=r.prerender)&&(t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),i.call(r,n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState()):"translucent"===t.renderPass&&(t.setCustomLayerDefaults(),n.setColorMode(t.colorModeForRenderPass()),n.setStencilMode(tr.disabled),i="3d"===r.renderingMode?new $e(t.context.gl.LEQUAL,$e.ReadWrite,t.depthRangeFor3D):t.depthModeForSublayer(0,$e.ReadOnly),n.setDepthMode(i),r.render(n.gl,t.transform.customLayerMatrix()),n.setDirty(),t.setBaseState(),n.bindFramebuffer.set(null))}};function _n(t,e){this.points=t,this.planes=e}function vn(e,r){this.min=e,this.max=r,this.center=t.scale$2([],t.add([],this.min,this.max),.5)}function xn(t,e,r,i){if(void 0===t&&(t=0),void 0===e&&(e=0),void 0===r&&(r=0),void 0===i&&(i=0),isNaN(t)||t<0||isNaN(e)||e<0||isNaN(r)||r<0||isNaN(i)||i<0)throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");this.top=t,this.bottom=e,this.left=r,this.right=i}function bn(e,r,i,n,o){this.tileSize=512,this.maxValidLatitude=85.051129,this._renderWorldCopies=void 0===o||o,this._minZoom=e||0,this._maxZoom=r||22,this._minPitch=null==i?0:i,this._maxPitch=null==n?60:n,this.setMaxBounds(),this.width=0,this.height=0,this._center=new t.LngLat(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new xn,this._posMatrixCache={},this._alignedPosMatrixCache={}}function wn(e){var r,i,n,o;this._hashName=e&&encodeURIComponent(e),t.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=(r=this._updateHashUnthrottled.bind(this),i=!1,n=null,o=function(){n=null,i&&(r(),n=setTimeout(o,300),i=!1)},function(){return i=!0,n||o(),n})}function Sn(t){this._map=t,this.clear()}yn.prototype.resize=function(e,r){if(this.width=e*t.browser.devicePixelRatio,this.height=r*t.browser.devicePixelRatio,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(var i=0,n=this.style._order;i<n.length;i+=1)this.style._layers[n[i]].resize()},yn.prototype.setup=function(){var e=this.context,r=new t.StructArrayLayout2i4;r.emplaceBack(0,0),r.emplaceBack(t.EXTENT,0),r.emplaceBack(0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT),this.tileExtentBuffer=e.createVertexBuffer(r,gi.members),this.tileExtentSegments=t.SegmentVector.simpleSegment(0,0,4,2),(r=new t.StructArrayLayout2i4).emplaceBack(0,0),r.emplaceBack(t.EXTENT,0),r.emplaceBack(0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT),this.debugBuffer=e.createVertexBuffer(r,gi.members),this.debugSegments=t.SegmentVector.simpleSegment(0,0,4,5),(r=new t.StructArrayLayout4i8).emplaceBack(0,0,0,0),r.emplaceBack(t.EXTENT,0,t.EXTENT,0),r.emplaceBack(0,t.EXTENT,0,t.EXTENT),r.emplaceBack(t.EXTENT,t.EXTENT,t.EXTENT,t.EXTENT),this.rasterBoundsBuffer=e.createVertexBuffer(r,U.members),this.rasterBoundsSegments=t.SegmentVector.simpleSegment(0,0,4,2),(r=new t.StructArrayLayout2i4).emplaceBack(0,0),r.emplaceBack(1,0),r.emplaceBack(0,1),r.emplaceBack(1,1),this.viewportBuffer=e.createVertexBuffer(r,gi.members),this.viewportSegments=t.SegmentVector.simpleSegment(0,0,4,2),(r=new t.StructArrayLayout1ui2).emplaceBack(0),r.emplaceBack(1),r.emplaceBack(3),r.emplaceBack(2),r.emplaceBack(0),this.tileBorderIndexBuffer=e.createIndexBuffer(r),(r=new t.StructArrayLayout3ui6).emplaceBack(0,1,2),r.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=e.createIndexBuffer(r),this.emptyTexture=new t.Texture(e,{width:1,height:1,data:new Uint8Array([0,0,0,0])},e.gl.RGBA),e=this.context.gl,this.stencilClearMode=new tr({func:e.ALWAYS,mask:0},0,255,e.ZERO,e.ZERO,e.ZERO)},yn.prototype.clearStencil=function(){var e=this.context,r=e.gl;this.nextStencilID=1,this.currentStencilSource=void 0;var i=t.create();t.ortho(i,0,this.width,this.height,0,0,1),t.scale(i,i,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(e,r.TRIANGLES,$e.disabled,this.stencilClearMode,er.disabled,rr.disabled,qi(i),"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)},yn.prototype._renderTileClippingMasks=function(t,e){if(this.currentStencilSource!==t.source&&t.isTileClipped()&&e&&e.length){this.currentStencilSource=t.source;var r=this.context,i=r.gl;256<this.nextStencilID+e.length&&this.clearStencil(),r.setColorMode(er.disabled),r.setDepthMode($e.disabled);var n=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(var o=0,a=e;o<a.length;o+=1){var s=a[o],u=this._tileClippingMaskIDs[s.key]=this.nextStencilID++;n.draw(r,i.TRIANGLES,$e.disabled,new tr({func:i.ALWAYS,mask:0},u,255,i.KEEP,i.KEEP,i.REPLACE),er.disabled,rr.disabled,qi(s.posMatrix),"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}},yn.prototype.stencilModeFor3D=function(){this.currentStencilSource=void 0,256<this.nextStencilID+1&&this.clearStencil();var t=this.nextStencilID++,e=this.context.gl;return new tr({func:e.NOTEQUAL,mask:255},t,255,e.KEEP,e.KEEP,e.REPLACE)},yn.prototype.stencilModeForClipping=function(t){var e=this.context.gl;return new tr({func:e.EQUAL,mask:255},this._tileClippingMaskIDs[t.key],0,e.KEEP,e.KEEP,e.REPLACE)},yn.prototype.stencilConfigForOverlap=function(t){var e=this.context.gl,r=t.sort((function(t,e){return e.overscaledZ-t.overscaledZ})),i=r[r.length-1].overscaledZ,n=r[0].overscaledZ-i+1;if(1<n){this.currentStencilSource=void 0,256<this.nextStencilID+n&&this.clearStencil();for(var o={},a=0;a<n;a++)o[a+i]=new tr({func:e.GEQUAL,mask:255},a+this.nextStencilID,255,e.KEEP,e.KEEP,e.REPLACE);return this.nextStencilID+=n,[o,r]}return[((t={})[i]=tr.disabled,t),r]},yn.prototype.colorModeForRenderPass=function(){var e=this.context.gl;return this._showOverdrawInspector?new er([e.CONSTANT_COLOR,e.ONE],new t.Color(1/8,1/8,1/8,0),[!0,!0,!0,!0]):"opaque"===this.renderPass?er.unblended:er.alphaBlended},yn.prototype.depthModeForSublayer=function(t,e,r){return this.opaquePassEnabledForLayer()?(t=1-((1+this.currentLayer)*this.numSublayers+t)*this.depthEpsilon,new $e(r||this.context.gl.LEQUAL,e,[t,t])):$e.disabled},yn.prototype.opaquePassEnabledForLayer=function(){return this.currentLayer<this.opaquePassCutoff},yn.prototype.render=function(e,r){var i=this;this.style=e,this.options=r,this.lineAtlas=e.lineAtlas,this.imageManager=e.imageManager,this.glyphManager=e.glyphManager,this.symbolFadeChange=e.placement.symbolFadeChange(t.browser.now()),this.imageManager.beginFrame();var n,o=this.style._order,a=this.style.sourceCaches;for(n in a){var s=a[n];s.used&&s.prepare(this.context)}var u,l,c,p={},h={},f={};for(c in a){var d=a[c];p[c]=d.getVisibleCoordinates(),h[c]=p[c].slice().reverse(),f[c]=d.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(var m=0;m<o.length;m++)if(this.style._layers[o[m]].is3D()){this.opaquePassCutoff=m;break}this.renderPass="offscreen";for(var y=0,g=o;y<g.length;y+=1){var _,v=this.style._layers[g[y]];v.hasOffscreenPass()&&!v.isHidden(this.transform.zoom)&&(_=h[v.source],"custom"!==v.type&&!_.length||this.renderLayer(this,a[v.source],v,_))}for(this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?t.Color.black:t.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(e._order.length+2)*this.numSublayers*this.depthEpsilon],this.renderPass="opaque",this.currentLayer=o.length-1;0<=this.currentLayer;this.currentLayer--){var x=this.style._layers[o[this.currentLayer]],b=a[x.source],w=p[x.source];this._renderTileClippingMasks(x,w),this.renderLayer(this,b,x,w)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<o.length;this.currentLayer++){var S=this.style._layers[o[this.currentLayer]],T=a[S.source],E=("symbol"===S.type?f:h)[S.source];this._renderTileClippingMasks(S,p[S.source]),this.renderLayer(this,T,S,E)}this.options.showTileBoundaries&&(t.values(this.style._layers).forEach((function(t){t.source&&!t.isHidden(i.transform.zoom)&&(t.source!==(l&&l.id)&&(l=i.style.sourceCaches[t.source]),(!u||u.getSource().maxzoom<l.getSource().maxzoom)&&(u=l))})),u&&gn.debug(this,u,u.getVisibleCoordinates())),this.options.showPadding&&function(t){var e=t.transform.padding;hn(t,t.transform.height-(e.top||0),3,sn),hn(t,e.bottom||0,3,un),fn(t,e.left||0,3,ln),fn(t,t.transform.width-(e.right||0),3,cn);var r,i=t.transform.centerPoint;dn(r=t,(e=i.x)-1,(t=t.transform.height-i.y)-10,2,20,i=pn),dn(r,e-10,t-1,20,2,i)}(this),this.context.setDefault()},yn.prototype.renderLayer=function(t,e,r,i){r.isHidden(this.transform.zoom)||"background"!==r.type&&"custom"!==r.type&&!i.length||(this.id=r.id,this.gpuTimingStart(r),gn[r.type](t,e,r,i,this.style.placement.variableOffsets),this.gpuTimingEnd())},yn.prototype.gpuTimingStart=function(t){var e,r;this.options.gpuTiming&&(e=this.context.extTimerQuery,(r=(r=this.gpuTimers[t.id])||(this.gpuTimers[t.id]={calls:0,cpuTime:0,query:e.createQueryEXT()})).calls++,e.beginQueryEXT(e.TIME_ELAPSED_EXT,r.query))},yn.prototype.gpuTimingEnd=function(){var t;this.options.gpuTiming&&(t=this.context.extTimerQuery).endQueryEXT(t.TIME_ELAPSED_EXT)},yn.prototype.collectGpuTimers=function(){var t=this.gpuTimers;return this.gpuTimers={},t},yn.prototype.queryGpuTimers=function(t){var e,r={};for(e in t){var i=t[e],n=this.context.extTimerQuery,o=n.getQueryObjectEXT(i.query,n.QUERY_RESULT_EXT)/1e6;n.deleteQueryEXT(i.query),r[e]=o}return r},yn.prototype.translatePosMatrix=function(e,r,i,n,o){if(!i[0]&&!i[1])return e;var a=o?"map"===n?this.transform.angle:0:"viewport"===n?-this.transform.angle:0;return a&&(n=Math.sin(a),a=Math.cos(a),i=[i[0]*a-i[1]*n,i[0]*n+i[1]*a]),r=[o?i[0]:Or(r,i[0],this.transform.zoom),o?i[1]:Or(r,i[1],this.transform.zoom),0],i=new Float32Array(16),t.translate(i,e,r),i},yn.prototype.saveTileTexture=function(t){var e=this._tileTextures[t.size[0]];e?e.push(t):this._tileTextures[t.size[0]]=[t]},yn.prototype.getTileTexture=function(t){return(t=this._tileTextures[t])&&0<t.length?t.pop():null},yn.prototype.isPatternMissing=function(t){if(!t)return!1;if(!t.from||!t.to)return!0;var e=this.imageManager.getPattern(t.from.toString());t=this.imageManager.getPattern(t.to.toString());return!e||!t},yn.prototype.useProgram=function(t,e){this.cache=this.cache||{};var r=""+t+(e?e.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"");return this.cache[r]||(this.cache[r]=new Fi(this.context,0,Ri[t],e,Qi[t],this._showOverdrawInspector)),this.cache[r]},yn.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()},yn.prototype.setBaseState=function(){var t=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(t.FUNC_ADD)},yn.prototype.initDebugOverlayCanvas=function(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=t.window.document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new t.Texture(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))},yn.prototype.destroy=function(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()},_n.fromInvProjectionMatrix=function(e,r,i){var n=Math.pow(2,i),o=[[-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(r){return t.transformMat4([],r,e)})).map((function(e){return t.scale$1([],e,1/e[3]/r*n)}));i=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((function(e){var r=t.sub([],o[e[0]],o[e[1]]),i=t.sub([],o[e[2]],o[e[1]]);i=t.normalize([],t.cross([],r,i)),e=-t.dot(i,o[e[1]]);return i.concat(e)}));return new _n(o,i)},vn.prototype.quadrant=function(e){for(var r=[e%2==0,e<2],i=t.clone$2(this.min),n=t.clone$2(this.max),o=0;o<r.length;o++)i[o]=(r[o]?this.min:this.center)[o],n[o]=(r[o]?this.center:this.max)[o];return n[2]=this.max[2],new vn(i,n)},vn.prototype.distanceX=function(t){return Math.max(Math.min(this.max[0],t[0]),this.min[0])-t[0]},vn.prototype.distanceY=function(t){return Math.max(Math.min(this.max[1],t[1]),this.min[1])-t[1]},vn.prototype.intersects=function(e){for(var r=[[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]],i=!0,n=0;n<e.planes.length;n++){for(var o=e.planes[n],a=0,s=0;s<r.length;s++)a+=0<=t.dot$1(o,r[s]);if(0===a)return 0;a!==r.length&&(i=!1)}if(i)return 2;for(var u=0;u<3;u++){for(var l=Number.MAX_VALUE,c=-Number.MAX_VALUE,p=0;p<e.points.length;p++){var h=e.points[p][u]-this.min[u];l=Math.min(l,h),c=Math.max(c,h)}if(c<0||l>this.max[u]-this.min[u])return 0}return 1},xn.prototype.interpolate=function(e,r,i){return null!=r.top&&null!=e.top&&(this.top=t.number(e.top,r.top,i)),null!=r.bottom&&null!=e.bottom&&(this.bottom=t.number(e.bottom,r.bottom,i)),null!=r.left&&null!=e.left&&(this.left=t.number(e.left,r.left,i)),null!=r.right&&null!=e.right&&(this.right=t.number(e.right,r.right,i)),this},xn.prototype.getCenter=function(e,r){return e=t.clamp((this.left+e-this.right)/2,0,e),r=t.clamp((this.top+r-this.bottom)/2,0,r),new t.Point(e,r)},xn.prototype.equals=function(t){return this.top===t.top&&this.bottom===t.bottom&&this.left===t.left&&this.right===t.right},xn.prototype.clone=function(){return new xn(this.top,this.bottom,this.left,this.right)},xn.prototype.toJSON=function(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}},j={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}},bn.prototype.clone=function(){var t=new bn(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return t.tileSize=this.tileSize,t.latRange=this.latRange,t.width=this.width,t.height=this.height,t._center=this._center,t.zoom=this.zoom,t.angle=this.angle,t._fov=this._fov,t._pitch=this._pitch,t._unmodified=this._unmodified,t._edgeInsets=this._edgeInsets.clone(),t._calcMatrices(),t},j.minZoom.get=function(){return this._minZoom},j.minZoom.set=function(t){this._minZoom!==t&&(this._minZoom=t,this.zoom=Math.max(this.zoom,t))},j.maxZoom.get=function(){return this._maxZoom},j.maxZoom.set=function(t){this._maxZoom!==t&&(this._maxZoom=t,this.zoom=Math.min(this.zoom,t))},j.minPitch.get=function(){return this._minPitch},j.minPitch.set=function(t){this._minPitch!==t&&(this._minPitch=t,this.pitch=Math.max(this.pitch,t))},j.maxPitch.get=function(){return this._maxPitch},j.maxPitch.set=function(t){this._maxPitch!==t&&(this._maxPitch=t,this.pitch=Math.min(this.pitch,t))},j.renderWorldCopies.get=function(){return this._renderWorldCopies},j.renderWorldCopies.set=function(t){void 0===t?t=!0:null===t&&(t=!1),this._renderWorldCopies=t},j.worldSize.get=function(){return this.tileSize*this.scale},j.centerOffset.get=function(){return this.centerPoint._sub(this.size._div(2))},j.size.get=function(){return new t.Point(this.width,this.height)},j.bearing.get=function(){return-this.angle/Math.PI*180},j.bearing.set=function(e){e=-t.wrap(e,-180,180)*Math.PI/180,this.angle!==e&&(this._unmodified=!1,this.angle=e,this._calcMatrices(),this.rotationMatrix=t.create$2(),t.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))},j.pitch.get=function(){return this._pitch/Math.PI*180},j.pitch.set=function(e){e=t.clamp(e,this.minPitch,this.maxPitch)/180*Math.PI,this._pitch!==e&&(this._unmodified=!1,this._pitch=e,this._calcMatrices())},j.fov.get=function(){return this._fov/Math.PI*180},j.fov.set=function(t){t=Math.max(.01,Math.min(60,t)),this._fov!==t&&(this._unmodified=!1,this._fov=t/180*Math.PI,this._calcMatrices())},j.zoom.get=function(){return this._zoom},j.zoom.set=function(t){t=Math.min(Math.max(t,this.minZoom),this.maxZoom),this._zoom!==t&&(this._unmodified=!1,this._zoom=t,this.scale=this.zoomScale(t),this.tileZoom=Math.floor(t),this.zoomFraction=t-this.tileZoom,this._constrain(),this._calcMatrices())},j.center.get=function(){return this._center},j.center.set=function(t){t.lat===this._center.lat&&t.lng===this._center.lng||(this._unmodified=!1,this._center=t,this._constrain(),this._calcMatrices())},j.padding.get=function(){return this._edgeInsets.toJSON()},j.padding.set=function(t){this._edgeInsets.equals(t)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,t,1),this._calcMatrices())},j.centerPoint.get=function(){return this._edgeInsets.getCenter(this.width,this.height)},bn.prototype.isPaddingEqual=function(t){return this._edgeInsets.equals(t)},bn.prototype.interpolatePadding=function(t,e,r){this._unmodified=!1,this._edgeInsets.interpolate(t,e,r),this._constrain(),this._calcMatrices()},bn.prototype.coveringZoomLevel=function(t){return t=(t.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/t.tileSize)),Math.max(0,t)},bn.prototype.getVisibleUnwrappedCoordinates=function(e){var r=[new t.UnwrappedTileID(0,e)];if(this._renderWorldCopies)for(var i=this.pointCoordinate(new t.Point(0,0)),n=this.pointCoordinate(new t.Point(this.width,0)),o=this.pointCoordinate(new t.Point(this.width,this.height)),a=this.pointCoordinate(new t.Point(0,this.height)),s=Math.floor(Math.min(i.x,n.x,o.x,a.x)),u=Math.floor(Math.max(i.x,n.x,o.x,a.x)),l=s-1;l<=u+1;l++)0!==l&&r.push(new t.UnwrappedTileID(l,e));return r},bn.prototype.coveringTiles=function(e){var r=this.coveringZoomLevel(e),i=r;if(void 0!==e.minzoom&&r<e.minzoom)return[];void 0!==e.maxzoom&&r>e.maxzoom&&(r=e.maxzoom);var n=t.MercatorCoordinate.fromLngLat(this.center),o=Math.pow(2,r),a=[o*n.x,o*n.y,0],s=_n.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,r),u=e.minzoom||0;function l(t){return{aabb:new vn([t*o,0,0],[(t+1)*o,o,0]),zoom:0,x:0,y:0,wrap:t,fullyVisible:!1}}this.pitch<=60&&this._edgeInsets.top<.1&&(u=r);var c=[],p=[],h=r,f=e.reparseOverscaled?i:r;if(this._renderWorldCopies)for(var d=1;d<=3;d++)c.push(l(-d)),c.push(l(d));for(c.push(l(0));0<c.length;){var m=c.pop(),y=m.x,g=m.y,_=m.fullyVisible;if(!_){if(0===(x=m.aabb.intersects(s)))continue;_=2===x}var v=m.aabb.distanceX(a),x=m.aabb.distanceY(a);x=Math.max(Math.abs(v),Math.abs(x));if(m.zoom===h||x>3+(1<<h-m.zoom)-2&&m.zoom>=u)p.push({tileID:new t.OverscaledTileID(m.zoom===h?f:m.zoom,m.wrap,m.zoom,y,g),distanceSq:t.sqrLen([a[0]-.5-y,a[1]-.5-g])});else for(var b=0;b<4;b++){var w=(y<<1)+b%2,S=(g<<1)+(b>>1);c.push({aabb:m.aabb.quadrant(b),zoom:m.zoom+1,x:w,y:S,wrap:m.wrap,fullyVisible:_})}}return p.sort((function(t,e){return t.distanceSq-e.distanceSq})).map((function(t){return t.tileID}))},bn.prototype.resize=function(t,e){this.width=t,this.height=e,this.pixelsToGLUnits=[2/t,-2/e],this._constrain(),this._calcMatrices()},j.unmodified.get=function(){return this._unmodified},bn.prototype.zoomScale=function(t){return Math.pow(2,t)},bn.prototype.scaleZoom=function(t){return Math.log(t)/Math.LN2},bn.prototype.project=function(e){var r=t.clamp(e.lat,-this.maxValidLatitude,this.maxValidLatitude);return new t.Point(t.mercatorXfromLng(e.lng)*this.worldSize,t.mercatorYfromLat(r)*this.worldSize)},bn.prototype.unproject=function(e){return new t.MercatorCoordinate(e.x/this.worldSize,e.y/this.worldSize).toLngLat()},j.point.get=function(){return this.project(this.center)},bn.prototype.setLocationAtPoint=function(e,r){var i=this.pointCoordinate(r);r=this.pointCoordinate(this.centerPoint),e=this.locationCoordinate(e),r=new t.MercatorCoordinate(e.x-(i.x-r.x),e.y-(i.y-r.y));this.center=this.coordinateLocation(r),this._renderWorldCopies&&(this.center=this.center.wrap())},bn.prototype.locationPoint=function(t){return this.coordinatePoint(this.locationCoordinate(t))},bn.prototype.pointLocation=function(t){return this.coordinateLocation(this.pointCoordinate(t))},bn.prototype.locationCoordinate=function(e){return t.MercatorCoordinate.fromLngLat(e)},bn.prototype.coordinateLocation=function(t){return t.toLngLat()},bn.prototype.pointCoordinate=function(e){var r=[e.x,e.y,0,1],i=[e.x,e.y,1,1];t.transformMat4(r,r,this.pixelMatrixInverse),t.transformMat4(i,i,this.pixelMatrixInverse);var n=r[3],o=i[3],a=r[1]/n,s=i[1]/o,u=(u=r[2]/n)==(e=i[2]/o)?0:(0-u)/(e-u);return new t.MercatorCoordinate(t.number(r[0]/n,i[0]/o,u)/this.worldSize,t.number(a,s,u)/this.worldSize)},bn.prototype.coordinatePoint=function(e){return e=[e.x*this.worldSize,e.y*this.worldSize,0,1],t.transformMat4(e,e,this.pixelMatrix),new t.Point(e[0]/e[3],e[1]/e[3])},bn.prototype.getBounds=function(){return(new t.LngLatBounds).extend(this.pointLocation(new t.Point(0,0))).extend(this.pointLocation(new t.Point(this.width,0))).extend(this.pointLocation(new t.Point(this.width,this.height))).extend(this.pointLocation(new t.Point(0,this.height)))},bn.prototype.getMaxBounds=function(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new t.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null},bn.prototype.setMaxBounds=function(t){t?(this.lngRange=[t.getWest(),t.getEast()],this.latRange=[t.getSouth(),t.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])},bn.prototype.calculatePosMatrix=function(e,r){void 0===r&&(r=!1);var i=e.key,n=r?this._alignedPosMatrixCache:this._posMatrixCache;if(n[i])return n[i];var o=e.canonical,a=this.worldSize/this.zoomScale(o.z),s=o.x+Math.pow(2,o.z)*e.wrap;e=t.identity(new Float64Array(16));return t.translate(e,e,[s*a,o.y*a,0]),t.scale(e,e,[a/t.EXTENT,a/t.EXTENT,1]),t.multiply(e,r?this.alignedProjMatrix:this.projMatrix,e),n[i]=new Float32Array(e),n[i]},bn.prototype.customLayerMatrix=function(){return this.mercatorMatrix.slice()},bn.prototype._constrain=function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var e,r,i,n,o=-90,a=90,s=-180,u=180,l=this.size,c=this._unmodified;this.latRange&&(h=this.latRange,o=t.mercatorYfromLat(h[1])*this.worldSize,i=(a=t.mercatorYfromLat(h[0])*this.worldSize)-o<l.y?l.y/(a-o):0),this.lngRange&&(f=this.lngRange,s=t.mercatorXfromLng(f[0])*this.worldSize,n=(u=t.mercatorXfromLng(f[1])*this.worldSize)-s<l.x?l.x/(u-s):0);var p,h=this.point,f=Math.max(n||0,i||0);if(f)return this.center=this.unproject(new t.Point(n?(u+s)/2:h.x,i?(a+o)/2:h.y)),this.zoom+=this.scaleZoom(f),this._unmodified=c,void(this._constraining=!1);this.latRange&&((f=h.y)-(p=l.y/2)<o&&(r=o+p),a<f+p&&(r=a-p)),this.lngRange&&((p=h.x)-(l=l.x/2)<s&&(e=s+l),u<p+l&&(e=u-l)),void 0===e&&void 0===r||(this.center=this.unproject(new t.Point(void 0!==e?e:h.x,void 0!==r?r:h.y))),this._unmodified=c,this._constraining=!1}},bn.prototype._calcMatrices=function(){if(this.height){var e=this.centerOffset;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var r=Math.PI/2+this._pitch,i=this._fov*(.5+e.y/this.height),n=Math.sin(i)*this.cameraToCenterDistance/Math.sin(t.clamp(Math.PI-r-i,.01,Math.PI-.01)),o=(s=this.point).x,a=s.y,s=(r=1.01*(Math.cos(Math.PI/2-this._pitch)*n+this.cameraToCenterDistance),i=this.height/50,new Float64Array(16));if(t.perspective(s,this._fov,this.width/this.height,i,r),s[8]=2*-e.x/this.width,s[9]=2*e.y/this.height,t.scale(s,s,[1,-1,1]),t.translate(s,s,[0,0,-this.cameraToCenterDistance]),t.rotateX(s,s,this._pitch),t.rotateZ(s,s,this.angle),t.translate(s,s,[-o,-a,0]),this.mercatorMatrix=t.scale([],s,[this.worldSize,this.worldSize,this.worldSize]),t.scale(s,s,[1,1,t.mercatorZfromAltitude(1,this.center.lat)*this.worldSize,1]),this.projMatrix=s,this.invProjMatrix=t.invert([],this.projMatrix),n=this.width%2/2,i=this.height%2/2,r=Math.cos(this.angle),e=Math.sin(this.angle),o=o-Math.round(o)+r*n+e*i,e=a-Math.round(a)+r*i+e*n,n=new Float64Array(s),t.translate(n,n,[.5<o?o-1:o,.5<e?e-1:e,0]),this.alignedProjMatrix=n,s=t.create(),t.scale(s,s,[this.width/2,-this.height/2,1]),t.translate(s,s,[1,-1,0]),this.labelPlaneMatrix=s,s=t.create(),t.scale(s,s,[1,-1,1]),t.translate(s,s,[-1,-1,0]),t.scale(s,s,[2/this.width,2/this.height,1]),this.glCoordMatrix=s,this.pixelMatrix=t.multiply(new Float64Array(16),this.labelPlaneMatrix,this.projMatrix),!(s=t.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=s,this._posMatrixCache={},this._alignedPosMatrixCache={}}},bn.prototype.maxPitchScaleFactor=function(){if(!this.pixelMatrixInverse)return 1;var e=[(e=this.pointCoordinate(new t.Point(0,0))).x*this.worldSize,e.y*this.worldSize,0,1];return t.transformMat4(e,e,this.pixelMatrix)[3]/this.cameraToCenterDistance},bn.prototype.getCameraPoint=function(){var e=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new t.Point(0,e))},bn.prototype.getCameraQueryGeometry=function(e){var r=this.getCameraPoint();if(1===e.length)return[e[0],r];for(var i=r.x,n=r.y,o=r.x,a=r.y,s=0,u=e;s<u.length;s+=1){var l=u[s];i=Math.min(i,l.x),n=Math.min(n,l.y),o=Math.max(o,l.x),a=Math.max(a,l.y)}return[new t.Point(i,n),new t.Point(o,n),new t.Point(o,a),new t.Point(i,a),new t.Point(i,n)]},Object.defineProperties(bn.prototype,j),wn.prototype.addTo=function(e){return this._map=e,t.window.addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this},wn.prototype.remove=function(){return t.window.removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this},wn.prototype.getHashString=function(e){var r=this._map.getCenter(),i=Math.round(100*this._map.getZoom())/100,n=Math.ceil((i*Math.LN2+Math.log(512/360/.5))/Math.LN10),o=Math.pow(10,n),a=Math.round(r.lng*o)/o,s=(n=Math.round(r.lat*o)/o,r=this._map.getBearing(),o=this._map.getPitch(),"");if(s+=e?"/"+a+"/"+n+"/"+i:i+"/"+n+"/"+a,(r||o)&&(s+="/"+Math.round(10*r)/10),o&&(s+="/"+Math.round(o)),this._hashName){var u=this._hashName,l=!1;o=t.window.location.hash.slice(1).split("&").map((function(t){var e=t.split("=")[0];return e===u?(l=!0,e+"="+s):t})).filter((function(t){return t}));return l||o.push(u+"="+s),"#"+o.join("&")}return"#"+s},wn.prototype._getCurrentHash=function(){var e,r=this,i=t.window.location.hash.replace("#","");return this._hashName?(i.split("&").map((function(t){return t.split("=")})).forEach((function(t){t[0]===r._hashName&&(e=t)})),(e&&e[1]||"").split("/")):i.split("/")},wn.prototype._onHashChange=function(){var t=this._getCurrentHash();if(3<=t.length&&!t.some((function(t){return isNaN(t)}))){var e=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(t[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+t[2],+t[1]],zoom:+t[0],bearing:e,pitch:+(t[4]||0)}),!0}return!1},wn.prototype._updateHashUnthrottled=function(){var e=t.window.location.href.replace(/(#.+)?$/,this.getHashString());try{t.window.history.replaceState(t.window.history.state,null,e)}catch(e){}};V={linearity:.3,easing:t.bezier(0,0,.3,1)};var Tn=t.extend({deceleration:2500,maxSpeed:1400},V),En=t.extend({deceleration:20,maxSpeed:1400},V),In=t.extend({deceleration:1e3,maxSpeed:360},V),An=t.extend({deceleration:1e3,maxSpeed:90},V);function Cn(t,e){(!t.duration||t.duration<e.duration)&&(t.duration=e.duration,t.easing=e.easing)}function Pn(e,r,i){var n=i.maxSpeed,o=i.linearity,a=i.deceleration;n=t.clamp(e*o/(r/1e3),-n,n),o=Math.abs(n)/(a*o);return{easing:i.easing,duration:1e3*o,amount:n*(o/2)}}function Mn(t,e){this._map=t,this._clickTolerance=e.clickTolerance}Sn.prototype.clear=function(){this._inertiaBuffer=[]},Sn.prototype.record=function(e){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:t.browser.now(),settings:e})},Sn.prototype._drainInertiaBuffer=function(){for(var e=this._inertiaBuffer,r=t.browser.now();0<e.length&&160<r-e[0].time;)e.shift()},Sn.prototype._onMoveEnd=function(e){if(this._drainInertiaBuffer(),!(this._inertiaBuffer.length<2)){for(var r={zoom:0,bearing:0,pitch:0,pan:new t.Point(0,0),pinchAround:void 0,around:void 0},i=0,n=this._inertiaBuffer;i<n.length;i+=1){var o=n[i].settings;r.zoom+=o.zoomDelta||0,r.bearing+=o.bearingDelta||0,r.pitch+=o.pitchDelta||0,o.panDelta&&r.pan._add(o.panDelta),o.around&&(r.around=o.around),o.pinchAround&&(r.pinchAround=o.pinchAround)}var a,s,u=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,l={};return r.pan.mag()&&(e=Pn(r.pan.mag(),u,t.extend({},Tn,e||{})),l.offset=r.pan.mult(e.amount/r.pan.mag()),l.center=this._map.transform.center,Cn(l,e)),r.zoom&&(a=Pn(r.zoom,u,En),l.zoom=this._map.transform.zoom+a.amount,Cn(l,a)),r.bearing&&(a=Pn(r.bearing,u,In),l.bearing=this._map.transform.bearing+t.clamp(a.amount,-179,179),Cn(l,a)),r.pitch&&(s=Pn(r.pitch,u,An),l.pitch=this._map.transform.pitch+s.amount,Cn(l,s)),(l.zoom||l.bearing)&&(s=void 0===r.pinchAround?r.around:r.pinchAround,l.around=s?this._map.unproject(s):this._map.getCenter()),this.clear(),t.extend(l,{noMoveStart:!0})}};var kn=function(e){function i(i,n,o,a){void 0===a&&(a={});var s=r.mousePos(n.getCanvasContainer(),o),u=n.unproject(s);e.call(this,i,t.extend({point:s,lngLat:u,originalEvent:o},a)),this._defaultPrevented=!1,this.target=n}e&&(i.__proto__=e);var n={defaultPrevented:{configurable:!0}};return((i.prototype=Object.create(e&&e.prototype)).constructor=i).prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(i.prototype,n),i}(t.Event),zn=function(e){function i(i,n,o){var a="touchend"===i?o.changedTouches:o.touches,s=r.touchPos(n.getCanvasContainer(),a),u=s.map((function(t){return n.unproject(t)})),l=s.reduce((function(t,e,r,i){return t.add(e.div(i.length))}),new t.Point(0,0));a=n.unproject(l);e.call(this,i,{points:s,point:l,lngLats:u,lngLat:a,originalEvent:o}),this._defaultPrevented=!1}e&&(i.__proto__=e);var n={defaultPrevented:{configurable:!0}};return((i.prototype=Object.create(e&&e.prototype)).constructor=i).prototype.preventDefault=function(){this._defaultPrevented=!0},n.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(i.prototype,n),i}(t.Event),Ln=function(t){function e(e,r,i){t.call(this,e,{originalEvent:i}),this._defaultPrevented=!1}t&&(e.__proto__=t);var r={defaultPrevented:{configurable:!0}};return((e.prototype=Object.create(t&&t.prototype)).constructor=e).prototype.preventDefault=function(){this._defaultPrevented=!0},r.defaultPrevented.get=function(){return this._defaultPrevented},Object.defineProperties(e.prototype,r),e}(t.Event);function Bn(t){this._map=t}function Dn(t,e){this._map=t,this._el=t.getCanvasContainer(),this._container=t.getContainer(),this._clickTolerance=e.clickTolerance||1}function Rn(t,e){for(var r={},i=0;i<t.length;i++)r[t[i].identifier]=e[i];return r}function On(t){this.reset(),this.numTouches=t.numTouches}function Fn(t){this.singleTap=new On(t),this.numTaps=t.numTaps,this.reset()}function jn(){this._zoomIn=new Fn({numTouches:1,numTaps:2}),this._zoomOut=new Fn({numTouches:2,numTaps:1}),this.reset()}Mn.prototype.reset=function(){delete this._mousedownPos},Mn.prototype.wheel=function(t){return this._firePreventable(new Ln(t.type,this._map,t))},Mn.prototype.mousedown=function(t,e){return this._mousedownPos=e,this._firePreventable(new kn(t.type,this._map,t))},Mn.prototype.mouseup=function(t){this._map.fire(new kn(t.type,this._map,t))},Mn.prototype.click=function(t,e){this._mousedownPos&&this._mousedownPos.dist(e)>=this._clickTolerance||this._map.fire(new kn(t.type,this._map,t))},Mn.prototype.dblclick=function(t){return this._firePreventable(new kn(t.type,this._map,t))},Mn.prototype.mouseover=function(t){this._map.fire(new kn(t.type,this._map,t))},Mn.prototype.mouseout=function(t){this._map.fire(new kn(t.type,this._map,t))},Mn.prototype.touchstart=function(t){return this._firePreventable(new zn(t.type,this._map,t))},Mn.prototype.touchmove=function(t){this._map.fire(new zn(t.type,this._map,t))},Mn.prototype.touchend=function(t){this._map.fire(new zn(t.type,this._map,t))},Mn.prototype.touchcancel=function(t){this._map.fire(new zn(t.type,this._map,t))},Mn.prototype._firePreventable=function(t){if(this._map.fire(t),t.defaultPrevented)return{}},Mn.prototype.isEnabled=function(){return!0},Mn.prototype.isActive=function(){return!1},Mn.prototype.enable=function(){},Mn.prototype.disable=function(){},Bn.prototype.reset=function(){this._delayContextMenu=!1,delete this._contextMenuEvent},Bn.prototype.mousemove=function(t){this._map.fire(new kn(t.type,this._map,t))},Bn.prototype.mousedown=function(){this._delayContextMenu=!0},Bn.prototype.mouseup=function(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new kn("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)},Bn.prototype.contextmenu=function(t){this._delayContextMenu?this._contextMenuEvent=t:this._map.fire(new kn(t.type,this._map,t)),this._map.listens("contextmenu")&&t.preventDefault()},Bn.prototype.isEnabled=function(){return!0},Bn.prototype.isActive=function(){return!1},Bn.prototype.enable=function(){},Bn.prototype.disable=function(){},Dn.prototype.isEnabled=function(){return!!this._enabled},Dn.prototype.isActive=function(){return!!this._active},Dn.prototype.enable=function(){this.isEnabled()||(this._enabled=!0)},Dn.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},Dn.prototype.mousedown=function(t,e){this.isEnabled()&&t.shiftKey&&0===t.button&&(r.disableDrag(),this._startPos=this._lastPos=e,this._active=!0)},Dn.prototype.mousemoveWindow=function(t,e){var i,n,o;this._active&&(o=e,this._lastPos.equals(o)||!this._box&&o.dist(this._startPos)<this._clickTolerance||(i=this._startPos,this._lastPos=o,this._box||(this._box=r.create("div","maplibregl-boxzoom mapboxgl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair","mapboxgl-crosshair"),this._fireEvent("boxzoomstart",t)),n=Math.min(i.x,o.x),e=Math.max(i.x,o.x),t=Math.min(i.y,o.y),o=Math.max(i.y,o.y),r.setTransform(this._box,"translate("+n+"px,"+t+"px)"),this._box.style.width=e-n+"px",this._box.style.height=o-t+"px"))},Dn.prototype.mouseupWindow=function(e,i){var n=this;if(this._active&&0===e.button){var o=this._startPos,a=i;if(this.reset(),r.suppressClick(),o.x!==a.x||o.y!==a.y)return this._map.fire(new t.Event("boxzoomend",{originalEvent:e})),{cameraAnimation:function(t){return t.fitScreenCoordinates(o,a,n._map.getBearing(),{linear:!0})}};this._fireEvent("boxzoomcancel",e)}},Dn.prototype.keydown=function(t){this._active&&27===t.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",t))},Dn.prototype.reset=function(){this._active=!1,this._container.classList.remove("maplibregl-crosshair","mapboxgl-crosshair"),this._box&&(r.remove(this._box),this._box=null),r.enableDrag(),delete this._startPos,delete this._lastPos},Dn.prototype._fireEvent=function(e,r){return this._map.fire(new t.Event(e,{originalEvent:r}))},On.prototype.reset=function(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1},On.prototype.touchstart=function(e,r,i){(this.centroid||i.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=e.timeStamp),i.length===this.numTouches&&(this.centroid=function(e){for(var r=new t.Point(0,0),i=0,n=e;i<n.length;i+=1)r._add(n[i]);return r.div(e.length)}(r),this.touches=Rn(i,r)))},On.prototype.touchmove=function(t,e,r){if(!this.aborted&&this.centroid){var i,n=Rn(r,e);for(i in this.touches){var o=n[i];(!o||30<o.dist(this.touches[i]))&&(this.aborted=!0)}}},On.prototype.touchend=function(t,e,r){if((!this.centroid||500<t.timeStamp-this.startTime)&&(this.aborted=!0),0===r.length&&(r=!this.aborted&&this.centroid,this.reset(),r))return r},Fn.prototype.reset=function(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()},Fn.prototype.touchstart=function(t,e,r){this.singleTap.touchstart(t,e,r)},Fn.prototype.touchmove=function(t,e,r){this.singleTap.touchmove(t,e,r)},Fn.prototype.touchend=function(t,e,r){var i=this.singleTap.touchend(t,e,r);if(i&&(e=t.timeStamp-this.lastTime<500,r=!this.lastTap||this.lastTap.dist(i)<30,e&&r||this.reset(),this.count++,this.lastTime=t.timeStamp,this.lastTap=i,this.count===this.numTaps))return this.reset(),i},jn.prototype.reset=function(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()},jn.prototype.touchstart=function(t,e,r){this._zoomIn.touchstart(t,e,r),this._zoomOut.touchstart(t,e,r)},jn.prototype.touchmove=function(t,e,r){this._zoomIn.touchmove(t,e,r),this._zoomOut.touchmove(t,e,r)},jn.prototype.touchend=function(t,e,r){var i=this,n=this._zoomIn.touchend(t,e,r),o=this._zoomOut.touchend(t,e,r);return n?(this._active=!0,t.preventDefault(),setTimeout((function(){return i.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()+1,around:e.unproject(n)},{originalEvent:t})}}):o?(this._active=!0,t.preventDefault(),setTimeout((function(){return i.reset()}),0),{cameraAnimation:function(e){return e.easeTo({duration:300,zoom:e.getZoom()-1,around:e.unproject(o)},{originalEvent:t})}}):void 0},jn.prototype.touchcancel=function(){this.reset()},jn.prototype.enable=function(){this._enabled=!0},jn.prototype.disable=function(){this._enabled=!1,this.reset()},jn.prototype.isEnabled=function(){return this._enabled},jn.prototype.isActive=function(){return this._active};var Un={0:1,2:2};function Nn(t){this._minTouches=1,this._clickTolerance=t.clickTolerance||1,this.reset()}(q=function(t){this.reset(),this._clickTolerance=t.clickTolerance||1}).prototype.reset=function(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton},q.prototype._correctButton=function(t,e){return!1},q.prototype._move=function(t,e){return{}},q.prototype.mousedown=function(t,e){var i;this._lastPoint||(i=r.mouseButton(t),this._correctButton(t,i)&&(this._lastPoint=e,this._eventButton=i))},q.prototype.mousemoveWindow=function(t,e){var r=this._lastPoint;if(r)if(t.preventDefault(),function(e){return e=Un[e],void 0===t.buttons||(t.buttons&e)!==e}(this._eventButton))this.reset();else if(this._moved||!(e.dist(r)<this._clickTolerance))return this._moved=!0,this._lastPoint=e,this._move(r,e)},q.prototype.mouseupWindow=function(t){this._lastPoint&&r.mouseButton(t)===this._eventButton&&(this._moved&&r.suppressClick(),this.reset())},q.prototype.enable=function(){this._enabled=!0},q.prototype.disable=function(){this._enabled=!1,this.reset()},q.prototype.isEnabled=function(){return this._enabled},q.prototype.isActive=function(){return this._active};var Vn,qn,Gn,Hn=((Gn=q)&&(Jn.__proto__=Gn),((Jn.prototype=Object.create(Gn&&Gn.prototype)).constructor=Jn).prototype.mousedown=function(t,e){Gn.prototype.mousedown.call(this,t,e),this._lastPoint&&(this._active=!0)},Jn.prototype._correctButton=function(t,e){return 0===e&&!t.ctrlKey},Jn.prototype._move=function(t,e){return{around:e,panDelta:e.sub(t)}},Jn),Zn=((qn=q)&&(Kn.__proto__=qn),((Kn.prototype=Object.create(qn&&qn.prototype)).constructor=Kn).prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},Kn.prototype._move=function(t,e){if(t=.8*(e.x-t.x))return this._active=!0,{bearingDelta:t}},Kn.prototype.contextmenu=function(t){t.preventDefault()},Kn),Wn=((Vn=q)&&(Xn.__proto__=Vn),((Xn.prototype=Object.create(Vn&&Vn.prototype)).constructor=Xn).prototype._correctButton=function(t,e){return 0===e&&t.ctrlKey||2===e},Xn.prototype._move=function(t,e){if(t=-.5*(e.y-t.y))return this._active=!0,{pitchDelta:t}},Xn.prototype.contextmenu=function(t){t.preventDefault()},Xn);function Xn(){Vn.apply(this,arguments)}function Kn(){qn.apply(this,arguments)}function Jn(){Gn.apply(this,arguments)}function Yn(t,e,r){for(var i=0;i<t.length;i++)if(t[i].identifier===r)return e[i]}function Qn(t,e){return Math.log(t/e)/Math.LN2}Nn.prototype.reset=function(){this._active=!1,this._touches={},this._sum=new t.Point(0,0)},Nn.prototype.touchstart=function(t,e,r){return this._calculateTransform(t,e,r)},Nn.prototype.touchmove=function(t,e,r){if(this._active&&!(r.length<this._minTouches))return t.preventDefault(),this._calculateTransform(t,e,r)},Nn.prototype.touchend=function(t,e,r){this._calculateTransform(t,e,r),this._active&&r.length<this._minTouches&&this.reset()},Nn.prototype.touchcancel=function(){this.reset()},Nn.prototype._calculateTransform=function(e,r,i){0<i.length&&(this._active=!0);var n,o=Rn(i,r),a=new t.Point(0,0),s=new t.Point(0,0),u=0;for(n in o){var l=o[n],c=this._touches[n];c&&(a._add(l),s._add(l.sub(c)),u++,o[n]=l)}if(this._touches=o,!(u<this._minTouches)&&s.mag()&&(r=s.div(u),this._sum._add(r),!(this._sum.mag()<this._clickTolerance)))return{around:a.div(u),panDelta:r}},Nn.prototype.enable=function(){this._enabled=!0},Nn.prototype.disable=function(){this._enabled=!1,this.reset()},Nn.prototype.isEnabled=function(){return this._enabled},Nn.prototype.isActive=function(){return this._active},(Li=function(){this.reset()}).prototype.reset=function(){this._active=!1,delete this._firstTwoTouches},Li.prototype._start=function(t){},Li.prototype._move=function(t,e,r){return{}},Li.prototype.touchstart=function(t,e,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([e[0],e[1]]))},Li.prototype.touchmove=function(t,e,r){if(this._firstTwoTouches){t.preventDefault();var i=(n=this._firstTwoTouches)[1],n=Yn(r,e,n[0]);e=Yn(r,e,i);if(n&&e)return i=this._aroundCenter?null:n.add(e).div(2),this._move([n,e],i,t)}},Li.prototype.touchend=function(t,e,i){var n,o;this._firstTwoTouches&&(o=(n=this._firstTwoTouches)[1],n=Yn(i,e,n[0]),o=Yn(i,e,o),n&&o||(this._active&&r.suppressClick(),this.reset()))},Li.prototype.touchcancel=function(){this.reset()},Li.prototype.enable=function(t){this._enabled=!0,this._aroundCenter=!!t&&"center"===t.around},Li.prototype.disable=function(){this._enabled=!1,this.reset()},Li.prototype.isEnabled=function(){return this._enabled},Li.prototype.isActive=function(){return this._active};var $n,to=(($n=Li)&&(eo.__proto__=$n),((eo.prototype=Object.create($n&&$n.prototype)).constructor=eo).prototype.reset=function(){$n.prototype.reset.call(this),delete this._distance,delete this._startDistance},eo.prototype._start=function(t){this._startDistance=this._distance=t[0].dist(t[1])},eo.prototype._move=function(t,e){var r=this._distance;if(this._distance=t[0].dist(t[1]),this._active||!(Math.abs(Qn(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Qn(this._distance,r),pinchAround:e}},eo);function eo(){$n.apply(this,arguments)}function ro(t,e){return 180*t.angleWith(e)/Math.PI}var io,no=((io=Li)&&(oo.__proto__=io),((oo.prototype=Object.create(io&&io.prototype)).constructor=oo).prototype.reset=function(){io.prototype.reset.call(this),delete this._minDiameter,delete this._startVector,delete this._vector},oo.prototype._start=function(t){this._startVector=this._vector=t[0].sub(t[1]),this._minDiameter=t[0].dist(t[1])},oo.prototype._move=function(t,e){var r=this._vector;if(this._vector=t[0].sub(t[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:ro(this._vector,r),pinchAround:e}},oo.prototype._isBelowThreshold=function(t){this._minDiameter=Math.min(this._minDiameter,t.mag());var e=25/(Math.PI*this._minDiameter)*360;t=ro(t,this._startVector);return Math.abs(t)<e},oo);function oo(){io.apply(this,arguments)}function ao(t){return Math.abs(t.y)>Math.abs(t.x)}function so(){var t=co;this._panStep=t.panStep,this._bearingStep=t.bearingStep,this._pitchStep=t.pitchStep,this._rotationDisabled=!1}var uo,lo=((uo=Li)&&(po.__proto__=uo),((po.prototype=Object.create(uo&&uo.prototype)).constructor=po).prototype.reset=function(){uo.prototype.reset.call(this),this._valid=void 0,delete this._firstMove,delete this._lastPoints},po.prototype._start=function(t){ao((this._lastPoints=t)[0].sub(t[1]))&&(this._valid=!1)},po.prototype._move=function(t,e,r){var i=t[0].sub(this._lastPoints[0]),n=t[1].sub(this._lastPoints[1]);if(this._valid=this.gestureBeginsVertically(i,n,r.timeStamp),this._valid)return this._lastPoints=t,this._active=!0,{pitchDelta:(i.y+n.y)/2*-.5}},po.prototype.gestureBeginsVertically=function(t,e,r){if(void 0!==this._valid)return this._valid;var i=2<=t.mag(),n=2<=e.mag();return i||n?i&&n?(r=0<t.y==0<e.y,ao(t)&&ao(e)&&r):(void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0):void 0},po),co={panStep:100,bearingStep:15,pitchStep:10};function po(){uo.apply(this,arguments)}function ho(t){return t*(2-t)}function fo(e,r){this._map=e,this._el=e.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=1/450,t.bindAll(["_onTimeout"],this)}function mo(t,e){this._clickZoom=t,this._tapZoom=e}function yo(){this.reset()}function go(){this._tap=new Fn({numTouches:1,numTaps:1}),this.reset()}function _o(t,e,r){this._el=t,this._mousePan=e,this._touchPan=r}function vo(t,e,r){this._pitchWithRotate=t.pitchWithRotate,this._mouseRotate=e,this._mousePitch=r}function xo(t,e,r,i){this._el=t,this._touchZoom=e,this._touchRotate=r,this._tapDragZoom=i,this._rotationDisabled=!1,this._enabled=!0}function bo(t){return t.zoom||t.drag||t.pitch||t.rotate}so.prototype.reset=function(){this._active=!1},so.prototype.keydown=function(t){var e=this;if(!(t.altKey||t.ctrlKey||t.metaKey)){var r=0,i=0,n=0,o=0,a=0;switch(t.keyCode){case 61:case 107:case 171:case 187:r=1;break;case 189:case 109:case 173:r=-1;break;case 37:t.shiftKey?i=-1:(t.preventDefault(),o=-1);break;case 39:t.shiftKey?i=1:(t.preventDefault(),o=1);break;case 38:t.shiftKey?n=1:(t.preventDefault(),a=-1);break;case 40:t.shiftKey?n=-1:(t.preventDefault(),a=1);break;default:return}return this._rotationDisabled&&(n=i=0),{cameraAnimation:function(s){var u=s.getZoom();s.easeTo({duration:300,easeId:"keyboardHandler",easing:ho,zoom:r?Math.round(u)+r*(t.shiftKey?2:1):u,bearing:s.getBearing()+i*e._bearingStep,pitch:s.getPitch()+n*e._pitchStep,offset:[-o*e._panStep,-a*e._panStep],center:s.getCenter()},{originalEvent:t})}}}},so.prototype.enable=function(){this._enabled=!0},so.prototype.disable=function(){this._enabled=!1,this.reset()},so.prototype.isEnabled=function(){return this._enabled},so.prototype.isActive=function(){return this._active},so.prototype.disableRotation=function(){this._rotationDisabled=!0},so.prototype.enableRotation=function(){this._rotationDisabled=!1},fo.prototype.setZoomRate=function(t){this._defaultZoomRate=t},fo.prototype.setWheelZoomRate=function(t){this._wheelZoomRate=t},fo.prototype.isEnabled=function(){return!!this._enabled},fo.prototype.isActive=function(){return!!this._active||void 0!==this._finishTimeout},fo.prototype.isZooming=function(){return!!this._zooming},fo.prototype.enable=function(t){this.isEnabled()||(this._enabled=!0,this._aroundCenter=t&&"center"===t.around)},fo.prototype.disable=function(){this.isEnabled()&&(this._enabled=!1)},fo.prototype.wheel=function(e){var r,i,n;this.isEnabled()&&(r=e.deltaMode===t.window.WheelEvent.DOM_DELTA_LINE?40*e.deltaY:e.deltaY,n=(i=t.browser.now())-(this._lastWheelEventTime||0),this._lastWheelEventTime=i,0!==r&&r%4.000244140625==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":400<n?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,e)):this._type||(this._type=Math.abs(n*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),e.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=e,this._delta-=r,this._active||this._start(e)),e.preventDefault())},fo.prototype._onTimeout=function(t){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(t)},fo.prototype._start=function(e){this._delta&&(this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout),e=r.mousePos(this._el,e),this._around=t.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(e)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame()))},fo.prototype.renderFrame=function(){var e=this;if(this._frameId&&(this._frameId=null,this.isActive())){var r=this._map.transform;0!==this._delta&&(o="wheel"===this._type&&4.000244140625<Math.abs(this._delta)?this._wheelZoomRate:this._defaultZoomRate,s=2/(1+Math.exp(-Math.abs(this._delta*o))),this._delta<0&&0!==s&&(s=1/s),a="number"==typeof this._targetZoom?r.zoomScale(this._targetZoom):r.scale,this._targetZoom=Math.min(r.maxZoom,Math.max(r.minZoom,r.scaleZoom(a*s))),"wheel"===this._type&&(this._startZoom=r.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0);var i,n="number"==typeof this._targetZoom?this._targetZoom:r.zoom,o=this._startZoom,a=this._easing,s=!1;return"wheel"===this._type&&o&&a?(i=a(a=Math.min((t.browser.now()-this._lastWheelEventTime)/200,1)),i=t.number(o,n,i),a<1?this._frameId||(this._frameId=!0):s=!0):(i=n,s=!0),this._active=!0,s&&(this._active=!1,this._finishTimeout=setTimeout((function(){e._zooming=!1,e._handler._triggerRenderFrame(),delete e._targetZoom,delete e._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!s,zoomDelta:i-r.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}},fo.prototype._smoothOutEasing=function(e){var r,i,n=t.ease;return this._prevEase&&(i=this._prevEase,r=(t.browser.now()-i.start)/i.duration,i=i.easing(.01+r)-i.easing(r),r=.27/Math.sqrt(i*i+1e-4)*.01,i=Math.sqrt(.0729-r*r),n=t.bezier(r,i,.25,1)),this._prevEase={start:t.browser.now(),duration:e,easing:n},n},fo.prototype.reset=function(){this._active=!1},mo.prototype.enable=function(){this._clickZoom.enable(),this._tapZoom.enable()},mo.prototype.disable=function(){this._clickZoom.disable(),this._tapZoom.disable()},mo.prototype.isEnabled=function(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()},mo.prototype.isActive=function(){return this._clickZoom.isActive()||this._tapZoom.isActive()},yo.prototype.reset=function(){this._active=!1},yo.prototype.dblclick=function(t,e){return t.preventDefault(),{cameraAnimation:function(r){r.easeTo({duration:300,zoom:r.getZoom()+(t.shiftKey?-1:1),around:r.unproject(e)},{originalEvent:t})}}},yo.prototype.enable=function(){this._enabled=!0},yo.prototype.disable=function(){this._enabled=!1,this.reset()},yo.prototype.isEnabled=function(){return this._enabled},yo.prototype.isActive=function(){return this._active},go.prototype.reset=function(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()},go.prototype.touchstart=function(t,e,r){this._swipePoint||(this._tapTime&&500<t.timeStamp-this._tapTime&&this.reset(),this._tapTime?0<r.length&&(this._swipePoint=e[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(t,e,r))},go.prototype.touchmove=function(t,e,r){if(this._tapTime){if(this._swipePoint&&r[0].identifier===this._swipeTouch){var i=e[0],n=i.y-this._swipePoint.y;return this._swipePoint=i,t.preventDefault(),this._active=!0,{zoomDelta:n/128}}}else this._tap.touchmove(t,e,r)},go.prototype.touchend=function(t,e,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(t,e,r)&&(this._tapTime=t.timeStamp)},go.prototype.touchcancel=function(){this.reset()},go.prototype.enable=function(){this._enabled=!0},go.prototype.disable=function(){this._enabled=!1,this.reset()},go.prototype.isEnabled=function(){return this._enabled},go.prototype.isActive=function(){return this._active},_o.prototype.enable=function(t){this._inertiaOptions=t||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")},_o.prototype.disable=function(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")},_o.prototype.isEnabled=function(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()},_o.prototype.isActive=function(){return this._mousePan.isActive()||this._touchPan.isActive()},vo.prototype.enable=function(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()},vo.prototype.disable=function(){this._mouseRotate.disable(),this._mousePitch.disable()},vo.prototype.isEnabled=function(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())},vo.prototype.isActive=function(){return this._mouseRotate.isActive()||this._mousePitch.isActive()},xo.prototype.enable=function(t){this._touchZoom.enable(t),this._rotationDisabled||this._touchRotate.enable(t),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")},xo.prototype.disable=function(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")},xo.prototype.isEnabled=function(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()},xo.prototype.isActive=function(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()},xo.prototype.disableRotation=function(){this._rotationDisabled=!0,this._touchRotate.disable()},xo.prototype.enableRotation=function(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()};var wo,So=((wo=t.Event)&&(To.__proto__=wo),(To.prototype=Object.create(wo&&wo.prototype)).constructor=To);function To(){wo.apply(this,arguments)}function Eo(t){return t.panDelta&&t.panDelta.mag()||t.zoomDelta||t.bearingDelta||t.pitchDelta}function Io(e,i){this._map=e,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new Sn(e),this._bearingSnap=i.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(i),t.bindAll(["handleEvent","handleWindowEvent"],this),i=this._el,this._listeners=[[i,"touchstart",{passive:!0}],[i,"touchmove",{passive:!1}],[i,"touchend",void 0],[i,"touchcancel",void 0],[i,"mousedown",void 0],[i,"mousemove",void 0],[i,"mouseup",void 0],[t.window.document,"mousemove",{capture:!0}],[t.window.document,"mouseup",void 0],[i,"mouseover",void 0],[i,"mouseout",void 0],[i,"dblclick",void 0],[i,"click",void 0],[i,"keydown",{capture:!1}],[i,"keyup",void 0],[i,"wheel",{passive:!1}],[i,"contextmenu",void 0],[t.window,"blur",void 0]];for(var n=0,o=this._listeners;n<o.length;n+=1){var a=o[n],s=a[0];r.addEventListener(s,a[1],s===t.window.document?this.handleWindowEvent:this.handleEvent,a[2])}}function Ao(e){void 0===e&&(e={}),this.options=e,t.bindAll(["_toggleAttribution","_updateEditLink","_updateData","_updateCompact"],this)}Io.prototype.destroy=function(){for(var e=0,i=this._listeners;e<i.length;e+=1){var n=i[e],o=n[0];r.removeEventListener(o,n[1],o===t.window.document?this.handleWindowEvent:this.handleEvent,n[2])}},Io.prototype._addDefaultHandlers=function(t){var e=this._map,r=e.getCanvasContainer();this._add("mapEvent",new Mn(e,t));var i=e.boxZoom=new Dn(e,t);this._add("boxZoom",i);var n=new jn,o=new yo;e.doubleClickZoom=new mo(o,n),this._add("tapZoom",n),this._add("clickZoom",o),i=new go,this._add("tapDragZoom",i),n=e.touchPitch=new lo,this._add("touchPitch",n),o=new Zn(t),n=new Wn(t),e.dragRotate=new vo(t,o,n),this._add("mouseRotate",o,["mousePitch"]),this._add("mousePitch",n,["mouseRotate"]),o=new Hn(t),n=new Nn(t),e.dragPan=new _o(r,o,n),this._add("mousePan",o),this._add("touchPan",n,["touchZoom","touchRotate"]),o=new no,n=new to,e.touchZoomRotate=new xo(r,n,o,i),this._add("touchRotate",o,["touchPan","touchZoom"]),this._add("touchZoom",n,["touchPan","touchRotate"]),n=e.scrollZoom=new fo(e,this),this._add("scrollZoom",n,["mousePan"]),n=e.keyboard=new so,this._add("keyboard",n),this._add("blockableMapEvent",new Bn(e));for(var a=0,s=["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"];a<s.length;a+=1){var u=s[a];t.interactive&&t[u]&&e[u].enable(t[u])}},Io.prototype._add=function(t,e,r){this._handlers.push({handlerName:t,handler:e,allowed:r}),this._handlersById[t]=e},Io.prototype.stop=function(t){if(!this._updatingCamera){for(var e=0,r=this._handlers;e<r.length;e+=1)r[e].handler.reset();this._inertia.clear(),this._fireEvents({},{},t),this._changes=[]}},Io.prototype.isActive=function(){for(var t=0,e=this._handlers;t<e.length;t+=1)if(e[t].handler.isActive())return!0;return!1},Io.prototype.isZooming=function(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()},Io.prototype.isRotating=function(){return!!this._eventsInProgress.rotate},Io.prototype.isMoving=function(){return Boolean(bo(this._eventsInProgress))||this.isZooming()},Io.prototype._blockedByActive=function(t,e,r){for(var i in t)if(i!==r&&(!e||e.indexOf(i)<0))return!0;return!1},Io.prototype.handleWindowEvent=function(t){this.handleEvent(t,t.type+"Window")},Io.prototype._getMapTouches=function(t){for(var e=[],r=0,i=t;r<i.length;r+=1){var n=i[r];this._el.contains(n.target)&&e.push(n)}return e},Io.prototype.handleEvent=function(t,e){if("blur"!==t.type){this._updatingCamera=!0;for(var i="renderFrame"===t.type?void 0:t,n={needsRenderFrame:!1},o={},a={},s=t.touches?this._getMapTouches(t.touches):void 0,u=s?r.touchPos(this._el,s):r.mousePos(this._el,t),l=0,c=this._handlers;l<c.length;l+=1){var p=c[l],h=p.handlerName,f=p.handler,d=p.allowed;f.isEnabled()&&(p=void 0,this._blockedByActive(a,d,h)?f.reset():f[e||t.type]&&(p=f[e||t.type](t,u,s),this.mergeHandlerResult(n,o,p,h,i),p&&p.needsRenderFrame&&this._triggerRenderFrame()),(p||f.isActive())&&(a[h]=f))}var m,y={};for(m in this._previousActiveHandlers)a[m]||(y[m]=i);this._previousActiveHandlers=a,(Object.keys(y).length||Eo(n))&&(this._changes.push([n,o,y]),this._triggerRenderFrame()),(Object.keys(a).length||Eo(n))&&this._map._stop(!0),this._updatingCamera=!1;var g=n.cameraAnimation;g&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],g(this._map))}else this.stop(!0)},Io.prototype.mergeHandlerResult=function(e,r,i,n,o){i&&(t.extend(e,i),o={handlerName:n,originalEvent:i.originalEvent||o},void 0!==i.zoomDelta&&(r.zoom=o),void 0!==i.panDelta&&(r.drag=o),void 0!==i.pitchDelta&&(r.pitch=o),void 0!==i.bearingDelta&&(r.rotate=o))},Io.prototype._applyChanges=function(){for(var e={},r={},i={},n=0,o=this._changes;n<o.length;n+=1){var a=(u=o[n])[0],s=u[1],u=u[2];a.panDelta&&(e.panDelta=(e.panDelta||new t.Point(0,0))._add(a.panDelta)),a.zoomDelta&&(e.zoomDelta=(e.zoomDelta||0)+a.zoomDelta),a.bearingDelta&&(e.bearingDelta=(e.bearingDelta||0)+a.bearingDelta),a.pitchDelta&&(e.pitchDelta=(e.pitchDelta||0)+a.pitchDelta),void 0!==a.around&&(e.around=a.around),void 0!==a.pinchAround&&(e.pinchAround=a.pinchAround),a.noInertia&&(e.noInertia=a.noInertia),t.extend(r,s),t.extend(i,u)}this._updateMapTransform(e,r,i),this._changes=[]},Io.prototype._updateMapTransform=function(t,e,r){var i=this._map,n=i.transform;if(!Eo(t))return this._fireEvents(e,r,!0);var o=t.panDelta,a=t.zoomDelta,s=t.bearingDelta,u=t.pitchDelta,l=t.around,c=t.pinchAround;void 0!==c&&(l=c),i._stop(!0),l=l||i.transform.centerPoint,o=n.pointLocation(o?l.sub(o):l),s&&(n.bearing+=s),u&&(n.pitch+=u),a&&(n.zoom+=a),n.setLocationAtPoint(o,l),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(e,r,!0)},Io.prototype._fireEvents=function(e,r,i){var n,o,a,s=this,u=bo(this._eventsInProgress),l=bo(e),c={};for(n in e)this._eventsInProgress[n]||(c[n+"start"]=e[n].originalEvent),this._eventsInProgress[n]=e[n];for(o in!u&&l&&this._fireEvent("movestart",l.originalEvent),c)this._fireEvent(o,c[o]);for(a in l&&this._fireEvent("move",l.originalEvent),e)this._fireEvent(a,e[a].originalEvent);var p,h,f,d={};for(h in this._eventsInProgress){var m=(y=this._eventsInProgress[h]).handlerName,y=y.originalEvent;this._handlersById[m].isActive()||(delete this._eventsInProgress[h],d[h+"end"]=p=r[m]||y)}for(f in d)this._fireEvent(f,d[f]);var g=bo(this._eventsInProgress);i&&(u||l)&&!g&&(this._updatingCamera=!0,l=function(t){return 0!==t&&-s._bearingSnap<t&&t<s._bearingSnap},(g=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions))?(l(g.bearing||this._map.getBearing())&&(g.bearing=0),this._map.easeTo(g,{originalEvent:p})):(this._map.fire(new t.Event("moveend",{originalEvent:p})),l(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1)},Io.prototype._fireEvent=function(e,r){this._map.fire(new t.Event(e,r?{originalEvent:r}:{}))},Io.prototype._requestFrame=function(){var t=this;return this._map.triggerRepaint(),this._map._renderTaskQueue.add((function(e){delete t._frameId,t.handleEvent(new So("renderFrame",{timeStamp:e})),t._applyChanges()}))},Io.prototype._triggerRenderFrame=function(){void 0===this._frameId&&(this._frameId=this._requestFrame())};var Co;(Co=t.Evented)&&(Po.__proto__=Co),((Po.prototype=Object.create(Co&&Co.prototype)).constructor=Po).prototype.getCenter=function(){return new t.LngLat(this.transform.center.lng,this.transform.center.lat)},Po.prototype.setCenter=function(t,e){return this.jumpTo({center:t},e)},Po.prototype.panBy=function(e,r,i){return e=t.Point.convert(e).mult(-1),this.panTo(this.transform.center,t.extend({offset:e},r),i)},Po.prototype.panTo=function(e,r,i){return this.easeTo(t.extend({center:e},r),i)},Po.prototype.getZoom=function(){return this.transform.zoom},Po.prototype.setZoom=function(t,e){return this.jumpTo({zoom:t},e),this},Po.prototype.zoomTo=function(e,r,i){return this.easeTo(t.extend({zoom:e},r),i)},Po.prototype.zoomIn=function(t,e){return this.zoomTo(this.getZoom()+1,t,e),this},Po.prototype.zoomOut=function(t,e){return this.zoomTo(this.getZoom()-1,t,e),this},Po.prototype.getBearing=function(){return this.transform.bearing},Po.prototype.setBearing=function(t,e){return this.jumpTo({bearing:t},e),this},Po.prototype.getPadding=function(){return this.transform.padding},Po.prototype.setPadding=function(t,e){return this.jumpTo({padding:t},e),this},Po.prototype.rotateTo=function(e,r,i){return this.easeTo(t.extend({bearing:e},r),i)},Po.prototype.resetNorth=function(e,r){return this.rotateTo(0,t.extend({duration:1e3},e),r),this},Po.prototype.resetNorthPitch=function(e,r){return this.easeTo(t.extend({bearing:0,pitch:0,duration:1e3},e),r),this},Po.prototype.snapToNorth=function(t,e){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(t,e):this},Po.prototype.getPitch=function(){return this.transform.pitch},Po.prototype.setPitch=function(t,e){return this.jumpTo({pitch:t},e),this},Po.prototype.cameraForBounds=function(e,r){e=t.LngLatBounds.convert(e);var i=r&&r.bearing||0;return this._cameraForBoxAndBearing(e.getNorthWest(),e.getSouthEast(),i,r)},Po.prototype._cameraForBoxAndBearing=function(e,r,i,n){var o={top:0,bottom:0,right:0,left:0};"number"==typeof(n=t.extend({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},n)).padding&&(l=n.padding,n.padding={top:l,bottom:l,right:l,left:l}),n.padding=t.extend(o,n.padding);var a=this.transform,s=a.padding,u=a.project(t.LngLat.convert(e)),l=a.project(t.LngLat.convert(r));o=u.rotate(-i*Math.PI/180),e=l.rotate(-i*Math.PI/180),r=new t.Point(Math.max(o.x,e.x),Math.max(o.y,e.y)),e=new t.Point(Math.min(o.x,e.x),Math.min(o.y,e.y)),r=r.sub(e),e=(a.width-(s.left+s.right+n.padding.left+n.padding.right))/r.x;if(!((r=(a.height-(s.top+s.bottom+n.padding.top+n.padding.bottom))/r.y)<0||e<0))return e=Math.min(a.scaleZoom(a.scale*Math.min(e,r)),n.maxZoom),r="number"==typeof n.offset.x?new t.Point(n.offset.x,n.offset.y):t.Point.convert(n.offset),n=new t.Point((n.padding.left-n.padding.right)/2,(n.padding.top-n.padding.bottom)/2).rotate(i*Math.PI/180),n=r.add(n).mult(a.scale/a.zoomScale(e)),{center:a.unproject(u.add(l).div(2).sub(n)),zoom:e,bearing:i};t.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.")},Po.prototype.fitBounds=function(t,e,r){return this._fitInternal(this.cameraForBounds(t,e),e,r)},Po.prototype.fitScreenCoordinates=function(e,r,i,n,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t.Point.convert(e)),this.transform.pointLocation(t.Point.convert(r)),i,n),n,o)},Po.prototype._fitInternal=function(e,r,i){return e?(delete(r=t.extend(e,r)).padding,r.linear?this.easeTo(r,i):this.flyTo(r,i)):this},Po.prototype.jumpTo=function(e,r){this.stop();var i=this.transform,n=!1,o=!1,a=!1;return"zoom"in e&&i.zoom!==+e.zoom&&(n=!0,i.zoom=+e.zoom),void 0!==e.center&&(i.center=t.LngLat.convert(e.center)),"bearing"in e&&i.bearing!==+e.bearing&&(o=!0,i.bearing=+e.bearing),"pitch"in e&&i.pitch!==+e.pitch&&(a=!0,i.pitch=+e.pitch),null==e.padding||i.isPaddingEqual(e.padding)||(i.padding=e.padding),this.fire(new t.Event("movestart",r)).fire(new t.Event("move",r)),n&&this.fire(new t.Event("zoomstart",r)).fire(new t.Event("zoom",r)).fire(new t.Event("zoomend",r)),o&&this.fire(new t.Event("rotatestart",r)).fire(new t.Event("rotate",r)).fire(new t.Event("rotateend",r)),a&&this.fire(new t.Event("pitchstart",r)).fire(new t.Event("pitch",r)).fire(new t.Event("pitchend",r)),this.fire(new t.Event("moveend",r))},Po.prototype.easeTo=function(e,r){var i=this;this._stop(!1,e.easeId),(!1===(e=t.extend({offset:[0,0],duration:500,easing:t.ease},e)).animate||!e.essential&&t.browser.prefersReducedMotion)&&(e.duration=0);var n=this.transform,o=this.getZoom(),a=this.getBearing(),s=this.getPitch(),u=this.getPadding(),l="zoom"in e?+e.zoom:o,c="bearing"in e?this._normalizeBearing(e.bearing,a):a,p="pitch"in e?+e.pitch:s,h=("padding"in e?e:n).padding,f=t.Point.convert(e.offset),d=n.centerPoint.add(f),m=n.pointLocation(d),y=t.LngLat.convert(e.center||m);this._normalizeCenter(y);var g,_,v=n.project(m),x=n.project(y).sub(v),b=n.zoomScale(l-o);return e.around&&(g=t.LngLat.convert(e.around),_=n.locationPoint(g)),y={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching},this._zooming=this._zooming||l!==o,this._rotating=this._rotating||a!==c,this._pitching=this._pitching||p!==s,this._padding=!n.isPaddingEqual(h),this._easeId=e.easeId,this._prepareEase(r,e.noMoveStart,y),this._ease((function(e){var m,y;i._zooming&&(n.zoom=t.number(o,l,e)),i._rotating&&(n.bearing=t.number(a,c,e)),i._pitching&&(n.pitch=t.number(s,p,e)),i._padding&&(n.interpolatePadding(u,h,e),d=n.centerPoint.add(f)),g?n.setLocationAtPoint(g,_):(y=n.zoomScale(n.zoom-o),m=o<l?Math.min(2,b):Math.max(.5,b),m=Math.pow(m,1-e),y=n.unproject(v.add(x.mult(e*m)).mult(y)),n.setLocationAtPoint(n.renderWorldCopies?y.wrap():y,d)),i._fireMoveEvents(r)}),(function(t){i._afterEase(r,t)}),e),this},Po.prototype._prepareEase=function(e,r,i){void 0===i&&(i={}),this._moving=!0,r||i.moving||this.fire(new t.Event("movestart",e)),this._zooming&&!i.zooming&&this.fire(new t.Event("zoomstart",e)),this._rotating&&!i.rotating&&this.fire(new t.Event("rotatestart",e)),this._pitching&&!i.pitching&&this.fire(new t.Event("pitchstart",e))},Po.prototype._fireMoveEvents=function(e){this.fire(new t.Event("move",e)),this._zooming&&this.fire(new t.Event("zoom",e)),this._rotating&&this.fire(new t.Event("rotate",e)),this._pitching&&this.fire(new t.Event("pitch",e))},Po.prototype._afterEase=function(e,r){var i,n;this._easeId&&r&&this._easeId===r||(delete this._easeId,i=this._zooming,n=this._rotating,r=this._pitching,this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,i&&this.fire(new t.Event("zoomend",e)),n&&this.fire(new t.Event("rotateend",e)),r&&this.fire(new t.Event("pitchend",e)),this.fire(new t.Event("moveend",e)))},Po.prototype.flyTo=function(e,r){var i=this;if(!e.essential&&t.browser.prefersReducedMotion){var n=t.pick(e,["center","zoom","bearing","pitch","around"]);return this.jumpTo(n,r)}this.stop(),e=t.extend({offset:[0,0],speed:1.2,curve:1.42,easing:t.ease},e);var o=this.transform,a=this.getZoom(),s=this.getBearing(),u=this.getPitch(),l=this.getPadding(),c="zoom"in e?t.clamp(+e.zoom,o.minZoom,o.maxZoom):a,p="bearing"in e?this._normalizeBearing(e.bearing,s):s,h="pitch"in e?+e.pitch:u,f=("padding"in e?e:o).padding,d=o.zoomScale(c-a),m=t.Point.convert(e.offset),y=o.centerPoint.add(m),g=(n=o.pointLocation(y),t.LngLat.convert(e.center||n));this._normalizeCenter(g);var _=o.project(n),v=o.project(g).sub(_),x=e.curve,b=Math.max(o.width,o.height),w=b/d,S=v.mag();"minZoom"in e&&(d=t.clamp(Math.min(e.minZoom,a,c),o.minZoom,o.maxZoom),d=b/o.zoomScale(d-a),x=Math.sqrt(d/S*2));var T=x*x;function E(t){return t=(w*w-b*b+(t?-1:1)*T*T*S*S)/(2*(t?w:b)*T*S),Math.log(Math.sqrt(t*t+1)-t)}function I(t){return(Math.exp(t)-Math.exp(-t))/2}function A(t){return(Math.exp(t)+Math.exp(-t))/2}var C=E(0),P=function(t){return A(C)/A(C+x*t)},M=function(t){return b*((A(C)*(I(t=C+x*t)/A(t))-I(C))/T)/S},k=(E(1)-C)/x;if(Math.abs(S)<1e-6||!isFinite(k)){if(Math.abs(b-w)<1e-6)return this.easeTo(e,r);var z=w<b?-1:1;k=Math.abs(Math.log(w/b))/x,M=function(){return 0},P=function(t){return Math.exp(z*x*t)}}return e.duration="duration"in e?+e.duration:1e3*k/("screenSpeed"in e?+e.screenSpeed/x:+e.speed),e.maxDuration&&e.duration>e.maxDuration&&(e.duration=0),this._zooming=!0,this._rotating=s!==p,this._pitching=h!==u,this._padding=!o.isPaddingEqual(f),this._prepareEase(r,!1),this._ease((function(e){var n=e*k,d=1/P(n);o.zoom=1===e?c:a+o.scaleZoom(d),i._rotating&&(o.bearing=t.number(s,p,e)),i._pitching&&(o.pitch=t.number(u,h,e)),i._padding&&(o.interpolatePadding(l,f,e),y=o.centerPoint.add(m)),d=1===e?g:o.unproject(_.add(v.mult(M(n))).mult(d)),o.setLocationAtPoint(o.renderWorldCopies?d.wrap():d,y),i._fireMoveEvents(r)}),(function(){return i._afterEase(r)}),e),this},Po.prototype.isEasing=function(){return!!this._easeFrameId},Po.prototype.stop=function(){return this._stop()},Po.prototype._stop=function(t,e){var r;return this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd&&(r=this._onEaseEnd,delete this._onEaseEnd,r.call(this,e)),t||(t=this.handlers)&&t.stop(!1),this},Po.prototype._ease=function(e,r,i){!1===i.animate||0===i.duration?(e(1),r()):(this._easeStart=t.browser.now(),this._easeOptions=i,this._onEaseFrame=e,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))},Po.prototype._renderFrameCallback=function(){var e=Math.min((t.browser.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(e)),e<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()},Po.prototype._normalizeBearing=function(e,r){e=t.wrap(e,-180,180);var i=Math.abs(e-r);return Math.abs(e-360-r)<i&&(e-=360),Math.abs(e+360-r)<i&&(e+=360),e},Po.prototype._normalizeCenter=function(t){var e=this.transform;e.renderWorldCopies&&!e.lngRange&&(e=t.lng-e.center.lng,t.lng+=180<e?-360:e<-180?360:0)},ye=Po;function Po(e,r){Co.call(this),this._moving=!1,this._zooming=!1,this.transform=e,this._bearingSnap=r.bearingSnap,t.bindAll(["_renderFrameCallback"],this)}function Mo(){t.bindAll(["_updateLogo"],this),t.bindAll(["_updateCompact"],this)}function ko(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}Ao.prototype.getDefaultPosition=function(){return"bottom-right"},Ao.prototype.onAdd=function(t){var e=this.options&&this.options.compact;return this._map=t,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-attrib mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=r.create("button","maplibregl-ctrl-attrib-button mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._compactButton.type="button",this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=r.create("div","maplibregl-ctrl-attrib-inner mapboxgl-ctrl-attrib-inner",this._container),this._innerContainer.setAttribute("role","list"),e&&this._container.classList.add("maplibregl-compact","mapboxgl-compact"),this._updateAttributions(),this._updateEditLink(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("moveend",this._updateEditLink),void 0===e&&(this._map.on("resize",this._updateCompact),this._updateCompact()),this._container},Ao.prototype.onRemove=function(){r.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},Ao.prototype._setElementTitle=function(t,e){e=this._map._getUIString("AttributionControl."+e),t.title=e,t.setAttribute("aria-label",e)},Ao.prototype._toggleAttribution=function(){this._container.classList.contains("maplibregl-compact-show")||this._container.classList.contains("mapboxgl-compact-show")?(this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","false")):(this._container.classList.add("maplibregl-compact-show","mapboxgl-compact-show"),this._compactButton.setAttribute("aria-pressed","true"))},Ao.prototype._updateEditLink=function(){var e,r=(r=this._editLink)||(this._editLink=this._container.querySelector(".mapbox-improve-map")),i=[{key:"owner",value:this.styleOwner},{key:"id",value:this.styleId},{key:"access_token",value:this._map._requestManager._customAccessToken||t.config.ACCESS_TOKEN}];r&&(e=i.reduce((function(t,e,r){return e.value&&(t+=e.key+"="+e.value+(r<i.length-1?"&":"")),t}),"?"),r.href=t.config.FEEDBACK_URL+"/"+e+(this._map._hash?this._map._hash.getHashString(!0):""),r.rel="noopener nofollow",this._setElementTitle(r,"MapFeedback"))},Ao.prototype._updateData=function(t){!t||"metadata"!==t.sourceDataType&&"visibility"!==t.sourceDataType&&"style"!==t.dataType||(this._updateAttributions(),this._updateEditLink())},Ao.prototype._updateAttributions=function(){if(this._map.style){var t=[];this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?t=t.concat(this.options.customAttribution.map((function(t){return"string"!=typeof t?"":t}))):"string"==typeof this.options.customAttribution&&t.push(this.options.customAttribution)),this._map.style.stylesheet&&(n=this._map.style.stylesheet,this.styleOwner=n.owner,this.styleId=n.id);var e,r=this._map.style.sourceCaches;for(e in r){var i=r[e];!i.used||(i=i.getSource()).attribution&&t.indexOf(i.attribution)<0&&t.push(i.attribution)}t.sort((function(t,e){return t.length-e.length}));var n=(t=t.filter((function(e,r){for(var i=r+1;i<t.length;i++)if(0<=t[i].indexOf(e))return!1;return!0}))).join(" | ");n!==this._attribHTML&&(this._attribHTML=n,t.length?(this._innerContainer.innerHTML=n,this._container.classList.remove("maplibregl-attrib-empty","mapboxgl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty","mapboxgl-attrib-empty"),this._editLink=null)}},Ao.prototype._updateCompact=function(){this._map.getCanvasContainer().offsetWidth<=640?this._container.classList.add("maplibregl-compact","mapboxgl-compact"):this._container.classList.remove("maplibregl-compact","maplibregl-compact-show","mapboxgl-compact","mapboxgl-compact-show")},Mo.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","maplibregl-ctrl mapboxgl-ctrl"),(t=r.create("a","maplibregl-ctrl-logo mapboxgl-ctrl-logo")).target="_blank",t.rel="noopener nofollow",t.href="https://maplibre.org/",t.setAttribute("aria-label",this._map._getUIString("LogoControl.Title")),t.setAttribute("rel","noopener nofollow"),this._container.appendChild(t),this._container.style.display="none",this._map.on("sourcedata",this._updateLogo),this._updateLogo(),this._map.on("resize",this._updateCompact),this._updateCompact(),this._container},Mo.prototype.onRemove=function(){r.remove(this._container),this._map.off("sourcedata",this._updateLogo),this._map.off("resize",this._updateCompact)},Mo.prototype.getDefaultPosition=function(){return"bottom-left"},Mo.prototype._updateLogo=function(t){t&&"metadata"!==t.sourceDataType||(this._container.style.display=this._logoRequired()?"block":"none")},Mo.prototype._logoRequired=function(){if(this._map.style){var t,e=this._map.style.sourceCaches;for(t in e)if(e[t].getSource().mapbox_logo)return!0;return!1}},Mo.prototype._updateCompact=function(){var t=this._container.children;t.length&&(t=t[0],this._map.getCanvasContainer().offsetWidth<250?t.classList.add("maplibregl-compact","mapboxgl-compact"):t.classList.remove("maplibregl-compact","mapboxgl-compact"))},ko.prototype.add=function(t){var e=++this._id;return this._queue.push({callback:t,id:e,cancelled:!1}),e},ko.prototype.remove=function(t){for(var e=this._currentlyRunning,r=0,i=e?this._queue.concat(e):this._queue;r<i.length;r+=1){var n=i[r];if(n.id===t)return void(n.cancelled=!0)}},ko.prototype.run=function(t){void 0===t&&(t=0);var e=this._currentlyRunning=this._queue;this._queue=[];for(var r=0,i=e;r<i.length;r+=1){var n=i[r];if(!n.cancelled&&(n.callback(t),this._cleared))break}this._cleared=!1,this._currentlyRunning=!1},ko.prototype.clear=function(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]};var zo={"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"},Lo=t.window.HTMLImageElement,Bo=t.window.HTMLElement,Do=t.window.ImageBitmap,Ro={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};fr=function(i){function n(e){var r=this;if(null!=(e=t.extend({},Ro,e)).minZoom&&null!=e.maxZoom&&e.minZoom>e.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=e.minPitch&&null!=e.maxPitch&&e.minPitch>e.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=e.minPitch&&e.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=e.maxPitch&&60<e.maxPitch)throw new Error("maxPitch must be less than or equal to 60");var n=new bn(e.minZoom,e.maxZoom,e.minPitch,e.maxPitch,e.renderWorldCopies);if(i.call(this,n,e),this._interactive=e.interactive,this._maxTileCacheSize=e.maxTileCacheSize,this._failIfMajorPerformanceCaveat=e.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=e.preserveDrawingBuffer,this._antialias=e.antialias,this._trackResize=e.trackResize,this._bearingSnap=e.bearingSnap,this._refreshExpiredTiles=e.refreshExpiredTiles,this._fadeDuration=e.fadeDuration,this._crossSourceCollisions=e.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=e.collectResourceTiming,this._renderTaskQueue=new ko,this._controls=[],this._mapId=t.uniqueId(),this._locale=t.extend({},zo,e.locale),this._clickTolerance=e.clickTolerance,this._requestManager=new t.RequestManager(e.transformRequest,e.accessToken),"string"==typeof e.container){if(this._container=t.window.document.getElementById(e.container),!this._container)throw new Error("Container '"+e.container+"' not found.")}else{if(!(e.container instanceof Bo))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=e.container}if(e.maxBounds&&this.setMaxBounds(e.maxBounds),t.bindAll(["_onWindowOnline","_onWindowResize","_onMapScroll","_contextLost","_contextRestored"],this),this._setupContainer(),this._setupPainter(),void 0===this.painter)throw new Error("Failed to initialize WebGL.");this.on("move",(function(){return r._update(!1)})),this.on("moveend",(function(){return r._update(!1)})),this.on("zoom",(function(){return r._update(!0)})),void 0!==t.window&&(t.window.addEventListener("online",this._onWindowOnline,!1),t.window.addEventListener("resize",this._onWindowResize,!1),t.window.addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Io(this,e),this._hash=e.hash&&new wn("string"==typeof e.hash&&e.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:e.center,zoom:e.zoom,bearing:e.bearing,pitch:e.pitch}),e.bounds&&(this.resize(),this.fitBounds(e.bounds,t.extend({},e.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=e.localIdeographFontFamily,e.style&&this.setStyle(e.style,{localIdeographFontFamily:e.localIdeographFontFamily}),e.attributionControl&&this.addControl(new Ao({customAttribution:e.customAttribution})),this.addControl(new Mo,e.logoPosition),this.on("style.load",(function(){r.transform.unmodified&&r.jumpTo(r.style.stylesheet)})),this.on("data",(function(e){r._update("style"===e.dataType),r.fire(new t.Event(e.dataType+"data",e))})),this.on("dataloading",(function(e){r.fire(new t.Event(e.dataType+"dataloading",e))}))}i&&(n.__proto__=i);var o={showTileBoundaries:{configurable:!0},showPadding:{configurable:!0},showCollisionBoxes:{configurable:!0},showOverdrawInspector:{configurable:!0},repaint:{configurable:!0},vertices:{configurable:!0},version:{configurable:!0}};return((n.prototype=Object.create(i&&i.prototype)).constructor=n).prototype._getMapId=function(){return this._mapId},n.prototype.addControl=function(e,r){if(void 0===r&&(r=e.getDefaultPosition?e.getDefaultPosition():"top-right"),!e||!e.onAdd)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));var i=e.onAdd(this);return this._controls.push(e),e=this._controlPositions[r],-1!==r.indexOf("bottom")?e.insertBefore(i,e.firstChild):e.appendChild(i),this},n.prototype.removeControl=function(e){if(!e||!e.onRemove)return this.fire(new t.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));var r=this._controls.indexOf(e);return-1<r&&this._controls.splice(r,1),e.onRemove(this),this},n.prototype.hasControl=function(t){return-1<this._controls.indexOf(t)},n.prototype.resize=function(e){var r=(i=this._containerDimensions())[0],i=i[1];return this._resizeCanvas(r,i),this.transform.resize(r,i),this.painter.resize(r,i),(i=!this._moving)&&(this.stop(),this.fire(new t.Event("movestart",e)).fire(new t.Event("move",e))),this.fire(new t.Event("resize",e)),i&&this.fire(new t.Event("moveend",e)),this},n.prototype.getBounds=function(){return this.transform.getBounds()},n.prototype.getMaxBounds=function(){return this.transform.getMaxBounds()},n.prototype.setMaxBounds=function(e){return this.transform.setMaxBounds(t.LngLatBounds.convert(e)),this._update()},n.prototype.setMinZoom=function(t){if(-2<=(t=null==t?-2:t)&&t<=this.transform.maxZoom)return this.transform.minZoom=t,this._update(),this.getZoom()<t&&this.setZoom(t),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")},n.prototype.getMinZoom=function(){return this.transform.minZoom},n.prototype.setMaxZoom=function(t){if((t=null==t?22:t)>=this.transform.minZoom)return this.transform.maxZoom=t,this._update(),this.getZoom()>t&&this.setZoom(t),this;throw new Error("maxZoom must be greater than the current minZoom")},n.prototype.getMaxZoom=function(){return this.transform.maxZoom},n.prototype.setMinPitch=function(t){if((t=null==t?0:t)<0)throw new Error("minPitch must be greater than or equal to 0");if(0<=t&&t<=this.transform.maxPitch)return this.transform.minPitch=t,this._update(),this.getPitch()<t&&this.setPitch(t),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")},n.prototype.getMinPitch=function(){return this.transform.minPitch},n.prototype.setMaxPitch=function(t){if(60<(t=null==t?60:t))throw new Error("maxPitch must be less than or equal to 60");if(t>=this.transform.minPitch)return this.transform.maxPitch=t,this._update(),this.getPitch()>t&&this.setPitch(t),this;throw new Error("maxPitch must be greater than the current minPitch")},n.prototype.getMaxPitch=function(){return this.transform.maxPitch},n.prototype.getRenderWorldCopies=function(){return this.transform.renderWorldCopies},n.prototype.setRenderWorldCopies=function(t){return this.transform.renderWorldCopies=t,this._update()},n.prototype.project=function(e){return this.transform.locationPoint(t.LngLat.convert(e))},n.prototype.unproject=function(e){return this.transform.pointLocation(t.Point.convert(e))},n.prototype.isMoving=function(){return this._moving||this.handlers.isMoving()},n.prototype.isZooming=function(){return this._zooming||this.handlers.isZooming()},n.prototype.isRotating=function(){return this._rotating||this.handlers.isRotating()},n.prototype._createDelegatedListener=function(t,e,r){var i,n=this;if("mouseenter"===t||"mouseover"===t){var o=!1;return{layer:e,listener:r,delegates:{mousemove:function(i){var a=n.getLayer(e)?n.queryRenderedFeatures(i.point,{layers:[e]}):[];a.length?o||(o=!0,r.call(n,new kn(t,n,i.originalEvent,{features:a}))):o=!1},mouseout:function(){o=!1}}}}if("mouseleave"!==t&&"mouseout"!==t)return{layer:e,listener:r,delegates:((i={})[t]=function(t){var i=n.getLayer(e)?n.queryRenderedFeatures(t.point,{layers:[e]}):[];i.length&&(t.features=i,r.call(n,t),delete t.features)},i)};var a=!1;return{layer:e,listener:r,delegates:{mousemove:function(i){(n.getLayer(e)?n.queryRenderedFeatures(i.point,{layers:[e]}):[]).length?a=!0:a&&(a=!1,r.call(n,new kn(t,n,i.originalEvent)))},mouseout:function(e){a&&(a=!1,r.call(n,new kn(t,n,e.originalEvent)))}}}},n.prototype.on=function(t,e,r){if(void 0===r)return i.prototype.on.call(this,t,e);var n,o=this._createDelegatedListener(t,e,r);for(n in this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[t]=this._delegatedListeners[t]||[],this._delegatedListeners[t].push(o),o.delegates)this.on(n,o.delegates[n]);return this},n.prototype.once=function(t,e,r){if(void 0===r)return i.prototype.once.call(this,t,e);var n,o=this._createDelegatedListener(t,e,r);for(n in o.delegates)this.once(n,o.delegates[n]);return this},n.prototype.off=function(t,e,r){var n=this;return void 0===r?i.prototype.off.call(this,t,e):(this._delegatedListeners&&this._delegatedListeners[t]&&function(i){for(var o=i[t],a=0;a<o.length;a++){var s=o[a];if(s.layer===e&&s.listener===r){for(var u in s.delegates)n.off(u,s.delegates[u]);return o.splice(a,1)}}}(this._delegatedListeners),this)},n.prototype.queryRenderedFeatures=function(e,r){return this.style?(void 0!==r||void 0===e||e instanceof t.Point||Array.isArray(e)||(r=e,e=void 0),r=r||{},i=(e=e||[[0,0],[this.transform.width,this.transform.height]])instanceof t.Point||"number"==typeof e[0]?[t.Point.convert(e)]:(i=t.Point.convert(e[0]),e=t.Point.convert(e[1]),[i,new t.Point(e.x,i.y),e,new t.Point(i.x,e.y),i]),this.style.queryRenderedFeatures(i,r,this.transform)):[];var i},n.prototype.querySourceFeatures=function(t,e){return this.style.querySourceFeatures(t,e)},n.prototype.setStyle=function(e,r){return!1!==(r=t.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&e?(this._diffStyle(e,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(e,r))},n.prototype.setTransformRequest=function(t){return this._requestManager.setTransformRequest(t),this},n.prototype._getUIString=function(t){var e=this._locale[t];if(null==e)throw new Error("Missing UI string '"+t+"'");return e},n.prototype._updateStyle=function(t,e){return this.style&&(this.style.setEventedParent(null),this.style._remove()),t?(this.style=new mi(this,e||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof t?this.style.loadURL(t):this.style.loadJSON(t)):delete this.style,this},n.prototype._lazyInitEmptyStyle=function(){this.style||(this.style=new mi(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())},n.prototype._diffStyle=function(e,r){var i,n=this;"string"==typeof e?(i=this._requestManager.normalizeStyleURL(e),i=this._requestManager.transformRequest(i,t.ResourceType.Style),t.getJSON(i,(function(e,i){e?n.fire(new t.ErrorEvent(e)):i&&n._updateDiff(i,r)}))):"object"==typeof e&&this._updateDiff(e,r)},n.prototype._updateDiff=function(e,r){try{this.style.setState(e)&&this._update(!0)}catch(i){t.warnOnce("Unable to perform style diff: "+(i.message||i.error||i)+". Rebuilding the style from scratch."),this._updateStyle(e,r)}},n.prototype.getStyle=function(){if(this.style)return this.style.serialize()},n.prototype.isStyleLoaded=function(){return this.style?this.style.loaded():t.warnOnce("There is no style added to the map.")},n.prototype.addSource=function(t,e){return this._lazyInitEmptyStyle(),this.style.addSource(t,e),this._update(!0)},n.prototype.isSourceLoaded=function(e){var r=this.style&&this.style.sourceCaches[e];if(void 0!==r)return r.loaded();this.fire(new t.ErrorEvent(new Error("There is no source with ID '"+e+"'")))},n.prototype.areTilesLoaded=function(){var t,e=this.style&&this.style.sourceCaches;for(t in e){var r,i=e[t]._tiles;for(r in i){var n=i[r];if("loaded"!==n.state&&"errored"!==n.state)return!1}}return!0},n.prototype.addSourceType=function(t,e,r){return this._lazyInitEmptyStyle(),this.style.addSourceType(t,e,r)},n.prototype.removeSource=function(t){return this.style.removeSource(t),this._update(!0)},n.prototype.getSource=function(t){return this.style.getSource(t)},n.prototype.addImage=function(e,r,i){void 0===i&&(i={});var n=i.pixelRatio;void 0===n&&(n=1);var o=i.sdf;void 0===o&&(o=!1);var a=i.stretchX,s=i.stretchY;i=i.content;if(this._lazyInitEmptyStyle(),r instanceof Lo||Do&&r instanceof Do){var u=t.browser.getImageData(r);this.style.addImage(e,{data:new t.RGBAImage({width:u.width,height:u.height},u.data),pixelRatio:n,stretchX:a,stretchY:s,content:i,sdf:o,version:0})}else{if(void 0===r.width||void 0===r.height)return this.fire(new t.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`")));u=r,this.style.addImage(e,{data:new t.RGBAImage({width:r.width,height:r.height},new Uint8Array(r.data)),pixelRatio:n,stretchX:a,stretchY:s,content:i,sdf:o,version:0,userImage:u}),u.onAdd&&u.onAdd(this,e)}},n.prototype.updateImage=function(e,r){var i=this.style.getImage(e);if(!i)return this.fire(new t.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));var n=(a=r instanceof Lo||Do&&r instanceof Do?t.browser.getImageData(r):r).width,o=a.height,a=a.data;return void 0===n||void 0===o?this.fire(new t.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`"))):n!==i.data.width||o!==i.data.height?this.fire(new t.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))):(i.data.replace(a,!(r instanceof Lo||Do&&r instanceof Do)),void this.style.updateImage(e,i))},n.prototype.hasImage=function(e){return e?!!this.style.getImage(e):(this.fire(new t.ErrorEvent(new Error("Missing required image id"))),!1)},n.prototype.removeImage=function(t){this.style.removeImage(t)},n.prototype.loadImage=function(e,r){t.getImage(this._requestManager.transformRequest(e,t.ResourceType.Image),r)},n.prototype.listImages=function(){return this.style.listImages()},n.prototype.addLayer=function(t,e){return this._lazyInitEmptyStyle(),this.style.addLayer(t,e),this._update(!0)},n.prototype.moveLayer=function(t,e){return this.style.moveLayer(t,e),this._update(!0)},n.prototype.removeLayer=function(t){return this.style.removeLayer(t),this._update(!0)},n.prototype.getLayer=function(t){return this.style.getLayer(t)},n.prototype.setLayerZoomRange=function(t,e,r){return this.style.setLayerZoomRange(t,e,r),this._update(!0)},n.prototype.setFilter=function(t,e,r){return void 0===r&&(r={}),this.style.setFilter(t,e,r),this._update(!0)},n.prototype.getFilter=function(t){return this.style.getFilter(t)},n.prototype.setPaintProperty=function(t,e,r,i){return void 0===i&&(i={}),this.style.setPaintProperty(t,e,r,i),this._update(!0)},n.prototype.getPaintProperty=function(t,e){return this.style.getPaintProperty(t,e)},n.prototype.setLayoutProperty=function(t,e,r,i){return void 0===i&&(i={}),this.style.setLayoutProperty(t,e,r,i),this._update(!0)},n.prototype.getLayoutProperty=function(t,e){return this.style.getLayoutProperty(t,e)},n.prototype.setLight=function(t,e){return void 0===e&&(e={}),this._lazyInitEmptyStyle(),this.style.setLight(t,e),this._update(!0)},n.prototype.getLight=function(){return this.style.getLight()},n.prototype.setFeatureState=function(t,e){return this.style.setFeatureState(t,e),this._update()},n.prototype.removeFeatureState=function(t,e){return this.style.removeFeatureState(t,e),this._update()},n.prototype.getFeatureState=function(t){return this.style.getFeatureState(t)},n.prototype.getContainer=function(){return this._container},n.prototype.getCanvasContainer=function(){return this._canvasContainer},n.prototype.getCanvas=function(){return this._canvas},n.prototype._containerDimensions=function(){var t=0,e=0;return this._container&&(t=this._container.clientWidth||400,e=this._container.clientHeight||300),[t,e]},n.prototype._setupContainer=function(){var t=this._container;t.classList.add("maplibregl-map","mapboxgl-map");var e=this._canvasContainer=r.create("div","maplibregl-canvas-container mapboxgl-canvas-container",t);this._interactive&&e.classList.add("maplibregl-interactive","mapboxgl-interactive"),this._canvas=r.create("canvas","maplibregl-canvas mapboxgl-canvas",e),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"),e=this._containerDimensions(),this._resizeCanvas(e[0],e[1]);var i=this._controlContainer=r.create("div","maplibregl-control-container mapboxgl-control-container",t),n=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((function(t){n[t]=r.create("div","maplibregl-ctrl-"+t+" mapboxgl-ctrl-"+t,i)})),this._container.addEventListener("scroll",this._onMapScroll,!1)},n.prototype._resizeCanvas=function(e,r){var i=t.browser.devicePixelRatio||1;this._canvas.width=i*e,this._canvas.height=i*r,this._canvas.style.width=e+"px",this._canvas.style.height=r+"px"},n.prototype._setupPainter=function(){var r=t.extend({},e.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1});(r=this._canvas.getContext("webgl",r)||this._canvas.getContext("experimental-webgl",r))?(this.painter=new yn(r,this.transform),t.webpSupported.testSupport(r)):this.fire(new t.ErrorEvent(new Error("Failed to initialize WebGL")))},n.prototype._contextLost=function(e){e.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new t.Event("webglcontextlost",{originalEvent:e}))},n.prototype._contextRestored=function(e){this._setupPainter(),this.resize(),this._update(),this.fire(new t.Event("webglcontextrestored",{originalEvent:e}))},n.prototype._onMapScroll=function(t){if(t.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1},n.prototype.loaded=function(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()},n.prototype._update=function(t){return this.style&&(this._styleDirty=this._styleDirty||t,this._sourcesDirty=!0,this.triggerRepaint()),this},n.prototype._requestRenderFrame=function(t){return this._update(),this._renderTaskQueue.add(t)},n.prototype._cancelRenderFrame=function(t){this._renderTaskQueue.remove(t)},n.prototype._render=function(e){var r,i=this,n=0,o=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(r=o.createQueryEXT(),o.beginQueryEXT(o.TIME_ELAPSED_EXT,r),n=t.browser.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(e),!this._removed){var a,s,u,l=!1;return this.style&&this._styleDirty&&(this._styleDirty=!1,a=this.transform.zoom,e=t.browser.now(),this.style.zoomHistory.update(a,e),1===(e=(a=new t.EvaluationParameters(a,{now:e,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()})).crossFadingFactor())&&e===this._crossFadingFactor||(l=!0,this._crossFadingFactor=e),this.style.update(a)),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 t.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,this.fire(new t.Event("load"))),this.style&&(this.style.hasTransitions()||l)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")&&(s=t.browser.now()-n,o.endQueryEXT(o.TIME_ELAPSED_EXT,r),setTimeout((function(){var e=o.getQueryObjectEXT(r,o.QUERY_RESULT_EXT)/1e6;o.deleteQueryEXT(r),i.fire(new t.Event("gpu-timing-frame",{cpuTime:s,gpuTime:e}))}),50)),this.listens("gpu-timing-layer")&&(u=this.painter.collectGpuTimers(),setTimeout((function(){var e=i.painter.queryGpuTimers(u);i.fire(new t.Event("gpu-timing-layer",{layerTimes:e}))}),50)),(n=this._sourcesDirty||this._styleDirty||this._placementDirty)||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new t.Event("idle")),!this._loaded||this._fullyLoaded||n||(this._fullyLoaded=!0),this}},n.prototype.remove=function(){this._hash&&this._hash.remove();for(var e=0,r=this._controls;e<r.length;e+=1)r[e].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),void 0!==t.window&&(t.window.removeEventListener("resize",this._onWindowResize,!1),t.window.removeEventListener("orientationchange",this._onWindowResize,!1),t.window.removeEventListener("online",this._onWindowOnline,!1));var i=this.painter.context.gl.getExtension("WEBGL_lose_context");i&&i.loseContext(),Oo(this._canvasContainer),Oo(this._controlContainer),this._container.classList.remove("maplibregl-map","mapboxgl-map"),this._removed=!0,this.fire(new t.Event("remove"))},n.prototype.triggerRepaint=function(){var e=this;this.style&&!this._frame&&(this._frame=t.browser.frame((function(t){e._frame=null,e._render(t)})))},n.prototype._onWindowOnline=function(){this._update()},n.prototype._onWindowResize=function(t){this._trackResize&&this.resize({originalEvent:t})._update()},o.showTileBoundaries.get=function(){return!!this._showTileBoundaries},o.showTileBoundaries.set=function(t){this._showTileBoundaries!==t&&(this._showTileBoundaries=t,this._update())},o.showPadding.get=function(){return!!this._showPadding},o.showPadding.set=function(t){this._showPadding!==t&&(this._showPadding=t,this._update())},o.showCollisionBoxes.get=function(){return!!this._showCollisionBoxes},o.showCollisionBoxes.set=function(t){this._showCollisionBoxes!==t&&((this._showCollisionBoxes=t)?this.style._generateCollisionBoxes():this._update())},o.showOverdrawInspector.get=function(){return!!this._showOverdrawInspector},o.showOverdrawInspector.set=function(t){this._showOverdrawInspector!==t&&(this._showOverdrawInspector=t,this._update())},o.repaint.get=function(){return!!this._repaint},o.repaint.set=function(t){this._repaint!==t&&(this._repaint=t,this.triggerRepaint())},o.vertices.get=function(){return!!this._vertices},o.vertices.set=function(t){this._vertices=t,this._update()},n.prototype._setCacheLimits=function(e,r){t.setCacheLimits(e,r)},o.version.get=function(){return t.version},Object.defineProperties(n.prototype,o),n}(ye);function Oo(t){t.parentNode&&t.parentNode.removeChild(t)}var Fo={showCompass:!0,showZoom:!0,visualizePitch:!1};(j=function(e){var i=this;this.options=t.extend({},Fo,e),this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this.options.showZoom&&(t.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in mapboxgl-ctrl-zoom-in",(function(t){return i._map.zoomIn({},{originalEvent:t})})),r.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden",!0),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out mapboxgl-ctrl-zoom-out",(function(t){return i._map.zoomOut({},{originalEvent:t})})),r.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden",!0)),this.options.showCompass&&(t.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("maplibregl-ctrl-compass mapboxgl-ctrl-compass",(function(t){i.options.visualizePitch?i._map.resetNorthPitch({},{originalEvent:t}):i._map.resetNorth({},{originalEvent:t})})),this._compassIcon=r.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden",!0))}).prototype._updateZoomButtons=function(){var t=(e=this._map.getZoom())===this._map.getMaxZoom(),e=e===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=e,this._zoomInButton.setAttribute("aria-disabled",t.toString()),this._zoomOutButton.setAttribute("aria-disabled",e.toString())},j.prototype._rotateCompassArrow=function(){var t=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=t},j.prototype.onAdd=function(t){return this._map=t,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 jo(this._map,this._compass,this.options.visualizePitch)),this._container},j.prototype.onRemove=function(){r.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},j.prototype._createButton=function(t,e){return(t=r.create("button",t,this._container)).type="button",t.addEventListener("click",e),t},j.prototype._setButtonTitle=function(t,e){e=this._map._getUIString("NavigationControl."+e),t.title=e,t.setAttribute("aria-label",e)};var jo=function(e,i,n){void 0===n&&(n=!1),this._clickTolerance=10,this.element=i,this.mouseRotate=new Zn({clickTolerance:e.dragRotate._mouseRotate._clickTolerance}),this.map=e,n&&(this.mousePitch=new Wn({clickTolerance:e.dragRotate._mousePitch._clickTolerance})),t.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),r.addEventListener(i,"mousedown",this.mousedown),r.addEventListener(i,"touchstart",this.touchstart,{passive:!1}),r.addEventListener(i,"touchmove",this.touchmove),r.addEventListener(i,"touchend",this.touchend),r.addEventListener(i,"touchcancel",this.reset)};function Uo(e,r,i){var n,o,a;for(e=new t.LngLat(e.lng,e.lat),r&&(n=new t.LngLat(e.lng-360,e.lat),o=new t.LngLat(e.lng+360,e.lat),a=i.locationPoint(e).distSqr(r),i.locationPoint(n).distSqr(r)<a?e=n:i.locationPoint(o).distSqr(r)<a&&(e=o));180<Math.abs(e.lng-i.center.lng);){var s=i.locationPoint(e);if(0<=s.x&&0<=s.y&&s.x<=i.width&&s.y<=i.height)break;e.lng>i.center.lng?e.lng-=360:e.lng+=360}return e}jo.prototype.down=function(t,e){this.mouseRotate.mousedown(t,e),this.mousePitch&&this.mousePitch.mousedown(t,e),r.disableDrag()},jo.prototype.move=function(t,e){var r,i=this.map,n=this.mouseRotate.mousemoveWindow(t,e);n&&n.bearingDelta&&i.setBearing(i.getBearing()+n.bearingDelta),this.mousePitch&&(r=this.mousePitch.mousemoveWindow(t,e))&&r.pitchDelta&&i.setPitch(i.getPitch()+r.pitchDelta)},jo.prototype.off=function(){var t=this.element;r.removeEventListener(t,"mousedown",this.mousedown),r.removeEventListener(t,"touchstart",this.touchstart,{passive:!1}),r.removeEventListener(t,"touchmove",this.touchmove),r.removeEventListener(t,"touchend",this.touchend),r.removeEventListener(t,"touchcancel",this.reset),this.offTemp()},jo.prototype.offTemp=function(){r.enableDrag(),r.removeEventListener(t.window,"mousemove",this.mousemove),r.removeEventListener(t.window,"mouseup",this.mouseup)},jo.prototype.mousedown=function(e){this.down(t.extend({},e,{ctrlKey:!0,preventDefault:function(){return e.preventDefault()}}),r.mousePos(this.element,e)),r.addEventListener(t.window,"mousemove",this.mousemove),r.addEventListener(t.window,"mouseup",this.mouseup)},jo.prototype.mousemove=function(t){this.move(t,r.mousePos(this.element,t))},jo.prototype.mouseup=function(t){this.mouseRotate.mouseupWindow(t),this.mousePitch&&this.mousePitch.mouseupWindow(t),this.offTemp()},jo.prototype.touchstart=function(t){1!==t.targetTouches.length?this.reset():(this._startPos=this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:function(){return t.preventDefault()}},this._startPos))},jo.prototype.touchmove=function(t){1!==t.targetTouches.length?this.reset():(this._lastPos=r.touchPos(this.element,t.targetTouches)[0],this.move({preventDefault:function(){return t.preventDefault()}},this._lastPos))},jo.prototype.touchend=function(t){0===t.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()},jo.prototype.reset=function(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()};var No={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 Vo(t,e,r){var i,n=t.classList;for(i in No)n.remove("maplibregl-"+r+"-anchor-"+i,"mapboxgl-"+r+"-anchor-"+i);n.add("maplibregl-"+r+"-anchor-"+e,"mapboxgl-"+r+"-anchor-"+e)}var qo,Go,Ho,Zo=((Ho=t.Evented)&&(Qo.__proto__=Ho),((Qo.prototype=Object.create(Ho&&Ho.prototype)).constructor=Qo).prototype.addTo=function(t){return this.remove(),(this._map=t).getCanvasContainer().appendChild(this._element),t.on("move",this._update),t.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this},Qo.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),r.remove(this._element),this._popup&&this._popup.remove(),this},Qo.prototype.getLngLat=function(){return this._lngLat},Qo.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this},Qo.prototype.getElement=function(){return this._element},Qo.prototype.setPopup=function(t){var e;return this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),t&&("offset"in t.options||(e=Math.sqrt(Math.pow(13.5,2)/2),t.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-38.1],"bottom-left":[e,-1*(24.6+e)],"bottom-right":[-e,-1*(24.6+e)],left:[13.5,-24.6],right:[-13.5,-24.6]}:this._offset),this._popup=t,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)),this},Qo.prototype._onKeyPress=function(t){var e=t.code;t=t.charCode||t.keyCode;"Space"!==e&&"Enter"!==e&&32!==t&&13!==t||this.togglePopup()},Qo.prototype._onMapClick=function(t){var e=t.originalEvent.target;t=this._element;this._popup&&(e===t||t.contains(e))&&this.togglePopup()},Qo.prototype.getPopup=function(){return this._popup},Qo.prototype.togglePopup=function(){var t=this._popup;return t&&(t.isOpen()?t.remove():t.addTo(this._map)),this},Qo.prototype._update=function(t){var e,i;this._map&&(this._map.transform.renderWorldCopies&&(this._lngLat=Uo(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset),e="","viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?e="rotateZ("+this._rotation+"deg)":"map"===this._rotationAlignment&&(e="rotateZ("+(this._rotation-this._map.getBearing())+"deg)"),i="","viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?i="rotateX(0deg)":"map"===this._pitchAlignment&&(i="rotateX("+this._map.getPitch()+"deg)"),t&&"moveend"!==t.type||(this._pos=this._pos.round()),r.setTransform(this._element,No[this._anchor]+" translate("+this._pos.x+"px, "+this._pos.y+"px) "+i+" "+e))},Qo.prototype.getOffset=function(){return this._offset},Qo.prototype.setOffset=function(e){return this._offset=t.Point.convert(e),this._update(),this},Qo.prototype._onMove=function(e){var r;this._isDragging||(r=this._clickTolerance||this._map._clickTolerance,this._isDragging=e.point.dist(this._pointerdownPos)>=r),this._isDragging&&(this._pos=e.point.sub(this._positionDelta),this._lngLat=this._map.unproject(this._pos),this.setLngLat(this._lngLat),this._element.style.pointerEvents="none","pending"===this._state&&(this._state="active",this.fire(new t.Event("dragstart"))),this.fire(new t.Event("drag")))},Qo.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),"active"===this._state&&this.fire(new t.Event("dragend")),this._state="inactive"},Qo.prototype._addDragHandler=function(t){this._element.contains(t.originalEvent.target)&&(t.preventDefault(),this._positionDelta=t.point.sub(this._pos).add(this._offset),this._pointerdownPos=t.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))},Qo.prototype.setDraggable=function(t){return this._draggable=!!t,this._map&&(t?(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},Qo.prototype.isDraggable=function(){return this._draggable},Qo.prototype.setRotation=function(t){return this._rotation=t||0,this._update(),this},Qo.prototype.getRotation=function(){return this._rotation},Qo.prototype.setRotationAlignment=function(t){return this._rotationAlignment=t||"auto",this._update(),this},Qo.prototype.getRotationAlignment=function(){return this._rotationAlignment},Qo.prototype.setPitchAlignment=function(t){return this._pitchAlignment=t&&"auto"!==t?t:this._rotationAlignment,this._update(),this},Qo.prototype.getPitchAlignment=function(){return this._pitchAlignment},Qo),Wo={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0},Xo=0,Ko=!1,Jo=(V=((Go=t.Evented)&&(Yo.__proto__=Go),((Yo.prototype=Object.create(Go&&Go.prototype)).constructor=Yo).prototype.onAdd=function(e){var i;return this._map=e,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),i=this._setupUI,void 0!==qo?i(qo):void 0!==t.window.navigator.permissions?t.window.navigator.permissions.query({name:"geolocation"}).then((function(t){i(qo="denied"!==t.state)})):i(qo=!!t.window.navigator.geolocation),this._container},Yo.prototype.onRemove=function(){void 0!==this._geolocationWatchID&&(t.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(),r.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,Xo=0,Ko=!1},Yo.prototype._isOutOfMapMaxBounds=function(t){var e=this._map.getMaxBounds();t=t.coords;return e&&(t.longitude<e.getWest()||t.longitude>e.getEast()||t.latitude<e.getSouth()||t.latitude>e.getNorth())},Yo.prototype._setErrorState=function(){switch(this._watchState){case"WAITING_ACTIVE":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error");break;case"ACTIVE_LOCK":this._watchState="ACTIVE_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting");break;case"BACKGROUND":this._watchState="BACKGROUND_ERROR",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting")}},Yo.prototype._onSuccess=function(e){if(this._map){if(this._isOutOfMapMaxBounds(e))return this._setErrorState(),this.fire(new t.Event("outofmaxbounds",e)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=e,this._watchState){case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"BACKGROUND":case"BACKGROUND_ERROR":this._watchState="BACKGROUND",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background")}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(e),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(e),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new t.Event("geolocate",e)),this._finish()}},Yo.prototype._updateCamera=function(e){var r=new t.LngLat(e.coords.longitude,e.coords.latitude),i=e.coords.accuracy;e=this._map.getBearing(),e=t.extend({bearing:e},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(i),e,{geolocateSource:!0})},Yo.prototype._updateMarker=function(e){var r;e?(r=new t.LngLat(e.coords.longitude,e.coords.latitude),this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=e.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()):(this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove())},Yo.prototype._updateCircleRadius=function(){var t=this._map._container.clientHeight/2,e=this._map.unproject([0,t]);t=this._map.unproject([1,t]),t=e.distanceTo(t),t=Math.ceil(2*this._accuracy/t);this._circleElement.style.width=t+"px",this._circleElement.style.height=t+"px"},Yo.prototype._onZoom=function(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()},Yo.prototype._onError=function(e){if(this._map){if(this.options.trackUserLocation)if(1===e.code){this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this._geolocateButton.disabled=!0;var r=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=r,this._geolocateButton.setAttribute("aria-label",r),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===e.code&&Ko)return;this._setErrorState()}"OFF"!==this._watchState&&this.options.showUserLocation&&this._dotElement.classList.add("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new t.Event("error",e)),this._finish()}},Yo.prototype._finish=function(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0},Yo.prototype._setupUI=function(e){var i,n=this;this._container.addEventListener("contextmenu",(function(t){return t.preventDefault()})),this._geolocateButton=r.create("button","maplibregl-ctrl-geolocate mapboxgl-ctrl-geolocate",this._container),r.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden",!0),!(this._geolocateButton.type="button")===e?(t.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled."),i=this._map._getUIString("GeolocateControl.LocationNotAvailable"),this._geolocateButton.disabled=!0,this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)):(i=this._map._getUIString("GeolocateControl.FindMyLocation"),this._geolocateButton.title=i,this._geolocateButton.setAttribute("aria-label",i)),this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=r.create("div","maplibregl-user-location-dot mapboxgl-user-location-dot"),this._userLocationDotMarker=new Zo(this._dotElement),this._circleElement=r.create("div","maplibregl-user-location-accuracy-circle mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new Zo({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(e){e.geolocateSource||"ACTIVE_LOCK"!==n._watchState||e.originalEvent&&"resize"===e.originalEvent.type||(n._watchState="BACKGROUND",n._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),n._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),n.fire(new t.Event("trackuserlocationend")))}))},Yo.prototype.trigger=function(){if(!this._setup)return t.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 t.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":Xo--,Ko=!1,this._watchState="OFF",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error"),this.fire(new t.Event("trackuserlocationend"));break;case"BACKGROUND":this._watchState="ACTIVE_LOCK",this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._lastKnownPosition&&this._updateCamera(this._lastKnownPosition),this.fire(new t.Event("trackuserlocationstart"))}switch(this._watchState){case"WAITING_ACTIVE":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_LOCK":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active");break;case"ACTIVE_ERROR":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-active-error","mapboxgl-ctrl-geolocate-active-error");break;case"BACKGROUND":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background");break;case"BACKGROUND_ERROR":this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background-error","mapboxgl-ctrl-geolocate-background-error")}var e;"OFF"===this._watchState&&void 0!==this._geolocationWatchID?this._clearWatch():void 0===this._geolocationWatchID&&(this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),Ko=1<++Xo?(e={maximumAge:6e5,timeout:0},!0):(e=this.options.positionOptions,!1),this._geolocationWatchID=t.window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e))}else t.window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0},Yo.prototype._clearWatch=function(){t.window.navigator.geolocation.clearWatch(this._geolocationWatchID),this._geolocationWatchID=void 0,this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","false"),this.options.showUserLocation&&this._updateMarker(null)},Yo),{maxWidth:100,unit:"metric"});function Yo(e){Go.call(this),this.options=t.extend({},Wo,e),t.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}function Qo(e,i){if(Ho.call(this),(e instanceof t.window.HTMLElement||i)&&(e=t.extend({element:e},i)),t.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=e&&e.anchor||"center",this._color=e&&e.color||"#3FB1CE",this._scale=e&&e.scale||1,this._draggable=e&&e.draggable||!1,this._clickTolerance=e&&e.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=e&&e.rotation||0,this._rotationAlignment=e&&e.rotationAlignment||"auto",this._pitchAlignment=e&&e.pitchAlignment&&"auto"!==e.pitchAlignment?e.pitchAlignment:this._rotationAlignment,e&&e.element)this._element=e.element,this._offset=t.Point.convert(e&&e.offset||[0,0]);else{this._defaultMarker=!0,this._element=r.create("div"),this._element.setAttribute("aria-label","Map marker");var n=r.createNS("http://www.w3.org/2000/svg","svg");n.setAttributeNS(null,"display","block"),n.setAttributeNS(null,"height","41px"),n.setAttributeNS(null,"width","27px"),n.setAttributeNS(null,"viewBox","0 0 27 41");var o=r.createNS("http://www.w3.org/2000/svg","g");o.setAttributeNS(null,"stroke","none"),o.setAttributeNS(null,"stroke-width","1"),o.setAttributeNS(null,"fill","none"),o.setAttributeNS(null,"fill-rule","evenodd");var a=r.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"fill-rule","nonzero");var s=r.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"transform","translate(3.0, 29.0)"),s.setAttributeNS(null,"fill","#000000");for(var u=0,l=[{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"}];u<l.length;u+=1){var c=l[u],p=r.createNS("http://www.w3.org/2000/svg","ellipse");p.setAttributeNS(null,"opacity","0.04"),p.setAttributeNS(null,"cx","10.5"),p.setAttributeNS(null,"cy","5.80029008"),p.setAttributeNS(null,"rx",c.rx),p.setAttributeNS(null,"ry",c.ry),s.appendChild(p)}var h=r.createNS("http://www.w3.org/2000/svg","g");h.setAttributeNS(null,"fill",this._color);var f=r.createNS("http://www.w3.org/2000/svg","path");f.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"),h.appendChild(f);var d=r.createNS("http://www.w3.org/2000/svg","g");d.setAttributeNS(null,"opacity","0.25"),d.setAttributeNS(null,"fill","#000000");var m=r.createNS("http://www.w3.org/2000/svg","path");m.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"),d.appendChild(m),(i=r.createNS("http://www.w3.org/2000/svg","g")).setAttributeNS(null,"transform","translate(6.0, 7.0)"),i.setAttributeNS(null,"fill","#FFFFFF"),(o=r.createNS("http://www.w3.org/2000/svg","g")).setAttributeNS(null,"transform","translate(8.0, 8.0)"),(f=r.createNS("http://www.w3.org/2000/svg","circle")).setAttributeNS(null,"fill","#000000"),f.setAttributeNS(null,"opacity","0.25"),f.setAttributeNS(null,"cx","5.5"),f.setAttributeNS(null,"cy","5.5"),f.setAttributeNS(null,"r","5.4999962"),(m=r.createNS("http://www.w3.org/2000/svg","circle")).setAttributeNS(null,"fill","#FFFFFF"),m.setAttributeNS(null,"cx","5.5"),m.setAttributeNS(null,"cy","5.5"),m.setAttributeNS(null,"r","5.4999962"),o.appendChild(f),o.appendChild(m),a.appendChild(s),a.appendChild(h),a.appendChild(d),a.appendChild(i),a.appendChild(o),n.appendChild(a),n.setAttributeNS(null,"height",41*this._scale+"px"),n.setAttributeNS(null,"width",27*this._scale+"px"),this._element.appendChild(n),this._offset=t.Point.convert(e&&e.offset||[0,-14])}this._element.classList.add("maplibregl-marker","mapboxgl-marker"),this._element.addEventListener("dragstart",(function(t){t.preventDefault()})),this._element.addEventListener("mousedown",(function(t){t.preventDefault()})),Vo(this._element,this._anchor,"marker"),this._popup=null}function $o(t,e,r){var i=r&&r.maxWidth||100,n=t._container.clientHeight/2,o=t.unproject([0,n]);n=t.unproject([i,n]),o=o.distanceTo(n);r&&"imperial"===r.unit?5280<(n=3.2808*o)?ta(e,i,n/5280,t._getUIString("ScaleControl.Miles")):ta(e,i,n,t._getUIString("ScaleControl.Feet")):r&&"nautical"===r.unit?ta(e,i,o/1852,t._getUIString("ScaleControl.NauticalMiles")):1e3<=o?ta(e,i,o/1e3,t._getUIString("ScaleControl.Kilometers")):ta(e,i,o,t._getUIString("ScaleControl.Meters"))}function ta(t,e,r,i){var n,o,a=(n=r,(o=Math.pow(10,(""+Math.floor(n)).length-1))*(a=10<=(a=n/o)?10:5<=a?5:3<=a?3:2<=a?2:1<=a?1:(n=a,o=Math.pow(10,Math.ceil(-Math.log(n)/Math.LN10)),Math.round(n*o)/o)));t.style.width=e*(a/r)+"px",t.innerHTML=a+"&nbsp;"+i}(q=function(e){this.options=t.extend({},Jo,e),t.bindAll(["_onMove","setUnit"],this)}).prototype.getDefaultPosition=function(){return"bottom-left"},q.prototype._onMove=function(){$o(this._map,this._container,this.options)},q.prototype.onAdd=function(t){return this._map=t,this._container=r.create("div","maplibregl-ctrl maplibregl-ctrl-scale mapboxgl-ctrl mapboxgl-ctrl-scale",t.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container},q.prototype.onRemove=function(){r.remove(this._container),this._map.off("move",this._onMove),this._map=void 0},q.prototype.setUnit=function(t){this.options.unit=t,$o(this._map,this._container,this.options)},(Li=function(e){this._fullscreen=!1,e&&e.container&&(e.container instanceof t.window.HTMLElement?this._container=e.container:t.warnOnce("Full screen control 'container' must be a DOM element.")),t.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in t.window.document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in t.window.document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in t.window.document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in t.window.document&&(this._fullscreenchange="MSFullscreenChange")}).prototype.onAdd=function(e){return this._map=e,this._container||(this._container=this._map.getContainer()),this._controlContainer=r.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",t.warnOnce("This device does not support fullscreen mode.")),this._controlContainer},Li.prototype.onRemove=function(){r.remove(this._controlContainer),this._map=null,t.window.document.removeEventListener(this._fullscreenchange,this._changeIcon)},Li.prototype._checkFullscreenSupport=function(){return!!(t.window.document.fullscreenEnabled||t.window.document.mozFullScreenEnabled||t.window.document.msFullscreenEnabled||t.window.document.webkitFullscreenEnabled)},Li.prototype._setupUI=function(){var e=this._fullscreenButton=r.create("button","maplibregl-ctrl-fullscreen mapboxgl-ctrl-fullscreen",this._controlContainer);r.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",e).setAttribute("aria-hidden",!0),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),t.window.document.addEventListener(this._fullscreenchange,this._changeIcon)},Li.prototype._updateTitle=function(){var t=this._getTitle();this._fullscreenButton.setAttribute("aria-label",t),this._fullscreenButton.title=t},Li.prototype._getTitle=function(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")},Li.prototype._isFullscreen=function(){return this._fullscreen},Li.prototype._changeIcon=function(){(t.window.document.fullscreenElement||t.window.document.mozFullScreenElement||t.window.document.webkitFullscreenElement||t.window.document.msFullscreenElement)===this._container!==this._fullscreen&&(this._fullscreen=!this._fullscreen,this._fullscreenButton.classList.toggle("maplibregl-ctrl-shrink"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"),this._fullscreenButton.classList.toggle("maplibregl-ctrl-fullscreen"),this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"),this._updateTitle())},Li.prototype._onClickFullscreen=function(){this._isFullscreen()?t.window.document.exitFullscreen?t.window.document.exitFullscreen():t.window.document.mozCancelFullScreen?t.window.document.mozCancelFullScreen():t.window.document.msExitFullscreen?t.window.document.msExitFullscreen():t.window.document.webkitCancelFullScreen&&t.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 ea,ra={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},ia=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", "),na=(ye=((ea=t.Evented)&&(oa.__proto__=ea),((oa.prototype=Object.create(ea&&ea.prototype)).constructor=oa).prototype.addTo=function(e){return this._map&&this.remove(),this._map=e,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("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")):this._map.on("move",this._update),this.fire(new t.Event("open")),this},oa.prototype.isOpen=function(){return!!this._map},oa.prototype.remove=function(){return this._content&&r.remove(this._content),this._container&&(r.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 t.Event("close")),this},oa.prototype.getLngLat=function(){return this._lngLat},oa.prototype.setLngLat=function(e){return this._lngLat=t.LngLat.convert(e),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("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.remove("maplibregl-track-pointer","mapboxgl-track-pointer")),this},oa.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("maplibregl-popup-track-pointer","mapboxgl-popup-track-pointer"),this._map._canvasContainer.classList.add("maplibregl-track-pointer","mapboxgl-track-pointer")),this},oa.prototype.getElement=function(){return this._container},oa.prototype.setText=function(e){return this.setDOMContent(t.window.document.createTextNode(e))},oa.prototype.setHTML=function(e){var r,i=t.window.document.createDocumentFragment(),n=t.window.document.createElement("body");for(n.innerHTML=e;r=n.firstChild;)i.appendChild(r);return this.setDOMContent(i)},oa.prototype.getMaxWidth=function(){return this._container&&this._container.style.maxWidth},oa.prototype.setMaxWidth=function(t){return this.options.maxWidth=t,this._update(),this},oa.prototype.setDOMContent=function(t){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=r.create("div","maplibregl-popup-content mapboxgl-popup-content",this._container);return this._content.appendChild(t),this._createCloseButton(),this._update(),this._focusFirstElement(),this},oa.prototype.addClassName=function(t){this._container&&this._container.classList.add(t)},oa.prototype.removeClassName=function(t){this._container&&this._container.classList.remove(t)},oa.prototype.setOffset=function(t){return this.options.offset=t,this._update(),this},oa.prototype.toggleClassName=function(t){if(this._container)return this._container.classList.toggle(t)},oa.prototype._createCloseButton=function(){this.options.closeButton&&(this._closeButton=r.create("button","maplibregl-popup-close-button mapboxgl-popup-close-button",this._content),this._closeButton.type="button",this._closeButton.setAttribute("aria-label","Close popup"),this._closeButton.innerHTML="&#215;",this._closeButton.addEventListener("click",this._onClose))},oa.prototype._onMouseUp=function(t){this._update(t.point)},oa.prototype._onMouseMove=function(t){this._update(t.point)},oa.prototype._onDrag=function(t){this._update(t.point)},oa.prototype._update=function(e){var i,n,o,a,s=this;this._map&&(this._lngLat||this._trackPointer)&&this._content&&(this._container||(this._container=r.create("div","maplibregl-popup mapboxgl-popup",this._map.getContainer()),this._tip=r.create("div","maplibregl-popup-tip mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((function(t){return s._container.classList.add(t)})),this._trackPointer&&this._container.classList.add("maplibregl-popup-track-pointer","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=Uo(this._lngLat,this._pos,this._map.transform)),!this._trackPointer||e)&&(i=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat),n=this.options.anchor,a=function e(r){if(r){if("number"==typeof r){var i=Math.round(Math.sqrt(.5*Math.pow(r,2)));return{center:new t.Point(0,0),top:new t.Point(0,r),"top-left":new t.Point(i,i),"top-right":new t.Point(-i,i),bottom:new t.Point(0,-r),"bottom-left":new t.Point(i,-i),"bottom-right":new t.Point(-i,-i),left:new t.Point(r,0),right:new t.Point(-r,0)}}return r instanceof t.Point||Array.isArray(r)?{center:i=t.Point.convert(r),top:i,"top-left":i,"top-right":i,bottom:i,"bottom-left":i,"bottom-right":i,left:i,right:i}:{center:t.Point.convert(r.center||[0,0]),top:t.Point.convert(r.top||[0,0]),"top-left":t.Point.convert(r["top-left"]||[0,0]),"top-right":t.Point.convert(r["top-right"]||[0,0]),bottom:t.Point.convert(r.bottom||[0,0]),"bottom-left":t.Point.convert(r["bottom-left"]||[0,0]),"bottom-right":t.Point.convert(r["bottom-right"]||[0,0]),left:t.Point.convert(r.left||[0,0]),right:t.Point.convert(r.right||[0,0])}}return e(new t.Point(0,0))}(this.options.offset),n||(o=this._container.offsetWidth,e=this._container.offsetHeight,e=i.y+a.bottom.y<e?["top"]:i.y>this._map.transform.height-e?["bottom"]:[],i.x<o/2?e.push("left"):i.x>this._map.transform.width-o/2&&e.push("right"),n=0===e.length?"bottom":e.join("-")),a=i.add(a[n]).round(),r.setTransform(this._container,No[n]+" translate("+a.x+"px,"+a.y+"px)"),Vo(this._container,n,"popup"))},oa.prototype._focusFirstElement=function(){var t;this.options.focusAfterOpen&&this._container&&(t=this._container.querySelector(ia))&&t.focus()},oa.prototype._onClose=function(){this.remove()},oa),{version:t.version,supported:e,setRTLTextPlugin:t.setRTLTextPlugin,getRTLTextPluginStatus:t.getRTLTextPluginStatus,Map:fr,NavigationControl:j,GeolocateControl:V,AttributionControl:Ao,ScaleControl:q,FullscreenControl:Li,Popup:ye,Marker:Zo,Style:mi,LngLat:t.LngLat,LngLatBounds:t.LngLatBounds,Point:t.Point,MercatorCoordinate:t.MercatorCoordinate,Evented:t.Evented,config:t.config,prewarm:function(){dr().acquire(cr)},clearPrewarmedResources:function(){var t=hr;t&&(t.isPreloaded()&&1===t.numActive()?(t.release(cr),hr=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 t.config.ACCESS_TOKEN},set accessToken(e){t.config.ACCESS_TOKEN=e},get baseApiUrl(){return t.config.API_URL},set baseApiUrl(e){t.config.API_URL=e},get workerCount(){return pr.workerCount},set workerCount(t){pr.workerCount=t},get maxParallelImageRequests(){return t.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(e){t.config.MAX_PARALLEL_IMAGE_REQUESTS=e},clearStorage:function(e){t.clearTileCache(e)},workerUrl:"",addProtocol:function(e,r){t.config.REGISTERED_PROTOCOLS[e]=r},removeProtocol:function(e){delete t.config.REGISTERED_PROTOCOLS[e]}});function oa(e){ea.call(this),this.options=t.extend(Object.create(ra),e),t.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}return na})),r}()},function(t,e){var r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){var i=r(66);"string"==typeof i&&(i=[[t.i,i,""]]);r(9)(i,{transform:void 0}),i.locals&&(t.exports=i.locals)},function(t,e,r){var i=r(16);(t.exports=r(8)(!1)).push([t.i,".maplibregl-ctrl-floors.hide,\n.mapxus-floor-selector-layout.hide{\n display: none;\n}\n.mapxus-floor-selector-layout {\n -moz-box-shadow: 0 1px 1px 0 rgba(0,0,0,0.5);\n -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,0.5);\n box-shadow: 0 1px 1px 0 rgba(0,0,0,0.5);\n width: 30px;\n visibility: visible;\n}\n.mapxus-floor-selector-outer {\n position: relative;\n width: 30px;\n z-index: 100;\n overflow: hidden;\n}\n.mapxus-floor-selector-inner {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: -20px;\n overflow-y: auto;\n overflow-x: hidden\n}\n.mapxus-floor-selector-inner > .floor {\n outline: none;\n font-family: Helvetica, Arial, sans-serif;\n cursor: pointer;\n width: 30px;\n border: 0;\n background: #fff;\n font-weight: bold;\n font-size: 12px;\n padding: inherit;\n height: 34px;\n overflow-x: auto;\n overflow-y: hidden\n}\n.mapxus-floor-selector-inner > .floor:not(:disabled):hover {\n background-color: rgba(0,0,0,.05) !important;\n}\n.mapxus-floor-selector-inner > .floor::-webkit-scrollbar {\n height: 4px;\n}\n.mapxus-floor-selector-inner > .floor::-webkit-scrollbar-track {\n background-color: white;\n -webkit-border-radius: 2em;\n -moz-border-radius: 2em;\n border-radius:2em;\n}\n.mapxus-floor-selector-inner > .floor::-webkit-scrollbar-thumb {\n background-color: rgb(83, 177, 207);\n -webkit-border-radius: 2em;\n -moz-border-radius: 2em;\n border-radius:2em;\n}\n.mapxus-floor-selector-up {\n margin-top: -4px;\n z-index: 102;\n position: absolute;\n width: 30px;\n height: 26px;\n cursor: pointer;\n background-size: 38px;\n background-position-x: center;\n background-repeat: no-repeat;\n background-image:url("+i(r(67))+");\n}\n.mapxus-floor-selector-up.hide {\n visibility: hidden;\n}\n.mapxus-floor-selector-down {\n z-index: 101;\n position: absolute;\n width: 30px;\n height: 26px;\n cursor: pointer;\n background-size: 38px;\n background-position-x: center;\n background-repeat: no-repeat;\n background-image:url("+i(r(68))+");\n}\n.mapxus-floor-selector-down.hide {\n visibility: hidden;\n}\n",""])},function(t,e){t.exports="\"data:image/svg+xml,%3C?xml version='1.0' encoding='utf-8'?%3E %3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' height='41.409260218957115' width='51.409260218957115'%3E %3Cdefs%3E %3Crect id='rect-0' opacity='1' x='4.704630109478558' y='4.704630109478558' width='42' height='32'/%3E %3ClinearGradient id='linearGradient-1' x1='0.5' y1='0' x2='0.5' y2='1'%3E %3Cstop offset='0' stop-color='rgb(255,255,255)' stop-opacity='0'/%3E %3Cstop offset='0.41' stop-color='rgb(255,255,255)' stop-opacity='0.8'/%3E %3Cstop offset='1' stop-color='rgb(200,200,200)' stop-opacity='1'/%3E %3C/linearGradient%3E %3Cpath id='path-2' opacity='1' fill-rule='evenodd' d='M18.02605868090714,23.704630109478558 L25.70463010947857,30.704630109478558 L33.38320153805,23.704630109478558 '/%3E %3C/defs%3E %3Cg transform='translate(25.704630109478558, 20.704630109478558) rotate(180.00006436155007) translate(-25.704630109478558, -20.704630109478558)' opacity='1'%3E %3Cg opacity='1'%3E %3Cuse xlink:href='%23rect-0' fill='url(%23linearGradient-1)'/%3E %3C/g%3E %3Cg opacity='1'%3E %3Cuse xlink:href='%23path-2' fill-opacity='0' stroke='rgb(187,187,189)' stroke-opacity='1' stroke-width='2'/%3E %3C/g%3E %3C/g%3E %3C/svg%3E\""},function(t,e){t.exports="\"data:image/svg+xml,%3C?xml version='1.0' encoding='utf-8'?%3E %3Csvg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' height='41.409260218957115' width='51.409260218957115'%3E %3Cdefs%3E %3Crect id='rect-0' opacity='1' x='4.704630109478558' y='4.704630109478558' width='42' height='32'/%3E %3ClinearGradient id='linearGradient-1' x1='0.5' y1='0' x2='0.5' y2='1'%3E %3Cstop offset='0' stop-color='rgb(255,255,255)' stop-opacity='0'/%3E %3Cstop offset='0.41' stop-color='rgb(255,255,255)' stop-opacity='0.8'/%3E %3Cstop offset='1' stop-color='rgb(200,200,200)' stop-opacity='1'/%3E %3C/linearGradient%3E %3Cpath id='path-2' opacity='1' fill-rule='evenodd' d='M18.02605868090714,23.704630109478558 L25.70463010947857,30.704630109478558 L33.38320153805,23.704630109478558 '/%3E %3C/defs%3E %3Cg opacity='1'%3E %3Cg opacity='1'%3E %3Cuse xlink:href='%23rect-0' fill='url(%23linearGradient-1)'/%3E %3C/g%3E %3Cg opacity='1'%3E %3Cuse xlink:href='%23path-2' fill-opacity='0' stroke='rgb(187,187,189)' stroke-opacity='1' stroke-width='2'/%3E %3C/g%3E %3C/g%3E %3C/svg%3E\""},function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var r=e.protocol+"//"+e.host,i=r+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){return e=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e})),/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/)/i.test(e)?t:(e=0===e.indexOf("//")?e:0===e.indexOf("/")?r+e:i+e.replace(/^\.\//,""),"url("+JSON.stringify(e)+")")}))}},function(t,e,r){var i=r(71);"string"==typeof i&&(i=[[t.i,i,""]]);r(9)(i,{transform:void 0}),i.locals&&(t.exports=i.locals)},function(t,e,r){var i=r(16);(t.exports=r(8)(!1)).push([t.i,".maplibregl-ctrl-building-filter.hide {\n display: none;\n}\n.mapxus-building-filter-icon {\n width: 30px;\n height: 30px;\n background-image: url("+i(r(72))+");\n background-size: 30px;\n background-color: white;\n border-radius: 4px;\n -moz-box-shadow: 0 0 2px rgba(0,0,0,0.1);\n -webkit-box-shadow: 0 0 2px rgba(0,0,0,0.1);\n box-shadow: 0 0 0 2px rgba(0,0,0,0.1);\n cursor: pointer;\n}\n.mapxus-building-name-layout {\n width: 125px;\n right: 45px;\n margin-top: -30px;\n position: absolute;\n overflow: hidden;\n}\n.mapxus-building-name-list {\n width: 140px;\n position: absolute;\n overflow-y: auto;\n}\n.mapxus-building-name {\n width: 115px;\n color: white;\n background: red;\n border-radius: 3px;\n padding: 2px 4px;\n margin: 2px;\n cursor: pointer;\n word-wrap: break-word;\n}\n.mapxus-building-name.active {\n background: cornflowerblue;\n}\n.mapxus-building-name:hover {\n background: rgba(0,0,0,0.5);\n}\n",""])},function(t,e){t.exports="\"data:image/svg+xml,%3C?xml version='1.0' encoding='utf-8'?%3E %3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E %3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0' y='0' width='15' height='15' viewBox='0, 0, 15, 15'%3E %3Cg%3E %3Cpath d='M13.639 4H12V1.361A.361.361 0 0 0 11.639 1h-.278a.361.361 0 0 0-.361.361V4H9.361A.361.361 0 0 0 9 4.361V10H5.363a.363.363 0 0 0-.363.363v3.275a.363.363 0 0 0 .363.362h8.276a.361.361 0 0 0 .361-.361V4.361A.361.361 0 0 0 13.639 4zM7 12H6v-1h1zm2 0H8v-1h1zm2 0h-1v-1h1zm0-2h-1V9h1zm0-2h-1V7h1zm0-2h-1V5h1zm2 6h-1v-1h1zm0-2h-1V9h1zm0-2h-1V7h1zm0-2h-1V5h1zM8 1.361A.361.361 0 0 0 7.639 1H5.361A.361.361 0 0 0 5 1.361V3H3.361A.361.361 0 0 0 3 3.361V4H1.361A.361.361 0 0 0 1 4.361v9.278a.361.361 0 0 0 .361.361H4V9h4zM3 12H2v-1h1zm0-2H2V9h1zm0-2H2V7h1zm0-2H2V5h1zm2 2H4V7h1zm0-2H4V5h1zm2 2H6V7h1zm0-2H6V5h1zm0-2H6V3h1z'%3E%3C/path%3E %3C/g%3E %3C/svg%3E\""},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.outdoorConfig=void 0;var i=r(29);e.outdoorConfig=function(){return{url:i.mapxusTheme_v2}}},function(t,e,r){!function(e,r){"use strict";"function"==typeof window.define&&window.define.amd?window.define(r):t.exports?t.exports=r():e.exports?e.exports=r():e.Fingerprint2=r()}(this,(function(){"use strict";var t=function(e){if(!(this instanceof t))return new t(e);this.options=this.extend(e,{swfContainerId:"fingerprintjs2",swfPath:"flash/compiled/FontList.swf",detectScreenOrientation:!0,sortPluginsFor:[/palemoon/i],userDefinedFonts:[],excludeDoNotTrack:!0,excludePixelRatio:!0}),this.nativeForEach=Array.prototype.forEach,this.nativeMap=Array.prototype.map};return t.prototype={extend:function(t,e){if(null==t)return e;for(var r in t)null!=t[r]&&e[r]!==t[r]&&(e[r]=t[r]);return e},get:function(t){var e=this,r={data:[],addPreprocessedComponent:function(t){var i=t.value;"function"==typeof e.options.preprocessor&&(i=e.options.preprocessor(t.key,i)),r.data.push({key:t.key,value:i})}};r=this.userAgentKey(r);r=this.languageKey(r),r=this.colorDepthKey(r),r=this.deviceMemoryKey(r),r=this.pixelRatioKey(r),r=this.hardwareConcurrencyKey(r),r=this.screenResolutionKey(r),r=this.availableScreenResolutionKey(r),r=this.timezoneOffsetKey(r),r=this.sessionStorageKey(r),r=this.localStorageKey(r),r=this.indexedDbKey(r),r=this.addBehaviorKey(r),r=this.openDatabaseKey(r),r=this.cpuClassKey(r),r=this.platformKey(r),r=this.doNotTrackKey(r),r=this.pluginsKey(r),r=this.canvasKey(r),r=this.webglKey(r),r=this.webglVendorAndRendererKey(r),r=this.adBlockKey(r),r=this.hasLiedLanguagesKey(r),r=this.hasLiedResolutionKey(r),r=this.hasLiedOsKey(r),r=this.hasLiedBrowserKey(r),r=this.touchSupportKey(r),r=this.customEntropyFunction(r),this.fontsKey(r,(function(r){var i=[];e.each(r.data,(function(t){(t=t.value)&&"function"==typeof t.join&&(t=t.join(";")),i.push(t)}));var n=e.x64hash128(i.join("~~~"),31);return t(n,r.data)}))},customEntropyFunction:function(t){return"function"==typeof this.options.customFunction&&t.addPreprocessedComponent({key:"custom",value:this.options.customFunction()}),t},userAgentKey:function(t){return this.options.excludeUserAgent||t.addPreprocessedComponent({key:"user_agent",value:this.getUserAgent()}),t},getUserAgent:function(){return navigator.userAgent},languageKey:function(t){return this.options.excludeLanguage||t.addPreprocessedComponent({key:"language",value:navigator.language||navigator.userLanguage||navigator.browserLanguage||navigator.systemLanguage||""}),t},colorDepthKey:function(t){return this.options.excludeColorDepth||t.addPreprocessedComponent({key:"color_depth",value:window.screen.colorDepth||-1}),t},deviceMemoryKey:function(t){return this.options.excludeDeviceMemory||t.addPreprocessedComponent({key:"device_memory",value:this.getDeviceMemory()}),t},getDeviceMemory:function(){return navigator.deviceMemory||-1},pixelRatioKey:function(t){return this.options.excludePixelRatio||t.addPreprocessedComponent({key:"pixel_ratio",value:this.getPixelRatio()}),t},getPixelRatio:function(){return window.devicePixelRatio||""},screenResolutionKey:function(t){return this.options.excludeScreenResolution?t:this.getScreenResolution(t)},getScreenResolution:function(t){var e=this.options.detectScreenOrientation&&window.screen.height>window.screen.width?[window.screen.height,window.screen.width]:[window.screen.width,window.screen.height];return t.addPreprocessedComponent({key:"resolution",value:e}),t},availableScreenResolutionKey:function(t){return this.options.excludeAvailableScreenResolution?t:this.getAvailableScreenResolution(t)},getAvailableScreenResolution:function(t){var e;return window.screen.availWidth&&window.screen.availHeight&&(e=!this.options.detectScreenOrientation||window.screen.availHeight>window.screen.availWidth?[window.screen.availHeight,window.screen.availWidth]:[window.screen.availWidth,window.screen.availHeight]),void 0!==e&&t.addPreprocessedComponent({key:"available_resolution",value:e}),t},timezoneOffsetKey:function(t){return this.options.excludeTimezoneOffset||t.addPreprocessedComponent({key:"timezone_offset",value:(new Date).getTimezoneOffset()}),t},sessionStorageKey:function(t){return!this.options.excludeSessionStorage&&this.hasSessionStorage()&&t.addPreprocessedComponent({key:"session_storage",value:1}),t},localStorageKey:function(t){return!this.options.excludeSessionStorage&&this.hasLocalStorage()&&t.addPreprocessedComponent({key:"local_storage",value:1}),t},indexedDbKey:function(t){return!this.options.excludeIndexedDB&&this.hasIndexedDB()&&t.addPreprocessedComponent({key:"indexed_db",value:1}),t},addBehaviorKey:function(t){return!this.options.excludeAddBehavior&&document.body&&document.body.addBehavior&&t.addPreprocessedComponent({key:"add_behavior",value:1}),t},openDatabaseKey:function(t){return!this.options.excludeOpenDatabase&&window.openDatabase&&t.addPreprocessedComponent({key:"open_database",value:1}),t},cpuClassKey:function(t){return this.options.excludeCpuClass||t.addPreprocessedComponent({key:"cpu_class",value:this.getNavigatorCpuClass()}),t},platformKey:function(t){return this.options.excludePlatform||t.addPreprocessedComponent({key:"navigator_platform",value:this.getNavigatorPlatform()}),t},doNotTrackKey:function(t){return this.options.excludeDoNotTrack||t.addPreprocessedComponent({key:"do_not_track",value:this.getDoNotTrack()}),t},canvasKey:function(t){return!this.options.excludeCanvas&&this.isCanvasSupported()&&t.addPreprocessedComponent({key:"canvas",value:this.getCanvasFp()}),t},webglKey:function(t){return!this.options.excludeWebGL&&this.isWebGlSupported()&&t.addPreprocessedComponent({key:"webgl",value:this.getWebglFp()}),t},webglVendorAndRendererKey:function(t){return!this.options.excludeWebGLVendorAndRenderer&&this.isWebGlSupported()&&t.addPreprocessedComponent({key:"webgl_vendor",value:this.getWebglVendorAndRenderer()}),t},adBlockKey:function(t){return this.options.excludeAdBlock||t.addPreprocessedComponent({key:"adblock",value:this.getAdBlock()}),t},hasLiedLanguagesKey:function(t){return this.options.excludeHasLiedLanguages||t.addPreprocessedComponent({key:"has_lied_languages",value:this.getHasLiedLanguages()}),t},hasLiedResolutionKey:function(t){return this.options.excludeHasLiedResolution||t.addPreprocessedComponent({key:"has_lied_resolution",value:this.getHasLiedResolution()}),t},hasLiedOsKey:function(t){return this.options.excludeHasLiedOs||t.addPreprocessedComponent({key:"has_lied_os",value:this.getHasLiedOs()}),t},hasLiedBrowserKey:function(t){return this.options.excludeHasLiedBrowser||t.addPreprocessedComponent({key:"has_lied_browser",value:this.getHasLiedBrowser()}),t},fontsKey:function(t,e){return this.options.excludeJsFonts?this.flashFontsKey(t,e):this.jsFontsKey(t,e)},flashFontsKey:function(t,e){return!this.options.excludeFlashFonts&&this.hasSwfObjectLoaded()&&this.hasMinFlashInstalled()&&void 0!==this.options.swfPath?void this.loadSwfAndDetectFonts((function(r){t.addPreprocessedComponent({key:"swf_fonts",value:r.join(";")}),e(t)})):e(t)},jsFontsKey:function(t,e){var r=this;return setTimeout((function(){var i=["monospace","sans-serif","serif"],n=["Andale Mono","Arial","Arial Black","Arial Hebrew","Arial MT","Arial Narrow","Arial Rounded MT Bold","Arial Unicode MS","Bitstream Vera Sans Mono","Book Antiqua","Bookman Old Style","Calibri","Cambria","Cambria Math","Century","Century Gothic","Century Schoolbook","Comic Sans","Comic Sans MS","Consolas","Courier","Courier New","Geneva","Georgia","Helvetica","Helvetica Neue","Impact","Lucida Bright","Lucida Calligraphy","Lucida Console","Lucida Fax","LUCIDA GRANDE","Lucida Handwriting","Lucida Sans","Lucida Sans Typewriter","Lucida Sans Unicode","Microsoft Sans Serif","Monaco","Monotype Corsiva","MS Gothic","MS Outlook","MS PGothic","MS Reference Sans Serif","MS Sans Serif","MS Serif","MYRIAD","MYRIAD PRO","Palatino","Palatino Linotype","Segoe Print","Segoe Script","Segoe UI","Segoe UI Light","Segoe UI Semibold","Segoe UI Symbol","Tahoma","Times","Times New Roman","Times New Roman PS","Trebuchet MS","Verdana","Wingdings","Wingdings 2","Wingdings 3"];function o(){var t=document.createElement("span");return t.style.position="absolute",t.style.left="-9999px",t.style.fontSize="72px",t.style.fontStyle="normal",t.style.fontWeight="normal",t.style.letterSpacing="normal",t.style.lineBreak="auto",t.style.lineHeight="normal",t.style.textTransform="none",t.style.textAlign="left",t.style.textDecoration="none",t.style.textShadow="none",t.style.whiteSpace="normal",t.style.wordBreak="normal",t.style.wordSpacing="normal",t.innerHTML="mmmmmmmmmmlli",t}r.options.extendedJsFonts&&(n=n.concat(["Abadi MT Condensed Light","Academy Engraved LET","ADOBE CASLON PRO","Adobe Garamond","ADOBE GARAMOND PRO","Agency FB","Aharoni","Albertus Extra Bold","Albertus Medium","Algerian","Amazone BT","American Typewriter","American Typewriter Condensed","AmerType Md BT","Andalus","Angsana New","AngsanaUPC","Antique Olive","Aparajita","Apple Chancery","Apple Color Emoji","Apple SD Gothic Neo","Arabic Typesetting","ARCHER","ARNO PRO","Arrus BT","Aurora Cn BT","AvantGarde Bk BT","AvantGarde Md BT","AVENIR","Ayuthaya","Bandy","Bangla Sangam MN","Bank Gothic","BankGothic Md BT","Baskerville","Baskerville Old Face","Batang","BatangChe","Bauer Bodoni","Bauhaus 93","Bazooka","Bell MT","Bembo","Benguiat Bk BT","Berlin Sans FB","Berlin Sans FB Demi","Bernard MT Condensed","BernhardFashion BT","BernhardMod BT","Big Caslon","BinnerD","Blackadder ITC","BlairMdITC TT","Bodoni 72","Bodoni 72 Oldstyle","Bodoni 72 Smallcaps","Bodoni MT","Bodoni MT Black","Bodoni MT Condensed","Bodoni MT Poster Compressed","Bookshelf Symbol 7","Boulder","Bradley Hand","Bradley Hand ITC","Bremen Bd BT","Britannic Bold","Broadway","Browallia New","BrowalliaUPC","Brush Script MT","Californian FB","Calisto MT","Calligrapher","Candara","CaslonOpnface BT","Castellar","Centaur","Cezanne","CG Omega","CG Times","Chalkboard","Chalkboard SE","Chalkduster","Charlesworth","Charter Bd BT","Charter BT","Chaucer","ChelthmITC Bk BT","Chiller","Clarendon","Clarendon Condensed","CloisterBlack BT","Cochin","Colonna MT","Constantia","Cooper Black","Copperplate","Copperplate Gothic","Copperplate Gothic Bold","Copperplate Gothic Light","CopperplGoth Bd BT","Corbel","Cordia New","CordiaUPC","Cornerstone","Coronet","Cuckoo","Curlz MT","DaunPenh","Dauphin","David","DB LCD Temp","DELICIOUS","Denmark","DFKai-SB","Didot","DilleniaUPC","DIN","DokChampa","Dotum","DotumChe","Ebrima","Edwardian Script ITC","Elephant","English 111 Vivace BT","Engravers MT","EngraversGothic BT","Eras Bold ITC","Eras Demi ITC","Eras Light ITC","Eras Medium ITC","EucrosiaUPC","Euphemia","Euphemia UCAS","EUROSTILE","Exotc350 Bd BT","FangSong","Felix Titling","Fixedsys","FONTIN","Footlight MT Light","Forte","FrankRuehl","Fransiscan","Freefrm721 Blk BT","FreesiaUPC","Freestyle Script","French Script MT","FrnkGothITC Bk BT","Fruitger","FRUTIGER","Futura","Futura Bk BT","Futura Lt BT","Futura Md BT","Futura ZBlk BT","FuturaBlack BT","Gabriola","Galliard BT","Gautami","Geeza Pro","Geometr231 BT","Geometr231 Hv BT","Geometr231 Lt BT","GeoSlab 703 Lt BT","GeoSlab 703 XBd BT","Gigi","Gill Sans","Gill Sans MT","Gill Sans MT Condensed","Gill Sans MT Ext Condensed Bold","Gill Sans Ultra Bold","Gill Sans Ultra Bold Condensed","Gisha","Gloucester MT Extra Condensed","GOTHAM","GOTHAM BOLD","Goudy Old Style","Goudy Stout","GoudyHandtooled BT","GoudyOLSt BT","Gujarati Sangam MN","Gulim","GulimChe","Gungsuh","GungsuhChe","Gurmukhi MN","Haettenschweiler","Harlow Solid Italic","Harrington","Heather","Heiti SC","Heiti TC","HELV","Herald","High Tower Text","Hiragino Kaku Gothic ProN","Hiragino Mincho ProN","Hoefler Text","Humanst 521 Cn BT","Humanst521 BT","Humanst521 Lt BT","Imprint MT Shadow","Incised901 Bd BT","Incised901 BT","Incised901 Lt BT","INCONSOLATA","Informal Roman","Informal011 BT","INTERSTATE","IrisUPC","Iskoola Pota","JasmineUPC","Jazz LET","Jenson","Jester","Jokerman","Juice ITC","Kabel Bk BT","Kabel Ult BT","Kailasa","KaiTi","Kalinga","Kannada Sangam MN","Kartika","Kaufmann Bd BT","Kaufmann BT","Khmer UI","KodchiangUPC","Kokila","Korinna BT","Kristen ITC","Krungthep","Kunstler Script","Lao UI","Latha","Leelawadee","Letter Gothic","Levenim MT","LilyUPC","Lithograph","Lithograph Light","Long Island","Lydian BT","Magneto","Maiandra GD","Malayalam Sangam MN","Malgun Gothic","Mangal","Marigold","Marion","Marker Felt","Market","Marlett","Matisse ITC","Matura MT Script Capitals","Meiryo","Meiryo UI","Microsoft Himalaya","Microsoft JhengHei","Microsoft New Tai Lue","Microsoft PhagsPa","Microsoft Tai Le","Microsoft Uighur","Microsoft YaHei","Microsoft Yi Baiti","MingLiU","MingLiU_HKSCS","MingLiU_HKSCS-ExtB","MingLiU-ExtB","Minion","Minion Pro","Miriam","Miriam Fixed","Mistral","Modern","Modern No. 20","Mona Lisa Solid ITC TT","Mongolian Baiti","MONO","MoolBoran","Mrs Eaves","MS LineDraw","MS Mincho","MS PMincho","MS Reference Specialty","MS UI Gothic","MT Extra","MUSEO","MV Boli","Nadeem","Narkisim","NEVIS","News Gothic","News GothicMT","NewsGoth BT","Niagara Engraved","Niagara Solid","Noteworthy","NSimSun","Nyala","OCR A Extended","Old Century","Old English Text MT","Onyx","Onyx BT","OPTIMA","Oriya Sangam MN","OSAKA","OzHandicraft BT","Palace Script MT","Papyrus","Parchment","Party LET","Pegasus","Perpetua","Perpetua Titling MT","PetitaBold","Pickwick","Plantagenet Cherokee","Playbill","PMingLiU","PMingLiU-ExtB","Poor Richard","Poster","PosterBodoni BT","PRINCETOWN LET","Pristina","PTBarnum BT","Pythagoras","Raavi","Rage Italic","Ravie","Ribbon131 Bd BT","Rockwell","Rockwell Condensed","Rockwell Extra Bold","Rod","Roman","Sakkal Majalla","Santa Fe LET","Savoye LET","Sceptre","Script","Script MT Bold","SCRIPTINA","Serifa","Serifa BT","Serifa Th BT","ShelleyVolante BT","Sherwood","Shonar Bangla","Showcard Gothic","Shruti","Signboard","SILKSCREEN","SimHei","Simplified Arabic","Simplified Arabic Fixed","SimSun","SimSun-ExtB","Sinhala Sangam MN","Sketch Rockwell","Skia","Small Fonts","Snap ITC","Snell Roundhand","Socket","Souvenir Lt BT","Staccato222 BT","Steamer","Stencil","Storybook","Styllo","Subway","Swis721 BlkEx BT","Swiss911 XCm BT","Sylfaen","Synchro LET","System","Tamil Sangam MN","Technical","Teletype","Telugu Sangam MN","Tempus Sans ITC","Terminal","Thonburi","Traditional Arabic","Trajan","TRAJAN PRO","Tristan","Tubular","Tunga","Tw Cen MT","Tw Cen MT Condensed","Tw Cen MT Condensed Extra Bold","TypoUpright BT","Unicorn","Univers","Univers CE 55 Medium","Univers Condensed","Utsaah","Vagabond","Vani","Vijaya","Viner Hand ITC","VisualUI","Vivaldi","Vladimir Script","Vrinda","Westminster","WHITNEY","Wide Latin","ZapfEllipt BT","ZapfHumnst BT","ZapfHumnst Dm BT","Zapfino","Zurich BlkEx BT","Zurich Ex BT","ZWAdobeF"])),n=(n=n.concat(r.options.userDefinedFonts)).filter((function(t,e){return n.indexOf(t)===e}));var a=document.getElementsByTagName("body")[0],s=document.createElement("div"),u=document.createElement("div"),l={},c={},p=function(){for(var t=[],e=0,r=i.length;e<r;e++){var n=o();n.style.fontFamily=i[e],s.appendChild(n),t.push(n)}return t}();a.appendChild(s);for(var h=0,f=i.length;h<f;h++)l[i[h]]=p[h].offsetWidth,c[i[h]]=p[h].offsetHeight;var d=function(){for(var t,e,r={},a=0,s=n.length;a<s;a++){for(var l=[],c=0,p=i.length;c<p;c++){var h=(t=n[a],e=i[c],h=void 0,(h=o()).style.fontFamily="'"+t+"',"+e,h);u.appendChild(h),l.push(h)}r[n[a]]=l}return r}();a.appendChild(u);for(var m=[],y=0,g=n.length;y<g;y++)!function(t){for(var e=!1,r=0;r<i.length;r++)if(e=t[r].offsetWidth!==l[i[r]]||t[r].offsetHeight!==c[i[r]])return e;return e}(d[n[y]])||m.push(n[y]);a.removeChild(u),a.removeChild(s),t.addPreprocessedComponent({key:"js_fonts",value:m}),e(t)}),1)},pluginsKey:function(t){return this.options.excludePlugins||(this.isIE()?this.options.excludeIEPlugins||t.addPreprocessedComponent({key:"ie_plugins",value:this.getIEPlugins()}):t.addPreprocessedComponent({key:"regular_plugins",value:this.getRegularPlugins()})),t},getRegularPlugins:function(){var t=[];if(navigator.plugins)for(var e=0,r=navigator.plugins.length;e<r;e++)navigator.plugins[e]&&t.push(navigator.plugins[e]);return this.pluginsShouldBeSorted()&&(t=t.sort((function(t,e){return t.name>e.name?1:t.name<e.name?-1:0}))),this.map(t,(function(t){var e=this.map(t,(function(t){return[t.type,t.suffixes].join("~")})).join(",");return[t.name,t.description,e].join("::")}),this)},getIEPlugins:function(){var t=[];return(Object.getOwnPropertyDescriptor&&Object.getOwnPropertyDescriptor(window,"ActiveXObject")||"ActiveXObject"in window)&&(t=this.map(["AcroPDF.PDF","Adodb.Stream","AgControl.AgControl","DevalVRXCtrl.DevalVRXCtrl.1","MacromediaFlashPaper.MacromediaFlashPaper","Msxml2.DOMDocument","Msxml2.XMLHTTP","PDF.PdfCtrl","QuickTime.QuickTime","QuickTimeCheckObject.QuickTimeCheck.1","RealPlayer","RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)","RealVideo.RealVideo(tm) ActiveX Control (32-bit)","Scripting.Dictionary","SWCtl.SWCtl","Shell.UIHelper","ShockwaveFlash.ShockwaveFlash","Skype.Detection","TDCCtl.TDCCtl","WMPlayer.OCX","rmocx.RealPlayer G2 Control","rmocx.RealPlayer G2 Control.1"],(function(t){try{return new window.ActiveXObject(t),t}catch(t){return null}}))),navigator.plugins&&(t=t.concat(this.getRegularPlugins())),t},pluginsShouldBeSorted:function(){for(var t=!1,e=0,r=this.options.sortPluginsFor.length;e<r;e++){var i=this.options.sortPluginsFor[e];if(navigator.userAgent.match(i)){t=!0;break}}return t},touchSupportKey:function(t){return this.options.excludeTouchSupport||t.addPreprocessedComponent({key:"touch_support",value:this.getTouchSupport()}),t},hardwareConcurrencyKey:function(t){return this.options.excludeHardwareConcurrency||t.addPreprocessedComponent({key:"hardware_concurrency",value:this.getHardwareConcurrency()}),t},hasSessionStorage:function(){try{return!!window.sessionStorage}catch(t){return!0}},hasLocalStorage:function(){try{return!!window.localStorage}catch(t){return!0}},hasIndexedDB:function(){try{return!!window.indexedDB}catch(t){return!0}},getHardwareConcurrency:function(){return navigator.hardwareConcurrency||"unknown"},getNavigatorCpuClass:function(){return navigator.cpuClass||"unknown"},getNavigatorPlatform:function(){return navigator.platform||"unknown"},getDoNotTrack:function(){return navigator.doNotTrack||navigator.msDoNotTrack||window.doNotTrack||"unknown"},getTouchSupport:function(){var t=0,e=!1;void 0!==navigator.maxTouchPoints?t=navigator.maxTouchPoints:void 0!==navigator.msMaxTouchPoints&&(t=navigator.msMaxTouchPoints);try{document.createEvent("TouchEvent"),e=!0}catch(t){}return[t,e,"ontouchstart"in window]},getCanvasFp:function(){var t=[],e=document.createElement("canvas");e.width=2e3,e.height=200,e.style.display="inline";var r=e.getContext("2d");return r.rect(0,0,10,10),r.rect(2,2,6,6),t.push("canvas winding:"+(!1===r.isPointInPath(5,5,"evenodd")?"yes":"no")),r.textBaseline="alphabetic",r.fillStyle="#f60",r.fillRect(125,1,62,20),r.fillStyle="#069",this.options.dontUseFakeFontInCanvas?r.font="11pt Arial":r.font="11pt no-real-font-123",r.fillText("Cwm fjordbank glyphs vext quiz, 😃",2,15),r.fillStyle="rgba(102, 204, 0, 0.2)",r.font="18pt Arial",r.fillText("Cwm fjordbank glyphs vext quiz, 😃",4,45),r.globalCompositeOperation="multiply",r.fillStyle="rgb(255,0,255)",r.beginPath(),r.arc(50,50,50,0,2*Math.PI,!0),r.closePath(),r.fill(),r.fillStyle="rgb(0,255,255)",r.beginPath(),r.arc(100,50,50,0,2*Math.PI,!0),r.closePath(),r.fill(),r.fillStyle="rgb(255,255,0)",r.beginPath(),r.arc(75,100,50,0,2*Math.PI,!0),r.closePath(),r.fill(),r.fillStyle="rgb(255,0,255)",r.arc(75,75,75,0,2*Math.PI,!0),r.arc(75,75,25,0,2*Math.PI,!0),r.fill("evenodd"),e.toDataURL&&t.push("canvas fp:"+e.toDataURL()),t.join("~")},getWebglFp:function(){function t(t){return e.clearColor(0,0,0,1),e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.clear(e.COLOR_BUFFER_BIT|e.DEPTH_BUFFER_BIT),"["+t[0]+", "+t[1]+"]"}var e;if(!(e=this.getWebglCanvas()))return null;var r=[],i=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,i);var n=new Float32Array([-.2,-.9,0,.4,-.26,0,0,.732134444,0]);e.bufferData(e.ARRAY_BUFFER,n,e.STATIC_DRAW),i.itemSize=3,i.numItems=3;var o=e.createProgram(),a=e.createShader(e.VERTEX_SHADER);e.shaderSource(a,"attribute vec2 attrVertex;varying vec2 varyinTexCoordinate;uniform vec2 uniformOffset;void main(){varyinTexCoordinate=attrVertex+uniformOffset;gl_Position=vec4(attrVertex,0,1);}"),e.compileShader(a),n=e.createShader(e.FRAGMENT_SHADER),e.shaderSource(n,"precision mediump float;varying vec2 varyinTexCoordinate;void main() {gl_FragColor=vec4(varyinTexCoordinate,0,1);}"),e.compileShader(n),e.attachShader(o,a),e.attachShader(o,n),e.linkProgram(o),e.useProgram(o),o.vertexPosAttrib=e.getAttribLocation(o,"attrVertex"),o.offsetUniform=e.getUniformLocation(o,"uniformOffset"),e.enableVertexAttribArray(o.vertexPosArray),e.vertexAttribPointer(o.vertexPosAttrib,i.itemSize,e.FLOAT,!1,0,0),e.uniform2f(o.offsetUniform,1,1),e.drawArrays(e.TRIANGLE_STRIP,0,i.numItems);try{r.push(e.canvas.toDataURL())}catch(e){}r.push("extensions:"+(e.getSupportedExtensions()||[]).join(";")),r.push("webgl aliased line width range:"+t(e.getParameter(e.ALIASED_LINE_WIDTH_RANGE))),r.push("webgl aliased point size range:"+t(e.getParameter(e.ALIASED_POINT_SIZE_RANGE))),r.push("webgl alpha bits:"+e.getParameter(e.ALPHA_BITS)),r.push("webgl antialiasing:"+(e.getContextAttributes().antialias?"yes":"no")),r.push("webgl blue bits:"+e.getParameter(e.BLUE_BITS)),r.push("webgl depth bits:"+e.getParameter(e.DEPTH_BITS)),r.push("webgl green bits:"+e.getParameter(e.GREEN_BITS)),r.push("webgl max anisotropy:"+function(t){var e=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic");return e?(0===(e=t.getParameter(e.MAX_TEXTURE_MAX_ANISOTROPY_EXT))&&(e=2),e):null}(e)),r.push("webgl max combined texture image units:"+e.getParameter(e.MAX_COMBINED_TEXTURE_IMAGE_UNITS)),r.push("webgl max cube map texture size:"+e.getParameter(e.MAX_CUBE_MAP_TEXTURE_SIZE)),r.push("webgl max fragment uniform vectors:"+e.getParameter(e.MAX_FRAGMENT_UNIFORM_VECTORS)),r.push("webgl max render buffer size:"+e.getParameter(e.MAX_RENDERBUFFER_SIZE)),r.push("webgl max texture image units:"+e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS)),r.push("webgl max texture size:"+e.getParameter(e.MAX_TEXTURE_SIZE)),r.push("webgl max varying vectors:"+e.getParameter(e.MAX_VARYING_VECTORS)),r.push("webgl max vertex attribs:"+e.getParameter(e.MAX_VERTEX_ATTRIBS)),r.push("webgl max vertex texture image units:"+e.getParameter(e.MAX_VERTEX_TEXTURE_IMAGE_UNITS)),r.push("webgl max vertex uniform vectors:"+e.getParameter(e.MAX_VERTEX_UNIFORM_VECTORS)),r.push("webgl max viewport dims:"+t(e.getParameter(e.MAX_VIEWPORT_DIMS))),r.push("webgl red bits:"+e.getParameter(e.RED_BITS)),r.push("webgl renderer:"+e.getParameter(e.RENDERER)),r.push("webgl shading language version:"+e.getParameter(e.SHADING_LANGUAGE_VERSION)),r.push("webgl stencil bits:"+e.getParameter(e.STENCIL_BITS)),r.push("webgl vendor:"+e.getParameter(e.VENDOR)),r.push("webgl version:"+e.getParameter(e.VERSION));try{var s=e.getExtension("WEBGL_debug_renderer_info");s&&(r.push("webgl unmasked vendor:"+e.getParameter(s.UNMASKED_VENDOR_WEBGL)),r.push("webgl unmasked renderer:"+e.getParameter(s.UNMASKED_RENDERER_WEBGL)))}catch(e){}return e.getShaderPrecisionFormat&&(r.push("webgl vertex shader high float precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).precision),r.push("webgl vertex shader high float precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).rangeMin),r.push("webgl vertex shader high float precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_FLOAT).rangeMax),r.push("webgl vertex shader medium float precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).precision),r.push("webgl vertex shader medium float precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).rangeMin),r.push("webgl vertex shader medium float precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_FLOAT).rangeMax),r.push("webgl vertex shader low float precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_FLOAT).precision),r.push("webgl vertex shader low float precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_FLOAT).rangeMin),r.push("webgl vertex shader low float precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_FLOAT).rangeMax),r.push("webgl fragment shader high float precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).precision),r.push("webgl fragment shader high float precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).rangeMin),r.push("webgl fragment shader high float precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_FLOAT).rangeMax),r.push("webgl fragment shader medium float precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).precision),r.push("webgl fragment shader medium float precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).rangeMin),r.push("webgl fragment shader medium float precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_FLOAT).rangeMax),r.push("webgl fragment shader low float precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_FLOAT).precision),r.push("webgl fragment shader low float precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_FLOAT).rangeMin),r.push("webgl fragment shader low float precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_FLOAT).rangeMax),r.push("webgl vertex shader high int precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_INT).precision),r.push("webgl vertex shader high int precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_INT).rangeMin),r.push("webgl vertex shader high int precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.HIGH_INT).rangeMax),r.push("webgl vertex shader medium int precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_INT).precision),r.push("webgl vertex shader medium int precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_INT).rangeMin),r.push("webgl vertex shader medium int precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.MEDIUM_INT).rangeMax),r.push("webgl vertex shader low int precision:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_INT).precision),r.push("webgl vertex shader low int precision rangeMin:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_INT).rangeMin),r.push("webgl vertex shader low int precision rangeMax:"+e.getShaderPrecisionFormat(e.VERTEX_SHADER,e.LOW_INT).rangeMax),r.push("webgl fragment shader high int precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_INT).precision),r.push("webgl fragment shader high int precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_INT).rangeMin),r.push("webgl fragment shader high int precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.HIGH_INT).rangeMax),r.push("webgl fragment shader medium int precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_INT).precision),r.push("webgl fragment shader medium int precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_INT).rangeMin),r.push("webgl fragment shader medium int precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.MEDIUM_INT).rangeMax),r.push("webgl fragment shader low int precision:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_INT).precision),r.push("webgl fragment shader low int precision rangeMin:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_INT).rangeMin),r.push("webgl fragment shader low int precision rangeMax:"+e.getShaderPrecisionFormat(e.FRAGMENT_SHADER,e.LOW_INT).rangeMax)),r.join("~")},getWebglVendorAndRenderer:function(){try{var t=this.getWebglCanvas(),e=t.getExtension("WEBGL_debug_renderer_info");return t.getParameter(e.UNMASKED_VENDOR_WEBGL)+"~"+t.getParameter(e.UNMASKED_RENDERER_WEBGL)}catch(t){return null}},getAdBlock:function(){var t=document.createElement("div");t.innerHTML="&nbsp;";var e=!(t.className="adsbox");try{document.body.appendChild(t),e=0===document.getElementsByClassName("adsbox")[0].offsetHeight,document.body.removeChild(t)}catch(t){e=!1}return e},getHasLiedLanguages:function(){if(void 0!==navigator.languages)try{if(navigator.languages[0].substr(0,2)!==navigator.language.substr(0,2))return!0}catch(t){return!0}return!1},getHasLiedResolution:function(){return window.screen.width<window.screen.availWidth||window.screen.height<window.screen.availHeight},getHasLiedOs:function(){var t=navigator.userAgent.toLowerCase(),e=navigator.oscpu,r=navigator.platform.toLowerCase();t=0<=t.indexOf("windows phone")?"Windows Phone":0<=t.indexOf("win")?"Windows":0<=t.indexOf("android")?"Android":0<=t.indexOf("linux")?"Linux":0<=t.indexOf("iphone")||0<=t.indexOf("ipad")?"iOS":0<=t.indexOf("mac")?"Mac":"Other";if(("ontouchstart"in window||0<navigator.maxTouchPoints||0<navigator.msMaxTouchPoints)&&"Windows Phone"!=t&&"Android"!=t&&"iOS"!=t&&"Other"!=t)return!0;if(void 0!==e){if(0<=(e=e.toLowerCase()).indexOf("win")&&"Windows"!=t&&"Windows Phone"!=t)return!0;if(0<=e.indexOf("linux")&&"Linux"!=t&&"Android"!=t)return!0;if(0<=e.indexOf("mac")&&"Mac"!=t&&"iOS"!=t)return!0;if((-1===e.indexOf("win")&&-1===e.indexOf("linux")&&-1===e.indexOf("mac"))!=("Other"==t))return!0}return 0<=r.indexOf("win")&&"Windows"!=t&&"Windows Phone"!=t||(0<=r.indexOf("linux")||0<=r.indexOf("android")||0<=r.indexOf("pike"))&&"Linux"!=t&&"Android"!=t||(0<=r.indexOf("mac")||0<=r.indexOf("ipad")||0<=r.indexOf("ipod")||0<=r.indexOf("iphone"))&&"Mac"!=t&&"iOS"!=t||(-1===r.indexOf("win")&&-1===r.indexOf("linux")&&-1===r.indexOf("mac"))!=("Other"==t)||void 0===navigator.plugins&&"Windows"!=t&&"Windows Phone"!=t},getHasLiedBrowser:function(){var t,e,r=navigator.userAgent.toLowerCase(),i=navigator.productSub;if(("Chrome"==(t=0<=r.indexOf("firefox")?"Firefox":0<=r.indexOf("opera")||0<=r.indexOf("opr")?"Opera":0<=r.indexOf("chrome")?"Chrome":0<=r.indexOf("safari")?"Safari":0<=r.indexOf("trident")?"Internet Explorer":"Other")||"Safari"==t||"Opera"==t)&&"20030107"!==i)return!0;if(37===(i=eval.toString().length)&&"Safari"!=t&&"Firefox"!=t&&"Other"!=t)return!0;if(39===i&&"Internet Explorer"!=t&&"Other"!=t)return!0;if(33===i&&"Chrome"!=t&&"Opera"!=t&&"Other"!=t)return!0;try{throw"a"}catch(t){try{t.toSource(),e=!0}catch(t){e=!1}}return!(!e||"Firefox"==t||"Other"==t)},isCanvasSupported:function(){var t=document.createElement("canvas");return!(!t.getContext||!t.getContext("2d"))},isWebGlSupported:function(){if(!this.isCanvasSupported())return!1;var t=this.getWebglCanvas();return!!window.WebGLRenderingContext&&!!t},isIE:function(){return"Microsoft Internet Explorer"===navigator.appName||!("Netscape"!==navigator.appName||!/Trident/.test(navigator.userAgent))},hasSwfObjectLoaded:function(){return void 0!==window.swfobject},hasMinFlashInstalled:function(){return window.swfobject.hasFlashPlayerVersion("9.0.0")},addFlashDivNode:function(){var t=document.createElement("div");t.setAttribute("id",this.options.swfContainerId),document.body.appendChild(t)},loadSwfAndDetectFonts:function(t){var e="___fp_swf_loaded";window[e]=function(e){t(e)};var r=this.options.swfContainerId;this.addFlashDivNode(),e={onReady:e},window.swfobject.embedSWF(this.options.swfPath,r,"1","1","9.0.0",!1,e,{allowScriptAccess:"always",menu:"false"},{})},getWebglCanvas:function(){var t=document.createElement("canvas"),e=null;try{e=t.getContext("webgl")||t.getContext("experimental-webgl")}catch(t){}return e||null},each:function(t,e,r){if(null!==t)if(this.nativeForEach&&t.forEach===this.nativeForEach)t.forEach(e,r);else if(t.length===+t.length){for(var i=0,n=t.length;i<n;i++)if(e.call(r,t[i],i,t)==={})return}else for(var o in t)if(t.hasOwnProperty(o)&&e.call(r,t[o],o,t)==={})return},map:function(t,e,r){var i=[];return null==t?i:this.nativeMap&&t.map===this.nativeMap?t.map(e,r):(this.each(t,(function(t,n,o){i[i.length]=e.call(r,t,n,o)})),i)},x64Add:function(t,e){t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]],e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]];var r=[0,0,0,0];return r[3]+=t[3]+e[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=t[2]+e[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=t[1]+e[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=t[0]+e[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]},x64Multiply:function(t,e){t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]],e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]];var r=[0,0,0,0];return r[3]+=t[3]*e[3],r[2]+=r[3]>>>16,r[3]&=65535,r[2]+=t[2]*e[3],r[1]+=r[2]>>>16,r[2]&=65535,r[2]+=t[3]*e[2],r[1]+=r[2]>>>16,r[2]&=65535,r[1]+=t[1]*e[3],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=t[2]*e[2],r[0]+=r[1]>>>16,r[1]&=65535,r[1]+=t[3]*e[1],r[0]+=r[1]>>>16,r[1]&=65535,r[0]+=t[0]*e[3]+t[1]*e[2]+t[2]*e[1]+t[3]*e[0],r[0]&=65535,[r[0]<<16|r[1],r[2]<<16|r[3]]},x64Rotl:function(t,e){return 32==(e%=64)?[t[1],t[0]]:e<32?[t[0]<<e|t[1]>>>32-e,t[1]<<e|t[0]>>>32-e]:(e-=32,[t[1]<<e|t[0]>>>32-e,t[0]<<e|t[1]>>>32-e])},x64LeftShift:function(t,e){return 0==(e%=64)?t:e<32?[t[0]<<e|t[1]>>>32-e,t[1]<<e]:[t[1]<<e-32,0]},x64Xor:function(t,e){return[t[0]^e[0],t[1]^e[1]]},x64Fmix:function(t){return t=this.x64Xor(t,[0,t[0]>>>1]),t=this.x64Multiply(t,[4283543511,3981806797]),t=this.x64Xor(t,[0,t[0]>>>1]),t=this.x64Multiply(t,[3301882366,444984403]),this.x64Xor(t,[0,t[0]>>>1])},x64hash128:function(t,e){e=e||0;for(var r=(t=t||"").length%16,i=t.length-r,n=[0,e],o=[0,e],a=[0,0],s=[0,0],u=[2277735313,289559509],l=[1291169091,658871167],c=0;c<i;c+=16)a=[255&t.charCodeAt(c+4)|(255&t.charCodeAt(c+5))<<8|(255&t.charCodeAt(c+6))<<16|(255&t.charCodeAt(c+7))<<24,255&t.charCodeAt(c)|(255&t.charCodeAt(c+1))<<8|(255&t.charCodeAt(c+2))<<16|(255&t.charCodeAt(c+3))<<24],s=[255&t.charCodeAt(c+12)|(255&t.charCodeAt(c+13))<<8|(255&t.charCodeAt(c+14))<<16|(255&t.charCodeAt(c+15))<<24,255&t.charCodeAt(c+8)|(255&t.charCodeAt(c+9))<<8|(255&t.charCodeAt(c+10))<<16|(255&t.charCodeAt(c+11))<<24],a=this.x64Multiply(a,u),a=this.x64Rotl(a,31),a=this.x64Multiply(a,l),n=this.x64Xor(n,a),n=this.x64Rotl(n,27),n=this.x64Add(n,o),n=this.x64Add(this.x64Multiply(n,[0,5]),[0,1390208809]),s=this.x64Multiply(s,l),s=this.x64Rotl(s,33),s=this.x64Multiply(s,u),o=this.x64Xor(o,s),o=this.x64Rotl(o,31),o=this.x64Add(o,n),o=this.x64Add(this.x64Multiply(o,[0,5]),[0,944331445]);switch(a=[0,0],s=[0,0],r){case 15:s=this.x64Xor(s,this.x64LeftShift([0,t.charCodeAt(c+14)],48));case 14:s=this.x64Xor(s,this.x64LeftShift([0,t.charCodeAt(c+13)],40));case 13:s=this.x64Xor(s,this.x64LeftShift([0,t.charCodeAt(c+12)],32));case 12:s=this.x64Xor(s,this.x64LeftShift([0,t.charCodeAt(c+11)],24));case 11:s=this.x64Xor(s,this.x64LeftShift([0,t.charCodeAt(c+10)],16));case 10:s=this.x64Xor(s,this.x64LeftShift([0,t.charCodeAt(c+9)],8));case 9:s=this.x64Xor(s,[0,t.charCodeAt(c+8)]),s=this.x64Multiply(s,l),s=this.x64Rotl(s,33),s=this.x64Multiply(s,u),o=this.x64Xor(o,s);case 8:a=this.x64Xor(a,this.x64LeftShift([0,t.charCodeAt(c+7)],56));case 7:a=this.x64Xor(a,this.x64LeftShift([0,t.charCodeAt(c+6)],48));case 6:a=this.x64Xor(a,this.x64LeftShift([0,t.charCodeAt(c+5)],40));case 5:a=this.x64Xor(a,this.x64LeftShift([0,t.charCodeAt(c+4)],32));case 4:a=this.x64Xor(a,this.x64LeftShift([0,t.charCodeAt(c+3)],24));case 3:a=this.x64Xor(a,this.x64LeftShift([0,t.charCodeAt(c+2)],16));case 2:a=this.x64Xor(a,this.x64LeftShift([0,t.charCodeAt(c+1)],8));case 1:a=this.x64Xor(a,[0,t.charCodeAt(c)]),a=this.x64Multiply(a,u),a=this.x64Rotl(a,31),a=this.x64Multiply(a,l),n=this.x64Xor(n,a)}return n=this.x64Xor(n,[0,t.length]),o=this.x64Xor(o,[0,t.length]),n=this.x64Add(n,o),o=this.x64Add(o,n),n=this.x64Fmix(n),o=this.x64Fmix(o),n=this.x64Add(n,o),o=this.x64Add(o,n),("00000000"+(n[0]>>>0).toString(16)).slice(-8)+("00000000"+(n[1]>>>0).toString(16)).slice(-8)+("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)}},t.VERSION="1.8.0",t}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LogoControl=void 0,r(76);var i=r(10);n.prototype.onAdd=function(t){return this._container=i.domCreate("div","maplibregl-ctrl mapxus-ctrl-logo",t.getContainer()),(t=i.domCreate("a","mapxus-logo",this._container)).target="_blank",t.href="http://www.mapxus.com/",t.setAttribute("aria-label","Mapxus logo"),t.setAttribute("rel","noopener"),this._container.appendChild(t),this._container},n.prototype.onRemove=function(){i.domRemove(this._container)},n.prototype.getDefaultPosition=function(){return"bottom-left"},r=n;function n(){}e.LogoControl=r},function(t,e,r){var i=r(77);"string"==typeof i&&(i=[[t.i,i,""]]);r(9)(i,{transform:void 0}),i.locals&&(t.exports=i.locals)},function(t,e,r){var i=r(16);(t.exports=r(8)(!1)).push([t.i,".mapxus-logo {\n width: 106.4px;\n height: 28.4px;\n margin: 0 0 -3px 3px;\n display: block;\n background-repeat: no-repeat;\n cursor: pointer;\n background-image: url("+i(r(78))+");\n background-size: contain;\n}",""])},function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAATAAAABRCAYAAABVJPq4AAAACXBIWXMAACxLAAAsSwGlPZapAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAABzbSURBVHgB7Z0HnBfVtcfPLrANdqVlETCWZU0MVqyAaDAosHRUSIzl2RJLorHHgorl2RKNSl7UlzxFDSriY4WVsjSJYqE9xYI+UcEGAoKULWyBze+3O//N/z87d+bOv8Bfc76fz+zM/ufOnZk7954599xzz4goiqIoiqIoiqIoiqIoiqIoiqIoiqIoiqIoiqIoiqIoiqIoiqIoivJvQIb8m1NSUpJdXV2dm5eXl5OVlZVTX1/fMSMjo8vOnTu7tGrVKq+hoeEl8LkoipJ2tJbvOcOGDcvD6iAIo7137dpVCOHUFf93hmAqxLoblg4FBQUd8H8+hFZ77G/F45A+ksU5WHqLoihpx/daA4Pw2hcCaRE2fygJAOF2ArSwRaIoSlph1MDGjx+f+cYbb7SH1pIzd+7cdfipQSwoLi7OLioq2guCoyA7O7s9fuqAPL6AAPhQdjO4hhslQeHlMAqLCjBFSTOMGtjQoUPPhwD4z8zMzErYhfrNnDnza690Q4YMGYnu1lhs7u0s+dBYcnBsLrZzsLTG/1/j/75lZWWrZTcB7esgnHM5NvMkcVbl5OQcOWXKlApRFCVtyDTtQONvh2VvCJ/u0iSYPIHw+j1Wv8TyMyw9sfwQx/0A63biaHjMB4LwCNlNUHvkSpIjvEgPGPp7iqIoaYVRgEFwbXA2W0P4ZImZH4gFMJAPkN3EsmXLDsXqVEkeLKefi6IoaYWfBrbD2aQW5anJlJSUFIilloP8+shuAue6BksbSSLIb0SfPn1yRVGUtCHTZ9+W5kSZmR29ErRu3bqT2HfT9oVdqrOkGNjk2FUdJkkGAmy/wsLCXqIoStrgp4FVRrY5EumVBvavvaTJUB8I8uPI5GGSQnr27JkFYUubXHtJMuhSt0E5/EIURUkbjAIMNqu65kSZmZ52rrq6ug7iEmBo6JVeaSkAIMCOkxRSVFTUF+cYK6njGFEUJW0wCjBoG1uitj1tP45XezRV+O01MZNSAYBz3yb+3eJEOfDUU0/dTxRFSQuMjT0rK6s2sg3BYOqSud0rOGfwLUNaCsKUTcmBfW0gVv0ktXSqra09TRRFSQuMAgzdxqrINrp/BV5pINj2cf1Eh9VXxQA1Noxc9pDkk8GRR0mt9hUh6QMEiqLEh7HBt2nTplmAOV71LfDoQm6AsFuJ9bdiACOXx0qSGTVq1JE478myG8A9H787RlMVRQnGKMCmTJlSG/WvZ4OF0Ojm+n/TUUcd9Rk214uZpAqw/v3756BreidVMNk90Kl3tCiKsscJ6nJFvPGzDftjupCQIRvHjx+/C5tGQz7SJNVO1a5du8EQnANDHGI1Kd0P3MOpENRJdZRVFCU8vgIMDbXWWZu6TDFGfGhCjV1HCJRlhvRMc6AkiTFjxnC+5pVib/ui8HpEEuf4rkAURdmjBDX8b/gHAqmFDQxdN07WjvHChzDZzDXsXEtNGdKhdciQIUlxRdixY8cJWJ0Y4pAPcG23SNNoaSLk4z5+Koqi7FF8I7JGnFKxbuFGga7bPh7p13JdXV29GoMAX3qMUjbSqlWrvlh9JgkAAcprvyLMMbie+0pLSzfBCP86tveVxGC39Wn5DoJBj/a1tbX7c3vnzp3ry8vLGSopdNea+eD47ljYnf722GOP/cIxISQVPuu8vLwicV6YGCHf8SlYuXJlrewBaHfF9ewbuR7cfwXK8GNRQuEMhnVHr6zRfp2dnV0FpeSzWbNm1djmERRSejv/oLG3mAsJIbQPThybWevWjQKsT58+W5YvX87RSE8BhuOOxOpZSQBUII469rdND+G6HHarp6dPn877mYSfEp0WdCIqcvuFCxdukT3IoEGDuuLBz/Tah3K+56WXXprM7REjRhyGMrgUmwPQ4IojIbO5xr4K7HsZgmES1jNRRttN5xs9evSPcPzlSMd8DorkQfDMd6BSvoHyfQ77p+Lc30ic0DxQU1NDl5Wxjo2zbfT+Hj161BcXF8/HNfwPzjcD52ocNR86dOgIXM9t4l0eFyHdkujfhg8fTufqRyKhxKPAaRtuKSsre4n/UIjm5+efgXRn4veTpGkwRyL3j/vein0vY9+TkK0zg4TryJEjS5F2f699uKfSGTNm3O53PIVoQUHBc9hs0ZtBvmyYp0fH38N93oPrG+SRdsP27dtHoh7vEAtQvmfhfq/22ofyHRnw/YgM1LX+SHcWroXht/bnj5H6U19fTxmyC9f6NvY/hXSlQd+j8BVgyGQLbpCbWYyxFf12ReYtbEBbt25tFGBMh4ugId/TuI6G0ofzFuN9g7Iy4abvkKhKFACv+8bI9aOCLMPxHKAolPjZNzc393Cs/yF7EDyjbDwjz1hr+L0rKgwDTN6DhTHb2hvS0RwwHM90ONZvojHej4ozVZrKrZGBAwcWQlDehUo2Bv8WGC6HgSzZuE/C+lqc+7aPP/74+ZDPOQN1ZwS0eI4sH+KTjoEyByHNQCzv4Jir0GAXYLubqTy8ghIgbVscc5RTz90U8w/KYwiOvR5pjsPiWedoGsFqFKOWQLguKSoquqGiomIRBEO9V3rUwXKkfcRwnUU45yt4BgvFAHpAl+F5jfAafacQRd10N/wfG8qF2jenA1oJMJyu2FS+uB6Wr6fAwfPpjWPH8cWHtd/8aZq16BZ1JNJdh+P+kJOT89iUKVOqTYmN4IKaVbnFixe3c+12h2qucmkjK8QALu4QvD07SJzgTXgWVkeHOKQcD3Rh5B9Gl0XhzJYEQTc5rSd3oyH8hJoVNql52U5wZ0V7Fg3oAScwJN+6RRBe1FwuELPwcsOKPhEN+UG+rGwOgNaVhfNSe3o+QHg14zTgw3Gu6ajsv5bkQo3hOpxiKr+LIHYvTJYZZ5wsQD292ZQI9fGvWM0y7C7AOf9KDd9rJ7TgQxgu3SC8PoHwvxoNfqekCdTacF2zsQwVy+APDnTT+hPu5wUndFcLbN0oBFLQ7TbQxZSW4GLXiAG+rbD/AIkDdi1w7O9CHLIL6R90+bWRlyRBkG8JVXlJX9igj5LwtMYzunzp0qVnDxgwoBO2nxeProoFrXDsxRBiV0nwB2Qyqqqq7sF6nNhr1v86OCODXcwJWCdNiCGvc/CM7xKzG5Hfsbzf6yEAz/faTwGDvC8W84BSMQTgNV476urqLhLvF1IN8rxq/vz5myRNwIDdoSiKPzsaalzg2CHoMd3r5brkK8BQGHVR2/mufd1cJ1kb/T9U5LVIs07MxOUPBmn8C5wrTHjqN9atW/ey+0dolzOwsjYWesHuClT57+sn1zKgwU2ArfFZdrEkftiWx0Oz8o2lBu1pKNL91kurCAEFX9JitjldpVYSP1l8eUJ78Byxduw712IxaUtXDx48OCYEFQTi8Sii8wzppx1zzDEJv5iTCQTPXYkIrwjI46KuXbue4v7dV4ChAm+MbMP2kePKMMYHDA/qi+j/jzvuuE1I866YL+gECQm7GKzkIQ6px3WNg3G5zr2DRl/ktUQSgCGCUEbfiVDTzsvoPaxfwPI07r0c/68JOIwvrVM8fl+F5X+xTKQB3fnfD2owE/D8PIUBhBu/u/CYRRRdmijm4vofx0IjOO+nXnYTuD5q8+9jeQ4vwIn46RUsQdpOPgzTTzluRy1Az4blaBrQyoGZ4il0wRrNLdRA2C0X14AGwe9f4ppuSMUocLzgudLn0zR3eAvK81IsB+K+WqGM+K1WmmRMLlh8t93mrkNBbhQVkRdidFBD52OxbhU2RgNzDPlvisGQDw4Na8h3tK9DbdMj7UKMsBg/h8aRMqxCC1JXHsNRqL9NJ5uDB6ugEV+M8ns9erSJhnk0oItwD7eKhabhaNTXY3khMupH6E6Bbs1ICHMapU3zZo/C+WnXWuGxj7a1bj6n3sSuHO7heeTxdcQwzu47NOCf4fjrHRtVqqBQWITzj+OXriL3Thvha6+9tjfsg9c5XVdTyPF9cZ202z7q3sF6g/b0RxzPhu7VLTwc5Up3oVu7d+/O0d9ijzQ1SDMOo8efSnphCiPP8rwQ10vhLfQMkKYXweSTTz55NupkuSF2YE8oUowC3WyuCupCNn9GDBlGdyHz3CF2+Ok09/Eo1LfFnHdnGPKt7WB8g+GcvxN7r3te872mUSCCwpgjidMdtpuUBmpMBJTzR6gQvWfNmrXAPVQ+Z86cDRxZxOaFFvlsRndgEBrvU9HCi7z44otbMOz/JDbHUksxZEEtrMT9o+PP9xsxU4tzj8I5H8A9fBn9PHk/+H0mhOcwRyNKFc+hrgzEPb4afe98Sc+dO3ctfrsCdZ32sm2mDPx6Djj+HVz/jWLmcigDw5D/dV478Xs5hMBTkmZ4BHuIUIGXged0w3nz5m3F6hrDcXl41jGuWUFTiTZHbTe/XXDyHBSae0j6K/fxeKh+wQ05vG/9oY+99trrTKyOtE1PX6Rp06bN80uDBrES6V6XxDld0pMqPIMz8ZbfbEpADaCsrGyi4xtnBMLrQpTnu35p6DOFZ3qfT5IWz48alJjdWXagYY8J+io6nuM22Oouw7kTMgkYmAbhcFaQcyXK5gWsLhOzQ/DBsF8VG/Y1wHb1mDR1y72gslAm3uW0Hu3xbEnCHN9kg7pn8pHMxz6j7biiooI9t8uxXOle6CAfnbZ1wAXscJziMqMFFjLpiP/d04haGOxLS0s34M1Bh1bPbyriGLpCTJQA0NVpi4p8l9hTi2u/1yYh8p2D6+grCUDfH6yukvRjCRrfMpuE0DD+jjIba7BD7aqtrZ1vkw/K8ynkw4bcwk6D37007kGmvFDHymiUhuYjQfCjwyNHjrwJ558myfseKO/nBpSJlXCAIJkMW84Z2BxsSMJpb54e+9TmBg0adBnaVl8fzaUFKKM7KMAlDUF5/L9hTIb2rCfpMgON6tny8vIY2eFo2RPEAl8NDJWaBdNoo8IbuLlS4KG6I7HuwAWZCtHPH8xqdAtdoHOw6ij2zD/iiCPesUmICsO3XrUkAO69Bz3iJf14yzYhGt47uA+TB/4nto2ksrJyNfIxxYNr8cJE2p8Y0rKeTQpjlIYWtACrDyVJoH6+C+3POj9qabifx33y8x09Z0PG8f8l9tc3DyPs/y1pSufOnalJrTXspq/b/TBhvAsl52kMVPwHbKn7mwZ6TAR1Iak2Nxqno6OyomK5Da47IG09uyk47hUxc3SQkyMHDHC+a8UeGjTvtK340BLfw+ptSRAI2TGSZkR9nDgQRuBFetOAyhqxxLGzWU0hcnzounjtQ93bhDoVtkvIUcJXJUmgTGbbal8RcM0fmPYZDPAxoBt+N85ZKsF8npWVdaHXCHu6MHHiRPbgaN80DtRhP43yZ6GsJ6LsVnEuJNr8kxBqJf369Qt0dvcVYMiQmkmkgJpD6uBk7jmOVRAynpUWadmFMU1TaG1hyD8PD9Ta2I8CgU35xTckBLj2WZIgnAeWbjHCUBZW00MsCDXCanve3NzcLK9AAU4e22tqauLRjFdLkogEJwiD8zGcKq99GYbIxu4s0F2nOcI4x5YDJeC2qVOnJhQQYXcADXYa7aKW7i7U0LvTgRjrme3bt18MQXZnSUmJ0ZHYV4ChW8FRyMYTI9NoTSlGMnK00tTFwAjdKuw3hpiGkDQ6HjpTKcLYlujbdUfYtya6x9OinXbjpK/GCAsHug+ZRJJLQs7JiYK6V59oXcrPz6dPpV/XtQZ19jX5btAAIXYzyoT+ku+HOZA+YljdBDm0wu3QG8G38uANWRd5GFhHfxuyU0wmmZlfmfJwhkVXmvbjQRg98vEgf4ObKBJ7JkMFXykhgSGRxsb3JDFyUA4jRLEGNla6SHhqKzRZdOjQIZ4pRYlM0HdjO++zGQhl2nY8nVYttRDGubtJfD5BiHxyoYE9wml18h0BAzFTUS59cN2MoPwkFna1be2bP0Z3ee6QIUNa2BB9BRhGdrY6djCJnkGe4QqvEzBliOmNAQ5Nhnz0gxlv6VKxp4Kx8SWO4WQaX51JzwmBPNLVnSItOfroo2kj8fRkZx3Di2V/CY+1q00q8kKPgi9cT0M07unLoONhzGZ7uEYCHIuR10kQdDdI4jDWmvV8Xryk455axTBNEGTl0MjORTn1hvJCgXYr6sBC7K7wOxZpCnHuxxy/wX9dT9BJqRI7GURsFRwXzXcl8zUWczjVZ/cRXoZ83Bx9W/y8s2Pg9BgUTtyeyCicuZI4hw0cOPCHoljBgRaUu7GrhLo3WEKANzRHx619Cy04IQ67plELR2P1nXIVFSYqX+y4gpOlLdOaDOlt8Qy6iD2BAxE20OQEW/USxj2DQDsJ2vgRnFrEkV/TMbjOXgUFBTEuWUEBDSkYaJwvRuaN6jQaaB5HDlz+HV/55eHMiaRh10vS58CQ33vlypXNo5Uw2jFYYphoq/XoJ98nCQAhuxiV50vc2z4SPx3QhWBf/4+i2MLn/ivDvstRFyahsn8iFuD5XSKJxXhz07Fbt25XYaTPyqcQBueDUX/ONO0PCuGExnkeI5yIPXm4579L0wR23+4Y8t1o8MniwAJ7DiskgBEjRnRpaArmaEMGnl3njJaBIimItrlnczjPmFPRHoEWeirStHDq5dxjLP2x2ewiZWNAjfgGNfqBQd3kBOYYIz6Eja9qjNGkjwMM+TGqOh7KuWL4lJsXKKTHIM3XSALgTfAtrnGmJAjyGCKKNag7bNSmUctOeDE948y99WXUqFFs+OMk+YxHQwyMOOJofww7ZLKbrUej/T/T8TBS78/IFV778DuDZm40HHoYyofzMIOiePhpupdAOAX2dnAd54rB7cUN8ivEs/sAbXmde4H8mOrnPkV7mRgcfnGtMT0cGwFW6awbBQoqXIuJ3Mj0a78MaMhHmo9M+xmhNbLNONnOnEcrkJaz2v8iSYAFK4nTjzMHRLGCYafRMBb4JDkWz2Uy3/5eOzmhGvsGowvCuZip+DJ7DhriNGhXp4lBSHCKEK7xRTHMOCEM6Gfax24qzvGweM8goCvHr3D8TabjUf/vhgA9XHxw5h6aRmg7If8nTGUsTVFyR2J9i1gCOUHFx/P7sDjXgAMOOMD4MR6n/Zgc12PuIbALKY4/iiO4WBAd8bDaxV5Pw3qLfOiVa/qSTy+GPqaRDw/j9xJC+8J1PYRGEHrk0Qvc26s4/zdhzu+GU3EwYsL5fWWiWIG38u14jowm4Wn7Qf1ipIalaETzaPDF8jGOaQwFje7dyfj/xIzgUDyJwG7p04z4ivPMwbW+zWl2WP8I//dmGJiIicXANgioO0w7nSgTQ732MQoH6vcqdKu+wTnPMHTh2mPfwxiVHGQKvdyuXbv3q6url/tMmxvIgSzcI+PsL0L5foqeE7uotE1ReHGxDuzILiLy4vxQL6HXGtfLqUTjPv3000nREWkcTfBmj7nWjbi9BWzeWFXOgR2dtVtKV/h1DyNAOPhNyD2A05MYuliaooha4cRAelSShNMvTzggHMpIv9wdgmnTpi2W4Dmx7Dqcxzl0DBKAZ09Bcjd+G5Bi4RWBtiI2coa+oSBd5EwbYn31E158wd8DE4enHY8hjRqaPraS6XHg2xipbYybTxNHbW0t7cKe3W1cy/GO+4UnjEiMNA+JP5zWxZDe/FjKagjd951J/mMljqi0EH5P+ETo6MZRxR49evDF9AyWh7HMQPq3Gpoi1XrB9hnjLRAowGj8i2w7fifdXfs3R1wt/IBWQslp9MgHvXBDDCli7XvDYHqMby/JhQIs0dhew23jwCtNoAvIDz4k49NkaRPQz4HBrjwFB7u/OTk5D2DT5Ot4U/SUuNmzZzPszp0GfzK25Qtgr+thyEu2b9/Oa0mGmcQK2qXRRunqYfL144uHDqqcAM8AALQfGwdhkNez6KXF9PYCBRjnyEW2KysrKcDcE7k3rV69ujIon6qqKgpC42gSJD6/mhMmuulmCL0HJMngrTHfK7JGSDr79fGVlnBYHXVgJCp1IuGN5uN4qxFDG5zQQImE6FkErekS94hbhCVLlvwcAslU58tyc3PL3T+iDd6L+mmyGe6NNjHB9PLkPFW0Q2p7VoEOPGAbDjVNr6ysjPZpRpYIlBEBLONLzv1joABDATergAyjg8KL0cAYhcImquqcOXN4A2/6JOEnvcJ4Fj9SWlr6kSQZBudDxU3UK58qpTq1hoTx2Rx71zMSTgumRjLR6bp/LkmCLzI0Gl4PDfRhNDtGZ3mInz1zh4qJQEdtvCz/hHRedmgObHh+WYihZpzgh6auWUlRUdH5hn0yf/789TgnR2x9Y6y5YZvAC2Y4u+4SEggxRsz9NZZ45m5ygj7Dh5d49bZsbGDN9q26ujpOvo1R8fD/V2IJ0vrFpgozglQBdTiVvlZWsa/8QCU7JRLLXLGHth6GT3L8qQI1BTRGCr0LMJJ3gd8HeeMFQnXj2rVrx6In8kucJ8gfjbNAlqOhj8a1XMF7MSXEdf9BDC4JOM+fabg3HYt8l2P1F5+876ZPmmk/rm0t2s8pOA/974KcvzmIN4EDJRAgiyVOcD98KR2P5VYfu5gbfvPg7IqKirGmjyTbjEI227egVezt4ehpPWMfx7+JhytJ4LZUfhEbb91SXCvjxCcy14x2DU4LmScpZOPGjV916dLF0/kRQtQ6lhU0z60YATod9+41EhjqC9toQJchn84ev1tVXEfzmAz7z5QVK1b0xIuT98coBY1ft0Ed3AqBwnr3WnZ29ptMjwreeCzumdrSGq98YYd9U+KAIWuwTIaQnNq1a1eGD++D8++H62jrXA+7VvSF/AeuI9AhlKAdUIA94f6dgQigmQV2oyHkb4fRfi7y8ewu4vp8PQOcsEd/g137CYxO8ruavXEMPwrMOk+N9htcywcFBQUvT5o0Kfq5PY5zepZj27ZtfW2YKBsqO7ejHO/GyGs/PCsGNKVJqgMjHDrzrjm1jP5iL/fq1ev9oLBYgZ+wghbRNyo0NLtF90vUNwKp6jJeuVhAoyUqAi/Q9iOrLaA/GW7uBEZ7lRSCN9hCMbt9WIGyeRxlc4EoaQu6cv1Rp0zzYK9E9+dBUdKWwG4bhEWzfQsPmm+dmOHUMDGTKE05NCwJgOMfTbXwIrjXhP24IPh/mm4xwhTl+4TNKGRz9wHCg744ua79FRKOpRInTtSLF2X3kHCMMJZXYWHhgaIoSkoIFGA1NTXsDzdqYWiQ7DrGTHeArSOUfYQOgBI/E6DSJy3iph+wuzCoXFw2kyiyYEvTuZGKkiJsw+lEvPGL3F7PplDSJtq0aROvD8oqGBST5nUfhPOBhmQ4/Z0miqKkhEABhhEHal8RRzx3rCsGEaySEGC063MxeOb6AWHy8DPPPBM4ZSmZQHtidIpEPbttRnoVRYmDQAGWm5u7C8IjYsh3R2LdhKHpsB9eoCE/rHfzhxgu3+2fj3IcZeP1xOYwdRnK7gxRFCUlBAowdPlqTI5nDExWWVkZz5djQhnyoeU9xsmosgeAAJou4VmNMrsQI5Cjpk+fnoz5fYqieBDYvdm4cWNDfn6+p/DgRO6FCxeG/goMBN9STtEXCz808HVeXt7fZA8Bze/+6urqbs40le4ByRlihVNI7uLcvohzpaIoqSFQgNFjd9iwYR+hAR/tsZsjiqE/ogGtbUHbtm2/aggO30xD+nn8bLzsIRzN77IxY8ZcjRHZsbhmBluMKQu6W0Aos4t714wZM0J/S1DZc+C5bcYLZ6Fhd9Ln2irJxUYDktGjR3eqr6/vh4banN4J6PaKaaZ9EBCK9I862C8N8l8DgbAi7HceUwnDG+Peh+La+Mk3hgJZg/+v69Wr1wLbr4EripIcrASY0hJ+QaagoKBw27ZtGxghQBRFURRFURRFURRFURRFURRFURRFURRFURRFURRFURRFURRFURRFURRFSQX/BO3KWsJPj46IAAAAAElFTkSuQmCC"},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AttributionControl=void 0;var i=r(10);function n(t){this._theme=t.theme||"default"}r(80),n.prototype.onAdd=function(t){return this._container=i.domCreate("div","maplibregl-ctrl mapxus-ctrl-attribution",t.getContainer()),this._anchor=i.domCreate("a","mapxus-attribution",this._container),this._anchor.target="_blank",this._setCopyrightInfo(this._theme),this._anchor.setAttribute("aria-label","Mapxus attribution"),this._anchor.setAttribute("rel","noopener"),this._container.appendChild(this._anchor),this._container},n.prototype.onRemove=function(){i.domRemove(this._container)},n.prototype.getDefaultPosition=function(){return"bottom-right"},n.prototype.changeTheme=function(t){this._setCopyrightInfo(t)},n.prototype._setCopyrightInfo=function(t){this._anchor.innerText="landsD"===t?"© The Government of the Hong Kong SAR":"© OpenStreetMap contributors",this._anchor.href="landsD"===t?"https://www.map.gov.hk/gm/":"https://www.openstreetmap.org/copyright/"},r=n,e.AttributionControl=r},function(t,e,r){var i=r(81);"string"==typeof i&&(i=[[t.i,i,""]]);r(9)(i,{transform:void 0}),i.locals&&(t.exports=i.locals)},function(t,e,r){(t.exports=r(8)(!1)).push([t.i,".mapxus-ctrl-attribution {\n margin: 0 10px 5px 0 !important;\n}\n.mapxus-attribution {\n text-decoration: none;\n color: #404040;\n}",""])},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.DistanceSearchType=void 0,(e=e.DistanceSearchType||(e.DistanceSearchType={})).POINT="Point",e.POLYGON="Polygon"},function(t,e,r){"use strict";function i(t){return-1<t.id.indexOf("mapxus-poi-restroom")}function n(t){var e=-1<t.id.indexOf("mapxus-poi-stairs"),r=-1<t.id.indexOf("mapxus-poi-escalator"),i=-1<t.id.indexOf("mapxus-poi-elevator");t=-1<t.id.indexOf("mapxus-poi-ramp");return e||r||i||t}function o(t){return/en/.test(t)}function a(t){return"zh-Hans"===t||"zh"===t||"zh-CN"===t}function s(t){return"zh-Hant"===t||"zh-TW"===t||"zh-HK"===t}Object.defineProperty(e,"__esModule",{value:!0}),e.isTraditionalChinese=e.isSimplifiedChinese=e.isEnglish=e.isConnectorPoi=e.isToiletPoi=e.getTextFieldCoalesceList=void 0,e.getTextFieldCoalesceList=function(t,e){return t.map((function(t){var r=[];r=o(e)?["coalesce",["get","name:en"],["get","name"]]:a(e)?["coalesce",["get","name:zh-Hans"],["get","name"]]:s(e)?["coalesce",["get","name:zh-Hant"],["get","name"]]:["coalesce",["get","name"]];return(i(t)||n(t))&&(r=""),{layerId:t.id,coalesce:r}}))},e.isToiletPoi=i,e.isConnectorPoi=n,e.isEnglish=o,e.isSimplifiedChinese=a,e.isTraditionalChinese=s},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ThemeType=void 0,(e=e.ThemeType||(e.ThemeType={})).CHRISTMAS="christmas",e.HALLOWEEN="halloween",e.MAPPY_BEE="mappyBee",e.MAPXUS="mapxus",e.LANDS_D="landsD",e.COMMON="common",e.MAPXUS_V2="mapxus_v2"},function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0}),e.Marker=void 0;var o;r=r(5),n(a,o=r.Evented),a.prototype.onEventListener=function(t,e){this._map.on(t,this._layerId,e)},a.prototype.addTo=function(t){return this._map=t.getMap(),this._indoor=t.getIndoor(),this},a.prototype.create=function(t,e,r){var i=this;return this._coordinates=t,this._floor=e||"",this._buildingId=r||"",this._map.hasImage(this._imageName)?this._createData():this._loadImage((function(t){i._map.addImage(i._imageName,t),i._createData()})),this},a.prototype.remove=function(){return this._map.getLayer(this._layerId)&&(this._map.removeLayer(this._layerId),this._map.removeSource(this._sourceId)),this},a.prototype.switch=function(t,e){return this._map.getLayer(this._layerId)&&this._map.setFilter(this._layerId,["any",["all",["==","floor",t],["==","buildingId",e]],["==","buildingId",""],["==","floor",""]]),this},Object.defineProperty(a.prototype,"layerId",{get:function(){return this._layerId},enumerable:!1,configurable:!0}),a.prototype.setImageUrl=function(t){return this._imageUrl=t,this._imageName=this._imageName+"_"+t,this},a.prototype.setImageScale=function(t){return this._imageScale=t,this},a.prototype._createData=function(){var t=this;this._addSource()._addLayer(),this._indoor.currentFloor===this._floor&&this._indoor.buildingId===this._buildingId||this.switch(this._indoor.currentFloor||"",this._indoor.buildingId||""),this._indoor.on("switchFloor",(function(e){e=e.target,t.switch(e.currentFloor,e.buildingId)})),this._indoor.on("selectBuilding",(function(e){e.feature||t.switch("","")}))},a.prototype._loadImage=function(t){this._map.loadImage(this._imageUrl,(function(e,r){if(e)throw e;t(r)}))},a.prototype._addSource=function(){return this._map.getSource(this._sourceId)||this._map.addSource(this._sourceId,{type:"geojson",data:{type:"Feature",geometry:{type:this._isMultiArray()?"MultiPoint":"Point",coordinates:this._coordinates},properties:{floor:this._floor,buildingId:this._buildingId}}}),this},a.prototype._addLayer=function(){return this._map.getLayer(this._layerId)||this._map.addLayer({id:this._layerId,type:"symbol",source:this._sourceId,layout:{"icon-image":this._imageName,"icon-size":this._imageScale}}),this},a.prototype._isMultiArray=function(){for(var t=0,e=this._coordinates;t<e.length;t++)if(e[t]instanceof Array)return!0;return!1},n=a;function a(t){var e=o.call(this)||this;t&&e.addTo(t);var r=Math.floor(1e3*Math.random());t="mapxus_marker";return e._sourceId=t+"_source_"+r,e._layerId=t+"_layer_"+r,e._imageName="poi-01",e._imageUrl="https://map-service.mapxus.co.jp/bssww/assets/origin-marker.png",e._imageScale=.65,e}e.Marker=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.RouteService=void 0;var i=r(7),n=r(87);o.prototype.search=function(t,e,r,i,o,a,s,u,l){if(void 0===s&&(s=n.WayFindingVehicleType.FOOT),!t.length||!e.length)throw new Error("Coord cannot be empty.");if(2!==t.length||2!==e.length)throw new Error("Coord cannot less than 2.");return s=[this._api+"?fromLon="+t[0],"fromLat="+t[1],"toLon="+e[0],"toLat="+e[1],"fromBuilding="+o,"toBuilding="+a,"fromFloor="+r,"toFloor="+i,"vehicle="+s],u&&s.push("locale="+u),l&&s.push("toDoor="+l),this._request.get(s.join("&"))},r=o;function o(){this._api="/api/v1/route",this._request=new i.Request}e.RouteService=r},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.WayFindingVehicleType=void 0,(e=e.WayFindingVehicleType||(e.WayFindingVehicleType={})).FOOT="foot",e.WHEELCHAIR="wheelchair",e.ESCALATOR="escalator"},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version=void 0,e.version="4.1.2-jp"}],t.c=r,t.d=function(e,r,i){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:i})},t.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(t.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)t.d(i,n,function(t){return e[t]}.bind(null,n));return i},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},t.p="",t(t.s=18);function t(i){if(r[i])return r[i].exports;var n=r[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var e,r}));