@emuanalytics/flow-rdf-core 1.1.2 → 1.1.4

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 (45) hide show
  1. package/dist/bundle/flow-rdf-core.umd.js +15 -0
  2. package/dist/bundle/flow-rdf-core.umd.js.map +1 -0
  3. package/dist/cjs/lib/flow-core-expression/flow-core-expression.d.ts.map +1 -1
  4. package/dist/cjs/lib/flow-core-expression/flow-core-expression.js.map +1 -1
  5. package/dist/cjs/lib/flow-core-expression/flow-core-parser.js.map +1 -1
  6. package/dist/cjs/lib/utils/type-checks.d.ts +1 -1
  7. package/dist/cjs/lib/utils/type-checks.d.ts.map +1 -1
  8. package/dist/cjs/lib/utils/type-checks.js +3 -2
  9. package/dist/cjs/lib/utils/type-checks.js.map +1 -1
  10. package/dist/cjs/umd.d.ts +4 -0
  11. package/dist/cjs/umd.d.ts.map +1 -0
  12. package/dist/cjs/umd.js +33 -0
  13. package/dist/cjs/umd.js.map +1 -0
  14. package/dist/esm/lib/flow-core-expression/flow-core-expression.d.ts.map +1 -1
  15. package/dist/esm/lib/flow-core-expression/flow-core-expression.js.map +1 -1
  16. package/dist/esm/lib/flow-core-expression/flow-core-parser.js.map +1 -1
  17. package/dist/esm/lib/utils/type-checks.d.ts +1 -1
  18. package/dist/esm/lib/utils/type-checks.d.ts.map +1 -1
  19. package/dist/esm/lib/utils/type-checks.js +2 -1
  20. package/dist/esm/lib/utils/type-checks.js.map +1 -1
  21. package/dist/esm/umd.d.ts +4 -0
  22. package/dist/esm/umd.d.ts.map +1 -0
  23. package/dist/esm/umd.js +4 -0
  24. package/dist/esm/umd.js.map +1 -0
  25. package/dist/esm5/lib/flow-core-expression/flow-core-expression.d.ts.map +1 -1
  26. package/dist/esm5/lib/flow-core-expression/flow-core-expression.js.map +1 -1
  27. package/dist/esm5/lib/flow-core-expression/flow-core-parser.js.map +1 -1
  28. package/dist/esm5/lib/utils/type-checks.d.ts +1 -1
  29. package/dist/esm5/lib/utils/type-checks.d.ts.map +1 -1
  30. package/dist/esm5/lib/utils/type-checks.js +2 -1
  31. package/dist/esm5/lib/utils/type-checks.js.map +1 -1
  32. package/dist/esm5/umd.d.ts +4 -0
  33. package/dist/esm5/umd.d.ts.map +1 -0
  34. package/dist/esm5/umd.js +4 -0
  35. package/dist/esm5/umd.js.map +1 -0
  36. package/dist/types/lib/flow-core-expression/flow-core-expression.d.ts.map +1 -1
  37. package/dist/types/lib/utils/type-checks.d.ts +1 -1
  38. package/dist/types/lib/utils/type-checks.d.ts.map +1 -1
  39. package/dist/types/umd.d.ts +4 -0
  40. package/dist/types/umd.d.ts.map +1 -0
  41. package/package.json +21 -5
  42. package/dist/bundle/flow-rdf-core.js +0 -42592
  43. package/dist/bundle/flow-rdf-core.js.map +0 -7
  44. package/dist/bundle/flow-rdf-core.min.js +0 -635
  45. package/dist/bundle/flow-rdf-core.min.js.map +0 -7
@@ -0,0 +1,15 @@
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).Flow={})}(this,(function(e){"use strict";var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},t(e,r)};function r(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}var i=function(){return i=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},i.apply(this,arguments)};function n(e,t,r,i){return new(r||(r=Promise))((function(n,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))}function o(e,t){var r,i,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(n=2&o[0]?i.return:o[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,o[1])).done)return n;switch(i=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){a.label=o[1];break}if(6===o[0]&&a.label<n[1]){a.label=n[1],n=o;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(o);break}n[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{r=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function a(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a}function l(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}var c={$version:8,$root:{version:{required:!0,type:"enum",values:[8],doc:"Style specification version number. Must be 8.",example:8},name:{type:"string",doc:"A human-readable name for the style.",example:"Bright"},metadata:{type:"*",doc:"Arbitrary properties useful to track with the stylesheet, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},center:{type:"array",value:"number",doc:"Default map center in longitude and latitude. The style center will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:[-73.9749,40.7736]},zoom:{type:"number",doc:"Default zoom level. The style zoom will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:12.5},bearing:{type:"number",default:0,period:360,units:"degrees",doc:'Default bearing, in degrees. The bearing is the compass direction that is "up"; for example, a bearing of 90° orients the map so that east is up. This value will be used only if the map has not been positioned by other means (e.g. map options or user interaction).',example:29},pitch:{type:"number",default:0,units:"degrees",doc:"Default pitch, in degrees. Zero is perpendicular to the surface, for a look straight down at the map, while a greater value like 60 looks ahead towards the horizon. The style pitch will be used only if the map has not been positioned by other means (e.g. map options or user interaction).",example:50},light:{type:"light",doc:"The global light source.",example:{anchor:"viewport",color:"white",intensity:.4}},terrain:{type:"terrain",doc:"The terrain configuration.",example:{source:"raster-dem-source",exaggeration:.5,elevationOffset:100}},sources:{required:!0,type:"sources",doc:"Data source specifications.",example:{"maplibre-demotiles":{type:"vector",url:"https://demotiles.maplibre.org/tiles/tiles.json"}}},sprite:{type:"string",doc:"A base URL for retrieving the sprite image and metadata. The extensions `.png`, `.json` and scale factor `@2x.png` will be automatically appended. This property is required if any layer uses the `background-pattern`, `fill-pattern`, `line-pattern`, `fill-extrusion-pattern`, or `icon-image` properties. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"mapbox://sprites/mapbox/bright-v8"},glyphs:{type:"string",doc:"A URL template for loading signed-distance-field glyph sets in PBF format. The URL must include `{fontstack}` and `{range}` tokens. This property is required if any layer uses the `text-field` layout property. The URL must be absolute, containing the [scheme, authority and path components](https://en.wikipedia.org/wiki/URL#Syntax).",example:"https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf"},transition:{type:"transition",doc:"A global transition definition to use as a default across properties, to be used for timing transitions between one value and the next when no property-specific transition is set. Collision-based symbol fading is controlled independently of the style's `transition` property.",example:{duration:300,delay:0}},layers:{required:!0,type:"array",value:"layer",doc:"Layers will be drawn in the order of this array.",example:[{id:"water",source:"mapbox-streets","source-layer":"water",type:"fill",paint:{"fill-color":"#00ffff"}}]}},sources:{"*":{type:"source",doc:"Specification of a data source. For vector and raster sources, either TileJSON or a URL to a TileJSON must be provided. For image and video sources, a URL must be provided. For GeoJSON sources, a URL or inline GeoJSON must be provided."}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{doc:"A vector tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:` and `https:`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by MapLibre GL."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`. If specified as a string for a vector tile source, the same property is used across all its source layers."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster:{type:{required:!0,type:"enum",values:{raster:{doc:"A raster tile source."}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:` and `https:`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by MapLibre GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},scheme:{type:"enum",values:{xyz:{doc:"Slippy map tilenames scheme."},tms:{doc:"OSGeo spec scheme."}},default:"xyz",doc:"Influences the y direction of the tile coordinates. The global-mercator (aka Spherical Mercator) profile is assumed."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{doc:"A RGB-encoded raster DEM source"}},doc:"The type of the source."},url:{type:"string",doc:"A URL to a TileJSON resource. Supported protocols are `http:` and `https:`."},tiles:{type:"array",value:"string",doc:"An array of one or more tile source URLs, as in the TileJSON spec."},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129],doc:"An array containing the longitude and latitude of the southwest and northeast corners of the source's bounding box in the following order: `[sw.lng, sw.lat, ne.lng, ne.lat]`. When this property is included in a source, no tiles outside of the given bounds are requested by MapLibre GL."},minzoom:{type:"number",default:0,doc:"Minimum zoom level for which tiles are available, as in the TileJSON spec."},maxzoom:{type:"number",default:22,doc:"Maximum zoom level for which tiles are available, as in the TileJSON spec. Data from tiles at the maxzoom are used when displaying the map at higher zoom levels."},tileSize:{type:"number",default:512,units:"pixels",doc:"The minimum visual size to display tiles for this layer. Only configurable for raster layers."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},encoding:{type:"enum",values:{terrarium:{doc:"Terrarium format PNG tiles. See https://aws.amazon.com/es/public-datasets/terrain/ for more info."},mapbox:{doc:"Mapbox Terrain RGB tiles. See https://www.mapbox.com/help/access-elevation-data/#mapbox-terrain-rgb for more info."}},default:"mapbox",doc:"The encoding used by this source. Mapbox Terrain RGB is used by default"},volatile:{type:"boolean",default:!1,doc:"A setting to determine whether a source's tiles are cached locally.","sdk-support":{"basic functionality":{android:"9.3.0",ios:"5.10.0"}}},"*":{type:"*",doc:"Other keys to configure the data source."}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{doc:"A GeoJSON data source."}},doc:"The data type of the GeoJSON source."},data:{type:"*",doc:"A URL to a GeoJSON file, or inline GeoJSON."},maxzoom:{type:"number",default:18,doc:"Maximum zoom level at which to create vector tiles (higher means greater detail at high zoom levels)."},attribution:{type:"string",doc:"Contains an attribution to be displayed when the map is shown to a user."},buffer:{type:"number",default:128,maximum:512,minimum:0,doc:"Size of the tile buffer on each side. A value of 0 produces no buffer. A value of 512 produces a buffer as wide as the tile itself. Larger values produce fewer rendering artifacts near tile edges and slower performance."},filter:{type:"*",doc:"An expression for filtering features prior to processing them for rendering."},tolerance:{type:"number",default:.375,doc:"Douglas-Peucker simplification tolerance (higher means simpler geometries and faster performance)."},cluster:{type:"boolean",default:!1,doc:"If the data is a collection of point features, setting this to true clusters the points by radius into groups. Cluster groups become new `Point` features in the source with additional properties:\n * `cluster` Is `true` if the point is a cluster \n * `cluster_id` A unqiue id for the cluster to be used in conjunction with the [cluster inspection methods](https://www.mapbox.com/mapbox-gl-js/api/#geojsonsource#getclusterexpansionzoom)\n * `point_count` Number of original points grouped into this cluster\n * `point_count_abbreviated` An abbreviated point count"},clusterRadius:{type:"number",default:50,minimum:0,doc:"Radius of each cluster if clustering is enabled. A value of 512 indicates a radius equal to the width of a tile."},clusterMaxZoom:{type:"number",doc:"Max zoom on which to cluster points if clustering is enabled. Defaults to one zoom less than maxzoom (so that last zoom features are not clustered). Clusters are re-evaluated at integer zoom levels so setting clusterMaxZoom to 14 means the clusters will be displayed until z15."},clusterMinPoints:{type:"number",doc:"Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`."},clusterProperties:{type:"*",doc:'An object defining custom properties on the generated clusters if clustering is enabled, aggregating values from clustered points. Has the form `{"property_name": [operator, map_expression]}`. `operator` is any expression function that accepts at least 2 operands (e.g. `"+"` or `"max"`) — it accumulates the property value from clusters/points the cluster contains; `map_expression` produces the value of a single point.\n\nExample: `{"sum": ["+", ["get", "scalerank"]]}`.\n\nFor more advanced use cases, in place of `operator`, you can use a custom reduce expression that references a special `["accumulated"]` value, e.g.:\n`{"sum": [["+", ["accumulated"], ["get", "sum"]], ["get", "scalerank"]]}`'},lineMetrics:{type:"boolean",default:!1,doc:"Whether to calculate line distance metrics. This is required for line layers that specify `line-gradient` values."},generateId:{type:"boolean",default:!1,doc:"Whether to generate ids for the geojson features. When enabled, the `feature.id` property will be auto assigned based on its index in the `features` array, over-writing any previous values."},promoteId:{type:"promoteId",doc:"A property to use as a feature id (for feature state). Either a property name, or an object of the form `{<sourceLayer>: <propertyName>}`."}},source_video:{type:{required:!0,type:"enum",values:{video:{doc:"A video data source."}},doc:"The data type of the video source."},urls:{required:!0,type:"array",value:"string",doc:"URLs to video content in order of preferred format."},coordinates:{required:!0,doc:"Corners of video specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},source_image:{type:{required:!0,type:"enum",values:{image:{doc:"An image data source."}},doc:"The data type of the image source."},url:{required:!0,type:"string",doc:"URL that points to an image."},coordinates:{required:!0,doc:"Corners of image specified in longitude, latitude pairs.",type:"array",length:4,value:{type:"array",length:2,value:"number",doc:"A single longitude, latitude pair."}}},layer:{id:{type:"string",doc:"Unique layer name.",required:!0},type:{type:"enum",values:{fill:{doc:"A filled polygon with an optional stroked border.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},line:{doc:"A stroked line.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},symbol:{doc:"An icon or a text label.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},circle:{doc:"A filled circle.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},heatmap:{doc:"A heatmap.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"fill-extrusion":{doc:"An extruded (3D) polygon.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},raster:{doc:"Raster map textures such as satellite imagery.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}},hillshade:{doc:"Client-side hillshading visualization based on DEM data. Currently, the implementation only supports Mapbox Terrain RGB and Mapzen Terrarium tiles.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},background:{doc:"The background color or pattern of the map.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}}}},doc:"Rendering type of this layer.",required:!0},metadata:{type:"*",doc:"Arbitrary properties useful to track with the layer, but do not influence rendering. Properties should be prefixed to avoid collisions, like 'mapbox:'."},source:{type:"string",doc:"Name of a source description to be used for this layer. Required for all layer types except `background`."},"source-layer":{type:"string",doc:"Layer to use from a vector tile source. Required for vector tile sources; prohibited for all other source types, including GeoJSON sources."},minzoom:{type:"number",minimum:0,maximum:24,doc:"The minimum zoom level for the layer. At zoom levels less than the minzoom, the layer will be hidden."},maxzoom:{type:"number",minimum:0,maximum:24,doc:"The maximum zoom level for the layer. At zoom levels equal to or greater than the maxzoom, the layer will be hidden."},filter:{type:"filter",doc:"A expression specifying conditions on source features. Only features that match the filter are displayed. Zoom expressions in filters are only evaluated at integer zoom levels. The `feature-state` expression is not supported in filter expressions."},layout:{type:"layout",doc:"Layout properties for the layer."},paint:{type:"paint",doc:"Default paint properties for this layer."}},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:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"},"data-driven styling":{js:"1.2.0",android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},"property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{doc:"A cap with a squared-off end which is drawn to the exact endpoint of the line."},round:{doc:"A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},square:{doc:"A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."}},default:"butt",doc:"The display of line endings.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{doc:"A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width."},round:{doc:"A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line."},miter:{doc:"A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet."}},default:"miter",doc:"The display of lines when joining.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,doc:"Used to automatically convert miter joins to bevel joins for sharp angles.",requires:[{"line-join":"miter"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,doc:"Used to automatically convert round joins to miter joins for shallow angles.",requires:[{"line-join":"round"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key.","sdk-support":{"basic functionality":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"},"data-driven styling":{js:"1.2.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{doc:"The label is placed at the point where the geometry is located."},line:{doc:"The label is placed along the line of the geometry. Can only be used on `LineString` and `Polygon` geometries."},"line-center":{doc:"The label is placed at the center of the line of the geometry. Can only be used on `LineString` and `Polygon` geometries. Note that a single feature in a vector tile may contain multiple line geometries."}},default:"point",doc:"Label placement relative to its geometry.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`line-center` value":{js:"0.47.0",android:"6.4.0",ios:"4.3.0",macos:"0.10.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",doc:"Distance between two symbol anchors.",requires:[{"symbol-placement":"line"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,doc:"If true, the symbols will not cross tile edges to avoid mutual collisions. Recommended in layers that don't have enough padding in the vector tile to prevent collisions, or if it is a point symbol layer placed after a line symbol layer. When using a client that supports global collision detection, like MapLibre GL JS version 0.42.0 or greater, enabling this property is not needed to prevent clipped labels at tile boundaries.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",doc:"Sorts features in ascending order based on this value. Features with lower sort keys are drawn and placed first. When `icon-allow-overlap` or `text-allow-overlap` is `false`, features with a lower sort key will have priority during placement. When `icon-allow-overlap` or `text-allow-overlap` is set to `true`, features with a higher sort key will overlap over features with a lower sort key.","sdk-support":{"basic functionality":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"},"data-driven styling":{js:"0.53.0",android:"7.4.0",ios:"4.11.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},"viewport-y":{doc:"Sorts symbols by their y-position relative to the viewport if `icon-allow-overlap` or `text-allow-overlap` is set to `true` or `icon-ignore-placement` or `text-ignore-placement` is `false`."},source:{doc:"Sorts symbols by `symbol-sort-key` if set. Otherwise, no sorting is applied; symbols are rendered in the same order as the source data."}},default:"auto",doc:"Determines whether overlapping symbols in the same layer are rendered in the order that they appear in the data source or by their y-position relative to the viewport. To control the order and prioritization of symbols otherwise, use `symbol-sort-key`.","sdk-support":{"basic functionality":{js:"0.49.0",android:"6.6.0",ios:"4.5.0",macos:"0.12.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,doc:"If true, the icon will be visible even if it collides with other previously drawn symbols.",requires:["icon-image",{"!":"icon-overlap"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{doc:"The icon will be hidden if it collides with any other previously drawn symbol."},always:{doc:"The icon will be visible even if it collides with any other previously drawn symbol."},cooperative:{doc:"If the icon collides with another previously drawn symbol, the overlap mode for that symbol is checked. If the previous symbol was placed using `never` overlap mode, the new icon is hidden. If the previous symbol was placed using `always` or `cooperative` overlap mode, the new icon is visible."}},doc:"Allows for control over whether to show an icon when it overlaps other symbols on the map. If `icon-overlap` is not set, `icon-allow-overlap` is used instead.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"2.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the icon.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,doc:"If true, text will display without their corresponding icons when the icon collides with other symbols and the text does not.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns icons east-west. When `symbol-placement` is set to `line` or `line-center`, aligns icon x-axes with the line."},viewport:{doc:"Produces icons whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",doc:"Scales the original size of the icon by the provided factor. The new pixel size of the image will be the original pixel size multiplied by `icon-size`. 1 is the original size; 3 triples the size of the image.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{doc:"The icon is displayed at its intrinsic aspect ratio."},width:{doc:"The icon is scaled in the x-dimension to fit the width of the text."},height:{doc:"The icon is scaled in the y-dimension to fit the height of the text."},both:{doc:"The icon is scaled in both x- and y-dimensions."}},default:"none",doc:"Scales the icon to fit around the associated text.",requires:["icon-image","text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"stretchable icons":{js:"1.6.0",android:"9.2.0",ios:"5.8.0",macos:"0.15.0"}},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",doc:"Size of the additional area added to dimensions determined by `icon-text-fit`, in clockwise order: top, right, bottom, left.",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",doc:"Name of image in sprite to use for drawing an image background.",tokens:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the icon clockwise.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",doc:"Size of additional area round the icon bounding box used for detecting symbol collisions. Values are declared using CSS margin shorthand syntax: a single value applies to all four sides; two values apply to [top/bottom, left/right]; three values apply to [top, left/right, bottom]; four values apply to [top, right, bottom, left]. For backwards compatibility, a single bare number is accepted, and treated the same as a one-element array - padding applied to all sides.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"2.2.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,doc:"If true, the icon may be flipped to prevent it from being rendered upside-down.",requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],doc:"Offset distance of icon from its anchor. Positive values indicate right and down, while negative values indicate left and up. Each component is multiplied by the value of `icon-size` to obtain the final offset in pixels. When combined with `icon-rotate` the offset will be as if the rotated direction was up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{doc:"The center of the icon is placed closest to the anchor."},left:{doc:"The left side of the icon is placed closest to the anchor."},right:{doc:"The right side of the icon is placed closest to the anchor."},top:{doc:"The top of the icon is placed closest to the anchor."},bottom:{doc:"The bottom of the icon is placed closest to the anchor."},"top-left":{doc:"The top left corner of the icon is placed closest to the anchor."},"top-right":{doc:"The top right corner of the icon is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the icon is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the icon is placed closest to the anchor."}},default:"center",doc:"Part of the icon placed closest to the anchor.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{doc:"The icon is aligned to the plane of the map."},viewport:{doc:"The icon is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `icon-rotation-alignment`."}},default:"auto",doc:"Orientation of icon when map is pitched.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{doc:"The text is aligned to the plane of the map."},viewport:{doc:"The text is aligned to the plane of the viewport."},auto:{doc:"Automatically matches the value of `text-rotation-alignment`."}},default:"auto",doc:"Orientation of text when map is pitched.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{doc:"When `symbol-placement` is set to `point`, aligns text east-west. When `symbol-placement` is set to `line` or `line-center`, aligns text x-axes with the line."},viewport:{doc:"Produces glyphs whose x-axes are aligned with the x-axis of the viewport, regardless of the value of `symbol-placement`."},"viewport-glyph":{doc:"When `symbol-placement` is set to `point`, aligns text to the x-axis of the viewport. When `symbol-placement` is set to `line` or `line-center`, aligns glyphs to the x-axis of the viewport and places them along the line."},auto:{doc:"When `symbol-placement` is set to `point`, this is equivalent to `viewport`. When `symbol-placement` is set to `line` or `line-center`, this is equivalent to `map`."}},default:"auto",doc:"In combination with `symbol-placement`, determines the rotation behavior of the individual glyphs forming the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"`auto` value":{js:"0.25.0",android:"4.2.0",ios:"3.4.0",macos:"0.3.0"},"`viewport-glyph` value":{js:"2.1.8"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,doc:"Value to use for a text label. If a plain `string` is provided, it will be treated as a `formatted` with default/inherited formatting options.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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"],doc:"Font stack to use for displaying text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",doc:"Font size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",doc:"The maximum line width for text wrapping.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",doc:"Text leading value for multi-line text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",doc:"Text tracking amount.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.40.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{doc:"The text is aligned towards the anchor position."},left:{doc:"The text is aligned to the left."},center:{doc:"The text is centered."},right:{doc:"The text is aligned to the right."}},default:"center",doc:"Text justification options.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"},auto:{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,doc:"Radial offset of text, in the direction of the symbol's anchor. Useful in combination with `text-variable-anchor`, which defaults to using the two-dimensional `text-offset` if present.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"},"data-driven styling":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},requires:["text-field",{"symbol-placement":["point"]}],doc:"To increase the chance of placing high-priority labels on the map, you can provide an array of `text-anchor` locations: the renderer will attempt to place the label at each location, in order, before moving onto the next label. Use `text-justify: auto` to choose justification based on anchor position. To apply an offset, use the `text-radial-offset` or the two-dimensional `text-offset`.","sdk-support":{"basic functionality":{js:"0.54.0",android:"7.4.0",ios:"4.10.0",macos:"0.14.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-anchor":{type:"enum",values:{center:{doc:"The center of the text is placed closest to the anchor."},left:{doc:"The left side of the text is placed closest to the anchor."},right:{doc:"The right side of the text is placed closest to the anchor."},top:{doc:"The top of the text is placed closest to the anchor."},bottom:{doc:"The bottom of the text is placed closest to the anchor."},"top-left":{doc:"The top left corner of the text is placed closest to the anchor."},"top-right":{doc:"The top right corner of the text is placed closest to the anchor."},"bottom-left":{doc:"The bottom left corner of the text is placed closest to the anchor."},"bottom-right":{doc:"The bottom right corner of the text is placed closest to the anchor."}},default:"center",doc:"Part of the text placed closest to the anchor.",requires:["text-field",{"!":"text-variable-anchor"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",doc:"Maximum angle change between adjacent characters.",requires:["text-field",{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{doc:"If a text's language supports horizontal writing mode, symbols with point placement would be laid out horizontally."},vertical:{doc:"If a text's language supports vertical writing mode, symbols with point placement would be laid out vertically."}},doc:"The property allows control over a symbol's orientation. Note that the property values act as a hint, so that a symbol whose language doesn’t support the provided orientation will be laid out in its natural orientation. Example: English point symbol will be rendered horizontally even if array value contains single 'vertical' enum value. The order of elements in an array define priority order for the placement of an orientation variant.",requires:["text-field",{"symbol-placement":["point"]}],"sdk-support":{"basic functionality":{js:"1.3.0",android:"8.3.0",ios:"5.3.0",macos:"0.15.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",doc:"Rotates the text clockwise.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",doc:"Size of the additional area around the text bounding box used for detecting symbol collisions.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,doc:"If true, the text may be flipped vertically to prevent it from being rendered upside-down.",requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{doc:"The text is not altered."},uppercase:{doc:"Forces all letters to be displayed in uppercase."},lowercase:{doc:"Forces all letters to be displayed in lowercase."}},default:"none",doc:"Specifies how to capitalize text, similar to the CSS `text-transform` property.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",doc:"Offset distance of text from its anchor. Positive values indicate right and down, while negative values indicate left and up. If used with text-variable-anchor, input values will be taken as absolute values. Offsets along the x- and y-axis will be applied automatically based on the anchor position.",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.35.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,doc:"If true, the text will be visible even if it collides with other previously drawn symbols.",requires:["text-field",{"!":"text-overlap"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{doc:"The text will be hidden if it collides with any other previously drawn symbol."},always:{doc:"The text will be visible even if it collides with any other previously drawn symbol."},cooperative:{doc:"If the text collides with another previously drawn symbol, the overlap mode for that symbol is checked. If the previous symbol was placed using `never` overlap mode, the new text is hidden. If the previous symbol was placed using `always` or `cooperative` overlap mode, the new text is visible."}},doc:"Allows for control over whether to show symbol text when it overlaps other symbols on the map. If `text-overlap` is not set, `text-allow-overlap` is used instead",requires:["text-field"],"sdk-support":{"basic functionality":{js:"2.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,doc:"If true, other symbols can be visible even if they collide with the text.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,doc:"If true, icons will display without their corresponding text when the text collides with other symbols and the icon does not.",requires:["text-field","icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},"property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{doc:"The layer is shown."},none:{doc:"The layer is not shown."}},default:"visible",doc:"Whether this layer is displayed.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},"property-type":"constant"}},filter:{type:"array",value:"*",doc:"A filter selects specific features from a layer."},filter_operator:{type:"enum",values:{"==":{doc:'`["==", key, value]` equality: `feature[key] = value`'},"!=":{doc:'`["!=", key, value]` inequality: `feature[key] ≠ value`'},">":{doc:'`[">", key, value]` greater than: `feature[key] > value`'},">=":{doc:'`[">=", key, value]` greater than or equal: `feature[key] ≥ value`'},"<":{doc:'`["<", key, value]` less than: `feature[key] < value`'},"<=":{doc:'`["<=", key, value]` less than or equal: `feature[key] ≤ value`'},in:{doc:'`["in", key, v0, ..., vn]` set inclusion: `feature[key] ∈ {v0, ..., vn}`'},"!in":{doc:'`["!in", key, v0, ..., vn]` set exclusion: `feature[key] ∉ {v0, ..., vn}`'},all:{doc:'`["all", f0, ..., fn]` logical `AND`: `f0 ∧ ... ∧ fn`'},any:{doc:'`["any", f0, ..., fn]` logical `OR`: `f0 ∨ ... ∨ fn`'},none:{doc:'`["none", f0, ..., fn]` logical `NOR`: `¬f0 ∧ ... ∧ ¬fn`'},has:{doc:'`["has", key]` `feature[key]` exists'},"!has":{doc:'`["!has", key]` `feature[key]` does not exist'},within:{doc:'`["within", object]` feature geometry is within object geometry'}},doc:"The filter operator."},geometry_type:{type:"enum",values:{Point:{doc:"Filter to point geometries."},LineString:{doc:"Filter to line geometries."},Polygon:{doc:"Filter to polygon geometries."}},doc:"The geometry type for the filter to select."},function:{expression:{type:"expression",doc:"An expression."},stops:{type:"array",doc:"An array of stops.",value:"function_stop"},base:{type:"number",default:1,minimum:0,doc:"The exponential base of the interpolation curve. It controls the rate at which the result increases. Higher values make the result increase more towards the high end of the range. With `1` the stops are interpolated linearly."},property:{type:"string",doc:"The name of a feature property to use as the function input.",default:"$zoom"},type:{type:"enum",values:{identity:{doc:"Return the input value as the output value."},exponential:{doc:"Generate an output by interpolating between stops just less than and just greater than the function input."},interval:{doc:"Return the output value of the stop just less than the function input."},categorical:{doc:"Return the output value of the stop equal to the function input."}},doc:"The interpolation strategy to use in function evaluation.",default:"exponential"},colorSpace:{type:"enum",values:{rgb:{doc:"Use the RGB color space to interpolate color values"},lab:{doc:"Use the LAB color space to interpolate color values."},hcl:{doc:"Use the HCL color space to interpolate color values, interpolating the Hue, Chroma, and Luminance channels individually."}},doc:"The color space in which colors interpolated. Interpolating colors in perceptual color spaces like LAB and HCL tend to produce color ramps that look more consistent and produce colors that can be differentiated more easily than those interpolated in RGB space.",default:"rgb"},default:{type:"*",required:!1,doc:"A value to serve as a fallback function result when a value isn't otherwise available. It is used in the following circumstances:\n* In categorical functions, when the feature value does not match any of the stop domain values.\n* In property and zoom-and-property functions, when a feature does not contain a value for the specified property.\n* In identity functions, when the feature value is not valid for the style property (for example, if the function is being used for a `circle-color` property but the feature property value is not a string or not a valid color).\n* In interval or exponential property and zoom-and-property functions, when the feature value is not numeric.\nIf no default is provided, the style property's default is used in these circumstances."}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2,doc:"Zoom level and value pair."},expression:{type:"array",value:"*",minimum:1,doc:"An expression defines a function that can be used for data-driven style properties or feature filters."},expression_name:{doc:"",type:"enum",values:{let:{doc:'Binds expressions to named variables, which can then be referenced in the result expression using ["var", "variable_name"].',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},var:{doc:'References variable bound using "let".',group:"Variable binding","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},literal:{doc:"Provides a literal array or object value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},array:{doc:"Asserts that the input is an array (optionally with a specific item type and length). If, when the input expression is evaluated, it is not of the asserted type, then this assertion will cause the whole expression to be aborted.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},at:{doc:"Retrieves an item from an array.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},in:{doc:"Determines whether an item exists in an array or a substring exists in a string.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.6.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"index-of":{doc:"Returns the first position at which an item can be found in an array or a substring can be found in a string, or `-1` if the input cannot be found. Accepts an optional index from where to begin the search.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},slice:{doc:"Returns an item from an array or a substring from a string from a specified start index, or between a start index and an end index if set. The return value is inclusive of the start index but not of the end index.",group:"Lookup","sdk-support":{"basic functionality":{js:"1.10.0"}}},case:{doc:"Selects the first output whose corresponding test condition evaluates to true, or the fallback value otherwise.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},match:{doc:'Selects the output whose label value matches the input value, or the fallback value if no match is found. The input can be any expression (e.g. `["get", "building_type"]`). Each label must be either:\n - a single literal value; or\n - an array of literal values, whose values must be all strings or all numbers (e.g. `[100, 101]` or `["c", "b"]`). The input matches if any of the values in the array matches, similar to the `"in"` operator.\nEach label must be unique. If the input type does not match the type of the labels, the result will be the fallback value.',group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},coalesce:{doc:"Evaluates each expression in turn until the first non-null value is obtained, and returns that value.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},step:{doc:'Produces discrete, stepped results by evaluating a piecewise-constant function defined by pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. Returns the output value of the stop just less than the input, or the first output if the input is less than the first stop.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},interpolate:{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). The `input` may be any numeric expression (e.g., `["get", "population"]`). Stop inputs must be numeric literals in strictly ascending order. The output type must be `number`, `array<number>`, or `color`.\n\nInterpolation types:\n- `["linear"]`: Interpolates linearly between the pair of stops just less than and just greater than the input.\n- `["exponential", base]`: Interpolates exponentially between the stops just less than and just greater than the input. `base` controls the rate at which the output increases: higher values make the output increase more towards the high end of the range. With values close to 1 the output increases linearly.\n- `["cubic-bezier", x1, y1, x2, y2]`: Interpolates using the cubic bezier curve defined by the given control points.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"interpolate-hcl":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the Hue-Chroma-Luminance color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},"interpolate-lab":{doc:'Produces continuous, smooth results by interpolating between pairs of input and output values ("stops"). Works like `interpolate`, but the output type must be `color`, and the interpolation is performed in the CIELAB color space.',group:"Ramps, scales, curves","sdk-support":{"basic functionality":{js:"0.49.0"}}},ln2:{doc:"Returns mathematical constant ln(2).",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},pi:{doc:"Returns the mathematical constant pi.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},e:{doc:"Returns the mathematical constant e.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},typeof:{doc:"Returns a string describing the type of the given value.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},string:{doc:"Asserts that the input value is a string. If multiple values are provided, each one is evaluated in order until a string is obtained. If none of the inputs are strings, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},number:{doc:"Asserts that the input value is a number. If multiple values are provided, each one is evaluated in order until a number is obtained. If none of the inputs are numbers, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},boolean:{doc:"Asserts that the input value is a boolean. If multiple values are provided, each one is evaluated in order until a boolean is obtained. If none of the inputs are booleans, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},object:{doc:"Asserts that the input value is an object. If multiple values are provided, each one is evaluated in order until an object is obtained. If none of the inputs are objects, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},collator:{doc:"Returns a `collator` for use in locale-dependent comparison operations. The `case-sensitive` and `diacritic-sensitive` options default to `false`. The `locale` argument specifies the IETF language tag of the locale to use. If none is provided, the default locale is used. If the requested locale is not available, the `collator` will use a system-defined fallback locale. Use `resolved-locale` to test the results of locale fallback behavior.",group:"Types","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},format:{doc:'Returns a `formatted` string for displaying mixed-format text in the `text-field` property. The input may contain a string literal or expression, including an [`\'image\'`](#types-image) expression. Strings may be followed by a style override object that supports the following properties:\n- `"text-font"`: Overrides the font stack specified by the root layout property.\n- `"text-color"`: Overrides the color specified by the root paint property.\n- `"font-scale"`: Applies a scaling factor on `text-size` as specified by the root layout property.',group:"Types","sdk-support":{"basic functionality":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-font":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"font-scale":{js:"0.48.0",android:"6.7.0",ios:"4.6.0",macos:"0.12.0"},"text-color":{js:"1.3.0",android:"7.3.0",ios:"4.10.0",macos:"0.14.0"},image:{js:"1.6.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},image:{doc:"Returns an `image` type for use in `icon-image`, `*-pattern` entries and as a section in the `format` expression. If set, the `image` argument will check that the requested image exists in the style and will return either the resolved image name or `null`, depending on whether or not the image is currently in the style. This validation process is synchronous and requires the image to have been added to the style before requesting it in the `image` argument.",group:"Types","sdk-support":{"basic functionality":{js:"1.4.0",android:"8.6.0",ios:"5.7.0",macos:"0.15.0"}}},"number-format":{doc:"Converts the input number into a string representation using the providing formatting rules. If set, the `locale` argument specifies the locale to use, as a BCP 47 language tag. If set, the `currency` argument specifies an ISO 4217 code to use for currency-style formatting. If set, the `min-fraction-digits` and `max-fraction-digits` arguments specify the minimum and maximum number of fractional digits to include.",group:"Types","sdk-support":{"basic functionality":{js:"0.54.0"}}},"to-string":{doc:'Converts the input value to a string. If the input is `null`, the result is `""`. If the input is a boolean, the result is `"true"` or `"false"`. If the input is a number, it is converted to a string as specified by the ["NumberToString" algorithm](https://tc39.github.io/ecma262/#sec-tostring-applied-to-the-number-type) of the ECMAScript Language Specification. If the input is a color, it is converted to a string of the form `"rgba(r,g,b,a)"`, where `r`, `g`, and `b` are numerals ranging from 0 to 255, and `a` ranges from 0 to 1. Otherwise, the input is converted to a string in the format specified by the [`JSON.stringify`](https://tc39.github.io/ecma262/#sec-json.stringify) function of the ECMAScript Language Specification.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-number":{doc:'Converts the input value to a number, if possible. If the input is `null` or `false`, the result is 0. If the input is `true`, the result is 1. If the input is a string, it is converted to a number as specified by the ["ToNumber Applied to the String Type" algorithm](https://tc39.github.io/ecma262/#sec-tonumber-applied-to-the-string-type) of the ECMAScript Language Specification. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.',group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-boolean":{doc:"Converts the input value to a boolean. The result is `false` when then input is an empty string, 0, `false`, `null`, or `NaN`; otherwise it is `true`.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-rgba":{doc:"Returns a four-element array containing the input color's red, green, blue, and alpha components, in that order.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"to-color":{doc:"Converts the input value to a color. If multiple values are provided, each one is evaluated in order until the first successful conversion is obtained. If none of the inputs can be converted, the expression is an error.",group:"Types","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgb:{doc:"Creates a color value from red, green, and blue components, which must range between 0 and 255, and an alpha component of 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},rgba:{doc:"Creates a color value from red, green, blue components, which must range between 0 and 255, and an alpha component which must range between 0 and 1. If any component is out of range, the expression is an error.",group:"Color","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},get:{doc:"Retrieves a property value from the current feature's properties, or from another object if a second argument is provided. Returns null if the requested property is missing.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},has:{doc:"Tests for the presence of an property value in the current feature's properties, or from another object if a second argument is provided.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},length:{doc:"Gets the length of an array or string.",group:"Lookup","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},properties:{doc:'Gets the feature properties object. Note that in some cases, it may be more efficient to use ["get", "property_name"] directly.',group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"feature-state":{doc:"Retrieves a property value from the current feature's state. Returns null if the requested property is not present on the feature's state. A feature's state is not part of the GeoJSON or vector tile data, and must be set programmatically on each feature. When `source.promoteId` is not provided, features are identified by their `id` attribute, which must be an integer or a string that can be cast to an integer. When `source.promoteId` is provided, features are identified by their `promoteId` property, which may be a number, string, or any primitive data type. Note that [\"feature-state\"] can only be used with paint properties that support data-driven styling.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.46.0"}}},"geometry-type":{doc:"Gets the feature's geometry type: `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},id:{doc:"Gets the feature's id, if it has one.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},zoom:{doc:'Gets the current zoom level. Note that in style layout and paint properties, ["zoom"] may only appear as the input to a top-level "step" or "interpolate" expression.',group:"Zoom","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"heatmap-density":{doc:"Gets the kernel density estimation of a pixel in a heatmap layer, which is a relative measure of how many data points are crowded around a particular pixel. Can only be used in the `heatmap-color` property.",group:"Heatmap","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"line-progress":{doc:"Gets the progress along a gradient line. Can only be used in the `line-gradient` property.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.6.0",macos:"0.12.0"}}},accumulated:{doc:"Gets the value of a cluster property accumulated so far. Can only be used in the `clusterProperties` option of a clustered GeoJSON source.",group:"Feature data","sdk-support":{"basic functionality":{js:"0.53.0"}}},"+":{doc:"Returns the sum of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"*":{doc:"Returns the product of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"-":{doc:"For two inputs, returns the result of subtracting the second input from the first. For a single input, returns the result of subtracting it from 0.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"/":{doc:"Returns the result of floating point division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"%":{doc:"Returns the remainder after integer division of the first input by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"^":{doc:"Returns the result of raising the first input to the power specified by the second.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sqrt:{doc:"Returns the square root of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.42.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log10:{doc:"Returns the base-ten logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ln:{doc:"Returns the natural logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},log2:{doc:"Returns the base-two logarithm of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},sin:{doc:"Returns the sine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},cos:{doc:"Returns the cosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},tan:{doc:"Returns the tangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},asin:{doc:"Returns the arcsine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},acos:{doc:"Returns the arccosine of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},atan:{doc:"Returns the arctangent of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},min:{doc:"Returns the minimum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},max:{doc:"Returns the maximum value of the inputs.",group:"Math","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},round:{doc:'Rounds the input to the nearest integer. Halfway values are rounded away from zero. For example, `["round", -1.5]` evaluates to -2.',group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},abs:{doc:"Returns the absolute value of the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},ceil:{doc:"Returns the smallest integer that is greater than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},floor:{doc:"Returns the largest integer that is less than or equal to the input.",group:"Math","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},distance:{doc:"Returns the shortest distance in meters between the evaluated feature and the input geometry. The input value can be a valid GeoJSON of type `Point`, `MultiPoint`, `LineString`, `MultiLineString`, `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Distance values returned may vary in precision due to loss in precision from encoding geometries, particularly below zoom level 13.",group:"Math","sdk-support":{"basic functionality":{android:"9.2.0",ios:"5.9.0",macos:"0.16.0"}}},"==":{doc:"Returns `true` if the input values are equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"!=":{doc:"Returns `true` if the input values are not equal, `false` otherwise. The comparison is strictly typed: values of different runtime types are always considered unequal. Cases where the types are known to be different at parse time are considered invalid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">":{doc:"Returns `true` if the first input is strictly greater than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<":{doc:"Returns `true` if the first input is strictly less than the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},">=":{doc:"Returns `true` if the first input is greater than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},"<=":{doc:"Returns `true` if the first input is less than or equal to the second, `false` otherwise. The arguments are required to be either both strings or both numbers; if during evaluation they are not, expression evaluation produces an error. Cases where this constraint is known not to hold at parse time are considered in valid and will produce a parse error. Accepts an optional `collator` argument to control locale-dependent string comparisons.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},collator:{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}},all:{doc:"Returns `true` if all the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `false`, the result is `false` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},any:{doc:"Returns `true` if any of the inputs are `true`, `false` otherwise. The inputs are evaluated in order, and evaluation is short-circuiting: once an input expression evaluates to `true`, the result is `true` and no further input expressions are evaluated.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"!":{doc:"Logical negation. Returns `true` if the input is `false`, and `false` if the input is `true`.",group:"Decision","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},within:{doc:"Returns `true` if the evaluated feature is fully contained inside a boundary of the input geometry, `false` otherwise. The input value can be a valid GeoJSON of type `Polygon`, `MultiPolygon`, `Feature`, or `FeatureCollection`. Supported features for evaluation:\n- `Point`: Returns `false` if a point is on the boundary or falls outside the boundary.\n- `LineString`: Returns `false` if any part of a line falls outside the boundary, the line intersects the boundary, or a line's endpoint is on the boundary.",group:"Decision","sdk-support":{"basic functionality":{js:"1.9.0",android:"9.1.0",ios:"5.8.0",macos:"0.15.0"}}},"is-supported-script":{doc:"Returns `true` if the input string is expected to render legibly. Returns `false` if the input string contains sections that cannot be rendered without potential loss of meaning (e.g. Indic scripts that require complex text shaping, or right-to-left scripts if the the `mapbox-gl-rtl-text` plugin is not in use in MapLibre GL JS).",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.6.0"}}},upcase:{doc:"Returns the input string converted to uppercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},downcase:{doc:"Returns the input string converted to lowercase. Follows the Unicode Default Case Conversion algorithm and the locale-insensitive case mappings in the Unicode Character Database.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},concat:{doc:"Returns a `string` consisting of the concatenation of the inputs. Each input is converted to a string as if by `to-string`.",group:"String","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}}},"resolved-locale":{doc:"Returns the IETF language tag of the locale being used by the provided `collator`. This can be used to determine the default system locale, or to determine if a requested locale was successfully loaded.",group:"String","sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.2.0",macos:"0.9.0"}}}}},light:{anchor:{type:"enum",default:"viewport",values:{map:{doc:"The position of the light source is aligned to the rotation of the map."},viewport:{doc:"The position of the light source is aligned to the rotation of the viewport."}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]},doc:"Whether extruded geometries are lit relative to the map or viewport.",example:"map","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},doc:"Position of the light source relative to lit (extruded) geometries, in [r radial coordinate, a azimuthal angle, p polar angle] where r indicates the distance from the center of the base of an object to its light, a indicates the position of the light relative to 0° (0° when `light.anchor` is set to `viewport` corresponds to the top of the viewport, or 0° when `light.anchor` is set to `map` corresponds to due north, and degrees proceed clockwise), and p indicates the height of the light (from 0°, directly above, to 180°, directly below).",example:[1.5,90,80],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Color tint for lighting extruded geometries.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0,doc:"Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}}}},terrain:{source:{type:"string",doc:"The source for the terrain data.",required:!0,"sdk-support":{"basic functionality":{js:"2.2.0"}}},exaggeration:{type:"number",minimum:0,doc:"The exaggeration of the terrain - how high it will look.",default:1,"sdk-support":{"basic functionality":{js:"2.2.0"}}},elevationOffset:{type:"number",doc:"The elevation offset.",default:450,"sdk-support":{"basic functionality":{js:"2.2.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,doc:"Whether or not the fill should be antialiased.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity of the entire fill layer. In contrast to the `fill-color`, this value will also affect the 1px stroke around the fill, if the stroke is used.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.21.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",doc:"The color of the filled part of this layer. This color can be specified as `rgba` with an alpha component and the color's opacity will not affect the opacity of the 1px stroke, if it is used.",transition:!0,requires:[{"!":"fill-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",doc:"The outline color of the fill. Matches the value of `fill-color` if unspecified.",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.19.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{doc:"The fill is translated relative to the map."},viewport:{doc:"The fill is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-translate`.",default:"map",requires:["fill-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.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,doc:"The opacity of the entire fill extrusion layer. This is rendered on a per-layer, not per-feature, basis, and data-driven styling is not available.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",doc:"The base color of the extruded fill. The extrusion's surfaces will be shaded differently based on this color in combination with the root `light` settings. If this color is specified as `rgba` with an alpha component, the alpha component will be ignored; use `fill-extrusion-opacity` to set layer opacity.",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{doc:"The fill extrusion is translated relative to the map."},viewport:{doc:"The fill extrusion is translated relative to the viewport."}},doc:"Controls the frame of reference for `fill-extrusion-translate`.",default:"map",requires:["fill-extrusion-translate"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing images on extruded fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude this layer.",transition:!0,"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",doc:"The height with which to extrude the base of this layer. Must be less than or equal to `fill-extrusion-height`.",transition:!0,requires:["fill-extrusion-height"],"sdk-support":{"basic functionality":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"},"data-driven styling":{js:"0.27.0",android:"5.1.0",ios:"3.6.0",macos:"0.5.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,doc:"Whether to apply a vertical gradient to the sides of a fill-extrusion layer. If true, sides will be shaded slightly darker farther down.",transition:!1,"sdk-support":{"basic functionality":{js:"0.50.0",ios:"4.7.0",macos:"0.13.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",doc:"The opacity at which the line will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",doc:"The color with which the line will be drawn.",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.23.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{doc:"The line is translated relative to the map."},viewport:{doc:"The line is translated relative to the viewport."}},doc:"Controls the frame of reference for `line-translate`.",default:"map",requires:["line-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",doc:"Stroke thickness.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,doc:"Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,doc:"The line's offset. For linear features, a positive value offsets the line to the right, relative to the direction of the line, and a negative value to the left. For polygon features, a positive value results in an inset, and a negative value results in an outset.",transition:!0,units:"pixels","sdk-support":{"basic functionality":{js:"0.12.1",android:"3.0.0",ios:"3.1.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"Blur applied to the line, in pixels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",doc:"Specifies the lengths of the alternating dashes and gaps that form the dash pattern. The lengths are later scaled by the line width. To convert a dash length to pixels, multiply the length by the current line width. Note that GeoJSON sources with `lineMetrics: true` specified won't render dashed lines to the expected scale. Also note that zoom-dependent expressions will be evaluated only at integer zoom levels.",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing image lines. For seamless patterns, image width must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.49.0",android:"6.5.0",macos:"0.11.0",ios:"4.4.0"}},expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",doc:'Defines a gradient with which to color a line feature. Can only be used with GeoJSON sources that specify `"lineMetrics": true`.',transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],"sdk-support":{"basic functionality":{js:"0.45.0",android:"6.5.0",ios:"4.4.0",macos:"0.11.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",doc:"Circle radius.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",doc:"The fill color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.18.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,doc:"Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",doc:"The opacity at which the circle will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.20.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"The geometry's offset. Values are [x, y] where negatives indicate left and up, respectively.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{doc:"The circle is translated relative to the map."},viewport:{doc:"The circle is translated relative to the viewport."}},doc:"Controls the frame of reference for `circle-translate`.",default:"map",requires:["circle-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{doc:"Circles are scaled according to their apparent distance to the camera."},viewport:{doc:"Circles are not scaled."}},default:"map",doc:"Controls the scaling behavior of the circle when the map is pitched.","sdk-support":{"basic functionality":{js:"0.21.0",android:"4.2.0",ios:"3.4.0",macos:"0.2.1"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{doc:"The circle is aligned to the plane of the map."},viewport:{doc:"The circle is aligned to the plane of the viewport."}},default:"viewport",doc:"Orientation of circle when map is pitched.","sdk-support":{"basic functionality":{js:"0.39.0",android:"5.2.0",ios:"3.7.0",macos:"0.6.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",doc:"The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.","sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",doc:"The stroke color of the circle.",transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",doc:"The opacity of the circle's stroke.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"},"data-driven styling":{js:"0.29.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.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",doc:"Radius of influence of one heatmap point in pixels. Increasing the value makes the heatmap smoother, but less detailed.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,doc:"A measure of how much an individual point contributes to the heatmap. A value of 10 would be equivalent to having 10 points of weight 1 in the same spot. Especially useful when combined with clustering.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,doc:"Similar to `heatmap-weight` but controls the intensity of the heatmap globally. Primarily used for adjusting the heatmap based on zoom level.","sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.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"],doc:'Defines the color of each pixel based on its density value in a heatmap. Should be an expression that uses `["heatmap-density"]` as input.',transition:!1,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"},"data-driven styling":{}},expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",doc:"The global opacity at which the heatmap layer will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.41.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{doc:"The opacity at which the icon will be drawn.",type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,doc:"The color of the icon. This can only be used with sdf icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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,doc:"The color of the icon's halo. Icon halos can only be used with SDF icons.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance of halo to the icon outline.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Fade out the halo towards the outside.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance that the icon's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["icon-image"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{doc:"Icons are translated relative to the map."},viewport:{doc:"Icons are translated relative to the viewport."}},doc:"Controls the frame of reference for `icon-translate`.",default:"map",requires:["icon-image","icon-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",doc:"The opacity at which the text will be drawn.",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",doc:"The color with which the text will be drawn.",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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,doc:"The color of the text's halo, which helps it stand out from backgrounds.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance of halo to the font outline. Max text halo width is 1/4 of the font-size.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"The halo's fadeout distance towards the outside.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{js:"0.33.0",android:"5.0.0",ios:"3.5.0",macos:"0.4.0"}},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",doc:"Distance that the text's anchor is moved from its original placement. Positive values indicate right and down, while negative values indicate left and up.",requires:["text-field"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{doc:"The text is translated relative to the map."},viewport:{doc:"The text is translated relative to the viewport."}},doc:"Controls the frame of reference for `text-translate`.",default:"map",requires:["text-field","text-translate"],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",doc:"The opacity at which the image will be drawn.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",doc:"Rotates hues around the color wheel.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the minimum brightness.",default:0,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",doc:"Increase or reduce the brightness of the image. The value is the maximum brightness.",default:1,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",doc:"Increase or reduce the saturation of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",doc:"Increase or reduce the contrast of the image.",default:0,minimum:-1,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",doc:"The resampling/interpolation method to use for overscaling, also known as texture magnification filter",values:{linear:{doc:"(Bi)linear filtering interpolates pixel values using the weighted average of the four closest original source pixels creating a smooth but blurry look when overscaled"},nearest:{doc:"Nearest neighbor filtering interpolates pixel values using the nearest original source pixel creating a sharp but pixelated look when overscaled"}},default:"linear","sdk-support":{"basic functionality":{js:"0.47.0",android:"6.3.0",ios:"4.2.0",macos:"0.9.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",doc:"Fade duration when a new tile is added.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"number",default:335,minimum:0,maximum:359,doc:"The direction of the light source used to generate the hillshading with 0 as the top of the viewport if `hillshade-illumination-anchor` is set to `viewport` and due north if `hillshade-illumination-anchor` is set to `map`.",transition:!1,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{doc:"The hillshade illumination is relative to the north direction."},viewport:{doc:"The hillshade illumination is relative to the top of the viewport."}},default:"viewport",doc:"Direction of light source when map is rotated.","sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",doc:"Intensity of the hillshade",default:.5,minimum:0,maximum:1,transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"color",default:"#000000",doc:"The shading color of areas that face away from the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"color",default:"#FFFFFF",doc:"The shading color of areas that faces towards the light source.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",doc:"The shading color used to accentuate rugged terrain like sharp cliffs and gorges.",transition:!0,"sdk-support":{"basic functionality":{js:"0.43.0",android:"6.0.0",ios:"4.0.0",macos:"0.7.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_background:{"background-color":{type:"color",default:"#000000",doc:"The color with which the background will be drawn.",transition:!0,requires:[{"!":"background-pattern"}],"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,doc:"Name of image in sprite to use for drawing an image background. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels.","sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"},"data-driven styling":{}},expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,doc:"The opacity at which the background will be drawn.",transition:!0,"sdk-support":{"basic functionality":{js:"0.10.0",android:"2.0.1",ios:"2.0.0",macos:"0.1.0"}},expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds",doc:"Time allotted for transitions to complete."},delay:{type:"number",default:0,minimum:0,units:"milliseconds",doc:"Length of time before a transition begins."}},"property-type":{"data-driven":{type:"property-type",doc:"Property is interpolable and can be represented using a property expression."},"cross-faded":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms."},"cross-faded-data-driven":{type:"property-type",doc:"Property is non-interpolable; rather, its values will be cross-faded to smoothly transition between integer zooms. It can be represented using a property expression."},"color-ramp":{type:"property-type",doc:"Property should be specified using a color ramp from which the output color can be sampled based on a property calculation."},"data-constant":{type:"property-type",doc:"Property is interpolable but cannot be represented using a property expression."},constant:{type:"property-type",doc:"Property is constant across all zoom levels and property values."}},promoteId:{"*":{type:"string",doc:"A name of a feature property to use as ID for feature state."}}},u="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},h={exports:{}};
2
+ /*! https://mths.be/punycode v1.3.2 by @mathias */
3
+ !function(e,t){!function(r){var i=t&&!t.nodeType&&t,n=e&&!e.nodeType&&e,o="object"==typeof u&&u;o.global!==o&&o.window!==o&&o.self!==o||(r=o);var a,s,l=2147483647,c=36,h=/^xn--/,p=/[^\x20-\x7E]/,d=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},m=Math.floor,y=String.fromCharCode;function g(e){throw RangeError(f[e])}function _(e,t){for(var r=e.length,i=[];r--;)i[r]=t(e[r]);return i}function b(e,t){var r=e.split("@"),i="";return r.length>1&&(i=r[0]+"@",e=r[1]),i+_((e=e.replace(d,".")).split("."),t).join(".")}function v(e){for(var t,r,i=[],n=0,o=e.length;n<o;)(t=e.charCodeAt(n++))>=55296&&t<=56319&&n<o?56320==(64512&(r=e.charCodeAt(n++)))?i.push(((1023&t)<<10)+(1023&r)+65536):(i.push(t),n--):i.push(t);return i}function x(e){return _(e,(function(e){var t="";return e>65535&&(t+=y((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+=y(e)})).join("")}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function S(e,t,r){var i=0;for(e=r?m(e/700):e>>1,e+=m(e/t);e>455;i+=c)e=m(e/35);return m(i+36*e/(e+38))}function E(e){var t,r,i,n,o,a,s,u,h,p,d,f=[],y=e.length,_=0,b=128,v=72;for((r=e.lastIndexOf("-"))<0&&(r=0),i=0;i<r;++i)e.charCodeAt(i)>=128&&g("not-basic"),f.push(e.charCodeAt(i));for(n=r>0?r+1:0;n<y;){for(o=_,a=1,s=c;n>=y&&g("invalid-input"),((u=(d=e.charCodeAt(n++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:c)>=c||u>m((l-_)/a))&&g("overflow"),_+=u*a,!(u<(h=s<=v?1:s>=v+26?26:s-v));s+=c)a>m(l/(p=c-h))&&g("overflow"),a*=p;v=S(_-o,t=f.length+1,0==o),m(_/t)>l-b&&g("overflow"),b+=m(_/t),_%=t,f.splice(_++,0,b)}return x(f)}function T(e){var t,r,i,n,o,a,s,u,h,p,d,f,_,b,x,E=[];for(f=(e=v(e)).length,t=128,r=0,o=72,a=0;a<f;++a)(d=e[a])<128&&E.push(y(d));for(i=n=E.length,n&&E.push("-");i<f;){for(s=l,a=0;a<f;++a)(d=e[a])>=t&&d<s&&(s=d);for(s-t>m((l-r)/(_=i+1))&&g("overflow"),r+=(s-t)*_,t=s,a=0;a<f;++a)if((d=e[a])<t&&++r>l&&g("overflow"),d==t){for(u=r,h=c;!(u<(p=h<=o?1:h>=o+26?26:h-o));h+=c)x=u-p,b=c-p,E.push(y(w(p+x%b,0))),u=m(x/b);E.push(y(w(u,0))),o=S(r,_,i==n),r=0,++i}++r,++t}return E.join("")}if(a={version:"1.3.2",ucs2:{decode:v,encode:x},decode:E,encode:T,toASCII:function(e){return b(e,(function(e){return p.test(e)?"xn--"+T(e):e}))},toUnicode:function(e){return b(e,(function(e){return h.test(e)?E(e.slice(4).toLowerCase()):e}))}},i&&n)if(e.exports==i)n.exports=a;else for(s in a)a.hasOwnProperty(s)&&(i[s]=a[s]);else r.punycode=a}(u)}(h,h.exports);var p={};function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var f=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};p.decode=p.parse=function(e,t,r,i){t=t||"&",r=r||"=";var n={};if("string"!=typeof e||0===e.length)return n;var o=/\+/g;e=e.split(t);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var s=e.length;a>0&&s>a&&(s=a);for(var l=0;l<s;++l){var c,u,h,p,f=e[l].replace(o,"%20"),m=f.indexOf(r);m>=0?(c=f.substr(0,m),u=f.substr(m+1)):(c=f,u=""),h=decodeURIComponent(c),p=decodeURIComponent(u),d(n,h)?Array.isArray(n[h])?n[h].push(p):n[h]=[n[h],p]:n[h]=p}return n},p.encode=p.stringify=function(e,t,r,i){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map((function(i){var n=encodeURIComponent(f(i))+r;return Array.isArray(e[i])?e[i].map((function(e){return n+encodeURIComponent(f(e))})).join(t):n+encodeURIComponent(f(e[i]))})).join(t):i?encodeURIComponent(f(i))+r+encodeURIComponent(f(e)):""};var m=h.exports,y={isString:function(e){return"string"==typeof e},isObject:function(e){return"object"==typeof e&&null!==e},isNull:function(e){return null===e},isNullOrUndefined:function(e){return null==e}};function g(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var _=/^([a-z0-9.+-]+:)/i,b=/:[0-9]*$/,v=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,x=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),w=["'"].concat(x),S=["%","/","?",";","#"].concat(w),E=["/","?","#"],T=/^[+a-z0-9A-Z_-]{0,63}$/,k=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,A={javascript:!0,"javascript:":!0},I={javascript:!0,"javascript:":!0},P={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},C=p;g.prototype.parse=function(e,t,r){if(!y.isString(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),n=-1!==i&&i<e.indexOf("#")?"?":"#",o=e.split(n);o[0]=o[0].replace(/\\/g,"/");var a=e=o.join(n);if(a=a.trim(),!r&&1===e.split("#").length){var s=v.exec(a);if(s)return this.path=a,this.href=a,this.pathname=s[1],s[2]?(this.search=s[2],this.query=t?C.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var l=_.exec(a);if(l){var c=(l=l[0]).toLowerCase();this.protocol=c,a=a.substr(l.length)}if(r||l||a.match(/^\/\/[^@\/]+@[^@\/]+/)){var u="//"===a.substr(0,2);!u||l&&I[l]||(a=a.substr(2),this.slashes=!0)}if(!I[l]&&(u||l&&!P[l])){for(var h,p,d=-1,f=0;f<E.length;f++){-1!==(g=a.indexOf(E[f]))&&(-1===d||g<d)&&(d=g)}-1!==(p=-1===d?a.lastIndexOf("@"):a.lastIndexOf("@",d))&&(h=a.slice(0,p),a=a.slice(p+1),this.auth=decodeURIComponent(h)),d=-1;for(f=0;f<S.length;f++){var g;-1!==(g=a.indexOf(S[f]))&&(-1===d||g<d)&&(d=g)}-1===d&&(d=a.length),this.host=a.slice(0,d),a=a.slice(d),this.parseHost(),this.hostname=this.hostname||"";var b="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!b)for(var x=this.hostname.split(/\./),z=(f=0,x.length);f<z;f++){var M=x[f];if(M&&!M.match(T)){for(var O="",D=0,L=M.length;D<L;D++)M.charCodeAt(D)>127?O+="x":O+=M[D];if(!O.match(T)){var j=x.slice(0,f),R=x.slice(f+1),B=M.match(k);B&&(j.push(B[1]),R.unshift(B[2])),R.length&&(a="/"+R.join(".")+a),this.hostname=j.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),b||(this.hostname=m.toASCII(this.hostname));var F=this.port?":"+this.port:"",N=this.hostname||"";this.host=N+F,this.href+=this.host,b&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==a[0]&&(a="/"+a))}if(!A[c])for(f=0,z=w.length;f<z;f++){var U=w[f];if(-1!==a.indexOf(U)){var V=encodeURIComponent(U);V===U&&(V=escape(U)),a=a.split(U).join(V)}}var q=a.indexOf("#");-1!==q&&(this.hash=a.substr(q),a=a.slice(0,q));var $=a.indexOf("?");if(-1!==$?(this.search=a.substr($),this.query=a.substr($+1),t&&(this.query=C.parse(this.query)),a=a.slice(0,$)):t&&(this.search="",this.query={}),a&&(this.pathname=a),P[c]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){F=this.pathname||"";var G=this.search||"";this.path=F+G}return this.href=this.format(),this},g.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,o="";this.host?n=e+this.host:this.hostname&&(n=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&y.isObject(this.query)&&Object.keys(this.query).length&&(o=C.stringify(this.query));var a=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||P[t])&&!1!==n?(n="//"+(n||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):n||(n=""),i&&"#"!==i.charAt(0)&&(i="#"+i),a&&"?"!==a.charAt(0)&&(a="?"+a),t+n+(r=r.replace(/[?#]/g,(function(e){return encodeURIComponent(e)})))+(a=a.replace("#","%23"))+i},g.prototype.resolve=function(e){return this.resolveObject(function(e,t,r){if(e&&y.isObject(e)&&e instanceof g)return e;var i=new g;return i.parse(e,t,r),i}(e,!1,!0)).format()},g.prototype.resolveObject=function(e){if(y.isString(e)){var t=new g;t.parse(e,!1,!0),e=t}for(var r=new g,i=Object.keys(this),n=0;n<i.length;n++){var o=i[n];r[o]=this[o]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var a=Object.keys(e),s=0;s<a.length;s++){var l=a[s];"protocol"!==l&&(r[l]=e[l])}return P[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!P[e.protocol]){for(var c=Object.keys(e),u=0;u<c.length;u++){var h=c[u];r[h]=e[h]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||I[e.protocol])r.pathname=e.pathname;else{for(var p=(e.pathname||"").split("/");p.length&&!(e.host=p.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==p[0]&&p.unshift(""),p.length<2&&p.unshift(""),r.pathname=p.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var d=r.pathname||"",f=r.search||"";r.path=d+f}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var m=r.pathname&&"/"===r.pathname.charAt(0),_=e.host||e.pathname&&"/"===e.pathname.charAt(0),b=_||m||r.host&&e.pathname,v=b,x=r.pathname&&r.pathname.split("/")||[],w=(p=e.pathname&&e.pathname.split("/")||[],r.protocol&&!P[r.protocol]);if(w&&(r.hostname="",r.port=null,r.host&&(""===x[0]?x[0]=r.host:x.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===p[0]?p[0]=e.host:p.unshift(e.host)),e.host=null),b=b&&(""===p[0]||""===x[0])),_)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,x=p;else if(p.length)x||(x=[]),x.pop(),x=x.concat(p),r.search=e.search,r.query=e.query;else if(!y.isNullOrUndefined(e.search)){if(w)r.hostname=r.host=x.shift(),(A=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=A.shift(),r.host=r.hostname=A.shift());return r.search=e.search,r.query=e.query,y.isNull(r.pathname)&&y.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!x.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var S=x.slice(-1)[0],E=(r.host||e.host||x.length>1)&&("."===S||".."===S)||""===S,T=0,k=x.length;k>=0;k--)"."===(S=x[k])?x.splice(k,1):".."===S?(x.splice(k,1),T++):T&&(x.splice(k,1),T--);if(!b&&!v)for(;T--;T)x.unshift("..");!b||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),E&&"/"!==x.join("/").substr(-1)&&x.push("");var A,C=""===x[0]||x[0]&&"/"===x[0].charAt(0);w&&(r.hostname=r.host=C?"":x.length?x.shift():"",(A=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=A.shift(),r.host=r.hostname=A.shift()));return(b=b||r.host&&x.length)&&!C&&x.unshift(""),x.length?r.pathname=x.join("/"):(r.pathname=null,r.path=null),y.isNull(r.pathname)&&y.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},g.prototype.parseHost=function(){var e=this.host,t=b.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)};var z={exports:{}},M=Object.getOwnPropertySymbols,O=Object.prototype.hasOwnProperty,D=Object.prototype.propertyIsEnumerable;
4
+ /*
5
+ object-assign
6
+ (c) Sindre Sorhus
7
+ @license MIT
8
+ */function L(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var j=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach((function(e){i[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},i)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var r,i,n=L(e),o=1;o<arguments.length;o++){for(var a in r=Object(arguments[o]))O.call(r,a)&&(n[a]=r[a]);if(M){i=M(r);for(var s=0;s<i.length;s++)D.call(r,i[s])&&(n[i[s]]=r[i[s]])}}return n},R={},B=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8},F={exports:{}};"function"==typeof Object.create?F.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:F.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e},function(e){var t=/%[sdj%]/g;e.format=function(e){if(!m(e)){for(var r=[],i=0;i<arguments.length;i++)r.push(n(arguments[i]));return r.join(" ")}i=1;for(var o=arguments,a=o.length,s=String(e).replace(t,(function(e){if("%%"===e)return"%";if(i>=a)return e;switch(e){case"%s":return String(o[i++]);case"%d":return Number(o[i++]);case"%j":try{return JSON.stringify(o[i++])}catch(e){return"[Circular]"}default:return e}})),l=o[i];i<a;l=o[++i])d(l)||!_(l)?s+=" "+l:s+=" "+n(l);return s},e.deprecate=function(t,r){if(y(u.process))return function(){return e.deprecate(t,r).apply(this,arguments)};if(!0===process.noDeprecation)return t;var i=!1;return function(){if(!i){if(process.throwDeprecation)throw new Error(r);process.traceDeprecation?console.trace(r):console.error(r),i=!0}return t.apply(this,arguments)}};var r,i={};function n(t,r){var i={seen:[],stylize:a};return arguments.length>=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),p(r)?i.showHidden=r:r&&e._extend(i,r),y(i.showHidden)&&(i.showHidden=!1),y(i.depth)&&(i.depth=2),y(i.colors)&&(i.colors=!1),y(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=o),s(i,t,i.depth)}function o(e,t){var r=n.styles[t];return r?"["+n.colors[r][0]+"m"+e+"["+n.colors[r][1]+"m":e}function a(e,t){return e}function s(t,r,i){if(t.customInspect&&r&&x(r.inspect)&&r.inspect!==e.inspect&&(!r.constructor||r.constructor.prototype!==r)){var n=r.inspect(i,t);return m(n)||(n=s(t,n,i)),n}var o=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(m(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(f(t))return e.stylize(""+t,"number");if(p(t))return e.stylize(""+t,"boolean");if(d(t))return e.stylize("null","null")}(t,r);if(o)return o;var a=Object.keys(r),u=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(r)),v(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return l(r);if(0===a.length){if(x(r)){var _=r.name?": "+r.name:"";return t.stylize("[Function"+_+"]","special")}if(g(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(b(r))return t.stylize(Date.prototype.toString.call(r),"date");if(v(r))return l(r)}var w,S="",E=!1,T=["{","}"];(h(r)&&(E=!0,T=["[","]"]),x(r))&&(S=" [Function"+(r.name?": "+r.name:"")+"]");return g(r)&&(S=" "+RegExp.prototype.toString.call(r)),b(r)&&(S=" "+Date.prototype.toUTCString.call(r)),v(r)&&(S=" "+l(r)),0!==a.length||E&&0!=r.length?i<0?g(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),w=E?function(e,t,r,i,n){for(var o=[],a=0,s=t.length;a<s;++a)k(t,String(a))?o.push(c(e,t,r,i,String(a),!0)):o.push("");return n.forEach((function(n){n.match(/^\d+$/)||o.push(c(e,t,r,i,n,!0))})),o}(t,r,i,u,a):a.map((function(e){return c(t,r,i,u,e,E)})),t.seen.pop(),function(e,t,r){if(e.reduce((function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(w,S,T)):T[0]+S+T[1]}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function c(e,t,r,i,n,o){var a,l,c;if((c=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?l=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(l=e.stylize("[Setter]","special")),k(i,n)||(a="["+n+"]"),l||(e.seen.indexOf(c.value)<0?(l=d(r)?s(e,c.value,null):s(e,c.value,r-1)).indexOf("\n")>-1&&(l=o?l.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+l.split("\n").map((function(e){return" "+e})).join("\n")):l=e.stylize("[Circular]","special")),y(a)){if(o&&n.match(/^\d+$/))return l;(a=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+l}function h(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function d(e){return null===e}function f(e){return"number"==typeof e}function m(e){return"string"==typeof e}function y(e){return void 0===e}function g(e){return _(e)&&"[object RegExp]"===w(e)}function _(e){return"object"==typeof e&&null!==e}function b(e){return _(e)&&"[object Date]"===w(e)}function v(e){return _(e)&&("[object Error]"===w(e)||e instanceof Error)}function x(e){return"function"==typeof e}function w(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}e.debuglog=function(t){if(y(r)&&(r=process.env.NODE_DEBUG||""),t=t.toUpperCase(),!i[t])if(new RegExp("\\b"+t+"\\b","i").test(r)){var n=process.pid;i[t]=function(){var r=e.format.apply(e,arguments);console.error("%s %d: %s",t,n,r)}}else i[t]=function(){};return i[t]},e.inspect=n,n.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},n.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.isArray=h,e.isBoolean=p,e.isNull=d,e.isNullOrUndefined=function(e){return null==e},e.isNumber=f,e.isString=m,e.isSymbol=function(e){return"symbol"==typeof e},e.isUndefined=y,e.isRegExp=g,e.isObject=_,e.isDate=b,e.isError=v,e.isFunction=x,e.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},e.isBuffer=B;var E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),E[e.getMonth()],t].join(" ")}function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.log=function(){console.log("%s - %s",T(),e.format.apply(e,arguments))},e.inherits=F.exports,e._extend=function(e,t){if(!t||!_(t))return e;for(var r=Object.keys(t),i=r.length;i--;)e[r[i]]=t[r[i]];return e}}(R);var N=j;
9
+ /*!
10
+ * The buffer module from node.js, for the browser.
11
+ *
12
+ * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
13
+ * @license MIT
14
+ */function U(e,t){if(e===t)return 0;for(var r=e.length,i=t.length,n=0,o=Math.min(r,i);n<o;++n)if(e[n]!==t[n]){r=e[n],i=t[n];break}return r<i?-1:i<r?1:0}function V(e){return u.Buffer&&"function"==typeof u.Buffer.isBuffer?u.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var q=R,$=Object.prototype.hasOwnProperty,G=Array.prototype.slice,Z="foo"===function(){}.name;function W(e){return Object.prototype.toString.call(e)}function X(e){return!V(e)&&("function"==typeof u.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var K=z.exports=te,H=/\s*function\s+([^\(\s]*)\s*/;function J(e){if(q.isFunction(e)){if(Z)return e.name;var t=e.toString().match(H);return t&&t[1]}}function Y(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function Q(e){if(Z||!q.isFunction(e))return q.inspect(e);var t=J(e);return"[Function"+(t?": "+t:"")+"]"}function ee(e,t,r,i,n){throw new K.AssertionError({message:r,actual:e,expected:t,operator:i,stackStartFunction:n})}function te(e,t){e||ee(e,!0,t,"==",K.ok)}function re(e,t,r,i){if(e===t)return!0;if(V(e)&&V(t))return 0===U(e,t);if(q.isDate(e)&&q.isDate(t))return e.getTime()===t.getTime();if(q.isRegExp(e)&&q.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(X(e)&&X(t)&&W(e)===W(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===U(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(V(e)!==V(t))return!1;var n=(i=i||{actual:[],expected:[]}).actual.indexOf(e);return-1!==n&&n===i.expected.indexOf(t)||(i.actual.push(e),i.expected.push(t),function(e,t,r,i){if(null==e||null==t)return!1;if(q.isPrimitive(e)||q.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var n=ie(e),o=ie(t);if(n&&!o||!n&&o)return!1;if(n)return re(e=G.call(e),t=G.call(t),r);var a,s,l=ae(e),c=ae(t);if(l.length!==c.length)return!1;for(l.sort(),c.sort(),s=l.length-1;s>=0;s--)if(l[s]!==c[s])return!1;for(s=l.length-1;s>=0;s--)if(!re(e[a=l[s]],t[a],r,i))return!1;return!0}(e,t,r,i))}return r?e===t:e==t}function ie(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function ne(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function oe(e,t,r,i){var n;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(i=r,r=null),n=function(e){var t;try{e()}catch(e){t=e}return t}(t),i=(r&&r.name?" ("+r.name+").":".")+(i?" "+i:"."),e&&!n&&ee(n,r,"Missing expected exception"+i);var o="string"==typeof i,a=!e&&n&&!r;if((!e&&q.isError(n)&&o&&ne(n,r)||a)&&ee(n,r,"Got unwanted exception"+i),e&&n&&r&&!ne(n,r)||!e&&n)throw n}K.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return Y(Q(e.actual),128)+" "+e.operator+" "+Y(Q(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||ee;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var i=r.stack,n=J(t),o=i.indexOf("\n"+n);if(o>=0){var a=i.indexOf("\n",o+1);i=i.substring(a+1)}this.stack=i}}},q.inherits(K.AssertionError,Error),K.fail=ee,K.ok=te,K.equal=function(e,t,r){e!=t&&ee(e,t,r,"==",K.equal)},K.notEqual=function(e,t,r){e==t&&ee(e,t,r,"!=",K.notEqual)},K.deepEqual=function(e,t,r){re(e,t,!1)||ee(e,t,r,"deepEqual",K.deepEqual)},K.deepStrictEqual=function(e,t,r){re(e,t,!0)||ee(e,t,r,"deepStrictEqual",K.deepStrictEqual)},K.notDeepEqual=function(e,t,r){re(e,t,!1)&&ee(e,t,r,"notDeepEqual",K.notDeepEqual)},K.notDeepStrictEqual=function e(t,r,i){re(t,r,!0)&&ee(t,r,i,"notDeepStrictEqual",e)},K.strictEqual=function(e,t,r){e!==t&&ee(e,t,r,"===",K.strictEqual)},K.notStrictEqual=function(e,t,r){e===t&&ee(e,t,r,"!==",K.notStrictEqual)},K.throws=function(e,t,r){oe(!0,e,t,r)},K.doesNotThrow=function(e,t,r){oe(!1,e,t,r)},K.ifError=function(e){if(e)throw e},K.strict=N((function e(t,r){t||ee(t,!0,r,"==",e)}),K,{equal:K.strictEqual,deepEqual:K.deepStrictEqual,notEqual:K.notStrictEqual,notDeepEqual:K.notDeepStrictEqual}),K.strict.strict=K.strict;var ae=Object.keys||function(e){var t=[];for(var r in e)$.call(e,r)&&t.push(r);return t};function se(e,...t){for(const r of t)for(const t in r)e[t]=r[t];return e}class le extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class ce{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,r]of t)this.bindings[e]=r}concat(e){return new ce(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const ue={kind:"null"},he={kind:"number"},pe={kind:"string"},de={kind:"boolean"},fe={kind:"color"},me={kind:"object"},ye={kind:"value"},ge={kind:"collator"},_e={kind:"formatted"},be={kind:"padding"},ve={kind:"resolvedImage"};function xe(e,t){return{kind:"array",itemType:e,N:t}}function we(e){if("array"===e.kind){const t=we(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const Se=[ue,he,pe,de,fe,_e,me,xe(ye),be,ve];function Ee(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!Ee(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of Se)if(!Ee(e,t))return null}return`Expected ${we(e)} but found ${we(t)} instead.`}function Te(e,t){return t.some((t=>t.kind===e.kind))}function ke(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}var Ae,Ie={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 Pe(e){return(e=Math.round(e))<0?0:e>255?255:e}function Ce(e){return e<0?0:e>1?1:e}function ze(e){return"%"===e[e.length-1]?Pe(parseFloat(e)/100*255):Pe(parseInt(e))}function Me(e){return"%"===e[e.length-1]?Ce(parseFloat(e)/100):Ce(parseFloat(e))}function Oe(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}try{Ae={}.parseCSSColor=function(e){var t,r=e.replace(/ /g,"").toLowerCase();if(r in Ie)return Ie[r].slice();if("#"===r[0])return 4===r.length?(t=parseInt(r.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===r.length&&(t=parseInt(r.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var i=r.indexOf("("),n=r.indexOf(")");if(-1!==i&&n+1===r.length){var o=r.substr(0,i),a=r.substr(i+1,n-(i+1)).split(","),s=1;switch(o){case"rgba":if(4!==a.length)return null;s=Me(a.pop());case"rgb":return 3!==a.length?null:[ze(a[0]),ze(a[1]),ze(a[2]),s];case"hsla":if(4!==a.length)return null;s=Me(a.pop());case"hsl":if(3!==a.length)return null;var l=(parseFloat(a[0])%360+360)%360/360,c=Me(a[1]),u=Me(a[2]),h=u<=.5?u*(c+1):u+c-u*c,p=2*u-h;return[Pe(255*Oe(p,h,l+1/3)),Pe(255*Oe(p,h,l)),Pe(255*Oe(p,h,l-1/3)),s];default:return null}}return null}}catch(e){}class De{constructor(e,t,r,i=1){this.r=e,this.g=t,this.b=r,this.a=i}static parse(e){if(!e)return;if(e instanceof De)return e;if("string"!=typeof e)return;const t=Ae(e);return t?new De(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3]):void 0}toString(){const[e,t,r,i]=this.toArray();return`rgba(${Math.round(e)},${Math.round(t)},${Math.round(r)},${i})`}toArray(){const{r:e,g:t,b:r,a:i}=this;return 0===i?[0,0,0,0]:[255*e/i,255*t/i,255*r/i,i]}}De.black=new De(0,0,0,1),De.white=new De(1,1,1,1),De.transparent=new De(0,0,0,0),De.red=new De(1,0,0,1);class Le{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class je{constructor(e,t,r,i,n){this.text=e,this.image=t,this.scale=r,this.fontStack=i,this.textColor=n}}class Re{constructor(e){this.sections=e}static fromString(e){return new Re([new je(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.name.length))}static factory(e){return e instanceof Re?e:Re.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}}class Be{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Be)return e;if("number"==typeof e)return new Be([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const t of e)if("number"!=typeof t)return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new Be(e)}}toString(){return JSON.stringify(this.values)}}class Fe{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Fe({name:e,available:!1}):null}}function Ne(e,t,r,i){if(!("number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255)){return`Invalid rgba value [${("number"==typeof i?[e,t,r,i]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}return void 0===i||"number"==typeof i&&i>=0&&i<=1?null:`Invalid rgba value [${[e,t,r,i].join(", ")}]: 'a' must be between 0 and 1.`}function Ue(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof De)return!0;if(e instanceof Le)return!0;if(e instanceof Re)return!0;if(e instanceof Be)return!0;if(e instanceof Fe)return!0;if(Array.isArray(e)){for(const t of e)if(!Ue(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!Ue(e[t]))return!1;return!0}return!1}function Ve(e){if(null===e)return ue;if("string"==typeof e)return pe;if("boolean"==typeof e)return de;if("number"==typeof e)return he;if(e instanceof De)return fe;if(e instanceof Le)return ge;if(e instanceof Re)return _e;if(e instanceof Be)return be;if(e instanceof Fe)return ve;if(Array.isArray(e)){const t=e.length;let r;for(const t of e){const e=Ve(t);if(r){if(r===e)continue;r=ye;break}r=e}return xe(r||ye,t)}return z.exports("object"==typeof e),me}function qe(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof De||e instanceof Re||e instanceof Be||e instanceof Fe?e.toString():JSON.stringify(e)}class $e{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Ue(e[1]))return t.error("invalid value");const r=e[1];let i=Ve(r);const n=t.expectedType;return"array"!==i.kind||0!==i.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(i=n),new $e(i,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Ge{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const Ze={string:pe,number:he,boolean:de,object:me};class We{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r,i=1;const n=e[0];if("array"===n){let n,o;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in Ze)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);n=Ze[r],i++}else n=ye;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);o=e[2],i++}r=xe(n,o)}else z.exports(Ze[n],n),r=Ze[n];const o=[];for(;i<e.length;i++){const r=t.parse(e[i],i,ye);if(!r)return null;o.push(r)}return new We(r,o)}evaluate(e){for(let t=0;t<this.args.length;t++){const r=this.args[t].evaluate(e);if(!Ee(this.type,Ve(r)))return r;if(t===this.args.length-1)throw new Ge(`Expected value to be of type ${we(this.type)}, but found ${we(Ve(r))} instead.`)}return z.exports(!1),null}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}const Xe={"to-boolean":de,"to-color":fe,"to-number":he,"to-string":pe};class Ke{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[0];if(z.exports(Xe[r],r),("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");const i=Xe[r],n=[];for(let r=1;r<e.length;r++){const i=t.parse(e[r],r,ye);if(!i)return null;n.push(i)}return new Ke(i,n)}evaluate(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){let t,r;for(const i of this.args){if(t=i.evaluate(e),r=null,t instanceof De)return t;if("string"==typeof t){const r=e.parseColor(t);if(r)return r}else if(Array.isArray(t)&&(r=t.length<3||t.length>4?`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:Ne(t[0],t[1],t[2],t[3]),!r))return new De(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Ge(r||`Could not parse color from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}if("padding"===this.type.kind){let t;for(const r of this.args){t=r.evaluate(e);const i=Be.parse(t);if(i)return i}throw new Ge(`Could not parse padding from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}if("number"===this.type.kind){let t=null;for(const r of this.args){if(t=r.evaluate(e),null===t)return 0;const i=Number(t);if(!isNaN(i))return i}throw new Ge(`Could not convert ${JSON.stringify(t)} to number.`)}return"formatted"===this.type.kind?Re.fromString(qe(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?Fe.fromString(qe(this.args[0].evaluate(e))):qe(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}const He=["Unknown","Point","LineString","Polygon"];class Je{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?He[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=De.parse(e)),t}}class Ye{constructor(e,t,r,i){this.name=e,this.type=t,this._evaluate=r,this.args=i}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,t){const r=e[0],i=Ye.definitions[r];if(!i)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const n=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,a=o.filter((([t])=>!Array.isArray(t)||t.length===e.length-1));let s=null;for(const[i,o]of a){s=new wt(t.registry,t.path,null,t.scope);const a=[];let l=!1;for(let t=1;t<e.length;t++){const r=e[t],n=Array.isArray(i)?i[t-1]:i.type,o=s.parse(r,1+a.length,n);if(!o){l=!0;break}a.push(o)}if(!l)if(Array.isArray(i)&&i.length!==a.length)s.error(`Expected ${i.length} arguments, but found ${a.length} instead.`);else{for(let e=0;e<a.length;e++){const t=Array.isArray(i)?i[e]:i.type,r=a[e];s.concat(e+1).checkSubtype(t,r.type)}if(0===s.errors.length)return new Ye(r,n,o,a)}}if(z.exports(!s||s.errors.length>0),1===a.length)t.errors.push(...s.errors);else{const r=(a.length?a:o).map((([e])=>{return t=e,Array.isArray(t)?`(${t.map(we).join(", ")})`:`(${we(t.type)}...)`;var t})).join(" | "),i=[];for(let r=1;r<e.length;r++){const n=t.parse(e[r],1+i.length);if(!n)return null;i.push(we(n.type))}t.error(`Expected arguments of type ${r}, but found (${i.join(", ")}) instead.`)}return null}static register(e,t){z.exports(!Ye.definitions),Ye.definitions=t;for(const r in t)e[r]=Ye}}class Qe{constructor(e,t,r){this.type=ge,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");const r=e[1];if("object"!=typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");const i=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,de);if(!i)return null;const n=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,de);if(!n)return null;let o=null;return r.locale&&(o=t.parse(r.locale,1,pe),!o)?null:new Qe(i,n,o)}evaluate(e){return new Le(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}const et=8192;function tt(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function rt(e,t){return!(e[0]<=t[0])&&(!(e[2]>=t[2])&&(!(e[1]<=t[1])&&!(e[3]>=t[3])))}function it(e,t){const r=(180+e[0])/360;const i=(n=e[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+n*Math.PI/360)))/360);var n;const o=Math.pow(2,t.z);return[Math.round(r*o*et),Math.round(i*o*et)]}function nt(e,t,r){const i=e[0]-t[0],n=e[1]-t[1],o=e[0]-r[0],a=e[1]-r[1];return i*a-o*n==0&&i*o<=0&&n*a<=0}function ot(e,t){let r=!1;for(let a=0,s=t.length;a<s;a++){const s=t[a];for(let t=0,a=s.length;t<a-1;t++){if(nt(e,s[t],s[t+1]))return!1;i=e,n=s[t],o=s[t+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]&&(r=!r)}}var i,n,o;return r}function at(e,t){for(let r=0;r<t.length;r++)if(ot(e,t[r]))return!0;return!1}function st(e,t,r,i){const n=e[0]-r[0],o=e[1]-r[1],a=t[0]-r[0],s=t[1]-r[1],l=i[0]-r[0],c=i[1]-r[1],u=n*c-l*o,h=a*c-l*s;return u>0&&h<0||u<0&&h>0}function lt(e,t,r,i){const n=[t[0]-e[0],t[1]-e[1]],o=[i[0]-r[0],i[1]-r[1]];return 0!=(a=o)[0]*(s=n)[1]-a[1]*s[0]&&!(!st(e,t,r,i)||!st(r,i,e,t));var a,s}function ct(e,t,r){for(const i of r)for(let r=0;r<i.length-1;++r)if(lt(e,t,i[r],i[r+1]))return!0;return!1}function ut(e,t){for(let r=0;r<e.length;++r)if(!ot(e[r],t))return!1;for(let r=0;r<e.length-1;++r)if(ct(e[r],e[r+1],t))return!1;return!0}function ht(e,t){for(let r=0;r<t.length;r++)if(ut(e,t[r]))return!0;return!1}function pt(e,t,r){const i=[];for(let n=0;n<e.length;n++){const o=[];for(let i=0;i<e[n].length;i++){const a=it(e[n][i],r);tt(t,a),o.push(a)}i.push(o)}return i}function dt(e,t,r){const i=[];for(let n=0;n<e.length;n++){const o=pt(e[n],t,r);i.push(o)}return i}function ft(e,t,r,i){if(e[0]<r[0]||e[0]>r[2]){const t=.5*i;let n=e[0]-r[0]>t?-i:r[0]-e[0]>t?i:0;0===n&&(n=e[0]-r[2]>t?-i:r[2]-e[0]>t?i:0),e[0]+=n}tt(t,e)}function mt(e,t,r,i){const n=Math.pow(2,i.z)*et,o=[i.x*et,i.y*et],a=[];for(const i of e)for(const e of i){const i=[e.x+o[0],e.y+o[1]];ft(i,t,r,n),a.push(i)}return a}function yt(e,t,r,i){const n=Math.pow(2,i.z)*et,o=[i.x*et,i.y*et],a=[];for(const r of e){const e=[];for(const i of r){const r=[i.x+o[0],i.y+o[1]];tt(t,r),e.push(r)}a.push(e)}if(t[2]-t[0]<=n/2){(s=t)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const e of a)for(const i of e)ft(i,t,r,n)}var s;return a}class gt{constructor(e,t){this.type=de,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Ue(e[1])){const t=e[1];if("FeatureCollection"===t.type)for(let e=0;e<t.features.length;++e){const r=t.features[e].geometry.type;if("Polygon"===r||"MultiPolygon"===r)return new gt(t,t.features[e].geometry)}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new gt(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new gt(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if("Polygon"===t.type){const o=pt(t.coordinates,i,n),a=mt(e.geometry(),r,i,n);if(!rt(r,i))return!1;for(const e of a)if(!ot(e,o))return!1}if("MultiPolygon"===t.type){const o=dt(t.coordinates,i,n),a=mt(e.geometry(),r,i,n);if(!rt(r,i))return!1;for(const e of a)if(!at(e,o))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if("Polygon"===t.type){const o=pt(t.coordinates,i,n),a=yt(e.geometry(),r,i,n);if(!rt(r,i))return!1;for(const e of a)if(!ut(e,o))return!1}if("MultiPolygon"===t.type){const o=dt(t.coordinates,i,n),a=yt(e.geometry(),r,i,n);if(!rt(r,i))return!1;for(const e of a)if(!ht(e,o))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}function _t(e){if(e instanceof Ye){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof gt)return!1;let t=!0;return e.eachChild((e=>{t&&!_t(e)&&(t=!1)})),t}function bt(e){if(e instanceof Ye&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!bt(e)&&(t=!1)})),t}function vt(e,t){if(e instanceof Ye&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild((e=>{r&&!vt(e,t)&&(r=!1)})),r}class xt{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const r=e[1];return t.scope.has(r)?new xt(r,t.scope.get(r)):t.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class wt{constructor(e,t=[],r,i=new ce,n=[]){this.registry=e,this.path=t,this.key=t.map((e=>`[${e}]`)).join(""),this.scope=i,this.errors=n,this.expectedType=r}parse(e,t,r,i,n={}){return t?this.concat(t,r,i)._parse(e,n):this._parse(e,n)}_parse(e,t){function r(e,t,r){return"assert"===r?new We(t,[e]):"coerce"===r?new Ke(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const i=e[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;const n=this.registry[i];if(n){let i=n.parse(e,this);if(!i)return null;if(this.expectedType){const e=this.expectedType,n=i.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==n.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==n.kind&&"string"!==n.kind)if("padding"!==e.kind||"value"!==n.kind&&"number"!==n.kind&&"array"!==n.kind){if(this.checkSubtype(e,n))return null}else i=r(i,e,t.typeAnnotation||"coerce");else i=r(i,e,t.typeAnnotation||"coerce");else i=r(i,e,t.typeAnnotation||"assert")}if(!(i instanceof $e)&&"resolvedImage"!==i.type.kind&&St(i)){const e=new Je;try{i=new $e(i.type,i.evaluate(e))}catch(e){return this.error(e.message),null}}return i}return this.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===e?this.error("'undefined' value invalid. Use null instead."):"object"==typeof e?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof e} instead.`)}concat(e,t,r){const i="number"==typeof e?this.path.concat(e):this.path,n=r?this.scope.concat(r):this.scope;return new wt(this.registry,i,t||null,n,this.errors)}error(e,...t){const r=`${this.key}${t.map((e=>`[${e}]`)).join("")}`;this.errors.push(new le(r,e))}checkSubtype(e,t){const r=Ee(e,t);return r&&this.error(r),r}}function St(e){if(e instanceof xt)return St(e.boundExpression);if(e instanceof Ye&&"error"===e.name)return!1;if(e instanceof Qe)return!1;if(e instanceof gt)return!1;const t=e instanceof Ke||e instanceof We;let r=!0;return e.eachChild((e=>{r=t?r&&St(e):r&&e instanceof $e})),!!r&&(_t(e)&&vt(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"]))}function Et(e,t){const r=e.length-1;let i,n,o=0,a=r,s=0;for(;o<=a;)if(s=Math.floor((o+a)/2),i=e[s],n=e[s+1],i<=t){if(s===r||t<n)return s;o=s+1}else{if(!(i>t))throw new Ge("Input is not a number.");a=s-1}return 0}class Tt{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of r)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const r=t.parse(e[1],1,he);if(!r)return null;const i=[];let n=null;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);for(let r=1;r<e.length;r+=2){const o=1===r?-1/0:e[r],a=e[r+1],s=r,l=r+1;if("number"!=typeof o)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(i.length&&i[i.length-1][0]>=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const c=t.parse(a,l,n);if(!c)return null;n=n||c.type,i.push([o,c])}return new Tt(n,r,i)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const i=this.input.evaluate(e);if(i<=t[0])return r[0].evaluate(e);const n=t.length;if(i>=t[n-1])return r[n-1].evaluate(e);return r[Et(t,i)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}var kt=At;function At(e,t,r,i){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(i-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=i}function It(e,t,r){return e*(1-r)+t*r}At.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,i=0;i<8;i++){var n=this.sampleCurveX(r)-e;if(Math.abs(n)<t)return r;var o=this.sampleCurveDerivativeX(r);if(Math.abs(o)<1e-6)break;r-=n/o}var a=0,s=1;for(r=e,i=0;i<20&&(n=this.sampleCurveX(r),!(Math.abs(n-e)<t));i++)e>n?a=r:s=r,r=.5*(s-a)+a;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}};var Pt=Object.freeze({__proto__:null,number:It,color:function(e,t,r){return new De(It(e.r,t.r,r),It(e.g,t.g,r),It(e.b,t.b,r),It(e.a,t.a,r))},array:function(e,t,r){return e.map(((e,i)=>It(e,t[i],r)))},padding:function(e,t,r){const i=e.values,n=t.values;return new Be([It(i[0],n[0],r),It(i[1],n[1],r),It(i[2],n[2],r),It(i[3],n[3],r)])}});const Ct=.95047,zt=1.08883,Mt=4/29,Ot=6/29,Dt=3*Ot*Ot,Lt=Math.PI/180,jt=180/Math.PI;function Rt(e){return e>.008856451679035631?Math.pow(e,1/3):e/Dt+Mt}function Bt(e){return e>Ot?e*e*e:Dt*(e-Mt)}function Ft(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Nt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Ut(e){const t=Nt(e.r),r=Nt(e.g),i=Nt(e.b),n=Rt((.4124564*t+.3575761*r+.1804375*i)/Ct),o=Rt((.2126729*t+.7151522*r+.072175*i)/1);return{l:116*o-16,a:500*(n-o),b:200*(o-Rt((.0193339*t+.119192*r+.9503041*i)/zt)),alpha:e.a}}function Vt(e){let t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,i=isNaN(e.b)?t:t-e.b/200;return t=1*Bt(t),r=Ct*Bt(r),i=zt*Bt(i),new De(Ft(3.2404542*r-1.5371385*t-.4985314*i),Ft(-.969266*r+1.8760108*t+.041556*i),Ft(.0556434*r-.2040259*t+1.0572252*i),e.alpha)}function qt(e,t,r){const i=t-e;return e+r*(i>180||i<-180?i-360*Math.round(i/360):i)}const $t={forward:Ut,reverse:Vt,interpolate:function(e,t,r){return{l:It(e.l,t.l,r),a:It(e.a,t.a,r),b:It(e.b,t.b,r),alpha:It(e.alpha,t.alpha,r)}}},Gt={forward:function(e){const{l:t,a:r,b:i}=Ut(e),n=Math.atan2(i,r)*jt;return{h:n<0?n+360:n,c:Math.sqrt(r*r+i*i),l:t,alpha:e.a}},reverse:function(e){const t=e.h*Lt,r=e.c;return Vt({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:qt(e.h,t.h,r),c:It(e.c,t.c,r),l:It(e.l,t.l,r),alpha:It(e.alpha,t.alpha,r)}}};var Zt=Object.freeze({__proto__:null,lab:$t,hcl:Gt});class Wt{constructor(e,t,r,i,n){this.type=e,this.operator=t,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];for(const[e,t]of n)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,r,i){let n=0;if("exponential"===e.name)n=Xt(t,e.base,r,i);else if("linear"===e.name)n=Xt(t,1,r,i);else if("cubic-bezier"===e.name){const o=e.controlPoints;n=new kt(o[0],o[1],o[2],o[3]).solve(Xt(t,1,r,i))}return n}static parse(e,t){let[r,i,n,...o]=e;if(!Array.isArray(i)||0===i.length)return t.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){const e=i[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:e}}else{if("cubic-bezier"!==i[0])return t.error(`Unknown interpolation type ${String(i[0])}`,1,0);{const e=i.slice(1);if(4!==e.length||e.some((e=>"number"!=typeof e||e<0||e>1)))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(n=t.parse(n,2,he),!n)return null;const a=[];let s=null;"interpolate-hcl"===r||"interpolate-lab"===r?s=fe:t.expectedType&&"value"!==t.expectedType.kind&&(s=t.expectedType);for(let e=0;e<o.length;e+=2){const r=o[e],i=o[e+1],n=e+3,l=e+4;if("number"!=typeof r)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',n);if(a.length&&a[a.length-1][0]>=r)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);const c=t.parse(i,l,s);if(!c)return null;s=s||c.type,a.push([r,c])}return"number"===s.kind||"color"===s.kind||"padding"===s.kind||"array"===s.kind&&"number"===s.itemType.kind&&"number"==typeof s.N?new Wt(s,r,i,n,a):t.error(`Type ${we(s)} is not interpolatable.`)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const i=this.input.evaluate(e);if(i<=t[0])return r[0].evaluate(e);const n=t.length;if(i>=t[n-1])return r[n-1].evaluate(e);const o=Et(t,i),a=t[o],s=t[o+1],l=Wt.interpolationFactor(this.interpolation,i,a,s),c=r[o].evaluate(e),u=r[o+1].evaluate(e);return"interpolate"===this.operator?Pt[this.type.kind.toLowerCase()](c,u,l):"interpolate-hcl"===this.operator?Gt.reverse(Gt.interpolate(Gt.forward(c),Gt.forward(u),l)):$t.reverse($t.interpolate($t.forward(c),$t.forward(u),l))}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function Xt(e,t,r,i){const n=i-r,o=e-r;return 0===n?0:1===t?o/n:(Math.pow(t,o)-1)/(Math.pow(t,n)-1)}class Kt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expectected at least one argument.");let r=null;const i=t.expectedType;i&&"value"!==i.kind&&(r=i);const n=[];for(const i of e.slice(1)){const e=t.parse(i,1+n.length,r,void 0,{typeAnnotation:"omit"});if(!e)return null;r=r||e.type,n.push(e)}z.exports(r);const o=i&&n.some((e=>Ee(i,e.type)));return new Kt(o?ye:r,n)}evaluate(e){let t,r=null,i=0;for(const n of this.args)if(i++,r=n.evaluate(e),r&&r instanceof Fe&&!r.available&&(t||(t=r.name),r=null,i===this.args.length&&(r=t)),null!==r)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}class Ht{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const r=[];for(let i=1;i<e.length-1;i+=2){const n=e[i];if("string"!=typeof n)return t.error(`Expected string, but found ${typeof n} instead.`,i);if(/[^a-zA-Z0-9_]/.test(n))return t.error("Variable names must contain only alphanumeric characters or '_'.",i);const o=t.parse(e[i+1],i+1);if(!o)return null;r.push([n,o])}const i=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return i?new Ht(r,i):null}outputDefined(){return this.result.outputDefined()}}class Jt{constructor(e,t,r){this.type=e,this.index=t,this.input=r}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,he),i=t.parse(e[2],2,xe(t.expectedType||ye));if(!r||!i)return null;const n=i.type;return new Jt(n.itemType,r,i)}evaluate(e){const t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new Ge(`Array index out of bounds: ${t} < 0.`);if(t>=r.length)throw new Ge(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new Ge(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class Yt{constructor(e,t){this.type=de,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ye),i=t.parse(e[2],2,ye);return r&&i?Te(r.type,[de,pe,he,ue,ye])?new Yt(r,i):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${we(r.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!ke(t,["boolean","string","number","null"]))throw new Ge(`Expected first argument to be of type boolean, string, number or null, but found ${we(Ve(t))} instead.`);if(!ke(r,["string","array"]))throw new Ge(`Expected second argument to be of type array or string, but found ${we(Ve(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Qt{constructor(e,t,r){this.type=he,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ye),i=t.parse(e[2],2,ye);if(!r||!i)return null;if(!Te(r.type,[de,pe,he,ue,ye]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${we(r.type)} instead`);if(4===e.length){const n=t.parse(e[3],3,he);return n?new Qt(r,i,n):null}return new Qt(r,i)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!ke(t,["boolean","string","number","null"]))throw new Ge(`Expected first argument to be of type boolean, string, number or null, but found ${we(Ve(t))} instead.`);if(!ke(r,["string","array"]))throw new Ge(`Expected second argument to be of type array or string, but found ${we(Ve(r))} instead.`);if(this.fromIndex){const i=this.fromIndex.evaluate(e);return r.indexOf(t,i)}return r.indexOf(t)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class er{constructor(e,t,r,i,n,o){this.inputType=e,this.type=t,this.input=r,this.cases=i,this.outputs=n,this.otherwise=o}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let r,i;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);const n={},o=[];for(let a=2;a<e.length-1;a+=2){let s=e[a];const l=e[a+1];Array.isArray(s)||(s=[s]);const c=t.concat(a);if(0===s.length)return c.error("Expected at least one branch label.");for(const e of s){if("number"!=typeof e&&"string"!=typeof e)return c.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,Ve(e)))return null}else r=Ve(e);if(void 0!==n[String(e)])return c.error("Branch labels must be unique.");n[String(e)]=o.length}const u=t.parse(l,a,i);if(!u)return null;i=i||u.type,o.push(u)}const a=t.parse(e[1],1,ye);if(!a)return null;const s=t.parse(e[e.length-1],e.length-1,i);return s?(z.exports(r&&i),"value"!==a.type.kind&&t.concat(1).checkSubtype(r,a.type)?null:new er(r,i,a,n,o,s)):null}evaluate(e){const t=this.input.evaluate(e);return(Ve(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}}class tr{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);const i=[];for(let n=1;n<e.length-1;n+=2){const o=t.parse(e[n],n,de);if(!o)return null;const a=t.parse(e[n+1],n+1,r);if(!a)return null;i.push([o,a]),r=r||a.type}const n=t.parse(e[e.length-1],e.length-1,r);return n?(z.exports(r),new tr(r,i,n)):null}evaluate(e){for(const[t,r]of this.branches)if(t.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,r]of this.branches)e(t),e(r);e(this.otherwise)}outputDefined(){return this.branches.every((([e,t])=>t.outputDefined()))&&this.otherwise.outputDefined()}}class rr{constructor(e,t,r,i){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=i}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ye),i=t.parse(e[2],2,he);if(!r||!i)return null;if(!Te(r.type,[xe(ye),pe,ye]))return t.error(`Expected first argument to be of type array or string, but found ${we(r.type)} instead`);if(4===e.length){const n=t.parse(e[3],3,he);return n?new rr(r.type,r,i,n):null}return new rr(r.type,r,i)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!ke(t,["string","array"]))throw new Ge(`Expected first argument to be of type array or string, but found ${we(Ve(t))} instead.`);if(this.endIndex){const i=this.endIndex.evaluate(e);return t.slice(r,i)}return t.slice(r)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function ir(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function nr(e,t,r,i){return 0===i.compare(t,r)}function or(e,t,r){const i="=="!==e&&"!="!==e;return class n{constructor(e,t,r){this.type=de,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const r=e[0];let o=t.parse(e[1],1,ye);if(!o)return null;if(!ir(r,o.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${we(o.type)}'.`);let a=t.parse(e[2],2,ye);if(!a)return null;if(!ir(r,a.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${we(a.type)}'.`);if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return t.error(`Cannot compare types '${we(o.type)}' and '${we(a.type)}'.`);i&&("value"===o.type.kind&&"value"!==a.type.kind?o=new We(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new We(o.type,[a])));let s=null;if(4===e.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return t.error("Cannot use collator to compare non-string types.");if(s=t.parse(e[3],3,ge),!s)return null}return new n(o,a,s)}evaluate(n){const o=this.lhs.evaluate(n),a=this.rhs.evaluate(n);if(i&&this.hasUntypedArgument){const t=Ve(o),r=Ve(a);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new Ge(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!i&&this.hasUntypedArgument){const e=Ve(o),r=Ve(a);if("string"!==e.kind||"string"!==r.kind)return t(n,o,a)}return this.collator?r(n,o,a,this.collator.evaluate(n)):t(n,o,a)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}const ar=or("==",(function(e,t,r){return t===r}),nr),sr=or("!=",(function(e,t,r){return t!==r}),(function(e,t,r,i){return!nr(0,t,r,i)})),lr=or("<",(function(e,t,r){return t<r}),(function(e,t,r,i){return i.compare(t,r)<0})),cr=or(">",(function(e,t,r){return t>r}),(function(e,t,r,i){return i.compare(t,r)>0})),ur=or("<=",(function(e,t,r){return t<=r}),(function(e,t,r,i){return i.compare(t,r)<=0})),hr=or(">=",(function(e,t,r){return t>=r}),(function(e,t,r,i){return i.compare(t,r)>=0}));class pr{constructor(e,t,r,i,n){this.type=pe,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=i,this.maxFractionDigits=n}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,he);if(!r)return null;const i=e[2];if("object"!=typeof i||Array.isArray(i))return t.error("NumberFormat options argument must be an object.");let n=null;if(i.locale&&(n=t.parse(i.locale,1,pe),!n))return null;let o=null;if(i.currency&&(o=t.parse(i.currency,1,pe),!o))return null;let a=null;if(i["min-fraction-digits"]&&(a=t.parse(i["min-fraction-digits"],1,he),!a))return null;let s=null;return i["max-fraction-digits"]&&(s=t.parse(i["max-fraction-digits"],1,he),!s)?null:new pr(r,n,o,a,s)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class dr{constructor(e){this.type=_e,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");const i=[];let n=!1;for(let r=1;r<=e.length-1;++r){const o=e[r];if(n&&"object"==typeof o&&!Array.isArray(o)){n=!1;let e=null;if(o["font-scale"]&&(e=t.parse(o["font-scale"],1,he),!e))return null;let r=null;if(o["text-font"]&&(r=t.parse(o["text-font"],1,xe(pe)),!r))return null;let a=null;if(o["text-color"]&&(a=t.parse(o["text-color"],1,fe),!a))return null;const s=i[i.length-1];s.scale=e,s.font=r,s.textColor=a}else{const o=t.parse(e[r],1,ye);if(!o)return null;const a=o.type.kind;if("string"!==a&&"value"!==a&&"null"!==a&&"resolvedImage"!==a)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,i.push({content:o,scale:null,font:null,textColor:null})}}return new dr(i)}evaluate(e){return new Re(this.sections.map((t=>{const r=t.content.evaluate(e);return Ve(r)===ve?new je("",r,null,null,null):new je(qe(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}}class fr{constructor(e){this.type=ve,this.input=e}static parse(e,t){if(2!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,pe);return r?new fr(r):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),r=Fe.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}}class mr{constructor(e){this.type=he,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error(`Expected argument of type string or array, but found ${we(r.type)} instead.`):new mr(r):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new Ge(`Expected value to be of type string or array, but found ${we(Ve(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const yr={"==":ar,"!=":sr,">":cr,"<":lr,">=":hr,"<=":ur,array:We,at:Jt,boolean:We,case:tr,coalesce:Kt,collator:Qe,format:dr,image:fr,in:Yt,"index-of":Qt,interpolate:Wt,"interpolate-hcl":Wt,"interpolate-lab":Wt,length:mr,let:Ht,literal:$e,match:er,number:We,"number-format":pr,object:We,slice:rr,step:Tt,string:We,"to-boolean":Ke,"to-color":Ke,"to-number":Ke,"to-string":Ke,var:xt,within:gt};function gr(e,[t,r,i,n]){t=t.evaluate(e),r=r.evaluate(e),i=i.evaluate(e);const o=n?n.evaluate(e):1,a=Ne(t,r,i,o);if(a)throw new Ge(a);return new De(t/255*o,r/255*o,i/255*o,o)}function _r(e,t){return e in t}function br(e,t){const r=t[e];return void 0===r?null:r}function vr(e){return{type:e}}function xr(e){return{result:"success",value:e}}function wr(e){return{result:"error",value:e}}function Sr(e){return!!e.expression&&e.expression.interpolated}function Er(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function Tr(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function kr(e){return e}function Ar(e,t){const r="color"===t.type,i=e.stops&&"object"==typeof e.stops[0][0],n=i||void 0!==e.property,o=i||!n,a=e.type||(Sr(t)?"exponential":"interval");if(r||"padding"===t.type){const i=r?De.parse:Be.parse;(e=se({},e)).stops&&(e.stops=e.stops.map((e=>[e[0],i(e[1])]))),e.default?e.default=i(e.default):e.default=i(t.default)}if(e.colorSpace&&"rgb"!==e.colorSpace&&!Zt[e.colorSpace])throw new Error(`Unknown color space: ${e.colorSpace}`);let s,l,c;if("exponential"===a)s=zr;else if("interval"===a)s=Cr;else if("categorical"===a){s=Pr,l=Object.create(null);for(const t of e.stops)l[t[0]]=t[1];c=typeof e.stops[0][0]}else{if("identity"!==a)throw new Error(`Unknown function type "${a}"`);s=Mr}if(i){const r={},i=[];for(let t=0;t<e.stops.length;t++){const n=e.stops[t],o=n[0].zoom;void 0===r[o]&&(r[o]={zoom:o,type:e.type,property:e.property,default:e.default,stops:[]},i.push(o)),r[o].stops.push([n[0].value,n[1]])}const n=[];for(const e of i)n.push([r[e].zoom,Ar(r[e],t)]);const o={name:"linear"};return{kind:"composite",interpolationType:o,interpolationFactor:Wt.interpolationFactor.bind(void 0,o),zoomStops:n.map((e=>e[0])),evaluate:({zoom:r},i)=>zr({stops:n,base:e.base},t,r).evaluate(r,i)}}if(o){const r="exponential"===a?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:Wt.interpolationFactor.bind(void 0,r),zoomStops:e.stops.map((e=>e[0])),evaluate:({zoom:r})=>s(e,t,r,l,c)}}return{kind:"source",evaluate(r,i){const n=i&&i.properties?i.properties[e.property]:void 0;return void 0===n?Ir(e.default,t.default):s(e,t,n,l,c)}}}function Ir(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function Pr(e,t,r,i,n){return Ir(typeof r===n?i[r]:void 0,e.default,t.default)}function Cr(e,t,r){if("number"!==Er(r))return Ir(e.default,t.default);const i=e.stops.length;if(1===i)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];const n=Et(e.stops.map((e=>e[0])),r);return e.stops[n][1]}function zr(e,t,r){const i=void 0!==e.base?e.base:1;if("number"!==Er(r))return Ir(e.default,t.default);const n=e.stops.length;if(1===n)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];const o=Et(e.stops.map((e=>e[0])),r),a=function(e,t,r,i){const n=i-r,o=e-r;return 0===n?0:1===t?o/n:(Math.pow(t,o)-1)/(Math.pow(t,n)-1)}(r,i,e.stops[o][0],e.stops[o+1][0]),s=e.stops[o][1],l=e.stops[o+1][1];let c=Pt[t.type]||kr;if(e.colorSpace&&"rgb"!==e.colorSpace){const t=Zt[e.colorSpace];c=(e,r)=>t.reverse(t.interpolate(t.forward(e),t.forward(r),a))}return"function"==typeof s.evaluate?{evaluate(...e){const t=s.evaluate.apply(void 0,e),r=l.evaluate.apply(void 0,e);if(void 0!==t&&void 0!==r)return c(t,r,a)}}:c(s,l,a)}function Mr(e,t,r){switch(t.type){case"color":r=De.parse(r);break;case"formatted":r=Re.fromString(r.toString());break;case"resolvedImage":r=Fe.fromString(r.toString());break;case"padding":r=Be.parse(r);break;default:Er(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0)}return Ir(r,e.default,t.default)}Ye.register(yr,{error:[{kind:"error"},[pe],(e,[t])=>{throw new Ge(t.evaluate(e))}],typeof:[pe,[ye],(e,[t])=>we(Ve(t.evaluate(e)))],"to-rgba":[xe(he,4),[fe],(e,[t])=>t.evaluate(e).toArray()],rgb:[fe,[he,he,he],gr],rgba:[fe,[he,he,he,he],gr],has:{type:de,overloads:[[[pe],(e,[t])=>_r(t.evaluate(e),e.properties())],[[pe,me],(e,[t,r])=>_r(t.evaluate(e),r.evaluate(e))]]},get:{type:ye,overloads:[[[pe],(e,[t])=>br(t.evaluate(e),e.properties())],[[pe,me],(e,[t,r])=>br(t.evaluate(e),r.evaluate(e))]]},"feature-state":[ye,[pe],(e,[t])=>br(t.evaluate(e),e.featureState||{})],properties:[me,[],e=>e.properties()],"geometry-type":[pe,[],e=>e.geometryType()],id:[ye,[],e=>e.id()],zoom:[he,[],e=>e.globals.zoom],"heatmap-density":[he,[],e=>e.globals.heatmapDensity||0],"line-progress":[he,[],e=>e.globals.lineProgress||0],accumulated:[ye,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[he,vr(he),(e,t)=>{let r=0;for(const i of t)r+=i.evaluate(e);return r}],"*":[he,vr(he),(e,t)=>{let r=1;for(const i of t)r*=i.evaluate(e);return r}],"-":{type:he,overloads:[[[he,he],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[he],(e,[t])=>-t.evaluate(e)]]},"/":[he,[he,he],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[he,[he,he],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[he,[],()=>Math.LN2],pi:[he,[],()=>Math.PI],e:[he,[],()=>Math.E],"^":[he,[he,he],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[he,[he],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[he,[he],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[he,[he],(e,[t])=>Math.log(t.evaluate(e))],log2:[he,[he],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[he,[he],(e,[t])=>Math.sin(t.evaluate(e))],cos:[he,[he],(e,[t])=>Math.cos(t.evaluate(e))],tan:[he,[he],(e,[t])=>Math.tan(t.evaluate(e))],asin:[he,[he],(e,[t])=>Math.asin(t.evaluate(e))],acos:[he,[he],(e,[t])=>Math.acos(t.evaluate(e))],atan:[he,[he],(e,[t])=>Math.atan(t.evaluate(e))],min:[he,vr(he),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[he,vr(he),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[he,[he],(e,[t])=>Math.abs(t.evaluate(e))],round:[he,[he],(e,[t])=>{const r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[he,[he],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[he,[he],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[de,[pe,ye],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[de,[ye],(e,[t])=>e.id()===t.value],"filter-type-==":[de,[pe],(e,[t])=>e.geometryType()===t.value],"filter-<":[de,[pe,ye],(e,[t,r])=>{const i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i<n}],"filter-id-<":[de,[ye],(e,[t])=>{const r=e.id(),i=t.value;return typeof r==typeof i&&r<i}],"filter->":[de,[pe,ye],(e,[t,r])=>{const i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>n}],"filter-id->":[de,[ye],(e,[t])=>{const r=e.id(),i=t.value;return typeof r==typeof i&&r>i}],"filter-<=":[de,[pe,ye],(e,[t,r])=>{const i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i<=n}],"filter-id-<=":[de,[ye],(e,[t])=>{const r=e.id(),i=t.value;return typeof r==typeof i&&r<=i}],"filter->=":[de,[pe,ye],(e,[t,r])=>{const i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>=n}],"filter-id->=":[de,[ye],(e,[t])=>{const r=e.id(),i=t.value;return typeof r==typeof i&&r>=i}],"filter-has":[de,[ye],(e,[t])=>t.value in e.properties()],"filter-has-id":[de,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[de,[xe(pe)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[de,[xe(ye)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[de,[pe,xe(ye)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[de,[pe,xe(ye)],(e,[t,r])=>function(e,t,r,i){for(;r<=i;){const n=r+i>>1;if(t[n]===e)return!0;t[n]>e?i=n-1:r=n+1}return!1}(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:de,overloads:[[[de,de],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[vr(de),(e,t)=>{for(const r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:de,overloads:[[[de,de],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[vr(de),(e,t)=>{for(const r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[de,[de],(e,[t])=>!t.evaluate(e)],"is-supported-script":[de,[pe],(e,[t])=>{const r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[pe,[pe],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[pe,[pe],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[pe,vr(ye),(e,t)=>t.map((t=>qe(t.evaluate(e)))).join("")],"resolved-locale":[pe,[ge],(e,[t])=>t.evaluate(e).resolvedLocale()]});class Or{constructor(e,t){var r;this.expression=e,this._warningHistory={},this._evaluator=new Je,this._defaultValue=t?"color"===(r=t).type&&Tr(r.default)?new De(0,0,0,0):"color"===r.type?De.parse(r.default)||null:"padding"===r.type?Be.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=t&&"enum"===t.type?t.values:null}evaluateWithoutErrorHandling(e,t,r,i,n,o){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,i,n,o){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new Ge(`Expected value to be one of ${Object.keys(this._enumValues).map((e=>JSON.stringify(e))).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}}}function Dr(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in yr}function Lr(e,t){const r=new wt(yr,[],t?function(e){const t={color:fe,string:pe,number:he,enum:pe,boolean:de,formatted:_e,padding:be,resolvedImage:ve};if("array"===e.type)return xe(t[e.value]||ye,e.length);return t[e.type]}(t):void 0),i=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return i?xr(new Or(i,t)):(z.exports(r.errors.length>0),wr(r.errors))}class jr{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!bt(t.expression)}evaluateWithoutErrorHandling(e,t,r,i,n,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,o)}evaluate(e,t,r,i,n,o){return this._styleExpression.evaluate(e,t,r,i,n,o)}}class Rr{constructor(e,t,r,i){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!bt(t.expression),this.interpolationType=i}evaluateWithoutErrorHandling(e,t,r,i,n,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,o)}evaluate(e,t,r,i,n,o){return this._styleExpression.evaluate(e,t,r,i,n,o)}interpolationFactor(e,t,r){return this.interpolationType?Wt.interpolationFactor(this.interpolationType,e,t,r):0}}function Br(e,t){const r=Lr(e,t);if("error"===r.result)return r;const i=r.value.expression,n=_t(i);if(!n&&("data-driven"!==(o=t)["property-type"]&&"cross-faded-data-driven"!==o["property-type"]))return wr([new le("","data expressions not supported")]);var o;const a=vt(i,["zoom"]);if(!a&&!function(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}(t))return wr([new le("","zoom expressions not supported")]);const s=Nr(i);if(!s&&!a)return wr([new le("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(s instanceof le)return wr([s]);if(s instanceof Wt&&!Sr(t))return wr([new le("",'"interpolate" expressions cannot be used with this property')]);if(!s)return xr(new jr(n?"constant":"source",r.value));const l=s instanceof Wt?s.interpolation:void 0;return xr(new Rr(n?"camera":"composite",r.value,s.labels,l))}class Fr{constructor(e,t){this._parameters=e,this._specification=t,se(this,Ar(this._parameters,this._specification))}static deserialize(e){return new Fr(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Nr(e){let t=null;if(e instanceof Ht)t=Nr(e.result);else if(e instanceof Kt){for(const r of e.args)if(t=Nr(r),t)break}else(e instanceof Tt||e instanceof Wt)&&e.input instanceof Ye&&"zoom"===e.input.name&&(t=e);return t instanceof le||e.eachChild((e=>{const r=Nr(e);r instanceof le?t=r:!t&&r?t=new le("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new le("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}!function(e){var t=function(){var e=function(e,t,r,i){for(r=r||{},i=e.length;i--;r[e[i]]=t);return r},t=[1,12],r=[1,13],i=[1,9],n=[1,10],o=[1,11],a=[1,14],s=[1,15],l=[14,18,22,24],c=[18,22],u=[22,24],h={trace:function(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function(e,t,r,i,n,o,a){var s=o.length-1;switch(n){case 1:this.$=new String(e.replace(/\\(\\|")/g,"$1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b")),this.$.__line__=this._$.first_line;break;case 2:this.$=new Number(e),this.$.__line__=this._$.first_line;break;case 3:this.$=null;break;case 4:this.$=new Boolean(!0),this.$.__line__=this._$.first_line;break;case 5:this.$=new Boolean(!1),this.$.__line__=this._$.first_line;break;case 6:return this.$=o[s-1];case 13:this.$={},Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 14:case 19:this.$=o[s-1],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 15:this.$=[o[s-2],o[s]];break;case 16:this.$={},this.$[o[s][0]]=o[s][1];break;case 17:this.$=o[s-2],o[s-2][o[s][0]]=o[s][1];break;case 18:this.$=[],Object.defineProperty(this.$,"__line__",{value:this._$.first_line,enumerable:!1});break;case 20:this.$=[o[s]];break;case 21:this.$=o[s-2],o[s-2].push(o[s])}},table:[{3:5,4:t,5:6,6:r,7:3,8:i,9:4,10:n,11:o,12:1,13:2,15:7,16:8,17:a,23:s},{1:[3]},{14:[1,16]},e(l,[2,7]),e(l,[2,8]),e(l,[2,9]),e(l,[2,10]),e(l,[2,11]),e(l,[2,12]),e(l,[2,3]),e(l,[2,4]),e(l,[2,5]),e([14,18,21,22,24],[2,1]),e(l,[2,2]),{3:20,4:t,18:[1,17],19:18,20:19},{3:5,4:t,5:6,6:r,7:3,8:i,9:4,10:n,11:o,13:23,15:7,16:8,17:a,23:s,24:[1,21],25:22},{1:[2,6]},e(l,[2,13]),{18:[1,24],22:[1,25]},e(c,[2,16]),{21:[1,26]},e(l,[2,18]),{22:[1,28],24:[1,27]},e(u,[2,20]),e(l,[2,14]),{3:20,4:t,20:29},{3:5,4:t,5:6,6:r,7:3,8:i,9:4,10:n,11:o,13:30,15:7,16:8,17:a,23:s},e(l,[2,19]),{3:5,4:t,5:6,6:r,7:3,8:i,9:4,10:n,11:o,13:31,15:7,16:8,17:a,23:s},e(c,[2,17]),e(c,[2,15]),e(u,[2,21])],defaultActions:{16:[2,6]},parseError:function(e,t){if(!t.recoverable)throw new Error(e);this.trace(e)},parse:function(e){var t=this,r=[0],i=[null],n=[],o=this.table,a="",s=0,l=0,c=2,u=1,h=n.slice.call(arguments,1),p=Object.create(this.lexer),d={yy:{}};for(var f in this.yy)Object.prototype.hasOwnProperty.call(this.yy,f)&&(d.yy[f]=this.yy[f]);p.setInput(e,d.yy),d.yy.lexer=p,d.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var m=p.yylloc;n.push(m);var y=p.options&&p.options.ranges;function g(){var e;return"number"!=typeof(e=p.lex()||u)&&(e=t.symbols_[e]||e),e}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var _,b,v,x,w,S,E,T,k={};;){if(b=r[r.length-1],this.defaultActions[b]?v=this.defaultActions[b]:(null==_&&(_=g()),v=o[b]&&o[b][_]),void 0===v||!v.length||!v[0]){var A="";for(w in T=[],o[b])this.terminals_[w]&&w>c&&T.push("'"+this.terminals_[w]+"'");A=p.showPosition?"Parse error on line "+(s+1)+":\n"+p.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[_]||_)+"'":"Parse error on line "+(s+1)+": Unexpected "+(_==u?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(A,{text:p.match,token:this.terminals_[_]||_,line:p.yylineno,loc:m,expected:T})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+_);switch(v[0]){case 1:r.push(_),i.push(p.yytext),n.push(p.yylloc),r.push(v[1]),_=null,l=p.yyleng,a=p.yytext,s=p.yylineno,m=p.yylloc;break;case 2:if(S=this.productions_[v[1]][1],k.$=i[i.length-S],k._$={first_line:n[n.length-(S||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(S||1)].first_column,last_column:n[n.length-1].last_column},y&&(k._$.range=[n[n.length-(S||1)].range[0],n[n.length-1].range[1]]),void 0!==(x=this.performAction.apply(k,[a,l,s,d.yy,v[1],i,n].concat(h))))return x;S&&(r=r.slice(0,-1*S*2),i=i.slice(0,-1*S),n=n.slice(0,-1*S)),r.push(this.productions_[v[1]][0]),i.push(k.$),n.push(k._$),E=o[r[r.length-2]][r[r.length-1]],r.push(E);break;case 3:return!0}}return!0}},p=function(){var e={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,r=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===i.length?this.yylloc.first_column:0)+i[i.length-r.length].length-r[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},test_match:function(e,t){var r,i,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(i=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],r=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var o in n)this[o]=n[o];return!1}return!1},next:function(){if(this.done)return this.EOF;var e,t,r,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),o=0;o<n.length;o++)if((r=this._input.match(this.rules[n[o]]))&&(!t||r[0].length>t[0].length)){if(t=r,i=o,this.options.backtrack_lexer){if(!1!==(e=this.test_match(r,n[o])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,n[i]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return e||this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},pushState:function(e){this.begin(e)},stateStackSize:function(){return this.conditionStack.length},options:{},performAction:function(e,t,r,i){switch(r){case 0:break;case 1:return 6;case 2:return t.yytext=t.yytext.substr(1,t.yyleng-2),4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}},rules:[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:!0}}};return e}();function d(){this.yy={}}return h.lexer=p,d.prototype=h,h.Parser=d,new d}();e.parser=t,e.Parser=t.Parser,e.parse=function(){return t.parse.apply(t,arguments)}}({});const Ur={StyleExpression:Or,isExpression:Dr,isExpressionFilter:function e(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const r of t.slice(1))if(!e(r)&&"boolean"!=typeof r)return!1;return!0;default:return!0}},createExpression:Lr,createPropertyExpression:Br,normalizePropertyExpression:function(e,t){if(Tr(e))return new Fr(e,t);if(Dr(e)){const r=Br(e,t);if("error"===r.result)throw new Error(r.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return r.value}{let r=e;return"color"===t.type&&"string"==typeof e?r=De.parse(e):"padding"!==t.type||"number"!=typeof e&&!Array.isArray(e)||(r=Be.parse(e)),{kind:"constant",evaluate:()=>r}}},ZoomConstantExpression:jr,ZoomDependentExpression:Rr,StylePropertyFunction:Fr};"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Vr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qr={exports:{}};!function(e,t){"undefined"!=typeof self&&self,e.exports=function(e){var t={};function r(i){if(t[i])return t[i].exports;var n=t[i]={i:i,l:!1,exports:{}};return e[i].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,i){r.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:i})},r.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){function i(e){if(!(this instanceof i))return new i(e);this._=e}var n=i.prototype;function o(e,t){for(var r=0;r<e;r++)t(r)}function a(e,t,r){return function(e,t){o(t.length,(function(r){e(t[r],r,t)}))}((function(r,i,n){t=e(t,r,i,n)}),r),t}function s(e,t){return a((function(t,r,i,n){return t.concat([e(r,i,n)])}),[],t)}function l(e,t){var r={v:0,buf:t};return o(e,(function(){var e;r={v:r.v<<1|(e=r.buf,e[0]>>7),buf:function(e){var t=a((function(e,t,r,i){return e.concat(r===i.length-1?Buffer.from([t,0]).readUInt16BE(0):i.readUInt16BE(r))}),[],e);return Buffer.from(s((function(e){return(e<<1&65535)>>8}),t))}(r.buf)}})),r}function c(){return"undefined"!=typeof Buffer}function u(){if(!c())throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.")}function h(e){u();var t=a((function(e,t){return e+t}),0,e);if(t%8!=0)throw new Error("The bits ["+e.join(", ")+"] add up to "+t+" which is not an even number of bytes; the total should be divisible by 8");var r,n=t/8,o=(r=function(e){return e>48},a((function(e,t){return e||(r(t)?t:e)}),null,e));if(o)throw new Error(o+" bit range requested exceeds 48 bit (6 byte) Number max.");return new i((function(t,r){var i=n+r;return i>t.length?w(r,n.toString()+" bytes"):x(i,a((function(e,t){var r=l(t,e.buf);return{coll:e.coll.concat(r.v),buf:r.buf}}),{coll:[],buf:t.slice(r,i)},e).coll)}))}function p(e,t){return new i((function(r,i){return u(),i+t>r.length?w(i,t+" bytes for "+e):x(i+t,r.slice(i,i+t))}))}function d(e,t){if("number"!=typeof(r=t)||Math.floor(r)!==r||t<0||t>6)throw new Error(e+" requires integer length in range [0, 6].");var r}function f(e){return d("uintBE",e),p("uintBE("+e+")",e).map((function(t){return t.readUIntBE(0,e)}))}function m(e){return d("uintLE",e),p("uintLE("+e+")",e).map((function(t){return t.readUIntLE(0,e)}))}function y(e){return d("intBE",e),p("intBE("+e+")",e).map((function(t){return t.readIntBE(0,e)}))}function g(e){return d("intLE",e),p("intLE("+e+")",e).map((function(t){return t.readIntLE(0,e)}))}function _(e){return e instanceof i}function b(e){return"[object Array]"==={}.toString.call(e)}function v(e){return c()&&Buffer.isBuffer(e)}function x(e,t){return{status:!0,index:e,value:t,furthest:-1,expected:[]}}function w(e,t){return b(t)||(t=[t]),{status:!1,index:-1,value:null,furthest:e,expected:t}}function S(e,t){if(!t)return e;if(e.furthest>t.furthest)return e;var r=e.furthest===t.furthest?function(e,t){if(function(){if(void 0!==i._supportsSet)return i._supportsSet;var e="undefined"!=typeof Set;return i._supportsSet=e,e}()&&Array.from){for(var r=new Set(e),n=0;n<t.length;n++)r.add(t[n]);var o=Array.from(r);return o.sort(),o}for(var a={},s=0;s<e.length;s++)a[e[s]]=!0;for(var l=0;l<t.length;l++)a[t[l]]=!0;var c=[];for(var u in a)({}).hasOwnProperty.call(a,u)&&c.push(u);return c.sort(),c}(e.expected,t.expected):t.expected;return{status:e.status,index:e.index,value:e.value,furthest:t.furthest,expected:r}}var E={};function T(e,t){if(v(e))return{offset:t,line:-1,column:-1};e in E||(E[e]={});for(var r=E[e],i=0,n=0,o=0,a=t;a>=0;){if(a in r){i=r[a].line,0===o&&(o=r[a].lineStart);break}("\n"===e.charAt(a)||"\r"===e.charAt(a)&&"\n"!==e.charAt(a+1))&&(n++,0===o&&(o=a+1)),a--}var s=i+n,l=t-o;return r[t]={line:s,lineStart:o},{offset:t,line:s+1,column:l+1}}function k(e){if(!_(e))throw new Error("not a parser: "+e)}function A(e,t){return"string"==typeof e?e.charAt(t):e[t]}function I(e){if("number"!=typeof e)throw new Error("not a number: "+e)}function P(e){if("function"!=typeof e)throw new Error("not a function: "+e)}function C(e){if("string"!=typeof e)throw new Error("not a string: "+e)}var z=2,M=3,O=8,D=5*O,L=4*O,j=" ";function R(e,t){return new Array(t+1).join(e)}function B(e,t,r){var i=t-e.length;return i<=0?e:R(r,i)+e}function F(e,t,r,i){return{from:e-t>0?e-t:0,to:e+r>i?i:e+r}}function N(e,t){var r,i,n,o,l,c=t.index,u=c.offset,h=1;if(u===e.length)return"Got the end of the input";if(v(e)){var p=u-u%O,d=u-p,f=F(p,D,L+O,e.length),m=s((function(e){return s((function(e){return B(e.toString(16),2,"0")}),e)}),function(e,t){var r=e.length,i=[],n=0;if(r<=t)return[e.slice()];for(var o=0;o<r;o++)i[n]||i.push([]),i[n].push(e[o]),(o+1)%t==0&&n++;return i}(e.slice(f.from,f.to).toJSON().data,O));o=function(e){return 0===e.from&&1===e.to?{from:e.from,to:e.to}:{from:e.from/O,to:Math.floor(e.to/O)}}(f),i=p/O,r=3*d,d>=4&&(r+=1),h=2,n=s((function(e){return e.length<=4?e.join(" "):e.slice(0,4).join(" ")+" "+e.slice(4).join(" ")}),m),(l=(8*(o.to>0?o.to-1:o.to)).toString(16).length)<2&&(l=2)}else{var y=e.split(/\r\n|[\n\r\u2028\u2029]/);r=c.column-1,i=c.line-1,o=F(i,z,M,y.length),n=y.slice(o.from,o.to),l=o.to.toString().length}var g=i-o.from;return v(e)&&(l=(8*(o.to>0?o.to-1:o.to)).toString(16).length)<2&&(l=2),a((function(t,i,n){var a,s=n===g,c=s?"> ":j;return a=v(e)?B((8*(o.from+n)).toString(16),l,"0"):B((o.from+n+1).toString(),l," "),[].concat(t,[c+a+" | "+i],s?[j+R(" ",l)+" | "+B("",r," ")+R("^",h)]:[])}),[],n).join("\n")}function U(e,t){return["\n","-- PARSING FAILED "+R("-",50),"\n\n",N(e,t),"\n\n",(r=t.expected,1===r.length?"Expected:\n\n"+r[0]:"Expected one of the following: \n\n"+r.join(", ")),"\n"].join("");var r}function V(e){return void 0!==e.flags?e.flags:[e.global?"g":"",e.ignoreCase?"i":"",e.multiline?"m":"",e.unicode?"u":"",e.sticky?"y":""].join("")}function q(){for(var e=[].slice.call(arguments),t=e.length,r=0;r<t;r+=1)k(e[r]);return i((function(r,i){for(var n,o=new Array(t),a=0;a<t;a+=1){if(!(n=S(e[a]._(r,i),n)).status)return n;o[a]=n.value,i=n.index}return S(x(i,o),n)}))}function $(){var e=[].slice.call(arguments);if(0===e.length)throw new Error("seqMap needs at least one argument");var t=e.pop();return P(t),q.apply(null,e).map((function(e){return t.apply(null,e)}))}function G(){var e=[].slice.call(arguments),t=e.length;if(0===t)return J("zero alternates");for(var r=0;r<t;r+=1)k(e[r]);return i((function(t,r){for(var i,n=0;n<e.length;n+=1)if((i=S(e[n]._(t,r),i)).status)return i;return i}))}function Z(e,t){return W(e,t).or(H([]))}function W(e,t){return k(e),k(t),$(e,t.then(e).many(),(function(e,t){return[e].concat(t)}))}function X(e){C(e);var t="'"+e+"'";return i((function(r,i){var n=i+e.length,o=r.slice(i,n);return o===e?x(n,o):w(i,t)}))}function K(e,t){!function(e){if(!(e instanceof RegExp))throw new Error("not a regexp: "+e);for(var t=V(e),r=0;r<t.length;r++){var i=t.charAt(r);if("i"!==i&&"m"!==i&&"u"!==i&&"s"!==i)throw new Error('unsupported regexp flag "'+i+'": '+e)}}(e),arguments.length>=2?I(t):t=0;var r=function(e){return RegExp("^(?:"+e.source+")",V(e))}(e),n=""+e;return i((function(e,i){var o=r.exec(e.slice(i));if(o){if(0<=t&&t<=o.length){var a=o[0],s=o[t];return x(i+a.length,s)}return w(i,"valid match group (0 to "+o.length+") in "+n)}return w(i,n)}))}function H(e){return i((function(t,r){return x(r,e)}))}function J(e){return i((function(t,r){return w(r,e)}))}function Y(e){if(_(e))return i((function(t,r){var i=e._(t,r);return i.index=r,i.value="",i}));if("string"==typeof e)return Y(X(e));if(e instanceof RegExp)return Y(K(e));throw new Error("not a string, regexp, or parser: "+e)}function Q(e){return k(e),i((function(t,r){var i=e._(t,r),n=t.slice(r,i.index);return i.status?w(r,'not "'+n+'"'):x(r,null)}))}function ee(e){return P(e),i((function(t,r){var i=A(t,r);return r<t.length&&e(i)?x(r+1,i):w(r,"a character/byte matching "+e)}))}function te(e,t){arguments.length<2&&(t=e,e=void 0);var r=i((function(e,i){return r._=t()._,r._(e,i)}));return e?r.desc(e):r}function re(){return J("fantasy-land/empty")}n.parse=function(e){if("string"!=typeof e&&!v(e))throw new Error(".parse must be called with a string or Buffer as its argument");var t,r=this.skip(ae)._(e,0);return t=r.status?{status:!0,value:r.value}:{status:!1,index:T(e,r.furthest),expected:r.expected},delete E[e],t},n.tryParse=function(e){var t=this.parse(e);if(t.status)return t.value;var r=U(e,t),i=new Error(r);throw i.type="ParsimmonError",i.result=t,i},n.assert=function(e,t){return this.chain((function(r){return e(r)?H(r):J(t)}))},n.or=function(e){return G(this,e)},n.trim=function(e){return this.wrap(e,e)},n.wrap=function(e,t){return $(e,this,t,(function(e,t){return t}))},n.thru=function(e){return e(this)},n.then=function(e){return k(e),q(this,e).map((function(e){return e[1]}))},n.many=function(){var e=this;return i((function(t,r){for(var i=[],n=void 0;;){if(!(n=S(e._(t,r),n)).status)return S(x(r,i),n);if(r===n.index)throw new Error("infinite loop detected in .many() parser --- calling .many() on a parser which can accept zero characters is usually the cause");r=n.index,i.push(n.value)}}))},n.tieWith=function(e){return C(e),this.map((function(t){if(function(e){if(!b(e))throw new Error("not an array: "+e)}(t),t.length){C(t[0]);for(var r=t[0],i=1;i<t.length;i++)C(t[i]),r+=e+t[i];return r}return""}))},n.tie=function(){return this.tieWith("")},n.times=function(e,t){var r=this;return arguments.length<2&&(t=e),I(e),I(t),i((function(i,n){for(var o=[],a=void 0,s=void 0,l=0;l<e;l+=1){if(s=S(a=r._(i,n),s),!a.status)return s;n=a.index,o.push(a.value)}for(;l<t&&(s=S(a=r._(i,n),s),a.status);l+=1)n=a.index,o.push(a.value);return S(x(n,o),s)}))},n.result=function(e){return this.map((function(){return e}))},n.atMost=function(e){return this.times(0,e)},n.atLeast=function(e){return $(this.times(e),this.many(),(function(e,t){return e.concat(t)}))},n.map=function(e){P(e);var t=this;return i((function(r,i){var n=t._(r,i);return n.status?S(x(n.index,e(n.value)),n):n}))},n.contramap=function(e){P(e);var t=this;return i((function(r,i){var n=t.parse(e(r.slice(i)));return n.status?x(i+r.length,n.value):n}))},n.promap=function(e,t){return P(e),P(t),this.contramap(e).map(t)},n.skip=function(e){return q(this,e).map((function(e){return e[0]}))},n.mark=function(){return $(ie,this,ie,(function(e,t,r){return{start:e,value:t,end:r}}))},n.node=function(e){return $(ie,this,ie,(function(t,r,i){return{name:e,value:r,start:t,end:i}}))},n.sepBy=function(e){return Z(this,e)},n.sepBy1=function(e){return W(this,e)},n.lookahead=function(e){return this.skip(Y(e))},n.notFollowedBy=function(e){return this.skip(Q(e))},n.desc=function(e){b(e)||(e=[e]);var t=this;return i((function(r,i){var n=t._(r,i);return n.status||(n.expected=e),n}))},n.fallback=function(e){return this.or(H(e))},n.ap=function(e){return $(e,this,(function(e,t){return e(t)}))},n.chain=function(e){var t=this;return i((function(r,i){var n=t._(r,i);return n.status?S(e(n.value)._(r,n.index),n):n}))},n.concat=n.or,n.empty=re,n.of=H,n["fantasy-land/ap"]=n.ap,n["fantasy-land/chain"]=n.chain,n["fantasy-land/concat"]=n.concat,n["fantasy-land/empty"]=n.empty,n["fantasy-land/of"]=n.of,n["fantasy-land/map"]=n.map;var ie=i((function(e,t){return x(t,T(e,t))})),ne=i((function(e,t){return t>=e.length?w(t,"any character/byte"):x(t+1,A(e,t))})),oe=i((function(e,t){return x(e.length,e.slice(t))})),ae=i((function(e,t){return t<e.length?w(t,"EOF"):x(t,null)})),se=K(/[0-9]/).desc("a digit"),le=K(/[0-9]*/).desc("optional digits"),ce=K(/[a-z]/i).desc("a letter"),ue=K(/[a-z]*/i).desc("optional letters"),he=K(/\s*/).desc("optional whitespace"),pe=K(/\s+/).desc("whitespace"),de=X("\r"),fe=X("\n"),me=X("\r\n"),ye=G(me,fe,de).desc("newline"),ge=G(ye,ae);i.all=oe,i.alt=G,i.any=ne,i.cr=de,i.createLanguage=function(e){var t={};for(var r in e)({}).hasOwnProperty.call(e,r)&&function(r){t[r]=te((function(){return e[r](t)}))}(r);return t},i.crlf=me,i.custom=function(e){return i(e(x,w))},i.digit=se,i.digits=le,i.empty=re,i.end=ge,i.eof=ae,i.fail=J,i.formatError=U,i.index=ie,i.isParser=_,i.lazy=te,i.letter=ce,i.letters=ue,i.lf=fe,i.lookahead=Y,i.makeFailure=w,i.makeSuccess=x,i.newline=ye,i.noneOf=function(e){return ee((function(t){return e.indexOf(t)<0})).desc("none of '"+e+"'")},i.notFollowedBy=Q,i.of=H,i.oneOf=function(e){for(var t=e.split(""),r=0;r<t.length;r++)t[r]="'"+t[r]+"'";return ee((function(t){return e.indexOf(t)>=0})).desc(t)},i.optWhitespace=he,i.Parser=i,i.range=function(e,t){return ee((function(r){return e<=r&&r<=t})).desc(e+"-"+t)},i.regex=K,i.regexp=K,i.sepBy=Z,i.sepBy1=W,i.seq=q,i.seqMap=$,i.seqObj=function(){for(var e,t={},r=0,n=(e=arguments,Array.prototype.slice.call(e)),o=n.length,a=0;a<o;a+=1){var s=n[a];if(!_(s)){if(b(s)&&2===s.length&&"string"==typeof s[0]&&_(s[1])){var l=s[0];if(Object.prototype.hasOwnProperty.call(t,l))throw new Error("seqObj: duplicate key "+l);t[l]=!0,r++;continue}throw new Error("seqObj arguments must be parsers or [string, parser] array pairs.")}}if(0===r)throw new Error("seqObj expects at least one named parser, found zero");return i((function(e,t){for(var r,i={},a=0;a<o;a+=1){var s,l;if(b(n[a])?(s=n[a][0],l=n[a][1]):(s=null,l=n[a]),!(r=S(l._(e,t),r)).status)return r;s&&(i[s]=r.value),t=r.index}return S(x(t,i),r)}))},i.string=X,i.succeed=H,i.takeWhile=function(e){return P(e),i((function(t,r){for(var i=r;i<t.length&&e(A(t,i));)i++;return x(i,t.slice(r,i))}))},i.test=ee,i.whitespace=pe,i["fantasy-land/empty"]=re,i["fantasy-land/of"]=H,i.Binary={bitSeq:h,bitSeqObj:function(e){u();var t={},r=0,i=s((function(e){if(b(e)){var i=e;if(2!==i.length)throw new Error("["+i.join(", ")+"] should be length 2, got length "+i.length);if(C(i[0]),I(i[1]),Object.prototype.hasOwnProperty.call(t,i[0]))throw new Error("duplicate key in bitSeqObj: "+i[0]);return t[i[0]]=!0,r++,i}return I(e),[null,e]}),e);if(r<1)throw new Error("bitSeqObj expects at least one named pair, got ["+e.join(", ")+"]");var n=s((function(e){return e[0]}),i);return h(s((function(e){return e[1]}),i)).map((function(e){return a((function(e,t){return null!==t[0]&&(e[t[0]]=t[1]),e}),{},s((function(t,r){return[t,e[r]]}),n))}))},byte:function(e){if(u(),I(e),e>255)throw new Error("Value specified to byte constructor ("+e+"=0x"+e.toString(16)+") is larger in value than a single byte.");var t=(e>15?"0x":"0x0")+e.toString(16);return i((function(r,i){var n=A(r,i);return n===e?x(i+1,n):w(i,t)}))},buffer:function(e){return p("buffer",e).map((function(e){return Buffer.from(e)}))},encodedString:function(e,t){return p("string",t).map((function(t){return t.toString(e)}))},uintBE:f,uint8BE:f(1),uint16BE:f(2),uint32BE:f(4),uintLE:m,uint8LE:m(1),uint16LE:m(2),uint32LE:m(4),intBE:y,int8BE:y(1),int16BE:y(2),int32BE:y(4),intLE:g,int8LE:g(1),int16LE:g(2),int32LE:g(4),floatBE:p("floatBE",4).map((function(e){return e.readFloatBE(0)})),floatLE:p("floatLE",4).map((function(e){return e.readFloatLE(0)})),doubleBE:p("doubleBE",8).map((function(e){return e.readDoubleBE(0)})),doubleLE:p("doubleLE",8).map((function(e){return e.readDoubleLE(0)}))},e.exports=i}])}(qr);var $r=Vr(qr.exports);function Gr(e,t){var r=$r.lazy((function(){return $r.seq(e,r).or(t)}));return r}function Zr(e,t){var r=$r.lazy((function(){return t.chain((function(t){return $r.seq(e,$r.of(t),r).or($r.of(t))}))}));return r}function Wr(e,t){var r=$r.lazy((function(){return t.chain((function(t){return $r.seqMap(e,$r.of(t),r,$r.string(":").trim($r.optWhitespace),r,(function(e,t,r,i,n){return[e,["to-boolean",t],r,n]})).or($r.of(t))}))}));return r}function Xr(e,t){return $r.seqMap(t,$r.seq(e,t).many(),(function(e,t){return t.reduce((function(e,t){var r=s(t,2);return[r[0],e,r[1]]}),e)}))}var Kr=function(){function e(){Object.defineProperty(this,"language",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.language=this.createLanguage()}return Object.defineProperty(e.prototype,"parseExpression",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.language.Expr.parse(e)}}),Object.defineProperty(e.prototype,"parseProgram",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.language.ProgramOrEmpty.parse(e)}}),Object.defineProperty(e.prototype,"createLanguage",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this,t=[{type:Gr,ops:this.operators({"-":"-","!":"!"})},{type:Zr,ops:this.operators({"^":"**"})},{type:Xr,ops:this.operators({"*":"*","/":"/","%":"%"})},{type:Xr,ops:this.operators({"+":"+","-":"-"})},{type:Xr,ops:this.operators({">=":">=","<=":"<="})},{type:Xr,ops:this.operators({"<":"<",">":">"})},{type:Xr,ops:this.operators({"==":"==","!=":"!="})},{type:Xr,ops:this.operators({all:"&&"})},{type:Xr,ops:this.operators({any:"||"})},{type:Wr,ops:this.operators({case:"?"})}];return $r.createLanguage({Whitespace:function(){return $r.regexp(/[ \n]*/).desc("whitespace")},NotNewline:function(){return $r.regexp(/[^\n]*/).desc("non-newline")},LineComment:function(e){return e.NotNewline.wrap($r.string("//"),$r.alt($r.string("\n"),$r.eof))},BlockComment:function(){return $r.regexp(/\/\*[\s\S]*?\*\//)},Comment:function(e){return $r.alt(e.LineComment,e.BlockComment).desc("comment")},End:function(){return $r.alt($r.string(";"),$r.eof)},_:function(e){return e.Comment.sepBy(e.Whitespace).trim(e.Whitespace)},Integer:function(){return $r.regexp(/-?[0-9]+/).map(Number)},Decimal:function(){return $r.regexp(/-?[0-9]+\.[0-9]+/).map(Number)},Number:function(e){return $r.alt(e.Decimal,e.Integer).desc("number")},Boolean:function(){return $r.alt($r.string("true"),$r.string("false")).map((function(e){return"true"===e})).desc("boolean")},Null:function(){return $r.string("null").result(null).desc("null")},DoubleQuoteString:function(){return $r.regexp(/"((?:\\.|.)*?)"/,1).desc("string")},SingleQuoteString:function(){return $r.regexp(/'((?:\\.|.)*?)'/,1).desc("string")},UnquotedString:function(){return $r.regexp(/[a-zA-Z_][a-zA-Z0-9_-]*/).desc("string")},HexColor:function(){return $r.regexp(/#(?:[0-9a-f]{3}){1,2}/i).desc("hex color")},String:function(e){return $r.alt(e.SingleQuoteString,e.DoubleQuoteString,e.HexColor,e.UnquotedString).map((function(e){return e.replace(/\\n/gm,"\n")}))},Symbol:function(){return $r.regexp(/[a-zA-Z_][a-zA-Z0-9_-]*/).desc("symbol")},PartialSymbol:function(){return $r.regexp(/[a-zA-Z0-9_-]+/).desc("symbol")},Feature:function(e){return $r.seqMap($r.string("@"),e.PartialSymbol.sepBy($r.string(".")),(function(e,t){return["get"].concat(t)}))},FeatureState:function(t){return $r.seqMap($r.string("@@"),t.PartialSymbol.sepBy($r.string(".")),(function(t,r){return e.expandFeatureState(r)}))},Array:function(e){return $r.string("[").trim(e._).then(e.Value.trim(e._).sepBy($r.string(","))).skip($r.string("]"))},State:function(e){return $r.seqMap($r.string("$"),e.PartialSymbol.sepBy($r.string(".")),(function(e,t){return["state"].concat(t)}))},Paren:function(e){return $r.seqMap($r.string("("),e.Expr.trim(e._),$r.string(")"),(function(e,t,r){return t}))},Func:function(e){return $r.seqMap(e.Symbol.trim(e._),$r.string("("),e.Expr.trim(e._).sepBy($r.string(",")),$r.string(")"),(function(e,t,r,i){return l([e],s(r),!1)}))},Value:function(e){return $r.alt(e.Paren,e.Array,e.Func,e.Boolean,e.Null,e.Number,e.String,e.FeatureState,e.Feature,e.State)},Expr:function(r){return e.tableParser(t,r.Value)},PropertyName:function(){return $r.regexp(/[a-zA-Z_-][a-zA-Z0-9_-]*/).desc("symbol")},Assignment:function(e){return $r.seqMap(e.PropertyName,$r.string(":").trim(e._),e.Expr.trim(e._).node("expr"),e.End,(function(e,t,r){return[e,{expr:r.value,start:r.start,end:r.end}]}))},Program:function(e){return e.Assignment.trim(e._).many().map((function(e){return e.filter((function(e){return""!==e})).reduce((function(e,t){return e[t[0]]=t[1],e}),{})}))},EmptyProgram:function(e){return $r.seqMap(e._,$r.eof,(function(){return null}))},ProgramOrEmpty:function(e){return $r.alt(e.EmptyProgram,e.Program)}})}}),Object.defineProperty(e.prototype,"operators",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=Object.keys(e).sort().map((function(t){return $r.string(e[t]).trim($r.optWhitespace).result(t)}));return $r.alt.apply(null,t)}}),Object.defineProperty(e.prototype,"tableParser",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return e.reduce((function(e,t){return t.type(t.ops,e)}),t)}}),Object.defineProperty(e.prototype,"expandFeatureState",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=["feature-state",e.shift()];return e.forEach((function(e){return t=["get",e,t]})),t}}),e}();function Hr(e){return void 0===e}var Jr=function(e){return null===e},Yr=function(e){return Hr(e)||Jr(e)},Qr=function(e){return!Yr(e)},ei=function(e){return"string"==typeof e},ti=function(e){return Qr(e)&&e.length>0},ri=function(e){return ei(e)&&ti(e)},ii=function(e){return Array.isArray(e)},ni=function(e){return Array.isArray(e)&&ti(e)},oi=function(e){return ni(e)&&e.every((function(e){return ri(e)}))},ai=function(e){return"object"==typeof e&&!Jr(e)},si=function(e){return ai(e)&&ti(Object.keys(e))},li=function(e){return"number"==typeof e&&!Number.isNaN(e)&&Number.isFinite(e)},ci=function(e){return!1===e},ui=function(e){return!0===e},hi=function(e,t){return ni(t)&&t.some((function(t){return e===t}))},pi=function(e){return"boolean"==typeof e},di=function(e){return ei(e)&&/^[+-]?([0-9]*[.])?[0-9]+$/.test(e)},fi=function(e){return e instanceof Date},mi=function(e){return ri(e)||li(e)||pi(e)||fi(e)},yi=function(e){return ni(e)?e.every((function(e){return mi(e)})):mi(e)},gi=function(e){return"function"==typeof e};function _i(e){var t,r;return!!ai(e)&&(void 0===(t=e.constructor)||(r=t.prototype,!1!==ai(r)&&!1!==r.hasOwnProperty("isPrototypeOf")))}var bi=new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i");function vi(e){return ei(e)&&!!bi.test(e)}function xi(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];throw new Error("number"==typeof e?"[MobX] minified error nr: "+e+(r.length?" "+r.map(String).join(","):"")+". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts":"[MobX] "+e)}var wi={};function Si(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:wi}var Ei=Object.assign,Ti=Object.getOwnPropertyDescriptor,ki=Object.defineProperty,Ai=Object.prototype,Ii=[];Object.freeze(Ii);var Pi={};Object.freeze(Pi);var Ci="undefined"!=typeof Proxy,zi=Object.toString();function Mi(){Ci||xi("Proxy not available")}function Oi(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}var Di=function(){};function Li(e){return"function"==typeof e}function ji(e){switch(typeof e){case"string":case"symbol":case"number":return!0}return!1}function Ri(e){return null!==e&&"object"==typeof e}function Bi(e){if(!Ri(e))return!1;var t=Object.getPrototypeOf(e);if(null==t)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r.toString()===zi}function Fi(e){var t=null==e?void 0:e.constructor;return!!t&&("GeneratorFunction"===t.name||"GeneratorFunction"===t.displayName)}function Ni(e,t,r){ki(e,t,{enumerable:!1,writable:!0,configurable:!0,value:r})}function Ui(e,t,r){ki(e,t,{enumerable:!1,writable:!1,configurable:!0,value:r})}function Vi(e,t){var r="isMobX"+e;return t.prototype[r]=!0,function(e){return Ri(e)&&!0===e[r]}}function qi(e){return e instanceof Map}function $i(e){return e instanceof Set}var Gi=void 0!==Object.getOwnPropertySymbols;var Zi="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:Gi?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Object.getOwnPropertyNames;function Wi(e){return null===e?null:"object"==typeof e?""+e:e}function Xi(e,t){return Ai.hasOwnProperty.call(e,t)}var Ki=Object.getOwnPropertyDescriptors||function(e){var t={};return Zi(e).forEach((function(r){t[r]=Ti(e,r)})),t};function Hi(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function Ji(e,t,r){return t&&Hi(e.prototype,t),r&&Hi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Yi(){return Yi=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e},Yi.apply(this,arguments)}function Qi(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,en(e,t)}function en(e,t){return en=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},en(e,t)}function tn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function rn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=new Array(t);r<t;r++)i[r]=e[r];return i}function nn(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return rn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?rn(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0;return function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var on=Symbol("mobx-stored-annotations");function an(e){return Object.assign((function(t,r){sn(t,r,e)}),e)}function sn(e,t,r){Xi(e,on)||Ni(e,on,Yi({},e[on])),function(e){return e.annotationType_===mn}(r)||(e[on][t]=r)}var ln=Symbol("mobx administration"),cn=function(){function e(e){void 0===e&&(e="Atom"),this.name_=void 0,this.isPendingUnobservation_=!1,this.isBeingObserved_=!1,this.observers_=new Set,this.diffValue_=0,this.lastAccessedBy_=0,this.lowestObserverState_=co.NOT_TRACKING_,this.onBOL=void 0,this.onBUOL=void 0,this.name_=e}var t=e.prototype;return t.onBO=function(){this.onBOL&&this.onBOL.forEach((function(e){return e()}))},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach((function(e){return e()}))},t.reportObserved=function(){return Oo(this)},t.reportChanged=function(){zo(),Do(this),Mo()},t.toString=function(){return this.name_},e}(),un=Vi("Atom",cn);function hn(e,t,r){void 0===t&&(t=Di),void 0===r&&(r=Di);var i=new cn(e);return t!==Di&&ta(i,t),r!==Di&&ra(i,r),i}var pn={identity:function(e,t){return e===t},structural:function(e,t){return vs(e,t)},default:function(e,t){return Object.is?Object.is(e,t):e===t?0!==e||1/e==1/t:e!=e&&t!=t},shallow:function(e,t){return vs(e,t,1)}};function dn(e,t,r){return fa(e)?e:Array.isArray(e)?Gn.array(e,{name:r}):Bi(e)?Gn.object(e,void 0,{name:r}):qi(e)?Gn.map(e,{name:r}):$i(e)?Gn.set(e,{name:r}):"function"!=typeof e||Ho(e)||ha(e)?e:Fi(e)?ca(e):Xo(r,e)}function fn(e){return e}var mn="override";function yn(e,t){return{annotationType_:e,options_:t,make_:gn,extend_:_n}}function gn(e,t,r,i){var n;if(null!=(n=this.options_)&&n.bound)return null===this.extend_(e,t,r,!1)?0:1;if(i===e.target_)return null===this.extend_(e,t,r,!1)?0:2;if(Ho(r.value))return 1;var o=bn(e,this,t,r,!1);return ki(i,t,o),2}function _n(e,t,r,i){var n=bn(e,this,t,r);return e.defineProperty_(t,n,i)}function bn(e,t,r,i,n){var o,a,s,l,c,u,h,p;void 0===n&&(n=Ao.safeDescriptors),p=i,t.annotationType_,p.value;var d,f=i.value;null!=(o=t.options_)&&o.bound&&(f=f.bind(null!=(d=e.proxy_)?d:e.target_));return{value:to(null!=(a=null==(s=t.options_)?void 0:s.name)?a:r.toString(),f,null!=(l=null==(c=t.options_)?void 0:c.autoAction)&&l,null!=(u=t.options_)&&u.bound?null!=(h=e.proxy_)?h:e.target_:void 0),configurable:!n||e.isPlainObject_,enumerable:!1,writable:!n}}function vn(e,t){return{annotationType_:e,options_:t,make_:xn,extend_:wn}}function xn(e,t,r,i){var n;if(i===e.target_)return null===this.extend_(e,t,r,!1)?0:2;if(null!=(n=this.options_)&&n.bound&&(!Xi(e.target_,t)||!ha(e.target_[t]))&&null===this.extend_(e,t,r,!1))return 0;if(ha(r.value))return 1;var o=Sn(e,this,t,r,!1,!1);return ki(i,t,o),2}function wn(e,t,r,i){var n,o=Sn(e,this,t,r,null==(n=this.options_)?void 0:n.bound);return e.defineProperty_(t,o,i)}function Sn(e,t,r,i,n,o){var a;void 0===o&&(o=Ao.safeDescriptors),a=i,t.annotationType_,a.value;var s,l=i.value;(ha(l)||(l=ca(l)),n)&&((l=l.bind(null!=(s=e.proxy_)?s:e.target_)).isMobXFlow=!0);return{value:l,configurable:!o||e.isPlainObject_,enumerable:!1,writable:!o}}function En(e,t){return{annotationType_:e,options_:t,make_:Tn,extend_:kn}}function Tn(e,t,r){return null===this.extend_(e,t,r,!1)?0:1}function kn(e,t,r,i){var n;return n=r,this.annotationType_,n.get,e.defineComputedProperty_(t,Yi({},this.options_,{get:r.get,set:r.set}),i)}function An(e,t){return{annotationType_:e,options_:t,make_:In,extend_:Pn}}function In(e,t,r){return null===this.extend_(e,t,r,!1)?0:1}function Pn(e,t,r,i){var n,o;return this.annotationType_,e.defineObservableProperty_(t,r.value,null!=(n=null==(o=this.options_)?void 0:o.enhancer)?n:dn,i)}var Cn=zn();function zn(e){return{annotationType_:"true",options_:e,make_:Mn,extend_:On}}function Mn(e,t,r,i){var n,o,a,s;if(r.get)return Kn.make_(e,t,r,i);if(r.set){var l=to(t.toString(),r.set);return i===e.target_?null===e.defineProperty_(t,{configurable:!Ao.safeDescriptors||e.isPlainObject_,set:l})?0:2:(ki(i,t,{configurable:!0,set:l}),2)}if(i!==e.target_&&"function"==typeof r.value)return Fi(r.value)?(null!=(s=this.options_)&&s.autoBind?ca.bound:ca).make_(e,t,r,i):(null!=(a=this.options_)&&a.autoBind?Xo.bound:Xo).make_(e,t,r,i);var c,u=!1===(null==(n=this.options_)?void 0:n.deep)?Gn.ref:Gn;"function"==typeof r.value&&null!=(o=this.options_)&&o.autoBind&&(r.value=r.value.bind(null!=(c=e.proxy_)?c:e.target_));return u.make_(e,t,r,i)}function On(e,t,r,i){var n,o,a;if(r.get)return Kn.extend_(e,t,r,i);if(r.set)return e.defineProperty_(t,{configurable:!Ao.safeDescriptors||e.isPlainObject_,set:to(t.toString(),r.set)},i);"function"==typeof r.value&&null!=(n=this.options_)&&n.autoBind&&(r.value=r.value.bind(null!=(a=e.proxy_)?a:e.target_));return(!1===(null==(o=this.options_)?void 0:o.deep)?Gn.ref:Gn).extend_(e,t,r,i)}var Dn={deep:!0,name:void 0,defaultDecorator:void 0,proxy:!0};function Ln(e){return e||Dn}Object.freeze(Dn);var jn=An("observable"),Rn=An("observable.ref",{enhancer:fn}),Bn=An("observable.shallow",{enhancer:function(e,t,r){return null==e||as(e)||qa(e)||Ha(e)||Qa(e)?e:Array.isArray(e)?Gn.array(e,{name:r,deep:!1}):Bi(e)?Gn.object(e,void 0,{name:r,deep:!1}):qi(e)?Gn.map(e,{name:r,deep:!1}):$i(e)?Gn.set(e,{name:r,deep:!1}):void 0}}),Fn=An("observable.struct",{enhancer:function(e,t){return vs(e,t)?t:e}}),Nn=an(jn);function Un(e){return!0===e.deep?dn:!1===e.deep?fn:(t=e.defaultDecorator)&&null!=(r=null==(i=t.options_)?void 0:i.enhancer)?r:dn;var t,r,i}function Vn(e,t,r){if(!ji(t))return fa(e)?e:Bi(e)?Gn.object(e,t,r):Array.isArray(e)?Gn.array(e,t):qi(e)?Gn.map(e,t):$i(e)?Gn.set(e,t):"object"==typeof e&&null!==e?e:Gn.box(e,t);sn(e,t,jn)}Object.assign(Vn,Nn);var qn,$n,Gn=Ei(Vn,{box:function(e,t){var r=Ln(t);return new so(e,Un(r),r.name,!0,r.equals)},array:function(e,t){var r=Ln(t);return(!1===Ao.useProxies||!1===r.proxy?ms:Da)(e,Un(r),r.name)},map:function(e,t){var r=Ln(t);return new Ka(e,Un(r),r.name)},set:function(e,t){var r=Ln(t);return new Ya(e,Un(r),r.name)},object:function(e,t,r){return na(!1===Ao.useProxies||!1===(null==r?void 0:r.proxy)?is({},r):function(e,t){var r,i;return Mi(),e=is(e,t),null!=(i=(r=e[ln]).proxy_)?i:r.proxy_=new Proxy(e,wa)}({},r),e,t)},ref:an(Rn),shallow:an(Bn),deep:Nn,struct:an(Fn)}),Zn="computed",Wn=En(Zn),Xn=En("computed.struct",{equals:pn.structural}),Kn=function(e,t){if(ji(t))return sn(e,t,Wn);if(Bi(e))return an(En(Zn,e));var r=Bi(t)?t:{};return r.get=e,r.name||(r.name=e.name||""),new ho(r)};Object.assign(Kn,Wn),Kn.struct=an(Xn);var Hn,Jn=0,Yn=1,Qn=null!=(qn=null==($n=Ti((function(){}),"name"))?void 0:$n.configurable)&&qn,eo={value:"action",configurable:!0,writable:!1,enumerable:!1};function to(e,t,r,i){function n(){return ro(e,r,t,i||this,arguments)}return void 0===r&&(r=!1),n.isMobxAction=!0,Qn&&(eo.value=e,Object.defineProperty(n,"name",eo)),n}function ro(e,t,r,i,n){var o=function(e,t,r,i){var n=!1,o=0,a=Ao.trackingDerivation,s=!t||!a;zo();var l=Ao.allowStateChanges;s&&(vo(),l=no(!0));var c=wo(!0),u={runAsAction_:s,prevDerivation_:a,prevAllowStateChanges_:l,prevAllowStateReads_:c,notifySpy_:n,startTime_:o,actionId_:Yn++,parentActionId_:Jn};return Jn=u.actionId_,u}(0,t);try{return r.apply(i,n)}catch(e){throw o.error_=e,e}finally{!function(e){Jn!==e.actionId_&&xi(30);Jn=e.parentActionId_,void 0!==e.error_&&(Ao.suppressReactionErrors=!0);oo(e.prevAllowStateChanges_),So(e.prevAllowStateReads_),Mo(),e.runAsAction_&&xo(e.prevDerivation_);Ao.suppressReactionErrors=!1}(o)}}function io(e,t){var r=no(e);try{return t()}finally{oo(r)}}function no(e){var t=Ao.allowStateChanges;return Ao.allowStateChanges=e,t}function oo(e){Ao.allowStateChanges=e}Hn=Symbol.toPrimitive;var ao,so=function(e){function t(t,r,i,n,o){var a;return void 0===i&&(i="ObservableValue"),void 0===o&&(o=pn.default),(a=e.call(this,i)||this).enhancer=void 0,a.name_=void 0,a.equals=void 0,a.hasUnreportedChange_=!1,a.interceptors_=void 0,a.changeListeners_=void 0,a.value_=void 0,a.dehancer=void 0,a.enhancer=r,a.name_=i,a.equals=o,a.value_=r(t,void 0,i),a}Qi(t,e);var r=t.prototype;return r.dehanceValue=function(e){return void 0!==this.dehancer?this.dehancer(e):e},r.set=function(e){this.value_,(e=this.prepareNewValue_(e))!==Ao.UNCHANGED&&this.setNewValue_(e)},r.prepareNewValue_=function(e){if(Sa(this)){var t=Ta(this,{object:this,type:za,newValue:e});if(!t)return Ao.UNCHANGED;e=t.newValue}return e=this.enhancer(e,this.value_,this.name_),this.equals(this.value_,e)?Ao.UNCHANGED:e},r.setNewValue_=function(e){var t=this.value_;this.value_=e,this.reportChanged(),ka(this)&&Ia(this,{type:za,object:this,newValue:e,oldValue:t})},r.get=function(){return this.reportObserved(),this.dehanceValue(this.value_)},r.intercept_=function(e){return Ea(this,e)},r.observe_=function(e,t){return t&&e({observableKind:"value",debugObjectName:this.name_,object:this,type:za,newValue:this.value_,oldValue:void 0}),Aa(this,e)},r.raw=function(){return this.value_},r.toJSON=function(){return this.get()},r.toString=function(){return this.name_+"["+this.value_+"]"},r.valueOf=function(){return Wi(this.get())},r[Hn]=function(){return this.valueOf()},t}(cn),lo=Vi("ObservableValue",so);ao=Symbol.toPrimitive;var co,uo,ho=function(){function e(e){this.dependenciesState_=co.NOT_TRACKING_,this.observing_=[],this.newObserving_=null,this.isBeingObserved_=!1,this.isPendingUnobservation_=!1,this.observers_=new Set,this.diffValue_=0,this.runId_=0,this.lastAccessedBy_=0,this.lowestObserverState_=co.UP_TO_DATE_,this.unboundDepsCount_=0,this.value_=new fo(null),this.name_=void 0,this.triggeredBy_=void 0,this.isComputing_=!1,this.isRunningSetter_=!1,this.derivation=void 0,this.setter_=void 0,this.isTracing_=uo.NONE,this.scope_=void 0,this.equals_=void 0,this.requiresReaction_=void 0,this.keepAlive_=void 0,this.onBOL=void 0,this.onBUOL=void 0,e.get||xi(31),this.derivation=e.get,this.name_=e.name||"ComputedValue",e.set&&(this.setter_=to("ComputedValue-setter",e.set)),this.equals_=e.equals||(e.compareStructural||e.struct?pn.structural:pn.default),this.scope_=e.context,this.requiresReaction_=e.requiresReaction,this.keepAlive_=!!e.keepAlive}var t=e.prototype;return t.onBecomeStale_=function(){!function(e){if(e.lowestObserverState_!==co.UP_TO_DATE_)return;e.lowestObserverState_=co.POSSIBLY_STALE_,e.observers_.forEach((function(e){e.dependenciesState_===co.UP_TO_DATE_&&(e.dependenciesState_=co.POSSIBLY_STALE_,e.onBecomeStale_())}))}(this)},t.onBO=function(){this.onBOL&&this.onBOL.forEach((function(e){return e()}))},t.onBUO=function(){this.onBUOL&&this.onBUOL.forEach((function(e){return e()}))},t.get=function(){if(this.isComputing_&&xi(32,this.name_,this.derivation),0!==Ao.inBatch||0!==this.observers_.size||this.keepAlive_){if(Oo(this),yo(this)){var e=Ao.trackingContext;this.keepAlive_&&!e&&(Ao.trackingContext=this),this.trackAndCompute()&&function(e){if(e.lowestObserverState_===co.STALE_)return;e.lowestObserverState_=co.STALE_,e.observers_.forEach((function(t){t.dependenciesState_===co.POSSIBLY_STALE_?t.dependenciesState_=co.STALE_:t.dependenciesState_===co.UP_TO_DATE_&&(e.lowestObserverState_=co.UP_TO_DATE_)}))}(this),Ao.trackingContext=e}}else yo(this)&&(this.warnAboutUntrackedRead_(),zo(),this.value_=this.computeValue_(!1),Mo());var t=this.value_;if(mo(t))throw t.cause;return t},t.set=function(e){if(this.setter_){this.isRunningSetter_&&xi(33,this.name_),this.isRunningSetter_=!0;try{this.setter_.call(this.scope_,e)}finally{this.isRunningSetter_=!1}}else xi(34,this.name_)},t.trackAndCompute=function(){var e=this.value_,t=this.dependenciesState_===co.NOT_TRACKING_,r=this.computeValue_(!0),i=t||mo(e)||mo(r)||!this.equals_(e,r);return i&&(this.value_=r),i},t.computeValue_=function(e){this.isComputing_=!0;var t,r=no(!1);if(e)t=go(this,this.derivation,this.scope_);else if(!0===Ao.disableErrorBoundaries)t=this.derivation.call(this.scope_);else try{t=this.derivation.call(this.scope_)}catch(e){t=new fo(e)}return oo(r),this.isComputing_=!1,t},t.suspend_=function(){this.keepAlive_||(_o(this),this.value_=void 0)},t.observe_=function(e,t){var r=this,i=!0,n=void 0;return Jo((function(){var o=r.get();if(!i||t){var a=vo();e({observableKind:"computed",debugObjectName:r.name_,type:za,object:r,newValue:o,oldValue:n}),xo(a)}i=!1,n=o}))},t.warnAboutUntrackedRead_=function(){},t.toString=function(){return this.name_+"["+this.derivation.toString()+"]"},t.valueOf=function(){return Wi(this.get())},t[ao]=function(){return this.valueOf()},e}(),po=Vi("ComputedValue",ho);!function(e){e[e.NOT_TRACKING_=-1]="NOT_TRACKING_",e[e.UP_TO_DATE_=0]="UP_TO_DATE_",e[e.POSSIBLY_STALE_=1]="POSSIBLY_STALE_",e[e.STALE_=2]="STALE_"}(co||(co={})),function(e){e[e.NONE=0]="NONE",e[e.LOG=1]="LOG",e[e.BREAK=2]="BREAK"}(uo||(uo={}));var fo=function(e){this.cause=void 0,this.cause=e};function mo(e){return e instanceof fo}function yo(e){switch(e.dependenciesState_){case co.UP_TO_DATE_:return!1;case co.NOT_TRACKING_:case co.STALE_:return!0;case co.POSSIBLY_STALE_:for(var t=wo(!0),r=vo(),i=e.observing_,n=i.length,o=0;o<n;o++){var a=i[o];if(po(a)){if(Ao.disableErrorBoundaries)a.get();else try{a.get()}catch(e){return xo(r),So(t),!0}if(e.dependenciesState_===co.STALE_)return xo(r),So(t),!0}}return Eo(e),xo(r),So(t),!1}}function go(e,t,r){var i=wo(!0);Eo(e),e.newObserving_=new Array(e.observing_.length+100),e.unboundDepsCount_=0,e.runId_=++Ao.runId;var n,o=Ao.trackingDerivation;if(Ao.trackingDerivation=e,Ao.inBatch++,!0===Ao.disableErrorBoundaries)n=t.call(r);else try{n=t.call(r)}catch(e){n=new fo(e)}return Ao.inBatch--,Ao.trackingDerivation=o,function(e){for(var t=e.observing_,r=e.observing_=e.newObserving_,i=co.UP_TO_DATE_,n=0,o=e.unboundDepsCount_,a=0;a<o;a++){var s=r[a];0===s.diffValue_&&(s.diffValue_=1,n!==a&&(r[n]=s),n++),s.dependenciesState_>i&&(i=s.dependenciesState_)}r.length=n,e.newObserving_=null,o=t.length;for(;o--;){var l=t[o];0===l.diffValue_&&Po(l,e),l.diffValue_=0}for(;n--;){var c=r[n];1===c.diffValue_&&(c.diffValue_=0,Io(c,e))}i!==co.UP_TO_DATE_&&(e.dependenciesState_=i,e.onBecomeStale_())}(e),So(i),n}function _o(e){var t=e.observing_;e.observing_=[];for(var r=t.length;r--;)Po(t[r],e);e.dependenciesState_=co.NOT_TRACKING_}function bo(e){var t=vo();try{return e()}finally{xo(t)}}function vo(){var e=Ao.trackingDerivation;return Ao.trackingDerivation=null,e}function xo(e){Ao.trackingDerivation=e}function wo(e){var t=Ao.allowStateReads;return Ao.allowStateReads=e,t}function So(e){Ao.allowStateReads=e}function Eo(e){if(e.dependenciesState_!==co.UP_TO_DATE_){e.dependenciesState_=co.UP_TO_DATE_;for(var t=e.observing_,r=t.length;r--;)t[r].lowestObserverState_=co.UP_TO_DATE_}}var To=function(){this.version=6,this.UNCHANGED={},this.trackingDerivation=null,this.trackingContext=null,this.runId=0,this.mobxGuid=0,this.inBatch=0,this.pendingUnobservations=[],this.pendingReactions=[],this.isRunningReactions=!1,this.allowStateChanges=!1,this.allowStateReads=!0,this.enforceActions=!0,this.spyListeners=[],this.globalReactionErrorHandlers=[],this.computedRequiresReaction=!1,this.reactionRequiresObservable=!1,this.observableRequiresReaction=!1,this.disableErrorBoundaries=!1,this.suppressReactionErrors=!1,this.useProxies=!0,this.verifyProxies=!1,this.safeDescriptors=!0},ko=!0,Ao=function(){var e=Si();return e.__mobxInstanceCount>0&&!e.__mobxGlobals&&(ko=!1),e.__mobxGlobals&&e.__mobxGlobals.version!==(new To).version&&(ko=!1),ko?e.__mobxGlobals?(e.__mobxInstanceCount+=1,e.__mobxGlobals.UNCHANGED||(e.__mobxGlobals.UNCHANGED={}),e.__mobxGlobals):(e.__mobxInstanceCount=1,e.__mobxGlobals=new To):(setTimeout((function(){xi(35)}),1),new To)}();function Io(e,t){e.observers_.add(t),e.lowestObserverState_>t.dependenciesState_&&(e.lowestObserverState_=t.dependenciesState_)}function Po(e,t){e.observers_.delete(t),0===e.observers_.size&&Co(e)}function Co(e){!1===e.isPendingUnobservation_&&(e.isPendingUnobservation_=!0,Ao.pendingUnobservations.push(e))}function zo(){Ao.inBatch++}function Mo(){if(0==--Ao.inBatch){jo();for(var e=Ao.pendingUnobservations,t=0;t<e.length;t++){var r=e[t];r.isPendingUnobservation_=!1,0===r.observers_.size&&(r.isBeingObserved_&&(r.isBeingObserved_=!1,r.onBUO()),r instanceof ho&&r.suspend_())}Ao.pendingUnobservations=[]}}function Oo(e){var t=Ao.trackingDerivation;return null!==t?(t.runId_!==e.lastAccessedBy_&&(e.lastAccessedBy_=t.runId_,t.newObserving_[t.unboundDepsCount_++]=e,!e.isBeingObserved_&&Ao.trackingContext&&(e.isBeingObserved_=!0,e.onBO())),!0):(0===e.observers_.size&&Ao.inBatch>0&&Co(e),!1)}function Do(e){e.lowestObserverState_!==co.STALE_&&(e.lowestObserverState_=co.STALE_,e.observers_.forEach((function(e){e.dependenciesState_===co.UP_TO_DATE_&&e.onBecomeStale_(),e.dependenciesState_=co.STALE_})))}var Lo=function(){function e(e,t,r,i){void 0===e&&(e="Reaction"),this.name_=void 0,this.onInvalidate_=void 0,this.errorHandler_=void 0,this.requiresObservable_=void 0,this.observing_=[],this.newObserving_=[],this.dependenciesState_=co.NOT_TRACKING_,this.diffValue_=0,this.runId_=0,this.unboundDepsCount_=0,this.isDisposed_=!1,this.isScheduled_=!1,this.isTrackPending_=!1,this.isRunning_=!1,this.isTracing_=uo.NONE,this.name_=e,this.onInvalidate_=t,this.errorHandler_=r,this.requiresObservable_=i}var t=e.prototype;return t.onBecomeStale_=function(){this.schedule_()},t.schedule_=function(){this.isScheduled_||(this.isScheduled_=!0,Ao.pendingReactions.push(this),jo())},t.isScheduled=function(){return this.isScheduled_},t.runReaction_=function(){if(!this.isDisposed_){zo(),this.isScheduled_=!1;var e=Ao.trackingContext;if(Ao.trackingContext=this,yo(this)){this.isTrackPending_=!0;try{this.onInvalidate_()}catch(e){this.reportExceptionInDerivation_(e)}}Ao.trackingContext=e,Mo()}},t.track=function(e){if(!this.isDisposed_){zo(),this.isRunning_=!0;var t=Ao.trackingContext;Ao.trackingContext=this;var r=go(this,e,void 0);Ao.trackingContext=t,this.isRunning_=!1,this.isTrackPending_=!1,this.isDisposed_&&_o(this),mo(r)&&this.reportExceptionInDerivation_(r.cause),Mo()}},t.reportExceptionInDerivation_=function(e){var t=this;if(this.errorHandler_)this.errorHandler_(e,this);else{if(Ao.disableErrorBoundaries)throw e;var r="[mobx] uncaught error in '"+this+"'";Ao.suppressReactionErrors||console.error(r,e),Ao.globalReactionErrorHandlers.forEach((function(r){return r(e,t)}))}},t.dispose=function(){this.isDisposed_||(this.isDisposed_=!0,this.isRunning_||(zo(),_o(this),Mo()))},t.getDisposer_=function(){var e=this.dispose.bind(this);return e[ln]=this,e},t.toString=function(){return"Reaction["+this.name_+"]"},t.trace=function(e){void 0===e&&(e=!1),_a(this,e)},e}();function jo(){Ao.inBatch>0||Ao.isRunningReactions||Ro()}function Ro(){Ao.isRunningReactions=!0;for(var e=Ao.pendingReactions,t=0;e.length>0;){100==++t&&(console.error("[mobx] cycle in reaction: "+e[0]),e.splice(0));for(var r=e.splice(0),i=0,n=r.length;i<n;i++)r[i].runReaction_()}Ao.isRunningReactions=!1}var Bo=Vi("Reaction",Lo);var Fo="action",No="autoAction",Uo="<unnamed action>",Vo=yn(Fo),qo=yn("action.bound",{bound:!0}),$o=yn(No,{autoAction:!0}),Go=yn("autoAction.bound",{autoAction:!0,bound:!0});function Zo(e){return function(t,r){return Li(t)?to(t.name||Uo,t,e):Li(r)?to(t,r,e):ji(r)?sn(t,r,e?$o:Vo):ji(t)?an(yn(e?No:Fo,{name:t,autoAction:e})):void 0}}var Wo=Zo(!1);Object.assign(Wo,Vo);var Xo=Zo(!0);function Ko(e){return ro(e.name,!1,e,this,void 0)}function Ho(e){return Li(e)&&!0===e.isMobxAction}function Jo(e,t){var r,i;void 0===t&&(t=Pi);var n,o=null!=(r=null==(i=t)?void 0:i.name)?r:"Autorun";if(!t.scheduler&&!t.delay)n=new Lo(o,(function(){this.track(l)}),t.onError,t.requiresObservable);else{var a=Qo(t),s=!1;n=new Lo(o,(function(){s||(s=!0,a((function(){s=!1,n.isDisposed_||n.track(l)})))}),t.onError,t.requiresObservable)}function l(){e(n)}return n.schedule_(),n.getDisposer_()}Object.assign(Xo,$o),Wo.bound=an(qo),Xo.bound=an(Go);var Yo=function(e){return e()};function Qo(e){return e.scheduler?e.scheduler:e.delay?function(t){return setTimeout(t,e.delay)}:Yo}function ea(e,t,r){var i;void 0===r&&(r=Pi);var n,o,a,s,l=null!=(i=r.name)?i:"Reaction",c=Wo(l,r.onError?(n=r.onError,o=t,function(){try{return o.apply(this,arguments)}catch(e){n.call(this,e)}}):t),u=!r.scheduler&&!r.delay,h=Qo(r),p=!0,d=!1,f=r.compareStructural?pn.structural:r.equals||pn.default,m=new Lo(l,(function(){p||u?y():d||(d=!0,h(y))}),r.onError,r.requiresObservable);function y(){if(d=!1,!m.isDisposed_){var t=!1;m.track((function(){var r=io(!1,(function(){return e(m)}));t=p||!f(a,r),s=a,a=r})),(p&&r.fireImmediately||!p&&t)&&c(a,s,m),p=!1}}return m.schedule_(),m.getDisposer_()}function ta(e,t,r){return ia("onBO",e,t,r)}function ra(e,t,r){return ia("onBUO",e,t,r)}function ia(e,t,r,i){var n="function"==typeof i?ys(t,r):ys(t),o=Li(i)?i:r,a=e+"L";return n[a]?n[a].add(o):n[a]=new Set([o]),function(){var e=n[a];e&&(e.delete(o),0===e.size&&delete n[a])}}function na(e,t,r,i){var n=Ki(t),o=is(e,i)[ln];zo();try{Zi(n).forEach((function(e){o.extend_(e,n[e],!r||(!(e in r)||r[e]))}))}finally{Mo()}return e}var oa=0;function aa(){this.message="FLOW_CANCELLED"}aa.prototype=Object.create(Error.prototype);var sa=vn("flow"),la=vn("flow.bound",{bound:!0}),ca=Object.assign((function(e,t){if(ji(t))return sn(e,t,sa);var r=e,i=r.name||"<unnamed flow>",n=function(){var e,t=this,n=arguments,o=++oa,a=Wo(i+" - runid: "+o+" - init",r).apply(t,n),s=void 0,l=new Promise((function(t,r){var n=0;function l(e){var t;s=void 0;try{t=Wo(i+" - runid: "+o+" - yield "+n++,a.next).call(a,e)}catch(e){return r(e)}u(t)}function c(e){var t;s=void 0;try{t=Wo(i+" - runid: "+o+" - yield "+n++,a.throw).call(a,e)}catch(e){return r(e)}u(t)}function u(e){if(!Li(null==e?void 0:e.then))return e.done?t(e.value):(s=Promise.resolve(e.value)).then(l,c);e.then(u,r)}e=r,l(void 0)}));return l.cancel=Wo(i+" - runid: "+o+" - cancel",(function(){try{s&&ua(s);var t=a.return(void 0),r=Promise.resolve(t.value);r.then(Di,Di),ua(r),e(new aa)}catch(t){e(t)}})),l};return n.isMobXFlow=!0,n}),sa);function ua(e){Li(e.cancel)&&e.cancel()}function ha(e){return!0===(null==e?void 0:e.isMobXFlow)}function pa(e,t){if(void 0===t)return po(e);if(!1===as(e))return!1;if(!e[ln].values_.has(t))return!1;var r=ys(e,t);return po(r)}function da(e,t){return pa(e,t)}function fa(e){return function(e,t){return!!e&&(void 0!==t?!!as(e)&&e[ln].values_.has(t):as(e)||!!e[ln]||un(e)||Bo(e)||po(e))}(e)}function ma(e,t,r,i){return Li(r)?function(e,t,r,i){return gs(e,t).observe_(r,i)}(e,t,r,i):function(e,t,r){return gs(e).observe_(t,r)}(e,t,r)}function ya(e,t,r){return e.set(t,r),r}function ga(e,t){if(null==e||"object"!=typeof e||e instanceof Date||!fa(e))return e;if(lo(e)||po(e))return ga(e.get(),t);if(t.has(e))return t.get(e);if(qa(e)){var r=ya(t,e,new Array(e.length));return e.forEach((function(e,i){r[i]=ga(e,t)})),r}if(Qa(e)){var i=ya(t,e,new Set);return e.forEach((function(e){i.add(ga(e,t))})),i}if(Ha(e)){var n=ya(t,e,new Map);return e.forEach((function(e,r){n.set(r,ga(e,t))})),n}var o=ya(t,e,{});return function(e){if(as(e))return e[ln].ownKeys_();xi(38)}(e).forEach((function(r){Ai.propertyIsEnumerable.call(e,r)&&(o[r]=ga(e[r],t))})),o}function _a(){xi("trace() is not available in production builds");for(var e=!1,t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];"boolean"==typeof r[r.length-1]&&(e=r.pop());var n=ba(r);if(!n)return xi("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");n.isTracing_===uo.NONE&&console.log("[mobx.trace] '"+n.name_+"' tracing enabled"),n.isTracing_=e?uo.BREAK:uo.LOG}function ba(e){switch(e.length){case 0:return Ao.trackingDerivation;case 1:return ys(e[0]);case 2:return ys(e[0],e[1])}}function va(e,t){void 0===t&&(t=void 0),zo();try{return e.apply(t)}finally{Mo()}}function xa(e){return e[ln]}ca.bound=an(la);var wa={has:function(e,t){return xa(e).has_(t)},get:function(e,t){return xa(e).get_(t)},set:function(e,t,r){var i;return!!ji(t)&&(null==(i=xa(e).set_(t,r,!0))||i)},deleteProperty:function(e,t){var r;return!!ji(t)&&(null==(r=xa(e).delete_(t,!0))||r)},defineProperty:function(e,t,r){var i;return null==(i=xa(e).defineProperty_(t,r))||i},ownKeys:function(e){return xa(e).ownKeys_()},preventExtensions:function(e){xi(13)}};function Sa(e){return void 0!==e.interceptors_&&e.interceptors_.length>0}function Ea(e,t){var r=e.interceptors_||(e.interceptors_=[]);return r.push(t),Oi((function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}))}function Ta(e,t){var r=vo();try{for(var i=[].concat(e.interceptors_||[]),n=0,o=i.length;n<o&&((t=i[n](t))&&!t.type&&xi(14),t);n++);return t}finally{xo(r)}}function ka(e){return void 0!==e.changeListeners_&&e.changeListeners_.length>0}function Aa(e,t){var r=e.changeListeners_||(e.changeListeners_=[]);return r.push(t),Oi((function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}))}function Ia(e,t){var r=vo(),i=e.changeListeners_;if(i){for(var n=0,o=(i=i.slice()).length;n<o;n++)i[n](t);xo(r)}}function Pa(e,t,r){var i=is(e,r)[ln];zo();try{0,null!=t||(t=function(e){return Xi(e,on)||Ni(e,on,Yi({},e[on])),e[on]}(e)),Zi(t).forEach((function(e){return i.make_(e,t[e])}))}finally{Mo()}return e}var Ca="splice",za="update",Ma={get:function(e,t){var r=e[ln];return t===ln?r:"length"===t?r.getArrayLength_():"string"!=typeof t||isNaN(t)?Xi(La,t)?La[t]:e[t]:r.get_(parseInt(t))},set:function(e,t,r){var i=e[ln];return"length"===t&&i.setArrayLength_(r),"symbol"==typeof t||isNaN(t)?e[t]=r:i.set_(parseInt(t),r),!0},preventExtensions:function(){xi(15)}},Oa=function(){function e(e,t,r,i){void 0===e&&(e="ObservableArray"),this.owned_=void 0,this.legacyMode_=void 0,this.atom_=void 0,this.values_=[],this.interceptors_=void 0,this.changeListeners_=void 0,this.enhancer_=void 0,this.dehancer=void 0,this.proxy_=void 0,this.lastKnownLength_=0,this.owned_=r,this.legacyMode_=i,this.atom_=new cn(e),this.enhancer_=function(e,r){return t(e,r,"ObservableArray[..]")}}var t=e.prototype;return t.dehanceValue_=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.dehanceValues_=function(e){return void 0!==this.dehancer&&e.length>0?e.map(this.dehancer):e},t.intercept_=function(e){return Ea(this,e)},t.observe_=function(e,t){return void 0===t&&(t=!1),t&&e({observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:"splice",index:0,added:this.values_.slice(),addedCount:this.values_.length,removed:[],removedCount:0}),Aa(this,e)},t.getArrayLength_=function(){return this.atom_.reportObserved(),this.values_.length},t.setArrayLength_=function(e){("number"!=typeof e||isNaN(e)||e<0)&&xi("Out of range: "+e);var t=this.values_.length;if(e!==t)if(e>t){for(var r=new Array(e-t),i=0;i<e-t;i++)r[i]=void 0;this.spliceWithArray_(t,0,r)}else this.spliceWithArray_(e,t-e)},t.updateArrayLength_=function(e,t){e!==this.lastKnownLength_&&xi(16),this.lastKnownLength_+=t,this.legacyMode_&&t>0&&fs(e+t+1)},t.spliceWithArray_=function(e,t,r){var i=this;this.atom_;var n=this.values_.length;if(void 0===e?e=0:e>n?e=n:e<0&&(e=Math.max(0,n+e)),t=1===arguments.length?n-e:null==t?0:Math.max(0,Math.min(t,n-e)),void 0===r&&(r=Ii),Sa(this)){var o=Ta(this,{object:this.proxy_,type:Ca,index:e,removedCount:t,added:r});if(!o)return Ii;t=o.removedCount,r=o.added}if(r=0===r.length?r:r.map((function(e){return i.enhancer_(e,void 0)})),this.legacyMode_){var a=r.length-t;this.updateArrayLength_(n,a)}var s=this.spliceItemsIntoValues_(e,t,r);return 0===t&&0===r.length||this.notifyArraySplice_(e,r,s),this.dehanceValues_(s)},t.spliceItemsIntoValues_=function(e,t,r){var i;if(r.length<1e4)return(i=this.values_).splice.apply(i,[e,t].concat(r));var n=this.values_.slice(e,e+t),o=this.values_.slice(e+t);this.values_.length+=r.length-t;for(var a=0;a<r.length;a++)this.values_[e+a]=r[a];for(var s=0;s<o.length;s++)this.values_[e+r.length+s]=o[s];return n},t.notifyArrayChildUpdate_=function(e,t,r){var i=!this.owned_&&!1,n=ka(this),o=n||i?{observableKind:"array",object:this.proxy_,type:za,debugObjectName:this.atom_.name_,index:e,newValue:t,oldValue:r}:null;this.atom_.reportChanged(),n&&Ia(this,o)},t.notifyArraySplice_=function(e,t,r){var i=!this.owned_&&!1,n=ka(this),o=n||i?{observableKind:"array",object:this.proxy_,debugObjectName:this.atom_.name_,type:Ca,index:e,removed:r,added:t,removedCount:r.length,addedCount:t.length}:null;this.atom_.reportChanged(),n&&Ia(this,o)},t.get_=function(e){if(e<this.values_.length)return this.atom_.reportObserved(),this.dehanceValue_(this.values_[e]);console.warn("[mobx.array] Attempt to read an array index ("+e+") that is out of bounds ("+this.values_.length+"). Please check length first. Out of bound indices will not be tracked by MobX")},t.set_=function(e,t){var r=this.values_;if(e<r.length){this.atom_;var i=r[e];if(Sa(this)){var n=Ta(this,{type:za,object:this.proxy_,index:e,newValue:t});if(!n)return;t=n.newValue}(t=this.enhancer_(t,i))!==i&&(r[e]=t,this.notifyArrayChildUpdate_(e,t,i))}else e===r.length?this.spliceWithArray_(e,0,[t]):xi(17,e,r.length)},e}();function Da(e,t,r,i){void 0===r&&(r="ObservableArray"),void 0===i&&(i=!1),Mi();var n=new Oa(r,t,i,!1);Ui(n.values_,ln,n);var o=new Proxy(n.values_,Ma);if(n.proxy_=o,e&&e.length){var a=no(!0);n.spliceWithArray_(0,0,e),oo(a)}return o}var La={clear:function(){return this.splice(0)},replace:function(e){var t=this[ln];return t.spliceWithArray_(0,t.values_.length,e)},toJSON:function(){return this.slice()},splice:function(e,t){for(var r=arguments.length,i=new Array(r>2?r-2:0),n=2;n<r;n++)i[n-2]=arguments[n];var o=this[ln];switch(arguments.length){case 0:return[];case 1:return o.spliceWithArray_(e);case 2:return o.spliceWithArray_(e,t)}return o.spliceWithArray_(e,t,i)},spliceWithArray:function(e,t,r){return this[ln].spliceWithArray_(e,t,r)},push:function(){for(var e=this[ln],t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.spliceWithArray_(e.values_.length,0,r),e.values_.length},pop:function(){return this.splice(Math.max(this[ln].values_.length-1,0),1)[0]},shift:function(){return this.splice(0,1)[0]},unshift:function(){for(var e=this[ln],t=arguments.length,r=new Array(t),i=0;i<t;i++)r[i]=arguments[i];return e.spliceWithArray_(0,0,r),e.values_.length},reverse:function(){return Ao.trackingDerivation&&xi(37,"reverse"),this.replace(this.slice().reverse()),this},sort:function(){Ao.trackingDerivation&&xi(37,"sort");var e=this.slice();return e.sort.apply(e,arguments),this.replace(e),this},remove:function(e){var t=this[ln],r=t.dehanceValues_(t.values_).indexOf(e);return r>-1&&(this.splice(r,1),!0)}};function ja(e,t){"function"==typeof Array.prototype[e]&&(La[e]=t(e))}function Ra(e){return function(){var t=this[ln];t.atom_.reportObserved();var r=t.dehanceValues_(t.values_);return r[e].apply(r,arguments)}}function Ba(e){return function(t,r){var i=this,n=this[ln];return n.atom_.reportObserved(),n.dehanceValues_(n.values_)[e]((function(e,n){return t.call(r,e,n,i)}))}}function Fa(e){return function(){var t=this,r=this[ln];r.atom_.reportObserved();var i=r.dehanceValues_(r.values_),n=arguments[0];return arguments[0]=function(e,r,i){return n(e,r,i,t)},i[e].apply(i,arguments)}}ja("concat",Ra),ja("flat",Ra),ja("includes",Ra),ja("indexOf",Ra),ja("join",Ra),ja("lastIndexOf",Ra),ja("slice",Ra),ja("toString",Ra),ja("toLocaleString",Ra),ja("every",Ba),ja("filter",Ba),ja("find",Ba),ja("findIndex",Ba),ja("flatMap",Ba),ja("forEach",Ba),ja("map",Ba),ja("some",Ba),ja("reduce",Fa),ja("reduceRight",Fa);var Na,Ua,Va=Vi("ObservableArrayAdministration",Oa);function qa(e){return Ri(e)&&Va(e[ln])}var $a={},Ga="add",Za="delete";Na=Symbol.iterator,Ua=Symbol.toStringTag;var Wa,Xa,Ka=function(){function e(e,t,r){var i=this;void 0===t&&(t=dn),void 0===r&&(r="ObservableMap"),this.enhancer_=void 0,this.name_=void 0,this[ln]=$a,this.data_=void 0,this.hasMap_=void 0,this.keysAtom_=void 0,this.interceptors_=void 0,this.changeListeners_=void 0,this.dehancer=void 0,this.enhancer_=t,this.name_=r,Li(Map)||xi(18),this.keysAtom_=hn("ObservableMap.keys()"),this.data_=new Map,this.hasMap_=new Map,io(!0,(function(){i.merge(e)}))}var t=e.prototype;return t.has_=function(e){return this.data_.has(e)},t.has=function(e){var t=this;if(!Ao.trackingDerivation)return this.has_(e);var r=this.hasMap_.get(e);if(!r){var i=r=new so(this.has_(e),fn,"ObservableMap.key?",!1);this.hasMap_.set(e,i),ra(i,(function(){return t.hasMap_.delete(e)}))}return r.get()},t.set=function(e,t){var r=this.has_(e);if(Sa(this)){var i=Ta(this,{type:r?za:Ga,object:this,newValue:t,name:e});if(!i)return this;t=i.newValue}return r?this.updateValue_(e,t):this.addValue_(e,t),this},t.delete=function(e){var t=this;if((this.keysAtom_,Sa(this))&&!Ta(this,{type:Za,object:this,name:e}))return!1;if(this.has_(e)){var r=ka(this),i=r?{observableKind:"map",debugObjectName:this.name_,type:Za,object:this,oldValue:this.data_.get(e).value_,name:e}:null;return va((function(){var r;t.keysAtom_.reportChanged(),null==(r=t.hasMap_.get(e))||r.setNewValue_(!1),t.data_.get(e).setNewValue_(void 0),t.data_.delete(e)})),r&&Ia(this,i),!0}return!1},t.updateValue_=function(e,t){var r=this.data_.get(e);if((t=r.prepareNewValue_(t))!==Ao.UNCHANGED){var i=ka(this),n=i?{observableKind:"map",debugObjectName:this.name_,type:za,object:this,oldValue:r.value_,name:e,newValue:t}:null;r.setNewValue_(t),i&&Ia(this,n)}},t.addValue_=function(e,t){var r=this;this.keysAtom_,va((function(){var i,n=new so(t,r.enhancer_,"ObservableMap.key",!1);r.data_.set(e,n),t=n.value_,null==(i=r.hasMap_.get(e))||i.setNewValue_(!0),r.keysAtom_.reportChanged()}));var i=ka(this),n=i?{observableKind:"map",debugObjectName:this.name_,type:Ga,object:this,name:e,newValue:t}:null;i&&Ia(this,n)},t.get=function(e){return this.has(e)?this.dehanceValue_(this.data_.get(e).get()):this.dehanceValue_(void 0)},t.dehanceValue_=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.keys=function(){return this.keysAtom_.reportObserved(),this.data_.keys()},t.values=function(){var e=this,t=this.keys();return Ss({next:function(){var r=t.next(),i=r.done,n=r.value;return{done:i,value:i?void 0:e.get(n)}}})},t.entries=function(){var e=this,t=this.keys();return Ss({next:function(){var r=t.next(),i=r.done,n=r.value;return{done:i,value:i?void 0:[n,e.get(n)]}}})},t[Na]=function(){return this.entries()},t.forEach=function(e,t){for(var r,i=nn(this);!(r=i()).done;){var n=r.value,o=n[0],a=n[1];e.call(t,a,o,this)}},t.merge=function(e){var t=this;return Ha(e)&&(e=new Map(e)),va((function(){Bi(e)?function(e){var t=Object.keys(e);if(!Gi)return t;var r=Object.getOwnPropertySymbols(e);return r.length?[].concat(t,r.filter((function(t){return Ai.propertyIsEnumerable.call(e,t)}))):t}(e).forEach((function(r){return t.set(r,e[r])})):Array.isArray(e)?e.forEach((function(e){var r=e[0],i=e[1];return t.set(r,i)})):qi(e)?(e.constructor!==Map&&xi(19,e),e.forEach((function(e,r){return t.set(r,e)}))):null!=e&&xi(20,e)})),this},t.clear=function(){var e=this;va((function(){bo((function(){for(var t,r=nn(e.keys());!(t=r()).done;){var i=t.value;e.delete(i)}}))}))},t.replace=function(e){var t=this;return va((function(){for(var r,i=function(e){if(qi(e)||Ha(e))return e;if(Array.isArray(e))return new Map(e);if(Bi(e)){var t=new Map;for(var r in e)t.set(r,e[r]);return t}return xi(21,e)}(e),n=new Map,o=!1,a=nn(t.data_.keys());!(r=a()).done;){var s=r.value;if(!i.has(s))if(t.delete(s))o=!0;else{var l=t.data_.get(s);n.set(s,l)}}for(var c,u=nn(i.entries());!(c=u()).done;){var h=c.value,p=h[0],d=h[1],f=t.data_.has(p);if(t.set(p,d),t.data_.has(p)){var m=t.data_.get(p);n.set(p,m),f||(o=!0)}}if(!o)if(t.data_.size!==n.size)t.keysAtom_.reportChanged();else for(var y=t.data_.keys(),g=n.keys(),_=y.next(),b=g.next();!_.done;){if(_.value!==b.value){t.keysAtom_.reportChanged();break}_=y.next(),b=g.next()}t.data_=n})),this},t.toString=function(){return"[object ObservableMap]"},t.toJSON=function(){return Array.from(this)},t.observe_=function(e,t){return Aa(this,e)},t.intercept_=function(e){return Ea(this,e)},Ji(e,[{key:"size",get:function(){return this.keysAtom_.reportObserved(),this.data_.size}},{key:Ua,get:function(){return"Map"}}]),e}(),Ha=Vi("ObservableMap",Ka);var Ja={};Wa=Symbol.iterator,Xa=Symbol.toStringTag;var Ya=function(){function e(e,t,r){void 0===t&&(t=dn),void 0===r&&(r="ObservableSet"),this.name_=void 0,this[ln]=Ja,this.data_=new Set,this.atom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.dehancer=void 0,this.enhancer_=void 0,this.name_=r,Li(Set)||xi(22),this.atom_=hn(this.name_),this.enhancer_=function(e,i){return t(e,i,r)},e&&this.replace(e)}var t=e.prototype;return t.dehanceValue_=function(e){return void 0!==this.dehancer?this.dehancer(e):e},t.clear=function(){var e=this;va((function(){bo((function(){for(var t,r=nn(e.data_.values());!(t=r()).done;){var i=t.value;e.delete(i)}}))}))},t.forEach=function(e,t){for(var r,i=nn(this);!(r=i()).done;){var n=r.value;e.call(t,n,n,this)}},t.add=function(e){var t=this;if((this.atom_,Sa(this))&&!Ta(this,{type:Ga,object:this,newValue:e}))return this;if(!this.has(e)){va((function(){t.data_.add(t.enhancer_(e,void 0)),t.atom_.reportChanged()}));var r=ka(this),i=r?{observableKind:"set",debugObjectName:this.name_,type:Ga,object:this,newValue:e}:null;r&&Ia(this,i)}return this},t.delete=function(e){var t=this;if(Sa(this)&&!Ta(this,{type:Za,object:this,oldValue:e}))return!1;if(this.has(e)){var r=ka(this),i=r?{observableKind:"set",debugObjectName:this.name_,type:Za,object:this,oldValue:e}:null;return va((function(){t.atom_.reportChanged(),t.data_.delete(e)})),r&&Ia(this,i),!0}return!1},t.has=function(e){return this.atom_.reportObserved(),this.data_.has(this.dehanceValue_(e))},t.entries=function(){var e=0,t=Array.from(this.keys()),r=Array.from(this.values());return Ss({next:function(){var i=e;return e+=1,i<r.length?{value:[t[i],r[i]],done:!1}:{done:!0}}})},t.keys=function(){return this.values()},t.values=function(){this.atom_.reportObserved();var e=this,t=0,r=Array.from(this.data_.values());return Ss({next:function(){return t<r.length?{value:e.dehanceValue_(r[t++]),done:!1}:{done:!0}}})},t.replace=function(e){var t=this;return Qa(e)&&(e=new Set(e)),va((function(){Array.isArray(e)||$i(e)?(t.clear(),e.forEach((function(e){return t.add(e)}))):null!=e&&xi("Cannot initialize set from "+e)})),this},t.observe_=function(e,t){return Aa(this,e)},t.intercept_=function(e){return Ea(this,e)},t.toJSON=function(){return Array.from(this)},t.toString=function(){return"[object ObservableSet]"},t[Wa]=function(){return this.values()},Ji(e,[{key:"size",get:function(){return this.atom_.reportObserved(),this.data_.size}},{key:Xa,get:function(){return"Set"}}]),e}(),Qa=Vi("ObservableSet",Ya),es=Object.create(null),ts="remove",rs=function(){function e(e,t,r,i){void 0===t&&(t=new Map),void 0===i&&(i=Cn),this.target_=void 0,this.values_=void 0,this.name_=void 0,this.defaultAnnotation_=void 0,this.keysAtom_=void 0,this.changeListeners_=void 0,this.interceptors_=void 0,this.proxy_=void 0,this.isPlainObject_=void 0,this.appliedAnnotations_=void 0,this.pendingKeys_=void 0,this.target_=e,this.values_=t,this.name_=r,this.defaultAnnotation_=i,this.keysAtom_=new cn("ObservableObject.keys"),this.isPlainObject_=Bi(this.target_)}var t=e.prototype;return t.getObservablePropValue_=function(e){return this.values_.get(e).get()},t.setObservablePropValue_=function(e,t){var r=this.values_.get(e);if(r instanceof ho)return r.set(t),!0;if(Sa(this)){var i=Ta(this,{type:za,object:this.proxy_||this.target_,name:e,newValue:t});if(!i)return null;t=i.newValue}if((t=r.prepareNewValue_(t))!==Ao.UNCHANGED){var n=ka(this),o=n?{type:za,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,oldValue:r.value_,name:e,newValue:t}:null;r.setNewValue_(t),n&&Ia(this,o)}return!0},t.get_=function(e){return Ao.trackingDerivation&&!Xi(this.target_,e)&&this.has_(e),this.target_[e]},t.set_=function(e,t,r){return void 0===r&&(r=!1),Xi(this.target_,e)?this.values_.has(e)?this.setObservablePropValue_(e,t):r?Reflect.set(this.target_,e,t):(this.target_[e]=t,!0):this.extend_(e,{value:t,enumerable:!0,writable:!0,configurable:!0},this.defaultAnnotation_,r)},t.has_=function(e){if(!Ao.trackingDerivation)return e in this.target_;this.pendingKeys_||(this.pendingKeys_=new Map);var t=this.pendingKeys_.get(e);return t||(t=new so(e in this.target_,fn,"ObservableObject.key?",!1),this.pendingKeys_.set(e,t)),t.get()},t.make_=function(e,t){if(!0===t&&(t=this.defaultAnnotation_),!1!==t){if(!(e in this.target_)){var r;if(null!=(r=this.target_[on])&&r[e])return;xi(1,t.annotationType_,this.name_+"."+e.toString())}for(var i=this.target_;i&&i!==Ai;){var n=Ti(i,e);if(n){var o=t.make_(this,e,n,i);if(0===o)return;if(1===o)break}i=Object.getPrototypeOf(i)}ss(this,t,e)}},t.extend_=function(e,t,r,i){if(void 0===i&&(i=!1),!0===r&&(r=this.defaultAnnotation_),!1===r)return this.defineProperty_(e,t,i);var n=r.extend_(this,e,t,i);return n&&ss(this,r,e),n},t.defineProperty_=function(e,t,r){void 0===r&&(r=!1);try{zo();var i=this.delete_(e);if(!i)return i;if(Sa(this)){var n=Ta(this,{object:this.proxy_||this.target_,name:e,type:Ga,newValue:t.value});if(!n)return null;var o=n.newValue;t.value!==o&&(t=Yi({},t,{value:o}))}if(r){if(!Reflect.defineProperty(this.target_,e,t))return!1}else ki(this.target_,e,t);this.notifyPropertyAddition_(e,t.value)}finally{Mo()}return!0},t.defineObservableProperty_=function(e,t,r,i){void 0===i&&(i=!1);try{zo();var n=this.delete_(e);if(!n)return n;if(Sa(this)){var o=Ta(this,{object:this.proxy_||this.target_,name:e,type:Ga,newValue:t});if(!o)return null;t=o.newValue}var a=os(e),s={configurable:!Ao.safeDescriptors||this.isPlainObject_,enumerable:!0,get:a.get,set:a.set};if(i){if(!Reflect.defineProperty(this.target_,e,s))return!1}else ki(this.target_,e,s);var l=new so(t,r,"ObservableObject.key",!1);this.values_.set(e,l),this.notifyPropertyAddition_(e,l.value_)}finally{Mo()}return!0},t.defineComputedProperty_=function(e,t,r){void 0===r&&(r=!1);try{zo();var i=this.delete_(e);if(!i)return i;if(Sa(this))if(!Ta(this,{object:this.proxy_||this.target_,name:e,type:Ga,newValue:void 0}))return null;t.name||(t.name="ObservableObject.key"),t.context=this.proxy_||this.target_;var n=os(e),o={configurable:!Ao.safeDescriptors||this.isPlainObject_,enumerable:!1,get:n.get,set:n.set};if(r){if(!Reflect.defineProperty(this.target_,e,o))return!1}else ki(this.target_,e,o);this.values_.set(e,new ho(t)),this.notifyPropertyAddition_(e,void 0)}finally{Mo()}return!0},t.delete_=function(e,t){if(void 0===t&&(t=!1),!Xi(this.target_,e))return!0;if(Sa(this)&&!Ta(this,{object:this.proxy_||this.target_,name:e,type:ts}))return null;try{var r,i;zo();var n,o=ka(this),a=this.values_.get(e),s=void 0;if(!a&&o)s=null==(n=Ti(this.target_,e))?void 0:n.value;if(t){if(!Reflect.deleteProperty(this.target_,e))return!1}else delete this.target_[e];if(a&&(this.values_.delete(e),a instanceof so&&(s=a.value_),Do(a)),this.keysAtom_.reportChanged(),null==(r=this.pendingKeys_)||null==(i=r.get(e))||i.set(e in this.target_),o){var l={type:ts,observableKind:"object",object:this.proxy_||this.target_,debugObjectName:this.name_,oldValue:s,name:e};0,o&&Ia(this,l)}}finally{Mo()}return!0},t.observe_=function(e,t){return Aa(this,e)},t.intercept_=function(e){return Ea(this,e)},t.notifyPropertyAddition_=function(e,t){var r,i,n=ka(this);if(n){var o=n?{type:Ga,observableKind:"object",debugObjectName:this.name_,object:this.proxy_||this.target_,name:e,newValue:t}:null;n&&Ia(this,o)}null==(r=this.pendingKeys_)||null==(i=r.get(e))||i.set(!0),this.keysAtom_.reportChanged()},t.ownKeys_=function(){return this.keysAtom_.reportObserved(),Zi(this.target_)},t.keys_=function(){return this.keysAtom_.reportObserved(),Object.keys(this.target_)},e}();function is(e,t){var r;if(Xi(e,ln))return e;var i=null!=(r=null==t?void 0:t.name)?r:"ObservableObject",n=new rs(e,new Map,String(i),function(e){var t;return e?null!=(t=e.defaultDecorator)?t:zn(e):void 0}(t));return Ni(e,ln,n),e}var ns=Vi("ObservableObjectAdministration",rs);function os(e){return es[e]||(es[e]={get:function(){return this[ln].getObservablePropValue_(e)},set:function(t){return this[ln].setObservablePropValue_(e,t)}})}function as(e){return!!Ri(e)&&ns(e[ln])}function ss(e,t,r){var i;null==(i=e.target_[on])||delete i[r]}var ls,cs,us=0,hs=function(){};ls=hs,cs=Array.prototype,Object.setPrototypeOf?Object.setPrototypeOf(ls.prototype,cs):void 0!==ls.prototype.__proto__?ls.prototype.__proto__=cs:ls.prototype=cs;var ps=function(e,t,r){function i(t,r,i,n){var o;void 0===i&&(i="ObservableArray"),void 0===n&&(n=!1),o=e.call(this)||this;var a=new Oa(i,r,n,!0);if(a.proxy_=tn(o),Ui(tn(o),ln,a),t&&t.length){var s=no(!0);o.spliceWithArray(0,0,t),oo(s)}return o}Qi(i,e);var n=i.prototype;return n.concat=function(){this[ln].atom_.reportObserved();for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Array.prototype.concat.apply(this.slice(),t.map((function(e){return qa(e)?e.slice():e})))},n[r]=function(){var e=this,t=0;return Ss({next:function(){return t<e.length?{value:e[t++],done:!1}:{done:!0,value:void 0}}})},Ji(i,[{key:"length",get:function(){return this[ln].getArrayLength_()},set:function(e){this[ln].setArrayLength_(e)}},{key:t,get:function(){return"Array"}}]),i}(hs,Symbol.toStringTag,Symbol.iterator);function ds(e){ki(ps.prototype,""+e,function(e){return{enumerable:!1,configurable:!0,get:function(){return this[ln].get_(e)},set:function(t){this[ln].set_(e,t)}}}(e))}function fs(e){if(e>us){for(var t=us;t<e+100;t++)ds(t);us=e}}function ms(e,t,r){return new ps(e,t,r)}function ys(e,t){if("object"==typeof e&&null!==e){if(qa(e))return void 0!==t&&xi(23),e[ln].atom_;if(Qa(e))return e[ln];if(Ha(e)){if(void 0===t)return e.keysAtom_;var r=e.data_.get(t)||e.hasMap_.get(t);return r||xi(25,t,_s(e)),r}if(as(e)){if(!t)return xi(26);var i=e[ln].values_.get(t);return i||xi(27,t,_s(e)),i}if(un(e)||po(e)||Bo(e))return e}else if(Li(e)&&Bo(e[ln]))return e[ln];xi(28)}function gs(e,t){return e||xi(29),void 0!==t?gs(ys(e,t)):un(e)||po(e)||Bo(e)||Ha(e)||Qa(e)?e:e[ln]?e[ln]:void xi(24,e)}function _s(e,t){var r;if(void 0!==t)r=ys(e,t);else{if(Ho(e))return e.name;r=as(e)||Ha(e)||Qa(e)?gs(e):ys(e)}return r.name_}Object.entries(La).forEach((function(e){var t=e[0],r=e[1];"concat"!==t&&Ni(ps.prototype,t,r)})),fs(1e3);var bs=Ai.toString;function vs(e,t,r){return void 0===r&&(r=-1),xs(e,t,r)}function xs(e,t,r,i,n){if(e===t)return 0!==e||1/e==1/t;if(null==e||null==t)return!1;if(e!=e)return t!=t;var o=typeof e;if("function"!==o&&"object"!==o&&"object"!=typeof t)return!1;var a=bs.call(e);if(a!==bs.call(t))return!1;switch(a){case"[object RegExp]":case"[object String]":return""+e==""+t;case"[object Number]":return+e!=+e?+t!=+t:0==+e?1/+e==1/t:+e==+t;case"[object Date]":case"[object Boolean]":return+e==+t;case"[object Symbol]":return"undefined"!=typeof Symbol&&Symbol.valueOf.call(e)===Symbol.valueOf.call(t);case"[object Map]":case"[object Set]":r>=0&&r++}e=ws(e),t=ws(t);var s="[object Array]"===a;if(!s){if("object"!=typeof e||"object"!=typeof t)return!1;var l=e.constructor,c=t.constructor;if(l!==c&&!(Li(l)&&l instanceof l&&Li(c)&&c instanceof c)&&"constructor"in e&&"constructor"in t)return!1}if(0===r)return!1;r<0&&(r=-1),n=n||[];for(var u=(i=i||[]).length;u--;)if(i[u]===e)return n[u]===t;if(i.push(e),n.push(t),s){if((u=e.length)!==t.length)return!1;for(;u--;)if(!xs(e[u],t[u],r-1,i,n))return!1}else{var h,p=Object.keys(e);if(u=p.length,Object.keys(t).length!==u)return!1;for(;u--;)if(!Xi(t,h=p[u])||!xs(e[h],t[h],r-1,i,n))return!1}return i.pop(),n.pop(),!0}function ws(e){return qa(e)?e.slice():qi(e)||Ha(e)||$i(e)||Qa(e)?Array.from(e.entries()):e}function Ss(e){return e[Symbol.iterator]=Es,e}function Es(){return this}function Ts(e,t){void 0===t&&(t="Illegal state"),e||function(e){throw new Error("[mobx-utils] "+e)}(t)}["Symbol","Map","Set"].forEach((function(e){void 0===Si()[e]&&xi("MobX requires global '"+e+"' to be available or polyfilled")})),"object"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__&&__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({spy:function(e){return console.warn("[mobx.spy] Is a no-op in production builds"),function(){}},extras:{getDebugName:_s},$mobx:ln});var ks=function(e){return e&&e!==Object.prototype&&Object.getOwnPropertyNames(e).concat(ks(Object.getPrototypeOf(e))||[])},As=function(e){return function(e){var t=ks(e),r=t.filter((function(e,r){return t.indexOf(e)===r}));return r}(e).filter((function(e){return"constructor"!==e&&!~e.indexOf("__")}))},Is="pending",Ps="fulfilled",Cs="rejected";function zs(e){switch(this.state){case Is:return e.pending&&e.pending(this.value);case Cs:return e.rejected&&e.rejected(this.value);case Ps:return e.fulfilled?e.fulfilled(this.value):this.value}}function Ms(e,t){if(Ts(arguments.length<=2,"fromPromise expects up to two arguments"),Ts("function"==typeof e||"object"==typeof e&&e&&"function"==typeof e.then,"Please pass a promise or function to fromPromise"),!0===e.isPromiseBasedObservable)return e;"function"==typeof e&&(e=new Promise(e));var r=e;e.then(Wo("observableFromPromise-resolve",(function(e){r.value=e,r.state=Ps})),Wo("observableFromPromise-reject",(function(e){r.value=e,r.state=Cs}))),r.isPromiseBasedObservable=!0,r.case=zs;var i=t&&t.state===Ps?t.value:void 0;return na(r,{value:i,state:Is},{},{deep:!1}),r}!function(e){e.reject=Wo("fromPromise.reject",(function(t){var r=e(Promise.reject(t));return r.state=Cs,r.value=t,r})),e.resolve=Wo("fromPromise.resolve",(function(t){void 0===t&&(t=void 0);var r=e(Promise.resolve(t));return r.state=Ps,r.value=t,r}))}(Ms||(Ms={}));var Os=function(e,t,r,i){var n,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,i);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,r,a):n(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a};function Ds(e,t){var r;void 0===t&&(t=!1);var i=Kn(e);return(r={subscribe:function(e){return"function"==typeof e?{unsubscribe:ma(i,(function(t){var r=t.newValue;return e(r)}),t)}:e&&"object"==typeof e&&e.next?{unsubscribe:ma(i,(function(t){var r=t.newValue;return e.next(r)}),t)}:{unsubscribe:function(){}}}})["function"==typeof Symbol&&Symbol.observable||"@@observable"]=function(){return this},r}!function(){function e(e,t){var r=this;Object.defineProperty(this,"current",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"subscription",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Pa(this),Ko((function(){r.current=t,r.subscription=e.subscribe(r)}))}Object.defineProperty(e.prototype,"dispose",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.subscription&&this.subscription.unsubscribe()}}),Object.defineProperty(e.prototype,"next",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.current=e}}),Object.defineProperty(e.prototype,"complete",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.dispose()}}),Object.defineProperty(e.prototype,"error",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.current=e,this.dispose()}}),Os([Gn.ref],e.prototype,"current",void 0),Os([Wo.bound],e.prototype,"next",null),Os([Wo.bound],e.prototype,"complete",null),Os([Wo.bound],e.prototype,"error",null)}();var Ls=function(){return Ls=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Ls.apply(this,arguments)},js=function(e,t,r,i){var n,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,r):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,r,i);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,r,a):n(t,r))||a);return o>3&&a&&Object.defineProperty(t,r,a),a},Rs=["model","reset","submit","isDirty","isPropertyDirty","resetProperty"];!function(){function e(e){var t=this;Object.defineProperty(this,"model",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"localValues",{enumerable:!0,configurable:!0,writable:!0,value:Gn.map({})}),Object.defineProperty(this,"localComputedValues",{enumerable:!0,configurable:!0,writable:!0,value:Gn.map({})}),Object.defineProperty(this,"isPropertyDirty",{enumerable:!0,configurable:!0,writable:!0,value:function(e){return t.localValues.has(e)}}),Pa(this),Ts(as(e),"createViewModel expects an observable object");var r=As(this);As(e).forEach((function(i){var n;if(!r.includes(i)&&i!==ln&&"__mobxDidRunLazyInitializers"!==i){if(Ts(-1===Rs.indexOf(i),"The propertyname "+i+" is reserved and cannot be used with viewModels"),da(e,i)){var o=gs(e,i),a=o.derivation.bind(t),s=null===(n=o.setter_)||void 0===n?void 0:n.bind(t);t.localComputedValues.set(i,Kn(a,{set:s}))}var l=Object.getOwnPropertyDescriptor(e,i),c=l?{enumerable:l.enumerable}:{};Object.defineProperty(t,i,Ls(Ls({},c),{configurable:!0,get:function(){return da(e,i)?t.localComputedValues.get(i).get():t.isPropertyDirty(i)?t.localValues.get(i):t.model[i]},set:Wo((function(r){da(e,i)?t.localComputedValues.get(i).set(r):r!==t.model[i]?t.localValues.set(i,r):t.localValues.delete(i)}))}))}}))}Object.defineProperty(e.prototype,"isDirty",{get:function(){return this.localValues.size>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"changedValues",{get:function(){return new Map(this.localValues)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"submit",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t=this;(e=this.localValues,as(e)?e[ln].keys_():Ha(e)||Qa(e)?Array.from(e.keys()):qa(e)?e.map((function(e,t){return t})):void xi(5)).forEach((function(e){var r=t.localValues.get(e),i=t.model[e];qa(i)?i.replace(r):Ha(i)?(i.clear(),i.merge(r)):pa(r)||(t.model[e]=r)})),this.localValues.clear()}}),Object.defineProperty(e.prototype,"reset",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.localValues.clear()}}),Object.defineProperty(e.prototype,"resetProperty",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.localValues.delete(e)}}),js([Kn],e.prototype,"isDirty",null),js([Kn],e.prototype,"changedValues",null),js([Wo.bound],e.prototype,"submit",null),js([Wo.bound],e.prototype,"reset",null),js([Wo.bound],e.prototype,"resetProperty",null)}();var Bs=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}();!function(e){function t(t,r,i){var n=void 0===i?{}:i,o=n.name,a=void 0===o?"ogm"+(1e3*Math.random()|0):o,s=n.keyToName,l=void 0===s?function(e){return""+e}:s,c=e.call(this)||this;Object.defineProperty(c,"_base",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_ogmInfoKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_groupBy",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_keyToName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(c,"_disposeBaseObserver",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),c._keyToName=l,c._groupBy=r,c._ogmInfoKey=Symbol("ogmInfo"+a),c._base=t;for(var u=0;u<t.length;u++)c._addItem(t[u]);return c._disposeBaseObserver=ma(c._base,(function(e){if("splice"===e.type)va((function(){for(var t=0,r=e.removed;t<r.length;t++){var i=r[t];c._removeItem(i)}for(var n=0,o=e.added;n<o.length;n++){var a=o[n];c._addItem(a)}}));else{if("update"!==e.type)throw new Error("illegal state");va((function(){c._removeItem(e.oldValue),c._addItem(e.newValue)}))}})),c}Bs(t,e),Object.defineProperty(t.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){throw new Error("not supported")}}),Object.defineProperty(t.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(e){throw new Error("not supported")}}),Object.defineProperty(t.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){throw new Error("not supported")}}),Object.defineProperty(t.prototype,"dispose",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._disposeBaseObserver();for(var e=0;e<this._base.length;e++){var t=this._base[e];t[this._ogmInfoKey].reaction(),delete t[this._ogmInfoKey]}}}),Object.defineProperty(t.prototype,"_getGroupArr",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=e.prototype.get.call(this,t);return void 0===r&&(r=Gn([],{name:"GroupArray["+this._keyToName(t)+"]",deep:!1}),e.prototype.set.call(this,t,r)),r}}),Object.defineProperty(t.prototype,"_removeFromGroupArr",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){var i=e.prototype.get.call(this,t);1===i.length?e.prototype.delete.call(this,t):(r===i.length-1||(i[r]=i[i.length-1],i[r][this._ogmInfoKey].groupArrIndex=r),i.length--)}}),Object.defineProperty(t.prototype,"_addItem",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=this._groupBy(e),i=this._getGroupArr(r),n={groupByValue:r,groupArrIndex:i.length,reaction:ea((function(){return t._groupBy(e)}),(function(r,i){var n=e[t._ogmInfoKey];t._removeFromGroupArr(n.groupByValue,n.groupArrIndex);var o=t._getGroupArr(r),a=o.length;o.push(e),n.groupByValue=r,n.groupArrIndex=a}))};Object.defineProperty(e,this._ogmInfoKey,{configurable:!0,enumerable:!1,value:n}),i.push(e)}}),Object.defineProperty(t.prototype,"_removeItem",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e[this._ogmInfoKey];this._removeFromGroupArr(t.groupByValue,t.groupArrIndex),t.reaction(),delete e[this._ogmInfoKey]}})}(Ka);var Fs=function(e){function t(t,r){var i=e.call(this,t)||this;return i.name=i.constructor.name,i.cause=r,i}return r(t,e),t}(Error),Ns=function(e){function t(t,r,i){var n=e.call(this,"Failed to evaluate expression <".concat(t,">: ").concat(i.join(", ")))||this;return Object.defineProperty(n,"reason",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"errors",{enumerable:!0,configurable:!0,writable:!0,value:i}),n}return r(t,e),t}(Fs);var Us={name:"state",fn:function(e,t){if(!t.store)throw new Ns(t.expression,"evaluationError",["no state store provided"]);var r=e.slice(1).join("."),i=t.store.get(r);return Yr(i)?null:"object"==typeof i?["literal",i]:i}},Vs={schemeGroups:{sequential:["BuGn","BuPu","GnBu","OrRd","PuBu","PuBuGn","PuRd","RdPu","YlGn","YlGnBu","YlOrBr","YlOrRd"],singlehue:["Blues","Greens","Greys","Oranges","Purples","Reds"],diverging:["BrBG","PiYG","PRGn","PuOr","RdBu","RdGy","RdYlBu","RdYlGn","Spectral"],qualitative:["Accent","Dark2","Paired","Pastel1","Pastel2","Set1","Set2","Set3"]},YlGn:{3:["#f7fcb9","#addd8e","#31a354"],4:["#ffffcc","#c2e699","#78c679","#238443"],5:["#ffffcc","#c2e699","#78c679","#31a354","#006837"],6:["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],7:["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],8:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],9:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"]},YlGnBu:{3:["#edf8b1","#7fcdbb","#2c7fb8"],4:["#ffffcc","#a1dab4","#41b6c4","#225ea8"],5:["#ffffcc","#a1dab4","#41b6c4","#2c7fb8","#253494"],6:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#2c7fb8","#253494"],7:["#ffffcc","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],8:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#0c2c84"],9:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"]},GnBu:{3:["#e0f3db","#a8ddb5","#43a2ca"],4:["#f0f9e8","#bae4bc","#7bccc4","#2b8cbe"],5:["#f0f9e8","#bae4bc","#7bccc4","#43a2ca","#0868ac"],6:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#43a2ca","#0868ac"],7:["#f0f9e8","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],8:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#08589e"],9:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"]},BuGn:{3:["#e5f5f9","#99d8c9","#2ca25f"],4:["#edf8fb","#b2e2e2","#66c2a4","#238b45"],5:["#edf8fb","#b2e2e2","#66c2a4","#2ca25f","#006d2c"],6:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#2ca25f","#006d2c"],7:["#edf8fb","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],8:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#005824"],9:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"]},PuBuGn:{3:["#ece2f0","#a6bddb","#1c9099"],4:["#f6eff7","#bdc9e1","#67a9cf","#02818a"],5:["#f6eff7","#bdc9e1","#67a9cf","#1c9099","#016c59"],6:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#1c9099","#016c59"],7:["#f6eff7","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],8:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016450"],9:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"]},PuBu:{3:["#ece7f2","#a6bddb","#2b8cbe"],4:["#f1eef6","#bdc9e1","#74a9cf","#0570b0"],5:["#f1eef6","#bdc9e1","#74a9cf","#2b8cbe","#045a8d"],6:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#2b8cbe","#045a8d"],7:["#f1eef6","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],8:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#034e7b"],9:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"]},BuPu:{3:["#e0ecf4","#9ebcda","#8856a7"],4:["#edf8fb","#b3cde3","#8c96c6","#88419d"],5:["#edf8fb","#b3cde3","#8c96c6","#8856a7","#810f7c"],6:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8856a7","#810f7c"],7:["#edf8fb","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],8:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#6e016b"],9:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"]},RdPu:{3:["#fde0dd","#fa9fb5","#c51b8a"],4:["#feebe2","#fbb4b9","#f768a1","#ae017e"],5:["#feebe2","#fbb4b9","#f768a1","#c51b8a","#7a0177"],6:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#c51b8a","#7a0177"],7:["#feebe2","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],8:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177"],9:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"]},PuRd:{3:["#e7e1ef","#c994c7","#dd1c77"],4:["#f1eef6","#d7b5d8","#df65b0","#ce1256"],5:["#f1eef6","#d7b5d8","#df65b0","#dd1c77","#980043"],6:["#f1eef6","#d4b9da","#c994c7","#df65b0","#dd1c77","#980043"],7:["#f1eef6","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],8:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#91003f"],9:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"]},OrRd:{3:["#fee8c8","#fdbb84","#e34a33"],4:["#fef0d9","#fdcc8a","#fc8d59","#d7301f"],5:["#fef0d9","#fdcc8a","#fc8d59","#e34a33","#b30000"],6:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#e34a33","#b30000"],7:["#fef0d9","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],8:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#990000"],9:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"]},YlOrRd:{3:["#ffeda0","#feb24c","#f03b20"],4:["#ffffb2","#fecc5c","#fd8d3c","#e31a1c"],5:["#ffffb2","#fecc5c","#fd8d3c","#f03b20","#bd0026"],6:["#ffffb2","#fed976","#feb24c","#fd8d3c","#f03b20","#bd0026"],7:["#ffffb2","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],8:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#b10026"],9:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"]},YlOrBr:{3:["#fff7bc","#fec44f","#d95f0e"],4:["#ffffd4","#fed98e","#fe9929","#cc4c02"],5:["#ffffd4","#fed98e","#fe9929","#d95f0e","#993404"],6:["#ffffd4","#fee391","#fec44f","#fe9929","#d95f0e","#993404"],7:["#ffffd4","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],8:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#8c2d04"],9:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"]},Purples:{3:["#efedf5","#bcbddc","#756bb1"],4:["#f2f0f7","#cbc9e2","#9e9ac8","#6a51a3"],5:["#f2f0f7","#cbc9e2","#9e9ac8","#756bb1","#54278f"],6:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#756bb1","#54278f"],7:["#f2f0f7","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],8:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#4a1486"],9:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"]},Blues:{3:["#deebf7","#9ecae1","#3182bd"],4:["#eff3ff","#bdd7e7","#6baed6","#2171b5"],5:["#eff3ff","#bdd7e7","#6baed6","#3182bd","#08519c"],6:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#3182bd","#08519c"],7:["#eff3ff","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],8:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#084594"],9:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"]},Greens:{3:["#e5f5e0","#a1d99b","#31a354"],4:["#edf8e9","#bae4b3","#74c476","#238b45"],5:["#edf8e9","#bae4b3","#74c476","#31a354","#006d2c"],6:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#31a354","#006d2c"],7:["#edf8e9","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],8:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#005a32"],9:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"]},Oranges:{3:["#fee6ce","#fdae6b","#e6550d"],4:["#feedde","#fdbe85","#fd8d3c","#d94701"],5:["#feedde","#fdbe85","#fd8d3c","#e6550d","#a63603"],6:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#e6550d","#a63603"],7:["#feedde","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],8:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#8c2d04"],9:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"]},Reds:{3:["#fee0d2","#fc9272","#de2d26"],4:["#fee5d9","#fcae91","#fb6a4a","#cb181d"],5:["#fee5d9","#fcae91","#fb6a4a","#de2d26","#a50f15"],6:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#de2d26","#a50f15"],7:["#fee5d9","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],8:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#99000d"],9:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"]},Greys:{3:["#f0f0f0","#bdbdbd","#636363"],4:["#f7f7f7","#cccccc","#969696","#525252"],5:["#f7f7f7","#cccccc","#969696","#636363","#252525"],6:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#636363","#252525"],7:["#f7f7f7","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],8:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525"],9:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"]},PuOr:{3:["#f1a340","#f7f7f7","#998ec3"],4:["#e66101","#fdb863","#b2abd2","#5e3c99"],5:["#e66101","#fdb863","#f7f7f7","#b2abd2","#5e3c99"],6:["#b35806","#f1a340","#fee0b6","#d8daeb","#998ec3","#542788"],7:["#b35806","#f1a340","#fee0b6","#f7f7f7","#d8daeb","#998ec3","#542788"],8:["#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788"],9:["#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788"],10:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],11:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"]},BrBG:{3:["#d8b365","#f5f5f5","#5ab4ac"],4:["#a6611a","#dfc27d","#80cdc1","#018571"],5:["#a6611a","#dfc27d","#f5f5f5","#80cdc1","#018571"],6:["#8c510a","#d8b365","#f6e8c3","#c7eae5","#5ab4ac","#01665e"],7:["#8c510a","#d8b365","#f6e8c3","#f5f5f5","#c7eae5","#5ab4ac","#01665e"],8:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e"],9:["#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e"],10:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],11:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"]},PRGn:{3:["#af8dc3","#f7f7f7","#7fbf7b"],4:["#7b3294","#c2a5cf","#a6dba0","#008837"],5:["#7b3294","#c2a5cf","#f7f7f7","#a6dba0","#008837"],6:["#762a83","#af8dc3","#e7d4e8","#d9f0d3","#7fbf7b","#1b7837"],7:["#762a83","#af8dc3","#e7d4e8","#f7f7f7","#d9f0d3","#7fbf7b","#1b7837"],8:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837"],9:["#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837"],10:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],11:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"]},PiYG:{3:["#e9a3c9","#f7f7f7","#a1d76a"],4:["#d01c8b","#f1b6da","#b8e186","#4dac26"],5:["#d01c8b","#f1b6da","#f7f7f7","#b8e186","#4dac26"],6:["#c51b7d","#e9a3c9","#fde0ef","#e6f5d0","#a1d76a","#4d9221"],7:["#c51b7d","#e9a3c9","#fde0ef","#f7f7f7","#e6f5d0","#a1d76a","#4d9221"],8:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221"],9:["#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221"],10:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],11:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"]},RdBu:{3:["#ef8a62","#f7f7f7","#67a9cf"],4:["#ca0020","#f4a582","#92c5de","#0571b0"],5:["#ca0020","#f4a582","#f7f7f7","#92c5de","#0571b0"],6:["#b2182b","#ef8a62","#fddbc7","#d1e5f0","#67a9cf","#2166ac"],7:["#b2182b","#ef8a62","#fddbc7","#f7f7f7","#d1e5f0","#67a9cf","#2166ac"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"]},RdGy:{3:["#ef8a62","#ffffff","#999999"],4:["#ca0020","#f4a582","#bababa","#404040"],5:["#ca0020","#f4a582","#ffffff","#bababa","#404040"],6:["#b2182b","#ef8a62","#fddbc7","#e0e0e0","#999999","#4d4d4d"],7:["#b2182b","#ef8a62","#fddbc7","#ffffff","#e0e0e0","#999999","#4d4d4d"],8:["#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d"],9:["#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d"],10:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],11:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"]},RdYlBu:{3:["#fc8d59","#ffffbf","#91bfdb"],4:["#d7191c","#fdae61","#abd9e9","#2c7bb6"],5:["#d7191c","#fdae61","#ffffbf","#abd9e9","#2c7bb6"],6:["#d73027","#fc8d59","#fee090","#e0f3f8","#91bfdb","#4575b4"],7:["#d73027","#fc8d59","#fee090","#ffffbf","#e0f3f8","#91bfdb","#4575b4"],8:["#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4"],9:["#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"]},Spectral:{3:["#fc8d59","#ffffbf","#99d594"],4:["#d7191c","#fdae61","#abdda4","#2b83ba"],5:["#d7191c","#fdae61","#ffffbf","#abdda4","#2b83ba"],6:["#d53e4f","#fc8d59","#fee08b","#e6f598","#99d594","#3288bd"],7:["#d53e4f","#fc8d59","#fee08b","#ffffbf","#e6f598","#99d594","#3288bd"],8:["#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd"],9:["#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd"],10:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],11:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"]},RdYlGn:{3:["#fc8d59","#ffffbf","#91cf60"],4:["#d7191c","#fdae61","#a6d96a","#1a9641"],5:["#d7191c","#fdae61","#ffffbf","#a6d96a","#1a9641"],6:["#d73027","#fc8d59","#fee08b","#d9ef8b","#91cf60","#1a9850"],7:["#d73027","#fc8d59","#fee08b","#ffffbf","#d9ef8b","#91cf60","#1a9850"],8:["#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850"],9:["#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850"],10:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],11:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"]},Accent:{3:["#7fc97f","#beaed4","#fdc086"],4:["#7fc97f","#beaed4","#fdc086","#ffff99"],5:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0"],6:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f"],7:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17"],8:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"]},Dark2:{3:["#1b9e77","#d95f02","#7570b3"],4:["#1b9e77","#d95f02","#7570b3","#e7298a"],5:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e"],6:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02"],7:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d"],8:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"]},Paired:{3:["#a6cee3","#1f78b4","#b2df8a"],4:["#a6cee3","#1f78b4","#b2df8a","#33a02c"],5:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99"],6:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c"],7:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f"],8:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00"],9:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6"],10:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a"],11:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99"],12:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"]},Pastel1:{3:["#fbb4ae","#b3cde3","#ccebc5"],4:["#fbb4ae","#b3cde3","#ccebc5","#decbe4"],5:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6"],6:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc"],7:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd"],8:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec"],9:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},Pastel2:{3:["#b3e2cd","#fdcdac","#cbd5e8"],4:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4"],5:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9"],6:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae"],7:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc"],8:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"]},Set1:{3:["#e41a1c","#377eb8","#4daf4a"],4:["#e41a1c","#377eb8","#4daf4a","#984ea3"],5:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00"],6:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33"],7:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628"],8:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf"],9:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"]},Set2:{3:["#66c2a5","#fc8d62","#8da0cb"],4:["#66c2a5","#fc8d62","#8da0cb","#e78ac3"],5:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854"],6:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f"],7:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494"],8:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"]},Set3:{3:["#8dd3c7","#ffffb3","#bebada"],4:["#8dd3c7","#ffffb3","#bebada","#fb8072"],5:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3"],6:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462"],7:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69"],8:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5"],9:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9"],10:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd"],11:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5"],12:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"]}},qs=Object.freeze({__proto__:null,isUndefined:Hr,isNull:Jr,isNil:Yr,isDefined:Qr,isString:ei,hasLength:ti,isStringFull:ri,isArray:ii,isArrayFull:ni,isArrayStrings:oi,isObject:ai,isObjectFull:si,isNumber:li,isFalse:ci,isTrue:ui,isIn:hi,isBoolean:pi,isNumeric:di,isDate:fi,isValue:mi,hasValue:yi,isFunction:gi,isPlainObject:_i,isURL:vi}),$s={};var Gs={name:"from-palette",initialize:function(){Object.keys(Vs).filter((function(e){return"schemeGroups"!==e})).forEach((function(e){return $s[e]={id:e,colors:Vs[e][5]}}))},fn:function(e,t){var r,i,n=e[1],o=e[2],a=e.slice(3);if(ei(n))i=(null===(r=$s[n])||void 0===r?void 0:r.colors)||$s.Greys.colors;else{if(!ii(n)||"literal"!==n[0])throw new Ns(t.expression,"evaluationError",["from-palette requires palette id as string or custom palette array"]);i=n[1]}var s=i.length,l=!1;if(s<5)throw new Ns(t.expression,"evaluationError",["custom palette requires at least 5 color entries"]);switch(a.length){case 2:break;case 3:l=!!a[2],a=a.slice(0,2);break;case s:break;case s+1:l=!!a[s],a=a.slice(0,s);break;default:throw new Ns(t.expression,"evaluationError",["incorrect color stop arguments"])}if(2===a.length){var c=a[0],u=a[1];a=[];for(var h=(u-c)/(s-1),p=0;p<s;p++)a.push(c+p*h)}for(e=["interpolate-lab",["linear"],o],p=0;p<a.length;p++)e.push(a[p]),e.push(l?i[a.length-p-1]:i[p]);return e}},Zs=function(){function e(t,r){Object.defineProperty(this,"_expression",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"parsedResult",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_store",{enumerable:!0,configurable:!0,writable:!0,value:null}),Pa(this,{_store:Gn.ref,maplibreExpression:Kn,value:Kn,bindState:Wo},{name:this.formatName(t)}),this._expression=t,Hr(r)?this.parsedResult=e.parser.parseExpression(t):this.parsedResult={status:!0,value:r}}return Object.defineProperty(e,"hasCustomFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!!this.customFunctions[e]}}),Object.defineProperty(e,"registerCustomFunction",{enumerable:!1,configurable:!0,writable:!0,value:function(e){e.initialize&&e.initialize(),this.customFunctions[e.name]=e}}),Object.defineProperty(e,"parseProgram",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this.parser.parseProgram(t);if(ei(t)&&0===t.length)return{};if(r.status)return Object.keys(r.value).reduce((function(i,n){var o=r.value[n],a=t.slice(o.start.offset,o.end.offset);return i[n]=new e(a,o.expr),i}),{});throw new Ns("program","parseError",["expected ".concat(r.expected.join(" ")," at line ").concat(r.index.line,", column ").concat(r.index.column,"]")])}}),Object.defineProperty(e.prototype,"maplibreExpression",{get:function(){if(this.isParseError(this.parsedResult))throw this.parseError;return this.expandCustomFunctions(this.parsedResult.value)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.evaluateExpression()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parseError",{get:function(){return this.isParseError(this.parsedResult)?new Ns(this._expression,"parseError",["index: ".concat(this.parsedResult.index.offset),"expected: ".concat(this.parsedResult.expected.join(" "))]):null},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"expression",{get:function(){return this._expression},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"store",{get:function(){return this._store},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bindState",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._store=e,this}}),Object.defineProperty(e.prototype,"toStream",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return void 0===e&&(e=!0),Ds((function(){return t.value}),e)}}),Object.defineProperty(e.prototype,"evaluateExpression",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=Ur.createExpression(this.maplibreExpression),t=e.result,r=e.value;if("success"===t)return r.evaluate({zoom:0});throw new Ns(this.expression,"evaluationError",r.map((function(e){return e.message})))}}),Object.defineProperty(e.prototype,"expandCustomFunctions",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this;if(this.isFunctionExpression(t)){var i=t[0],n=t.slice(1).map((function(e){return r.expandCustomFunctions(e)}));return t=l([i],s(n),!1),e.hasCustomFunction(i)?e.customFunctions[i].fn(t,this):t}return t}}),Object.defineProperty(e.prototype,"isParseError",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return!e.status}}),Object.defineProperty(e.prototype,"isFunctionExpression",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Array.isArray(e)}}),Object.defineProperty(e.prototype,"formatName",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"FlowCoreExpression<".concat(e,">}")}}),Object.defineProperty(e,"parser",{enumerable:!0,configurable:!0,writable:!0,value:new Kr}),Object.defineProperty(e,"customFunctions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),e}();Zs.registerCustomFunction(Us),Zs.registerCustomFunction(Gs);var Ws,Xs,Ks={exports:{}};function Hs(){if(Xs)return Ws;Xs=1;var e=1e3,t=60*e,r=60*t,i=24*r,n=7*i,o=365.25*i;function a(e,t,r,i){var n=t>=1.5*r;return Math.round(e/r)+" "+i+(n?"s":"")}return Ws=function(s,l){l=l||{};var c=typeof s;if("string"===c&&s.length>0)return function(a){if((a=String(a)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(a);if(!s)return;var l=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return l*o;case"weeks":case"week":case"w":return l*n;case"days":case"day":case"d":return l*i;case"hours":case"hour":case"hrs":case"hr":case"h":return l*r;case"minutes":case"minute":case"mins":case"min":case"m":return l*t;case"seconds":case"second":case"secs":case"sec":case"s":return l*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return l;default:return}}(s);if("number"===c&&isFinite(s))return l.long?function(n){var o=Math.abs(n);if(o>=i)return a(n,o,i,"day");if(o>=r)return a(n,o,r,"hour");if(o>=t)return a(n,o,t,"minute");if(o>=e)return a(n,o,e,"second");return n+" ms"}(s):function(n){var o=Math.abs(n);if(o>=i)return Math.round(n/i)+"d";if(o>=r)return Math.round(n/r)+"h";if(o>=t)return Math.round(n/t)+"m";if(o>=e)return Math.round(n/e)+"s";return n+"ms"}(s);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(s))}}var Js=function(e){function t(e){let i,n,o,a=null;function s(...e){if(!s.enabled)return;const r=s,n=Number(new Date),o=n-(i||n);r.diff=o,r.prev=i,r.curr=n,i=n,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let a=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,((i,n)=>{if("%%"===i)return"%";a++;const o=t.formatters[n];if("function"==typeof o){const t=e[a];i=o.call(r,t),e.splice(a,1),a--}return i})),t.formatArgs.call(r,e);(r.log||t.log).apply(r,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=r,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==a?a:(n!==t.namespaces&&(n=t.namespaces,o=t.enabled(e)),o),set:e=>{a=e}}),"function"==typeof t.init&&t.init(s),s}function r(e,r){const i=t(this.namespace+(void 0===r?":":r)+e);return i.log=this.log,i}function i(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){const e=[...t.names.map(i),...t.skips.map(i).map((e=>"-"+e))].join(",");return t.enable(""),e},t.enable=function(e){let r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const i=("string"==typeof e?e:"").split(/[\s,]+/),n=i.length;for(r=0;r<n;r++)i[r]&&("-"===(e=i[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let r,i;for(r=0,i=t.skips.length;r<i;r++)if(t.skips[r].test(e))return!1;for(r=0,i=t.names.length;r<i;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=Hs(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((r=>{t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t};!function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let i=0,n=0;t[0].replace(/%[a-zA-Z%]/g,(e=>{"%%"!==e&&(i++,"%c"===e&&(n=i))})),t.splice(n,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}!e&&"undefined"!=typeof process&&"env"in process&&(e=process.env.DEBUG);return e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=Js(t);const{formatters:r}=e.exports;r.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(Ks,Ks.exports);var Ys=Ks.exports,Qs={exports:{}};!function(e){var t=Object.prototype.hasOwnProperty,r="~";function i(){}function n(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,i,o,a){if("function"!=typeof i)throw new TypeError("The listener must be a function");var s=new n(i,o||e,a),l=r?r+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function s(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),s.prototype.eventNames=function(){var e,i,n=[];if(0===this._eventsCount)return n;for(i in e=this._events)t.call(e,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},s.prototype.listeners=function(e){var t=r?r+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,a=new Array(o);n<o;n++)a[n]=i[n].fn;return a},s.prototype.listenerCount=function(e){var t=r?r+e:e,i=this._events[t];return i?i.fn?1:i.length:0},s.prototype.emit=function(e,t,i,n,o,a){var s=r?r+e:e;if(!this._events[s])return!1;var l,c,u=this._events[s],h=arguments.length;if(u.fn){switch(u.once&&this.removeListener(e,u.fn,void 0,!0),h){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,t),!0;case 3:return u.fn.call(u.context,t,i),!0;case 4:return u.fn.call(u.context,t,i,n),!0;case 5:return u.fn.call(u.context,t,i,n,o),!0;case 6:return u.fn.call(u.context,t,i,n,o,a),!0}for(c=1,l=new Array(h-1);c<h;c++)l[c-1]=arguments[c];u.fn.apply(u.context,l)}else{var p,d=u.length;for(c=0;c<d;c++)switch(u[c].once&&this.removeListener(e,u[c].fn,void 0,!0),h){case 1:u[c].fn.call(u[c].context);break;case 2:u[c].fn.call(u[c].context,t);break;case 3:u[c].fn.call(u[c].context,t,i);break;case 4:u[c].fn.call(u[c].context,t,i,n);break;default:if(!l)for(p=1,l=new Array(h-1);p<h;p++)l[p-1]=arguments[p];u[c].fn.apply(u[c].context,l)}}return!0},s.prototype.on=function(e,t,r){return o(this,e,t,r,!1)},s.prototype.once=function(e,t,r){return o(this,e,t,r,!0)},s.prototype.removeListener=function(e,t,i,n){var o=r?r+e:e;if(!this._events[o])return this;if(!t)return a(this,o),this;var s=this._events[o];if(s.fn)s.fn!==t||n&&!s.once||i&&s.context!==i||a(this,o);else{for(var l=0,c=[],u=s.length;l<u;l++)(s[l].fn!==t||n&&!s[l].once||i&&s[l].context!==i)&&c.push(s[l]);c.length?this._events[o]=1===c.length?c[0]:c:a(this,o)}return this},s.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&a(this,t)):(this._events=new i,this._eventsCount=0),this},s.prototype.off=s.prototype.removeListener,s.prototype.addListener=s.prototype.on,s.prefixed=r,s.EventEmitter=s,e.exports=s}(Qs);var el=Qs.exports,tl={exports:{}};!function(e,t){e.exports=function(){var e,t,r;function i(i,n){if(e)if(t){var o="var sharedChunk = {}; ("+e+")(sharedChunk); ("+t+")(sharedChunk);",a={};e(a),r=n(a),"undefined"!=typeof window&&(r.workerUrl=window.URL.createObjectURL(new Blob([o],{type:"text/javascript"})))}else t=n;else e=n}return i(["exports"],(function(e){var t=r;function r(e,t,r,i){this.cx=3*e,this.bx=3*(r-e)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*t,this.by=3*(i-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=i}function i(e,r,i,n){const o=new t(e,r,i,n);return function(e){return o.solve(e)}}r.prototype={sampleCurveX:function(e){return((this.ax*e+this.bx)*e+this.cx)*e},sampleCurveY:function(e){return((this.ay*e+this.by)*e+this.cy)*e},sampleCurveDerivativeX:function(e){return(3*this.ax*e+2*this.bx)*e+this.cx},solveCurveX:function(e,t){if(void 0===t&&(t=1e-6),e<0)return 0;if(e>1)return 1;for(var r=e,i=0;i<8;i++){var n=this.sampleCurveX(r)-e;if(Math.abs(n)<t)return r;var o=this.sampleCurveDerivativeX(r);if(Math.abs(o)<1e-6)break;r-=n/o}var a=0,s=1;for(r=e,i=0;i<20&&(n=this.sampleCurveX(r),!(Math.abs(n-e)<t));i++)e>n?a=r:s=r,r=.5*(s-a)+a;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}};const n=i(.25,.1,.25,1);function o(e,t,r){return Math.min(r,Math.max(t,e))}function a(e,t,r){const i=r-t,n=((e-t)%i+i)%i+t;return n===t?r:n}function s(e,...t){for(const r of t)for(const t in r)e[t]=r[t];return e}let l=1;function c(e,t){e.forEach((e=>{t[e]&&(t[e]=t[e].bind(t))}))}function u(e,t,r){const i={};for(const n in e)i[n]=t.call(r||this,e[n],n,e);return i}function h(e,t,r){const i={};for(const n in e)t.call(r||this,e[n],n,e)&&(i[n]=e[n]);return i}function p(e){return Array.isArray(e)?e.map(p):"object"==typeof e&&e?u(e,p):e}const d={};function f(e){d[e]||("undefined"!=typeof console&&console.warn(e),d[e]=!0)}function m(e,t,r){return(r.y-e.y)*(t.x-e.x)>(t.y-e.y)*(r.x-e.x)}function y(e){let t=0;for(let r,i,n=0,o=e.length,a=o-1;n<o;a=n++)r=e[n],i=e[a],t+=(i.x-r.x)*(r.y+i.y);return t}function g(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function _(e){const t={};if(e.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,((e,r,i,n)=>{const o=i||n;return t[r]=!o||o.toLowerCase(),""})),t["max-age"]){const e=parseInt(t["max-age"],10);isNaN(e)?delete t["max-age"]:t["max-age"]=e}return t}let b,v,x=null;function w(e){if(null==x){const t=e.navigator?e.navigator.userAgent:null;x=!!e.safari||!(!t||!(/\b(iPad|iPhone|iPod)\b/.test(t)||t.match("Safari")&&!t.match("Chrome")))}return x}function S(e){return"undefined"!=typeof ImageBitmap&&e instanceof ImageBitmap}const E={now:"undefined"!=typeof performance&&performance&&performance.now?performance.now.bind(performance):Date.now.bind(Date),frame(e){const t=requestAnimationFrame(e);return{cancel:()=>cancelAnimationFrame(t)}},getImageData(e,t=0){const r=window.document.createElement("canvas"),i=r.getContext("2d");if(!i)throw new Error("failed to create canvas 2d context");return r.width=e.width,r.height=e.height,i.drawImage(e,0,0,e.width,e.height),i.getImageData(-t,-t,e.width+2*t,e.height+2*t)},resolveURL:e=>(b||(b=document.createElement("a")),b.href=e,b.href),hardwareConcurrency:"undefined"!=typeof navigator&&navigator.hardwareConcurrency||4,get prefersReducedMotion(){return!!matchMedia&&(null==v&&(v=matchMedia("(prefers-reduced-motion: reduce)")),v.matches)}};var T=k;function k(e,t){this.x=e,this.y=t}k.prototype={clone:function(){return new k(this.x,this.y)},add:function(e){return this.clone()._add(e)},sub:function(e){return this.clone()._sub(e)},multByPoint:function(e){return this.clone()._multByPoint(e)},divByPoint:function(e){return this.clone()._divByPoint(e)},mult:function(e){return this.clone()._mult(e)},div:function(e){return this.clone()._div(e)},rotate:function(e){return this.clone()._rotate(e)},rotateAround:function(e,t){return this.clone()._rotateAround(e,t)},matMult:function(e){return this.clone()._matMult(e)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(e){return this.x===e.x&&this.y===e.y},dist:function(e){return Math.sqrt(this.distSqr(e))},distSqr:function(e){var t=e.x-this.x,r=e.y-this.y;return t*t+r*r},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(e){return Math.atan2(this.y-e.y,this.x-e.x)},angleWith:function(e){return this.angleWithSep(e.x,e.y)},angleWithSep:function(e,t){return Math.atan2(this.x*t-this.y*e,this.x*e+this.y*t)},_matMult:function(e){var t=e[2]*this.x+e[3]*this.y;return this.x=e[0]*this.x+e[1]*this.y,this.y=t,this},_add:function(e){return this.x+=e.x,this.y+=e.y,this},_sub:function(e){return this.x-=e.x,this.y-=e.y,this},_mult:function(e){return this.x*=e,this.y*=e,this},_div:function(e){return this.x/=e,this.y/=e,this},_multByPoint:function(e){return this.x*=e.x,this.y*=e.y,this},_divByPoint:function(e){return this.x/=e.x,this.y/=e.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var e=this.y;return this.y=this.x,this.x=-e,this},_rotate:function(e){var t=Math.cos(e),r=Math.sin(e),i=r*this.x+t*this.y;return this.x=t*this.x-r*this.y,this.y=i,this},_rotateAround:function(e,t){var r=Math.cos(e),i=Math.sin(e),n=t.y+i*(this.x-t.x)+r*(this.y-t.y);return this.x=t.x+r*(this.x-t.x)-i*(this.y-t.y),this.y=n,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},k.convert=function(e){return e instanceof k?e:Array.isArray(e)?new k(e[0],e[1]):e};const A={MAX_PARALLEL_IMAGE_REQUESTS:16,REGISTERED_PROTOCOLS:{}},I="mapbox-tiles";let P,C,z=500,M=50;function O(){"undefined"==typeof caches||P||(P=caches.open(I))}let D=1/0;const L={supported:!1,testSupport:function(e){!B&&R&&(F?N(e):j=e)}};let j,R,B=!1,F=!1;function N(e){const t=e.createTexture();e.bindTexture(e.TEXTURE_2D,t);try{if(e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,R),e.isContextLost())return;L.supported=!0}catch(e){}e.deleteTexture(t),B=!0}"undefined"!=typeof document&&(R=document.createElement("img"),R.onload=function(){j&&N(j),j=null,F=!0},R.onerror=function(){B=!0,j=null},R.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const U={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(U);class V extends Error{constructor(e,t,r,i){super(`AJAXError: ${t} (${e}): ${r}`),this.status=e,this.statusText=t,this.url=r,this.body=i}}const q=g()?()=>self.worker&&self.worker.referrer:()=>("blob:"===window.location.protocol?window.parent:window).location.href;function $(e,t){const r=new AbortController,i=new Request(e.url,{method:e.method||"GET",body:e.body,credentials:e.credentials,headers:e.headers,referrer:q(),signal:r.signal});let n=!1,o=!1;return"json"===e.type&&i.headers.set("Accept","application/json"),((r,a,s)=>{if(o)return;const l=Date.now();fetch(i).then((r=>r.ok?((r,a,s)=>{("arrayBuffer"===e.type?r.arrayBuffer():"json"===e.type?r.json():r.text()).then((e=>{o||(a&&s&&function(e,t,r){if(O(),!P)return;const i={status:t.status,statusText:t.statusText,headers:new Headers};t.headers.forEach(((e,t)=>i.headers.set(t,e)));const n=_(t.headers.get("Cache-Control")||"");n["no-store"]||(n["max-age"]&&i.headers.set("Expires",new Date(r+1e3*n["max-age"]).toUTCString()),new Date(i.headers.get("Expires")).getTime()-r<42e4||function(e,t){if(void 0===C)try{new Response(new ReadableStream),C=!0}catch(e){C=!1}C?t(e.body):e.blob().then(t)}(t,(t=>{const r=new Response(t,i);O(),P&&P.then((t=>t.put(function(e){const t=e.indexOf("?");return t<0?e:e.slice(0,t)}(e.url),r))).catch((e=>f(e.message)))})))}(i,a,s),n=!0,t(null,e,r.headers.get("Cache-Control"),r.headers.get("Expires")))})).catch((e=>{o||t(new Error(e.message))}))})(r,null,l):r.blob().then((i=>t(new V(r.status,r.statusText,e.url,i)))))).catch((e=>{20!==e.code&&t(new Error(e.message))}))})(),{cancel:()=>{o=!0,n||r.abort()}}}const G=function(e,t){if(/:\/\//.test(e.url)&&!/^https?:|^file:/.test(e.url)){if(g()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t);if(!g()){const r=e.url.substring(0,e.url.indexOf("://"));return(A.REGISTERED_PROTOCOLS[r]||$)(e,t)}}if(!(/^file:/.test(r=e.url)||/^file:/.test(q())&&!/^\w+:/.test(r))){if(fetch&&Request&&AbortController&&Object.prototype.hasOwnProperty.call(Request.prototype,"signal"))return $(e,t);if(g()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",e,t,void 0,!0)}var r;return function(e,t){const r=new XMLHttpRequest;r.open(e.method||"GET",e.url,!0),"arrayBuffer"===e.type&&(r.responseType="arraybuffer");for(const t in e.headers)r.setRequestHeader(t,e.headers[t]);return"json"===e.type&&(r.responseType="text",r.setRequestHeader("Accept","application/json")),r.withCredentials="include"===e.credentials,r.onerror=()=>{t(new Error(r.statusText))},r.onload=()=>{if((r.status>=200&&r.status<300||0===r.status)&&null!==r.response){let i=r.response;if("json"===e.type)try{i=JSON.parse(r.response)}catch(e){return t(e)}t(null,i,r.getResponseHeader("Cache-Control"),r.getResponseHeader("Expires"))}else{const i=new Blob([r.response],{type:r.getResponseHeader("Content-Type")});t(new V(r.status,r.statusText,e.url,i))}},r.send(e.body),{cancel:()=>r.abort()}}(e,t)},Z=function(e,t){return G(s(e,{type:"arrayBuffer"}),t)};function W(e){const t=window.document.createElement("a");return t.href=e,t.protocol===window.document.location.protocol&&t.host===window.document.location.host}const X="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";let K,H;K=[],H=0;const J=function(e,t){if(L.supported&&(e.headers||(e.headers={}),e.headers.accept="image/webp,*/*"),H>=A.MAX_PARALLEL_IMAGE_REQUESTS){const r={requestParameters:e,callback:t,cancelled:!1,cancel(){this.cancelled=!0}};return K.push(r),r}H++;let r=!1;const i=()=>{if(!r)for(r=!0,H--;K.length&&H<A.MAX_PARALLEL_IMAGE_REQUESTS;){const e=K.shift(),{requestParameters:t,callback:r,cancelled:i}=e;i||(e.cancel=J(t,r).cancel)}},n=Z(e,((e,r,n,o)=>{i(),e?t(e):r&&function(e,t){"function"==typeof createImageBitmap?function(e,t){const r=new Blob([new Uint8Array(e)],{type:"image/png"});createImageBitmap(r).then((e=>{t(null,e)})).catch((e=>{t(new Error(`Could not load image because of ${e.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))}))}(e,t):function(e,t){const r=new Image;r.onload=()=>{t(null,r),URL.revokeObjectURL(r.src),r.onload=null,window.requestAnimationFrame((()=>{r.src=X}))},r.onerror=()=>t(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));const i=new Blob([new Uint8Array(e)],{type:"image/png"});r.src=e.byteLength?URL.createObjectURL(i):X}(e,t)}(r,((e,r)=>{null!=e?t(e):null!=r&&t(null,r,{cacheControl:n,expires:o})}))}));return{cancel:()=>{n.cancel(),i()}}};function Y(e,t,r){r[e]&&-1!==r[e].indexOf(t)||(r[e]=r[e]||[],r[e].push(t))}function Q(e,t,r){if(r&&r[e]){const i=r[e].indexOf(t);-1!==i&&r[e].splice(i,1)}}class ee{constructor(e,t={}){s(this,t),this.type=e}}class te extends ee{constructor(e,t={}){super("error",s({error:e},t))}}class re{on(e,t){return this._listeners=this._listeners||{},Y(e,t,this._listeners),this}off(e,t){return Q(e,t,this._listeners),Q(e,t,this._oneTimeListeners),this}once(e,t){return this._oneTimeListeners=this._oneTimeListeners||{},Y(e,t,this._oneTimeListeners),this}fire(e,t){"string"==typeof e&&(e=new ee(e,t||{}));const r=e.type;if(this.listens(r)){e.target=this;const t=this._listeners&&this._listeners[r]?this._listeners[r].slice():[];for(const r of t)r.call(this,e);const i=this._oneTimeListeners&&this._oneTimeListeners[r]?this._oneTimeListeners[r].slice():[];for(const t of i)Q(r,t,this._oneTimeListeners),t.call(this,e);const n=this._eventedParent;n&&(s(e,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),n.fire(e))}else e instanceof te&&console.error(e.error);return this}listens(e){return this._listeners&&this._listeners[e]&&this._listeners[e].length>0||this._oneTimeListeners&&this._oneTimeListeners[e]&&this._oneTimeListeners[e].length>0||this._eventedParent&&this._eventedParent.listens(e)}setEventedParent(e,t){return this._eventedParent=e,this._eventedParentData=t,this}}var ie={$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"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"string"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{}},default:"mapbox"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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:{},"viewport-glyph":{},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",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},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}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1},elevationOffset:{type:"number",default:450}},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"}}};class ne{constructor(e,t,r,i){this.message=(e?`${e}: `:"")+r,i&&(this.identifier=i),null!=t&&t.__line__&&(this.line=t.__line__)}}function oe(e){const t=e.value;return t?[new ne(e.key,t,"constants have been deprecated as of v8")]:[]}function ae(e,...t){for(const r of t)for(const t in r)e[t]=r[t];return e}function se(e){return e instanceof Number||e instanceof String||e instanceof Boolean?e.valueOf():e}function le(e){if(Array.isArray(e))return e.map(le);if(e instanceof Object&&!(e instanceof Number||e instanceof String||e instanceof Boolean)){const t={};for(const r in e)t[r]=le(e[r]);return t}return se(e)}class ce extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class ue{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,r]of t)this.bindings[e]=r}concat(e){return new ue(this,e)}get(e){if(this.bindings[e])return this.bindings[e];if(this.parent)return this.parent.get(e);throw new Error(`${e} not found in scope.`)}has(e){return!!this.bindings[e]||!!this.parent&&this.parent.has(e)}}const he={kind:"null"},pe={kind:"number"},de={kind:"string"},fe={kind:"boolean"},me={kind:"color"},ye={kind:"object"},ge={kind:"value"},_e={kind:"collator"},be={kind:"formatted"},ve={kind:"padding"},xe={kind:"resolvedImage"};function we(e,t){return{kind:"array",itemType:e,N:t}}function Se(e){if("array"===e.kind){const t=Se(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const Ee=[he,pe,de,fe,me,be,ye,we(ge),ve,xe];function Te(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!Te(e.itemType,t.itemType))&&("number"!=typeof e.N||e.N===t.N))return null}else{if(e.kind===t.kind)return null;if("value"===e.kind)for(const e of Ee)if(!Te(e,t))return null}return`Expected ${Se(e)} but found ${Se(t)} instead.`}function ke(e,t){return t.some((t=>t.kind===e.kind))}function Ae(e,t){return t.some((t=>"null"===t?null===e:"array"===t?Array.isArray(e):"object"===t?e&&!Array.isArray(e)&&"object"==typeof e:t===typeof e))}var Ie,Pe={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 Ce(e){return(e=Math.round(e))<0?0:e>255?255:e}function ze(e){return Ce("%"===e[e.length-1]?parseFloat(e)/100*255:parseInt(e))}function Me(e){return(t="%"===e[e.length-1]?parseFloat(e)/100:parseFloat(e))<0?0:t>1?1:t;var t}function Oe(e,t,r){return r<0?r+=1:r>1&&(r-=1),6*r<1?e+(t-e)*r*6:2*r<1?t:3*r<2?e+(t-e)*(2/3-r)*6:e}try{Ie={}.parseCSSColor=function(e){var t,r=e.replace(/ /g,"").toLowerCase();if(r in Pe)return Pe[r].slice();if("#"===r[0])return 4===r.length?(t=parseInt(r.substr(1),16))>=0&&t<=4095?[(3840&t)>>4|(3840&t)>>8,240&t|(240&t)>>4,15&t|(15&t)<<4,1]:null:7===r.length&&(t=parseInt(r.substr(1),16))>=0&&t<=16777215?[(16711680&t)>>16,(65280&t)>>8,255&t,1]:null;var i=r.indexOf("("),n=r.indexOf(")");if(-1!==i&&n+1===r.length){var o=r.substr(0,i),a=r.substr(i+1,n-(i+1)).split(","),s=1;switch(o){case"rgba":if(4!==a.length)return null;s=Me(a.pop());case"rgb":return 3!==a.length?null:[ze(a[0]),ze(a[1]),ze(a[2]),s];case"hsla":if(4!==a.length)return null;s=Me(a.pop());case"hsl":if(3!==a.length)return null;var l=(parseFloat(a[0])%360+360)%360/360,c=Me(a[1]),u=Me(a[2]),h=u<=.5?u*(c+1):u+c-u*c,p=2*u-h;return[Ce(255*Oe(p,h,l+1/3)),Ce(255*Oe(p,h,l)),Ce(255*Oe(p,h,l-1/3)),s];default:return null}}return null}}catch(e){}class De{constructor(e,t,r,i=1){this.r=e,this.g=t,this.b=r,this.a=i}static parse(e){if(!e)return;if(e instanceof De)return e;if("string"!=typeof e)return;const t=Ie(e);return t?new De(t[0]/255*t[3],t[1]/255*t[3],t[2]/255*t[3],t[3]):void 0}toString(){const[e,t,r,i]=this.toArray();return`rgba(${Math.round(e)},${Math.round(t)},${Math.round(r)},${i})`}toArray(){const{r:e,g:t,b:r,a:i}=this;return 0===i?[0,0,0,0]:[255*e/i,255*t/i,255*r/i,i]}}De.black=new De(0,0,0,1),De.white=new De(1,1,1,1),De.transparent=new De(0,0,0,0),De.red=new De(1,0,0,1);class Le{constructor(e,t,r){this.sensitivity=e?t?"variant":"case":t?"accent":"base",this.locale=r,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(e,t){return this.collator.compare(e,t)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class je{constructor(e,t,r,i,n){this.text=e,this.image=t,this.scale=r,this.fontStack=i,this.textColor=n}}class Re{constructor(e){this.sections=e}static fromString(e){return new Re([new je(e,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some((e=>0!==e.text.length||e.image&&0!==e.image.name.length))}static factory(e){return e instanceof Re?e:Re.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map((e=>e.text)).join("")}}class Be{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof Be)return e;if("number"==typeof e)return new Be([e,e,e,e]);if(Array.isArray(e)&&!(e.length<1||e.length>4)){for(const t of e)if("number"!=typeof t)return;switch(e.length){case 1:e=[e[0],e[0],e[0],e[0]];break;case 2:e=[e[0],e[1],e[0],e[1]];break;case 3:e=[e[0],e[1],e[2],e[1]]}return new Be(e)}}toString(){return JSON.stringify(this.values)}}class Fe{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new Fe({name:e,available:!1}):null}}function Ne(e,t,r,i){return"number"==typeof e&&e>=0&&e<=255&&"number"==typeof t&&t>=0&&t<=255&&"number"==typeof r&&r>=0&&r<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:`Invalid rgba value [${[e,t,r,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof i?[e,t,r,i]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function Ue(e){if(null===e)return!0;if("string"==typeof e)return!0;if("boolean"==typeof e)return!0;if("number"==typeof e)return!0;if(e instanceof De)return!0;if(e instanceof Le)return!0;if(e instanceof Re)return!0;if(e instanceof Be)return!0;if(e instanceof Fe)return!0;if(Array.isArray(e)){for(const t of e)if(!Ue(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!Ue(e[t]))return!1;return!0}return!1}function Ve(e){if(null===e)return he;if("string"==typeof e)return de;if("boolean"==typeof e)return fe;if("number"==typeof e)return pe;if(e instanceof De)return me;if(e instanceof Le)return _e;if(e instanceof Re)return be;if(e instanceof Be)return ve;if(e instanceof Fe)return xe;if(Array.isArray(e)){const t=e.length;let r;for(const t of e){const e=Ve(t);if(r){if(r===e)continue;r=ge;break}r=e}return we(r||ge,t)}return ye}function qe(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof De||e instanceof Re||e instanceof Be||e instanceof Fe?e.toString():JSON.stringify(e)}class $e{constructor(e,t){this.type=e,this.value=t}static parse(e,t){if(2!==e.length)return t.error(`'literal' expression requires exactly one argument, but found ${e.length-1} instead.`);if(!Ue(e[1]))return t.error("invalid value");const r=e[1];let i=Ve(r);const n=t.expectedType;return"array"!==i.kind||0!==i.N||!n||"array"!==n.kind||"number"==typeof n.N&&0!==n.N||(i=n),new $e(i,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}class Ge{constructor(e){this.name="ExpressionEvaluationError",this.message=e}toJSON(){return this.message}}const Ze={string:de,number:pe,boolean:fe,object:ye};class We{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");let r,i=1;const n=e[0];if("array"===n){let n,o;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in Ze)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);n=Ze[r],i++}else n=ge;if(e.length>3){if(null!==e[2]&&("number"!=typeof e[2]||e[2]<0||e[2]!==Math.floor(e[2])))return t.error('The length argument to "array" must be a positive integer literal',2);o=e[2],i++}r=we(n,o)}else{if(!Ze[n])throw new Error(`Types doesn't contain name = ${n}`);r=Ze[n]}const o=[];for(;i<e.length;i++){const r=t.parse(e[i],i,ge);if(!r)return null;o.push(r)}return new We(r,o)}evaluate(e){for(let t=0;t<this.args.length;t++){const r=this.args[t].evaluate(e);if(!Te(this.type,Ve(r)))return r;if(t===this.args.length-1)throw new Ge(`Expected value to be of type ${Se(this.type)}, but found ${Se(Ve(r))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}const Xe={"to-boolean":fe,"to-color":me,"to-number":pe,"to-string":de};class Ke{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[0];if(!Xe[r])throw new Error(`Can't parse ${r} as it is not part of the known types`);if(("to-boolean"===r||"to-string"===r)&&2!==e.length)return t.error("Expected one argument.");const i=Xe[r],n=[];for(let r=1;r<e.length;r++){const i=t.parse(e[r],r,ge);if(!i)return null;n.push(i)}return new Ke(i,n)}evaluate(e){if("boolean"===this.type.kind)return Boolean(this.args[0].evaluate(e));if("color"===this.type.kind){let t,r;for(const i of this.args){if(t=i.evaluate(e),r=null,t instanceof De)return t;if("string"==typeof t){const r=e.parseColor(t);if(r)return r}else if(Array.isArray(t)&&(r=t.length<3||t.length>4?`Invalid rbga value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:Ne(t[0],t[1],t[2],t[3]),!r))return new De(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new Ge(r||`Could not parse color from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}if("padding"===this.type.kind){let t;for(const r of this.args){t=r.evaluate(e);const i=Be.parse(t);if(i)return i}throw new Ge(`Could not parse padding from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}if("number"===this.type.kind){let t=null;for(const r of this.args){if(t=r.evaluate(e),null===t)return 0;const i=Number(t);if(!isNaN(i))return i}throw new Ge(`Could not convert ${JSON.stringify(t)} to number.`)}return"formatted"===this.type.kind?Re.fromString(qe(this.args[0].evaluate(e))):"resolvedImage"===this.type.kind?Fe.fromString(qe(this.args[0].evaluate(e))):qe(this.args[0].evaluate(e))}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}const He=["Unknown","Point","LineString","Polygon"];class Je{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?He[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(e){let t=this._parseColorCache[e];return t||(t=this._parseColorCache[e]=De.parse(e)),t}}class Ye{constructor(e,t,r,i){this.name=e,this.type=t,this._evaluate=r,this.args=i}evaluate(e){return this._evaluate(e,this.args)}eachChild(e){this.args.forEach(e)}outputDefined(){return!1}static parse(e,t){const r=e[0],i=Ye.definitions[r];if(!i)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const n=Array.isArray(i)?i[0]:i.type,o=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,a=o.filter((([t])=>!Array.isArray(t)||t.length===e.length-1));let s=null;for(const[i,o]of a){s=new xt(t.registry,t.path,null,t.scope);const a=[];let l=!1;for(let t=1;t<e.length;t++){const r=e[t],n=Array.isArray(i)?i[t-1]:i.type,o=s.parse(r,1+a.length,n);if(!o){l=!0;break}a.push(o)}if(!l)if(Array.isArray(i)&&i.length!==a.length)s.error(`Expected ${i.length} arguments, but found ${a.length} instead.`);else{for(let e=0;e<a.length;e++){const t=Array.isArray(i)?i[e]:i.type,r=a[e];s.concat(e+1).checkSubtype(t,r.type)}if(0===s.errors.length)return new Ye(r,n,o,a)}}if(1===a.length)t.errors.push(...s.errors);else{const r=(a.length?a:o).map((([e])=>{return t=e,Array.isArray(t)?`(${t.map(Se).join(", ")})`:`(${Se(t.type)}...)`;var t})).join(" | "),i=[];for(let r=1;r<e.length;r++){const n=t.parse(e[r],1+i.length);if(!n)return null;i.push(Se(n.type))}t.error(`Expected arguments of type ${r}, but found (${i.join(", ")}) instead.`)}return null}static register(e,t){Ye.definitions=t;for(const r in t)e[r]=Ye}}class Qe{constructor(e,t,r){this.type=_e,this.locale=r,this.caseSensitive=e,this.diacriticSensitive=t}static parse(e,t){if(2!==e.length)return t.error("Expected one argument.");const r=e[1];if("object"!=typeof r||Array.isArray(r))return t.error("Collator options argument must be an object.");const i=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,fe);if(!i)return null;const n=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,fe);if(!n)return null;let o=null;return r.locale&&(o=t.parse(r.locale,1,de),!o)?null:new Qe(i,n,o)}evaluate(e){return new Le(this.caseSensitive.evaluate(e),this.diacriticSensitive.evaluate(e),this.locale?this.locale.evaluate(e):null)}eachChild(e){e(this.caseSensitive),e(this.diacriticSensitive),this.locale&&e(this.locale)}outputDefined(){return!1}}const et=8192;function tt(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.max(e[2],t[0]),e[3]=Math.max(e[3],t[1])}function rt(e,t){return!(e[0]<=t[0]||e[2]>=t[2]||e[1]<=t[1]||e[3]>=t[3])}function it(e,t){const r=(180+e[0])/360,i=(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e[1]*Math.PI/360)))/360,n=Math.pow(2,t.z);return[Math.round(r*n*et),Math.round(i*n*et)]}function nt(e,t,r){const i=e[0]-t[0],n=e[1]-t[1],o=e[0]-r[0],a=e[1]-r[1];return i*a-o*n==0&&i*o<=0&&n*a<=0}function ot(e,t){let r=!1;for(let a=0,s=t.length;a<s;a++){const s=t[a];for(let t=0,a=s.length;t<a-1;t++){if(nt(e,s[t],s[t+1]))return!1;(n=s[t])[1]>(i=e)[1]!=(o=s[t+1])[1]>i[1]&&i[0]<(o[0]-n[0])*(i[1]-n[1])/(o[1]-n[1])+n[0]&&(r=!r)}}var i,n,o;return r}function at(e,t){for(let r=0;r<t.length;r++)if(ot(e,t[r]))return!0;return!1}function st(e,t,r,i){const n=i[0]-r[0],o=i[1]-r[1],a=(e[0]-r[0])*o-n*(e[1]-r[1]),s=(t[0]-r[0])*o-n*(t[1]-r[1]);return a>0&&s<0||a<0&&s>0}function lt(e,t,r){for(const c of r)for(let r=0;r<c.length-1;++r)if(0!=(s=[(a=c[r+1])[0]-(o=c[r])[0],a[1]-o[1]])[0]*(l=[(n=t)[0]-(i=e)[0],n[1]-i[1]])[1]-s[1]*l[0]&&st(i,n,o,a)&&st(o,a,i,n))return!0;var i,n,o,a,s,l;return!1}function ct(e,t){for(let r=0;r<e.length;++r)if(!ot(e[r],t))return!1;for(let r=0;r<e.length-1;++r)if(lt(e[r],e[r+1],t))return!1;return!0}function ut(e,t){for(let r=0;r<t.length;r++)if(ct(e,t[r]))return!0;return!1}function ht(e,t,r){const i=[];for(let n=0;n<e.length;n++){const o=[];for(let i=0;i<e[n].length;i++){const a=it(e[n][i],r);tt(t,a),o.push(a)}i.push(o)}return i}function pt(e,t,r){const i=[];for(let n=0;n<e.length;n++){const o=ht(e[n],t,r);i.push(o)}return i}function dt(e,t,r,i){if(e[0]<r[0]||e[0]>r[2]){const t=.5*i;let n=e[0]-r[0]>t?-i:r[0]-e[0]>t?i:0;0===n&&(n=e[0]-r[2]>t?-i:r[2]-e[0]>t?i:0),e[0]+=n}tt(t,e)}function ft(e,t,r,i){const n=Math.pow(2,i.z)*et,o=[i.x*et,i.y*et],a=[];for(const i of e)for(const e of i){const i=[e.x+o[0],e.y+o[1]];dt(i,t,r,n),a.push(i)}return a}function mt(e,t,r,i){const n=Math.pow(2,i.z)*et,o=[i.x*et,i.y*et],a=[];for(const r of e){const e=[];for(const i of r){const r=[i.x+o[0],i.y+o[1]];tt(t,r),e.push(r)}a.push(e)}if(t[2]-t[0]<=n/2){(s=t)[0]=s[1]=1/0,s[2]=s[3]=-1/0;for(const e of a)for(const i of e)dt(i,t,r,n)}var s;return a}class yt{constructor(e,t){this.type=fe,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'within' expression requires exactly one argument, but found ${e.length-1} instead.`);if(Ue(e[1])){const t=e[1];if("FeatureCollection"===t.type)for(let e=0;e<t.features.length;++e){const r=t.features[e].geometry.type;if("Polygon"===r||"MultiPolygon"===r)return new yt(t,t.features[e].geometry)}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new yt(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new yt(t,t)}return t.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(e){if(null!=e.geometry()&&null!=e.canonicalID()){if("Point"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if("Polygon"===t.type){const o=ht(t.coordinates,i,n),a=ft(e.geometry(),r,i,n);if(!rt(r,i))return!1;for(const e of a)if(!ot(e,o))return!1}if("MultiPolygon"===t.type){const o=pt(t.coordinates,i,n),a=ft(e.geometry(),r,i,n);if(!rt(r,i))return!1;for(const e of a)if(!at(e,o))return!1}return!0}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],n=e.canonicalID();if("Polygon"===t.type){const o=ht(t.coordinates,i,n),a=mt(e.geometry(),r,i,n);if(!rt(r,i))return!1;for(const e of a)if(!ct(e,o))return!1}if("MultiPolygon"===t.type){const o=pt(t.coordinates,i,n),a=mt(e.geometry(),r,i,n);if(!rt(r,i))return!1;for(const e of a)if(!ut(e,o))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}function gt(e){if(e instanceof Ye){if("get"===e.name&&1===e.args.length)return!1;if("feature-state"===e.name)return!1;if("has"===e.name&&1===e.args.length)return!1;if("properties"===e.name||"geometry-type"===e.name||"id"===e.name)return!1;if(/^filter-/.test(e.name))return!1}if(e instanceof yt)return!1;let t=!0;return e.eachChild((e=>{t&&!gt(e)&&(t=!1)})),t}function _t(e){if(e instanceof Ye&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild((e=>{t&&!_t(e)&&(t=!1)})),t}function bt(e,t){if(e instanceof Ye&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild((e=>{r&&!bt(e,t)&&(r=!1)})),r}class vt{constructor(e,t){this.type=t.type,this.name=e,this.boundExpression=t}static parse(e,t){if(2!==e.length||"string"!=typeof e[1])return t.error("'var' expression requires exactly one string literal argument.");const r=e[1];return t.scope.has(r)?new vt(r,t.scope.get(r)):t.error(`Unknown variable "${r}". Make sure "${r}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(e){return this.boundExpression.evaluate(e)}eachChild(){}outputDefined(){return!1}}class xt{constructor(e,t=[],r,i=new ue,n=[]){this.registry=e,this.path=t,this.key=t.map((e=>`[${e}]`)).join(""),this.scope=i,this.errors=n,this.expectedType=r}parse(e,t,r,i,n={}){return t?this.concat(t,r,i)._parse(e,n):this._parse(e,n)}_parse(e,t){function r(e,t,r){return"assert"===r?new We(t,[e]):"coerce"===r?new Ke(t,[e]):e}if(null!==e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e||(e=["literal",e]),Array.isArray(e)){if(0===e.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const i=e[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;const n=this.registry[i];if(n){let i=n.parse(e,this);if(!i)return null;if(this.expectedType){const e=this.expectedType,n=i.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==n.kind)if("color"!==e.kind&&"formatted"!==e.kind&&"resolvedImage"!==e.kind||"value"!==n.kind&&"string"!==n.kind)if("padding"!==e.kind||"value"!==n.kind&&"number"!==n.kind&&"array"!==n.kind){if(this.checkSubtype(e,n))return null}else i=r(i,e,t.typeAnnotation||"coerce");else i=r(i,e,t.typeAnnotation||"coerce");else i=r(i,e,t.typeAnnotation||"assert")}if(!(i instanceof $e)&&"resolvedImage"!==i.type.kind&&wt(i)){const t=new Je;try{i=new $e(i.type,i.evaluate(t))}catch(e){return this.error(e.message),null}}return i}return this.error(`Unknown expression "${i}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===e?"'undefined' value invalid. Use null instead.":"object"==typeof e?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof e} instead.`)}concat(e,t,r){const i="number"==typeof e?this.path.concat(e):this.path,n=r?this.scope.concat(r):this.scope;return new xt(this.registry,i,t||null,n,this.errors)}error(e,...t){const r=`${this.key}${t.map((e=>`[${e}]`)).join("")}`;this.errors.push(new ce(r,e))}checkSubtype(e,t){const r=Te(e,t);return r&&this.error(r),r}}function wt(e){if(e instanceof vt)return wt(e.boundExpression);if(e instanceof Ye&&"error"===e.name)return!1;if(e instanceof Qe)return!1;if(e instanceof yt)return!1;const t=e instanceof Ke||e instanceof We;let r=!0;return e.eachChild((e=>{r=t?r&&wt(e):r&&e instanceof $e})),!!r&&gt(e)&&bt(e,["zoom","heatmap-density","line-progress","accumulated","is-supported-script"])}function St(e,t){const r=e.length-1;let i,n,o=0,a=r,s=0;for(;o<=a;)if(s=Math.floor((o+a)/2),i=e[s],n=e[s+1],i<=t){if(s===r||t<n)return s;o=s+1}else{if(!(i>t))throw new Ge("Input is not a number.");a=s-1}return 0}class Et{constructor(e,t,r){this.type=e,this.input=t,this.labels=[],this.outputs=[];for(const[e,t]of r)this.labels.push(e),this.outputs.push(t)}static parse(e,t){if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");const r=t.parse(e[1],1,pe);if(!r)return null;const i=[];let n=null;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);for(let r=1;r<e.length;r+=2){const o=1===r?-1/0:e[r],a=e[r+1],s=r,l=r+1;if("number"!=typeof o)return t.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',s);if(i.length&&i[i.length-1][0]>=o)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const c=t.parse(a,l,n);if(!c)return null;n=n||c.type,i.push([o,c])}return new Et(n,r,i)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const i=this.input.evaluate(e);if(i<=t[0])return r[0].evaluate(e);const n=t.length;return i>=t[n-1]?r[n-1].evaluate(e):r[St(t,i)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function Tt(e,t,r){return e*(1-r)+t*r}var kt=Object.freeze({__proto__:null,number:Tt,color:function(e,t,r){return new De(Tt(e.r,t.r,r),Tt(e.g,t.g,r),Tt(e.b,t.b,r),Tt(e.a,t.a,r))},array:function(e,t,r){return e.map(((e,i)=>Tt(e,t[i],r)))},padding:function(e,t,r){const i=e.values,n=t.values;return new Be([Tt(i[0],n[0],r),Tt(i[1],n[1],r),Tt(i[2],n[2],r),Tt(i[3],n[3],r)])}});const At=.95047,It=1.08883,Pt=4/29,Ct=6/29,zt=3*Ct*Ct,Mt=Math.PI/180,Ot=180/Math.PI;function Dt(e){return e>.008856451679035631?Math.pow(e,1/3):e/zt+Pt}function Lt(e){return e>Ct?e*e*e:zt*(e-Pt)}function jt(e){return 255*(e<=.0031308?12.92*e:1.055*Math.pow(e,1/2.4)-.055)}function Rt(e){return(e/=255)<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function Bt(e){const t=Rt(e.r),r=Rt(e.g),i=Rt(e.b),n=Dt((.4124564*t+.3575761*r+.1804375*i)/At),o=Dt((.2126729*t+.7151522*r+.072175*i)/1);return{l:116*o-16,a:500*(n-o),b:200*(o-Dt((.0193339*t+.119192*r+.9503041*i)/It)),alpha:e.a}}function Ft(e){let t=(e.l+16)/116,r=isNaN(e.a)?t:t+e.a/500,i=isNaN(e.b)?t:t-e.b/200;return t=1*Lt(t),r=At*Lt(r),i=It*Lt(i),new De(jt(3.2404542*r-1.5371385*t-.4985314*i),jt(-.969266*r+1.8760108*t+.041556*i),jt(.0556434*r-.2040259*t+1.0572252*i),e.alpha)}function Nt(e,t,r){const i=t-e;return e+r*(i>180||i<-180?i-360*Math.round(i/360):i)}const Ut={forward:Bt,reverse:Ft,interpolate:function(e,t,r){return{l:Tt(e.l,t.l,r),a:Tt(e.a,t.a,r),b:Tt(e.b,t.b,r),alpha:Tt(e.alpha,t.alpha,r)}}},Vt={forward:function(e){const{l:t,a:r,b:i}=Bt(e),n=Math.atan2(i,r)*Ot;return{h:n<0?n+360:n,c:Math.sqrt(r*r+i*i),l:t,alpha:e.a}},reverse:function(e){const t=e.h*Mt,r=e.c;return Ft({l:e.l,a:Math.cos(t)*r,b:Math.sin(t)*r,alpha:e.alpha})},interpolate:function(e,t,r){return{h:Nt(e.h,t.h,r),c:Tt(e.c,t.c,r),l:Tt(e.l,t.l,r),alpha:Tt(e.alpha,t.alpha,r)}}};var qt=Object.freeze({__proto__:null,lab:Ut,hcl:Vt});class $t{constructor(e,t,r,i,n){this.type=e,this.operator=t,this.interpolation=r,this.input=i,this.labels=[],this.outputs=[];for(const[e,t]of n)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,r,i,n){let o=0;if("exponential"===e.name)o=Gt(r,e.base,i,n);else if("linear"===e.name)o=Gt(r,1,i,n);else if("cubic-bezier"===e.name){const a=e.controlPoints;o=new t(a[0],a[1],a[2],a[3]).solve(Gt(r,1,i,n))}return o}static parse(e,t){let[r,i,n,...o]=e;if(!Array.isArray(i)||0===i.length)return t.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){const e=i[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:e}}else{if("cubic-bezier"!==i[0])return t.error(`Unknown interpolation type ${String(i[0])}`,1,0);{const e=i.slice(1);if(4!==e.length||e.some((e=>"number"!=typeof e||e<0||e>1)))return t.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:e}}}if(e.length-1<4)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if((e.length-1)%2!=0)return t.error("Expected an even number of arguments.");if(n=t.parse(n,2,pe),!n)return null;const a=[];let s=null;"interpolate-hcl"===r||"interpolate-lab"===r?s=me:t.expectedType&&"value"!==t.expectedType.kind&&(s=t.expectedType);for(let e=0;e<o.length;e+=2){const r=o[e],i=o[e+1],n=e+3,l=e+4;if("number"!=typeof r)return t.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',n);if(a.length&&a[a.length-1][0]>=r)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',n);const c=t.parse(i,l,s);if(!c)return null;s=s||c.type,a.push([r,c])}return"number"===s.kind||"color"===s.kind||"padding"===s.kind||"array"===s.kind&&"number"===s.itemType.kind&&"number"==typeof s.N?new $t(s,r,i,n,a):t.error(`Type ${Se(s)} is not interpolatable.`)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const i=this.input.evaluate(e);if(i<=t[0])return r[0].evaluate(e);const n=t.length;if(i>=t[n-1])return r[n-1].evaluate(e);const o=St(t,i),a=$t.interpolationFactor(this.interpolation,i,t[o],t[o+1]),s=r[o].evaluate(e),l=r[o+1].evaluate(e);return"interpolate"===this.operator?kt[this.type.kind.toLowerCase()](s,l,a):"interpolate-hcl"===this.operator?Vt.reverse(Vt.interpolate(Vt.forward(s),Vt.forward(l),a)):Ut.reverse(Ut.interpolate(Ut.forward(s),Ut.forward(l),a))}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))}}function Gt(e,t,r,i){const n=i-r,o=e-r;return 0===n?0:1===t?o/n:(Math.pow(t,o)-1)/(Math.pow(t,n)-1)}class Zt{constructor(e,t){this.type=e,this.args=t}static parse(e,t){if(e.length<2)return t.error("Expectected at least one argument.");let r=null;const i=t.expectedType;i&&"value"!==i.kind&&(r=i);const n=[];for(const i of e.slice(1)){const e=t.parse(i,1+n.length,r,void 0,{typeAnnotation:"omit"});if(!e)return null;r=r||e.type,n.push(e)}if(!r)throw new Error("No output type");const o=i&&n.some((e=>Te(i,e.type)));return new Zt(o?ge:r,n)}evaluate(e){let t,r=null,i=0;for(const n of this.args)if(i++,r=n.evaluate(e),r&&r instanceof Fe&&!r.available&&(t||(t=r.name),r=null,i===this.args.length&&(r=t)),null!==r)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every((e=>e.outputDefined()))}}class Wt{constructor(e,t){this.type=t.type,this.bindings=[].concat(e),this.result=t}evaluate(e){return this.result.evaluate(e)}eachChild(e){for(const t of this.bindings)e(t[1]);e(this.result)}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found ${e.length-1} instead.`);const r=[];for(let i=1;i<e.length-1;i+=2){const n=e[i];if("string"!=typeof n)return t.error(`Expected string, but found ${typeof n} instead.`,i);if(/[^a-zA-Z0-9_]/.test(n))return t.error("Variable names must contain only alphanumeric characters or '_'.",i);const o=t.parse(e[i+1],i+1);if(!o)return null;r.push([n,o])}const i=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return i?new Wt(r,i):null}outputDefined(){return this.result.outputDefined()}}class Xt{constructor(e,t,r){this.type=e,this.index=t,this.input=r}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,pe),i=t.parse(e[2],2,we(t.expectedType||ge));return r&&i?new Xt(i.type.itemType,r,i):null}evaluate(e){const t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new Ge(`Array index out of bounds: ${t} < 0.`);if(t>=r.length)throw new Ge(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new Ge(`Array index must be an integer, but found ${t} instead.`);return r[t]}eachChild(e){e(this.index),e(this.input)}outputDefined(){return!1}}class Kt{constructor(e,t){this.type=fe,this.needle=e,this.haystack=t}static parse(e,t){if(3!==e.length)return t.error(`Expected 2 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ge),i=t.parse(e[2],2,ge);return r&&i?ke(r.type,[fe,de,pe,he,ge])?new Kt(r,i):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Se(r.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!Ae(t,["boolean","string","number","null"]))throw new Ge(`Expected first argument to be of type boolean, string, number or null, but found ${Se(Ve(t))} instead.`);if(!Ae(r,["string","array"]))throw new Ge(`Expected second argument to be of type array or string, but found ${Se(Ve(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class Ht{constructor(e,t,r){this.type=pe,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ge),i=t.parse(e[2],2,ge);if(!r||!i)return null;if(!ke(r.type,[fe,de,pe,he,ge]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${Se(r.type)} instead`);if(4===e.length){const n=t.parse(e[3],3,pe);return n?new Ht(r,i,n):null}return new Ht(r,i)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Ae(t,["boolean","string","number","null"]))throw new Ge(`Expected first argument to be of type boolean, string, number or null, but found ${Se(Ve(t))} instead.`);if(!Ae(r,["string","array"]))throw new Ge(`Expected second argument to be of type array or string, but found ${Se(Ve(r))} instead.`);if(this.fromIndex){const i=this.fromIndex.evaluate(e);return r.indexOf(t,i)}return r.indexOf(t)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class Jt{constructor(e,t,r,i,n,o){this.inputType=e,this.type=t,this.input=r,this.cases=i,this.outputs=n,this.otherwise=o}static parse(e,t){if(e.length<5)return t.error(`Expected at least 4 arguments, but found only ${e.length-1}.`);if(e.length%2!=1)return t.error("Expected an even number of arguments.");let r,i;t.expectedType&&"value"!==t.expectedType.kind&&(i=t.expectedType);const n={},o=[];for(let a=2;a<e.length-1;a+=2){let s=e[a];const l=e[a+1];Array.isArray(s)||(s=[s]);const c=t.concat(a);if(0===s.length)return c.error("Expected at least one branch label.");for(const e of s){if("number"!=typeof e&&"string"!=typeof e)return c.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return c.error("Numeric branch labels must be integer values.");if(r){if(c.checkSubtype(r,Ve(e)))return null}else r=Ve(e);if(void 0!==n[String(e)])return c.error("Branch labels must be unique.");n[String(e)]=o.length}const u=t.parse(l,a,i);if(!u)return null;i=i||u.type,o.push(u)}const a=t.parse(e[1],1,ge);if(!a)return null;const s=t.parse(e[e.length-1],e.length-1,i);return s?"value"!==a.type.kind&&t.concat(1).checkSubtype(r,a.type)?null:new Jt(r,i,a,n,o,s):null}evaluate(e){const t=this.input.evaluate(e);return(Ve(t)===this.inputType&&this.outputs[this.cases[t]]||this.otherwise).evaluate(e)}eachChild(e){e(this.input),this.outputs.forEach(e),e(this.otherwise)}outputDefined(){return this.outputs.every((e=>e.outputDefined()))&&this.otherwise.outputDefined()}}class Yt{constructor(e,t,r){this.type=e,this.branches=t,this.otherwise=r}static parse(e,t){if(e.length<4)return t.error(`Expected at least 3 arguments, but found only ${e.length-1}.`);if(e.length%2!=0)return t.error("Expected an odd number of arguments.");let r;t.expectedType&&"value"!==t.expectedType.kind&&(r=t.expectedType);const i=[];for(let n=1;n<e.length-1;n+=2){const o=t.parse(e[n],n,fe);if(!o)return null;const a=t.parse(e[n+1],n+1,r);if(!a)return null;i.push([o,a]),r=r||a.type}const n=t.parse(e[e.length-1],e.length-1,r);if(!n)return null;if(!r)throw new Error("Can't infer output type");return new Yt(r,i,n)}evaluate(e){for(const[t,r]of this.branches)if(t.evaluate(e))return r.evaluate(e);return this.otherwise.evaluate(e)}eachChild(e){for(const[t,r]of this.branches)e(t),e(r);e(this.otherwise)}outputDefined(){return this.branches.every((([e,t])=>t.outputDefined()))&&this.otherwise.outputDefined()}}class Qt{constructor(e,t,r,i){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=i}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 3 or 4 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ge),i=t.parse(e[2],2,pe);if(!r||!i)return null;if(!ke(r.type,[we(ge),de,ge]))return t.error(`Expected first argument to be of type array or string, but found ${Se(r.type)} instead`);if(4===e.length){const n=t.parse(e[3],3,pe);return n?new Qt(r.type,r,i,n):null}return new Qt(r.type,r,i)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);if(!Ae(t,["string","array"]))throw new Ge(`Expected first argument to be of type array or string, but found ${Se(Ve(t))} instead.`);if(this.endIndex){const i=this.endIndex.evaluate(e);return t.slice(r,i)}return t.slice(r)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function er(e,t){return"=="===e||"!="===e?"boolean"===t.kind||"string"===t.kind||"number"===t.kind||"null"===t.kind||"value"===t.kind:"string"===t.kind||"number"===t.kind||"value"===t.kind}function tr(e,t,r,i){return 0===i.compare(t,r)}function rr(e,t,r){const i="=="!==e&&"!="!==e;return class n{constructor(e,t,r){this.type=fe,this.lhs=e,this.rhs=t,this.collator=r,this.hasUntypedArgument="value"===e.type.kind||"value"===t.type.kind}static parse(e,t){if(3!==e.length&&4!==e.length)return t.error("Expected two or three arguments.");const r=e[0];let o=t.parse(e[1],1,ge);if(!o)return null;if(!er(r,o.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${Se(o.type)}'.`);let a=t.parse(e[2],2,ge);if(!a)return null;if(!er(r,a.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${Se(a.type)}'.`);if(o.type.kind!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return t.error(`Cannot compare types '${Se(o.type)}' and '${Se(a.type)}'.`);i&&("value"===o.type.kind&&"value"!==a.type.kind?o=new We(a.type,[o]):"value"!==o.type.kind&&"value"===a.type.kind&&(a=new We(o.type,[a])));let s=null;if(4===e.length){if("string"!==o.type.kind&&"string"!==a.type.kind&&"value"!==o.type.kind&&"value"!==a.type.kind)return t.error("Cannot use collator to compare non-string types.");if(s=t.parse(e[3],3,_e),!s)return null}return new n(o,a,s)}evaluate(n){const o=this.lhs.evaluate(n),a=this.rhs.evaluate(n);if(i&&this.hasUntypedArgument){const t=Ve(o),r=Ve(a);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new Ge(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!i&&this.hasUntypedArgument){const e=Ve(o),r=Ve(a);if("string"!==e.kind||"string"!==r.kind)return t(n,o,a)}return this.collator?r(n,o,a,this.collator.evaluate(n)):t(n,o,a)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}const ir=rr("==",(function(e,t,r){return t===r}),tr),nr=rr("!=",(function(e,t,r){return t!==r}),(function(e,t,r,i){return!tr(0,t,r,i)})),or=rr("<",(function(e,t,r){return t<r}),(function(e,t,r,i){return i.compare(t,r)<0})),ar=rr(">",(function(e,t,r){return t>r}),(function(e,t,r,i){return i.compare(t,r)>0})),sr=rr("<=",(function(e,t,r){return t<=r}),(function(e,t,r,i){return i.compare(t,r)<=0})),lr=rr(">=",(function(e,t,r){return t>=r}),(function(e,t,r,i){return i.compare(t,r)>=0}));class cr{constructor(e,t,r,i,n){this.type=de,this.number=e,this.locale=t,this.currency=r,this.minFractionDigits=i,this.maxFractionDigits=n}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,pe);if(!r)return null;const i=e[2];if("object"!=typeof i||Array.isArray(i))return t.error("NumberFormat options argument must be an object.");let n=null;if(i.locale&&(n=t.parse(i.locale,1,de),!n))return null;let o=null;if(i.currency&&(o=t.parse(i.currency,1,de),!o))return null;let a=null;if(i["min-fraction-digits"]&&(a=t.parse(i["min-fraction-digits"],1,pe),!a))return null;let s=null;return i["max-fraction-digits"]&&(s=t.parse(i["max-fraction-digits"],1,pe),!s)?null:new cr(r,n,o,a,s)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(e):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(e):void 0}).format(this.number.evaluate(e))}eachChild(e){e(this.number),this.locale&&e(this.locale),this.currency&&e(this.currency),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class ur{constructor(e){this.type=be,this.sections=e}static parse(e,t){if(e.length<2)return t.error("Expected at least one argument.");const r=e[1];if(!Array.isArray(r)&&"object"==typeof r)return t.error("First argument must be an image or text section.");const i=[];let n=!1;for(let r=1;r<=e.length-1;++r){const o=e[r];if(n&&"object"==typeof o&&!Array.isArray(o)){n=!1;let e=null;if(o["font-scale"]&&(e=t.parse(o["font-scale"],1,pe),!e))return null;let r=null;if(o["text-font"]&&(r=t.parse(o["text-font"],1,we(de)),!r))return null;let a=null;if(o["text-color"]&&(a=t.parse(o["text-color"],1,me),!a))return null;const s=i[i.length-1];s.scale=e,s.font=r,s.textColor=a}else{const o=t.parse(e[r],1,ge);if(!o)return null;const a=o.type.kind;if("string"!==a&&"value"!==a&&"null"!==a&&"resolvedImage"!==a)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");n=!0,i.push({content:o,scale:null,font:null,textColor:null})}}return new ur(i)}evaluate(e){return new Re(this.sections.map((t=>{const r=t.content.evaluate(e);return Ve(r)===xe?new je("",r,null,null,null):new je(qe(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null)})))}eachChild(e){for(const t of this.sections)e(t.content),t.scale&&e(t.scale),t.font&&e(t.font),t.textColor&&e(t.textColor)}outputDefined(){return!1}}class hr{constructor(e){this.type=xe,this.input=e}static parse(e,t){if(2!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,de);return r?new hr(r):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),r=Fe.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}}class pr{constructor(e){this.type=pe,this.input=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=t.parse(e[1],1);return r?"array"!==r.type.kind&&"string"!==r.type.kind&&"value"!==r.type.kind?t.error(`Expected argument of type string or array, but found ${Se(r.type)} instead.`):new pr(r):null}evaluate(e){const t=this.input.evaluate(e);if("string"==typeof t)return t.length;if(Array.isArray(t))return t.length;throw new Ge(`Expected value to be of type string or array, but found ${Se(Ve(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const dr={"==":ir,"!=":nr,">":ar,"<":or,">=":lr,"<=":sr,array:We,at:Xt,boolean:We,case:Yt,coalesce:Zt,collator:Qe,format:ur,image:hr,in:Kt,"index-of":Ht,interpolate:$t,"interpolate-hcl":$t,"interpolate-lab":$t,length:pr,let:Wt,literal:$e,match:Jt,number:We,"number-format":cr,object:We,slice:Qt,step:Et,string:We,"to-boolean":Ke,"to-color":Ke,"to-number":Ke,"to-string":Ke,var:vt,within:yt};function fr(e,[t,r,i,n]){t=t.evaluate(e),r=r.evaluate(e),i=i.evaluate(e);const o=n?n.evaluate(e):1,a=Ne(t,r,i,o);if(a)throw new Ge(a);return new De(t/255*o,r/255*o,i/255*o,o)}function mr(e,t){return e in t}function yr(e,t){const r=t[e];return void 0===r?null:r}function gr(e){return{type:e}}function _r(e){return{result:"success",value:e}}function br(e){return{result:"error",value:e}}function vr(e){return"data-driven"===e["property-type"]||"cross-faded-data-driven"===e["property-type"]}function xr(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}function wr(e){return!!e.expression&&e.expression.interpolated}function Sr(e){return e instanceof Number?"number":e instanceof String?"string":e instanceof Boolean?"boolean":Array.isArray(e)?"array":null===e?"null":typeof e}function Er(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function Tr(e){return e}function kr(e,t){const r="color"===t.type,i=e.stops&&"object"==typeof e.stops[0][0],n=i||!(i||void 0!==e.property),o=e.type||(wr(t)?"exponential":"interval");if(r||"padding"===t.type){const i=r?De.parse:Be.parse;(e=ae({},e)).stops&&(e.stops=e.stops.map((e=>[e[0],i(e[1])]))),e.default=i(e.default?e.default:t.default)}if(e.colorSpace&&"rgb"!==e.colorSpace&&!qt[e.colorSpace])throw new Error(`Unknown color space: ${e.colorSpace}`);let a,s,l;if("exponential"===o)a=Cr;else if("interval"===o)a=Pr;else if("categorical"===o){a=Ir,s=Object.create(null);for(const t of e.stops)s[t[0]]=t[1];l=typeof e.stops[0][0]}else{if("identity"!==o)throw new Error(`Unknown function type "${o}"`);a=zr}if(i){const r={},i=[];for(let t=0;t<e.stops.length;t++){const n=e.stops[t],o=n[0].zoom;void 0===r[o]&&(r[o]={zoom:o,type:e.type,property:e.property,default:e.default,stops:[]},i.push(o)),r[o].stops.push([n[0].value,n[1]])}const n=[];for(const e of i)n.push([r[e].zoom,kr(r[e],t)]);const o={name:"linear"};return{kind:"composite",interpolationType:o,interpolationFactor:$t.interpolationFactor.bind(void 0,o),zoomStops:n.map((e=>e[0])),evaluate:({zoom:r},i)=>Cr({stops:n,base:e.base},t,r).evaluate(r,i)}}if(n){const r="exponential"===o?{name:"exponential",base:void 0!==e.base?e.base:1}:null;return{kind:"camera",interpolationType:r,interpolationFactor:$t.interpolationFactor.bind(void 0,r),zoomStops:e.stops.map((e=>e[0])),evaluate:({zoom:r})=>a(e,t,r,s,l)}}return{kind:"source",evaluate(r,i){const n=i&&i.properties?i.properties[e.property]:void 0;return void 0===n?Ar(e.default,t.default):a(e,t,n,s,l)}}}function Ar(e,t,r){return void 0!==e?e:void 0!==t?t:void 0!==r?r:void 0}function Ir(e,t,r,i,n){return Ar(typeof r===n?i[r]:void 0,e.default,t.default)}function Pr(e,t,r){if("number"!==Sr(r))return Ar(e.default,t.default);const i=e.stops.length;if(1===i)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[i-1][0])return e.stops[i-1][1];const n=St(e.stops.map((e=>e[0])),r);return e.stops[n][1]}function Cr(e,t,r){const i=void 0!==e.base?e.base:1;if("number"!==Sr(r))return Ar(e.default,t.default);const n=e.stops.length;if(1===n)return e.stops[0][1];if(r<=e.stops[0][0])return e.stops[0][1];if(r>=e.stops[n-1][0])return e.stops[n-1][1];const o=St(e.stops.map((e=>e[0])),r),a=function(e,t,r,i){const n=i-r,o=e-r;return 0===n?0:1===t?o/n:(Math.pow(t,o)-1)/(Math.pow(t,n)-1)}(r,i,e.stops[o][0],e.stops[o+1][0]),s=e.stops[o][1],l=e.stops[o+1][1];let c=kt[t.type]||Tr;if(e.colorSpace&&"rgb"!==e.colorSpace){const t=qt[e.colorSpace];c=(e,r)=>t.reverse(t.interpolate(t.forward(e),t.forward(r),a))}return"function"==typeof s.evaluate?{evaluate(...e){const t=s.evaluate.apply(void 0,e),r=l.evaluate.apply(void 0,e);if(void 0!==t&&void 0!==r)return c(t,r,a)}}:c(s,l,a)}function zr(e,t,r){switch(t.type){case"color":r=De.parse(r);break;case"formatted":r=Re.fromString(r.toString());break;case"resolvedImage":r=Fe.fromString(r.toString());break;case"padding":r=Be.parse(r);break;default:Sr(r)===t.type||"enum"===t.type&&t.values[r]||(r=void 0)}return Ar(r,e.default,t.default)}Ye.register(dr,{error:[{kind:"error"},[de],(e,[t])=>{throw new Ge(t.evaluate(e))}],typeof:[de,[ge],(e,[t])=>Se(Ve(t.evaluate(e)))],"to-rgba":[we(pe,4),[me],(e,[t])=>t.evaluate(e).toArray()],rgb:[me,[pe,pe,pe],fr],rgba:[me,[pe,pe,pe,pe],fr],has:{type:fe,overloads:[[[de],(e,[t])=>mr(t.evaluate(e),e.properties())],[[de,ye],(e,[t,r])=>mr(t.evaluate(e),r.evaluate(e))]]},get:{type:ge,overloads:[[[de],(e,[t])=>yr(t.evaluate(e),e.properties())],[[de,ye],(e,[t,r])=>yr(t.evaluate(e),r.evaluate(e))]]},"feature-state":[ge,[de],(e,[t])=>yr(t.evaluate(e),e.featureState||{})],properties:[ye,[],e=>e.properties()],"geometry-type":[de,[],e=>e.geometryType()],id:[ge,[],e=>e.id()],zoom:[pe,[],e=>e.globals.zoom],"heatmap-density":[pe,[],e=>e.globals.heatmapDensity||0],"line-progress":[pe,[],e=>e.globals.lineProgress||0],accumulated:[ge,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[pe,gr(pe),(e,t)=>{let r=0;for(const i of t)r+=i.evaluate(e);return r}],"*":[pe,gr(pe),(e,t)=>{let r=1;for(const i of t)r*=i.evaluate(e);return r}],"-":{type:pe,overloads:[[[pe,pe],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[pe],(e,[t])=>-t.evaluate(e)]]},"/":[pe,[pe,pe],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[pe,[pe,pe],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[pe,[],()=>Math.LN2],pi:[pe,[],()=>Math.PI],e:[pe,[],()=>Math.E],"^":[pe,[pe,pe],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[pe,[pe],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[pe,[pe],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[pe,[pe],(e,[t])=>Math.log(t.evaluate(e))],log2:[pe,[pe],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[pe,[pe],(e,[t])=>Math.sin(t.evaluate(e))],cos:[pe,[pe],(e,[t])=>Math.cos(t.evaluate(e))],tan:[pe,[pe],(e,[t])=>Math.tan(t.evaluate(e))],asin:[pe,[pe],(e,[t])=>Math.asin(t.evaluate(e))],acos:[pe,[pe],(e,[t])=>Math.acos(t.evaluate(e))],atan:[pe,[pe],(e,[t])=>Math.atan(t.evaluate(e))],min:[pe,gr(pe),(e,t)=>Math.min(...t.map((t=>t.evaluate(e))))],max:[pe,gr(pe),(e,t)=>Math.max(...t.map((t=>t.evaluate(e))))],abs:[pe,[pe],(e,[t])=>Math.abs(t.evaluate(e))],round:[pe,[pe],(e,[t])=>{const r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[pe,[pe],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[pe,[pe],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[fe,[de,ge],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[fe,[ge],(e,[t])=>e.id()===t.value],"filter-type-==":[fe,[de],(e,[t])=>e.geometryType()===t.value],"filter-<":[fe,[de,ge],(e,[t,r])=>{const i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i<n}],"filter-id-<":[fe,[ge],(e,[t])=>{const r=e.id(),i=t.value;return typeof r==typeof i&&r<i}],"filter->":[fe,[de,ge],(e,[t,r])=>{const i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>n}],"filter-id->":[fe,[ge],(e,[t])=>{const r=e.id(),i=t.value;return typeof r==typeof i&&r>i}],"filter-<=":[fe,[de,ge],(e,[t,r])=>{const i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i<=n}],"filter-id-<=":[fe,[ge],(e,[t])=>{const r=e.id(),i=t.value;return typeof r==typeof i&&r<=i}],"filter->=":[fe,[de,ge],(e,[t,r])=>{const i=e.properties()[t.value],n=r.value;return typeof i==typeof n&&i>=n}],"filter-id->=":[fe,[ge],(e,[t])=>{const r=e.id(),i=t.value;return typeof r==typeof i&&r>=i}],"filter-has":[fe,[ge],(e,[t])=>t.value in e.properties()],"filter-has-id":[fe,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[fe,[we(de)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[fe,[we(ge)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[fe,[de,we(ge)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[fe,[de,we(ge)],(e,[t,r])=>function(e,t,r,i){for(;r<=i;){const n=r+i>>1;if(t[n]===e)return!0;t[n]>e?i=n-1:r=n+1}return!1}(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:fe,overloads:[[[fe,fe],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[gr(fe),(e,t)=>{for(const r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:fe,overloads:[[[fe,fe],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[gr(fe),(e,t)=>{for(const r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[fe,[fe],(e,[t])=>!t.evaluate(e)],"is-supported-script":[fe,[de],(e,[t])=>{const r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[de,[de],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[de,[de],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[de,gr(ge),(e,t)=>t.map((t=>qe(t.evaluate(e)))).join("")],"resolved-locale":[de,[_e],(e,[t])=>t.evaluate(e).resolvedLocale()]});class Mr{constructor(e,t){this.expression=e,this._warningHistory={},this._evaluator=new Je,this._defaultValue=t?function(e){return"color"===e.type&&Er(e.default)?new De(0,0,0,0):"color"===e.type?De.parse(e.default)||null:"padding"===e.type?Be.parse(e.default)||null:void 0===e.default?null:e.default}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null}evaluateWithoutErrorHandling(e,t,r,i,n,o){return this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,i,n,o){this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=i,this._evaluator.availableImages=n||null,this._evaluator.formattedSection=o||null;try{const e=this.expression.evaluate(this._evaluator);if(null==e||"number"==typeof e&&e!=e)return this._defaultValue;if(this._enumValues&&!(e in this._enumValues))throw new Ge(`Expected value to be one of ${Object.keys(this._enumValues).map((e=>JSON.stringify(e))).join(", ")}, but found ${JSON.stringify(e)} instead.`);return e}catch(e){return this._warningHistory[e.message]||(this._warningHistory[e.message]=!0,"undefined"!=typeof console&&console.warn(e.message)),this._defaultValue}}}function Or(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in dr}function Dr(e,t){const r=new xt(dr,[],t?function(e){const t={color:me,string:de,number:pe,enum:de,boolean:fe,formatted:be,padding:ve,resolvedImage:xe};return"array"===e.type?we(t[e.value]||ge,e.length):t[e.type]}(t):void 0),i=r.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return i?_r(new Mr(i,t)):br(r.errors)}class Lr{constructor(e,t){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!_t(t.expression)}evaluateWithoutErrorHandling(e,t,r,i,n,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,o)}evaluate(e,t,r,i,n,o){return this._styleExpression.evaluate(e,t,r,i,n,o)}}class jr{constructor(e,t,r,i){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!_t(t.expression),this.interpolationType=i}evaluateWithoutErrorHandling(e,t,r,i,n,o){return this._styleExpression.evaluateWithoutErrorHandling(e,t,r,i,n,o)}evaluate(e,t,r,i,n,o){return this._styleExpression.evaluate(e,t,r,i,n,o)}interpolationFactor(e,t,r){return this.interpolationType?$t.interpolationFactor(this.interpolationType,e,t,r):0}}function Rr(e,t){const r=Dr(e,t);if("error"===r.result)return r;const i=r.value.expression,n=gt(i);if(!n&&!vr(t))return br([new ce("","data expressions not supported")]);const o=bt(i,["zoom"]);if(!o&&!xr(t))return br([new ce("","zoom expressions not supported")]);const a=Fr(i);return a||o?a instanceof ce?br([a]):a instanceof $t&&!wr(t)?br([new ce("",'"interpolate" expressions cannot be used with this property')]):_r(a?new jr(n?"camera":"composite",r.value,a.labels,a instanceof $t?a.interpolation:void 0):new Lr(n?"constant":"source",r.value)):br([new ce("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class Br{constructor(e,t){this._parameters=e,this._specification=t,ae(this,kr(this._parameters,this._specification))}static deserialize(e){return new Br(e._parameters,e._specification)}static serialize(e){return{_parameters:e._parameters,_specification:e._specification}}}function Fr(e){let t=null;if(e instanceof Wt)t=Fr(e.result);else if(e instanceof Zt){for(const r of e.args)if(t=Fr(r),t)break}else(e instanceof Et||e instanceof $t)&&e.input instanceof Ye&&"zoom"===e.input.name&&(t=e);return t instanceof ce||e.eachChild((e=>{const r=Fr(e);r instanceof ce?t=r:!t&&r?t=new ce("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new ce("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))})),t}function Nr(e){const t=e.key,r=e.value,i=e.valueSpec||{},n=e.objectElementValidators||{},o=e.style,a=e.styleSpec;let s=[];const l=Sr(r);if("object"!==l)return[new ne(t,r,`object expected, ${l} found`)];for(const e in r){const l=e.split(".")[0],c=i[l]||i["*"];let u;if(n[l])u=n[l];else if(i[l])u=fi;else if(n["*"])u=n["*"];else{if(!i["*"]){s.push(new ne(t,r[e],`unknown property "${e}"`));continue}u=fi}s=s.concat(u({key:(t?`${t}.`:t)+e,value:r[e],valueSpec:c,style:o,styleSpec:a,object:r,objectKey:e},r))}for(const e in i)n[e]||i[e].required&&void 0===i[e].default&&void 0===r[e]&&s.push(new ne(t,r,`missing required property "${e}"`));return s}function Ur(e){const t=e.value,r=e.valueSpec,i=e.style,n=e.styleSpec,o=e.key,a=e.arrayElementValidator||fi;if("array"!==Sr(t))return[new ne(o,t,`array expected, ${Sr(t)} found`)];if(r.length&&t.length!==r.length)return[new ne(o,t,`array length ${r.length} expected, length ${t.length} found`)];if(r["min-length"]&&t.length<r["min-length"])return[new ne(o,t,`array length at least ${r["min-length"]} expected, length ${t.length} found`)];let s={type:r.value,values:r.values};n.$version<7&&(s.function=r.function),"object"===Sr(r.value)&&(s=r.value);let l=[];for(let e=0;e<t.length;e++)l=l.concat(a({array:t,arrayIndex:e,value:t[e],valueSpec:s,style:i,styleSpec:n,key:`${o}[${e}]`}));return l}function Vr(e){const t=e.key,r=e.value,i=e.valueSpec;let n=Sr(r);return"number"===n&&r!=r&&(n="NaN"),"number"!==n?[new ne(t,r,`number expected, ${n} found`)]:"minimum"in i&&r<i.minimum?[new ne(t,r,`${r} is less than the minimum value ${i.minimum}`)]:"maximum"in i&&r>i.maximum?[new ne(t,r,`${r} is greater than the maximum value ${i.maximum}`)]:[]}function qr(e){const t=e.valueSpec,r=se(e.value.type);let i,n,o,a={};const s="categorical"!==r&&void 0===e.value.property,l=!s,c="array"===Sr(e.value.stops)&&"array"===Sr(e.value.stops[0])&&"object"===Sr(e.value.stops[0][0]),u=Nr({key:e.key,value:e.value,valueSpec:e.styleSpec.function,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{stops:function(e){if("identity"===r)return[new ne(e.key,e.value,'identity function may not have a "stops" property')];let t=[];const i=e.value;return t=t.concat(Ur({key:e.key,value:i,valueSpec:e.valueSpec,style:e.style,styleSpec:e.styleSpec,arrayElementValidator:h})),"array"===Sr(i)&&0===i.length&&t.push(new ne(e.key,i,"array must have at least one stop")),t},default:function(e){return fi({key:e.key,value:e.value,valueSpec:t,style:e.style,styleSpec:e.styleSpec})}}});return"identity"===r&&s&&u.push(new ne(e.key,e.value,'missing required property "property"')),"identity"===r||e.value.stops||u.push(new ne(e.key,e.value,'missing required property "stops"')),"exponential"===r&&e.valueSpec.expression&&!wr(e.valueSpec)&&u.push(new ne(e.key,e.value,"exponential functions not supported")),e.styleSpec.$version>=8&&(l&&!vr(e.valueSpec)?u.push(new ne(e.key,e.value,"property functions not supported")):s&&!xr(e.valueSpec)&&u.push(new ne(e.key,e.value,"zoom functions not supported"))),"categorical"!==r&&!c||void 0!==e.value.property||u.push(new ne(e.key,e.value,'"property" property is required')),u;function h(e){let r=[];const i=e.value,s=e.key;if("array"!==Sr(i))return[new ne(s,i,`array expected, ${Sr(i)} found`)];if(2!==i.length)return[new ne(s,i,`array length 2 expected, length ${i.length} found`)];if(c){if("object"!==Sr(i[0]))return[new ne(s,i,`object expected, ${Sr(i[0])} found`)];if(void 0===i[0].zoom)return[new ne(s,i,"object stop key must have zoom")];if(void 0===i[0].value)return[new ne(s,i,"object stop key must have value")];if(o&&o>se(i[0].zoom))return[new ne(s,i[0].zoom,"stop zoom values must appear in ascending order")];se(i[0].zoom)!==o&&(o=se(i[0].zoom),n=void 0,a={}),r=r.concat(Nr({key:`${s}[0]`,value:i[0],valueSpec:{zoom:{}},style:e.style,styleSpec:e.styleSpec,objectElementValidators:{zoom:Vr,value:p}}))}else r=r.concat(p({key:`${s}[0]`,value:i[0],valueSpec:{},style:e.style,styleSpec:e.styleSpec},i));return Or(le(i[1]))?r.concat([new ne(`${s}[1]`,i[1],"expressions are not allowed in function stops.")]):r.concat(fi({key:`${s}[1]`,value:i[1],valueSpec:t,style:e.style,styleSpec:e.styleSpec}))}function p(e,o){const s=Sr(e.value),l=se(e.value),c=null!==e.value?e.value:o;if(i){if(s!==i)return[new ne(e.key,c,`${s} stop domain type must match previous stop domain type ${i}`)]}else i=s;if("number"!==s&&"string"!==s&&"boolean"!==s)return[new ne(e.key,c,"stop domain value must be a number, string, or boolean")];if("number"!==s&&"categorical"!==r){let i=`number expected, ${s} found`;return vr(t)&&void 0===r&&(i+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ne(e.key,c,i)]}return"categorical"!==r||"number"!==s||isFinite(l)&&Math.floor(l)===l?"categorical"!==r&&"number"===s&&void 0!==n&&l<n?[new ne(e.key,c,"stop domain values must appear in ascending order")]:(n=l,"categorical"===r&&l in a?[new ne(e.key,c,"stop domain values must be unique")]:(a[l]=!0,[])):[new ne(e.key,c,`integer expected, found ${l}`)]}}function $r(e){const t=("property"===e.expressionContext?Rr:Dr)(le(e.value),e.valueSpec);if("error"===t.result)return t.value.map((t=>new ne(`${e.key}${t.key}`,e.value,t.message)));const r=t.value.expression||t.value._styleExpression.expression;if("property"===e.expressionContext&&"text-font"===e.propertyKey&&!r.outputDefined())return[new ne(e.key,e.value,`Invalid data expression for "${e.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===e.expressionContext&&"layout"===e.propertyType&&!_t(r))return[new ne(e.key,e.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===e.expressionContext&&!_t(r))return[new ne(e.key,e.value,'"feature-state" data expressions are not supported with filters.')];if(e.expressionContext&&0===e.expressionContext.indexOf("cluster")){if(!bt(r,["zoom","feature-state"]))return[new ne(e.key,e.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===e.expressionContext&&!gt(r))return[new ne(e.key,e.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function Gr(e){const t=e.key,r=e.value,i=e.valueSpec,n=[];return Array.isArray(i.values)?-1===i.values.indexOf(se(r))&&n.push(new ne(t,r,`expected one of [${i.values.join(", ")}], ${JSON.stringify(r)} found`)):-1===Object.keys(i.values).indexOf(se(r))&&n.push(new ne(t,r,`expected one of [${Object.keys(i.values).join(", ")}], ${JSON.stringify(r)} found`)),n}function Zr(e){if(!0===e||!1===e)return!0;if(!Array.isArray(e)||0===e.length)return!1;switch(e[0]){case"has":return e.length>=2&&"$id"!==e[1]&&"$type"!==e[1];case"in":return e.length>=3&&("string"!=typeof e[1]||Array.isArray(e[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==e.length||Array.isArray(e[1])||Array.isArray(e[2]);case"any":case"all":for(const t of e.slice(1))if(!Zr(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}const Wr={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function Xr(e){if(null==e)return{filter:()=>!0,needGeometry:!1};Zr(e)||(e=Jr(e));const t=Dr(e,Wr);if("error"===t.result)throw new Error(t.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return{filter:(e,r,i)=>t.value.evaluate(e,r,{},i),needGeometry:Hr(e)}}function Kr(e,t){return e<t?-1:e>t?1:0}function Hr(e){if(!Array.isArray(e))return!1;if("within"===e[0])return!0;for(let t=1;t<e.length;t++)if(Hr(e[t]))return!0;return!1}function Jr(e){if(!e)return!0;const t=e[0];return e.length<=1?"any"!==t:"=="===t?Yr(e[1],e[2],"=="):"!="===t?ti(Yr(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?Yr(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(Jr))):"all"===t?["all"].concat(e.slice(1).map(Jr)):"none"===t?["all"].concat(e.slice(1).map(Jr).map(ti)):"in"===t?Qr(e[1],e.slice(2)):"!in"===t?ti(Qr(e[1],e.slice(2))):"has"===t?ei(e[1]):"!has"===t?ti(ei(e[1])):"within"!==t||e;var r}function Yr(e,t,r){switch(e){case"$type":return[`filter-type-${r}`,t];case"$id":return[`filter-id-${r}`,t];default:return[`filter-${r}`,e,t]}}function Qr(e,t){if(0===t.length)return!1;switch(e){case"$type":return["filter-type-in",["literal",t]];case"$id":return["filter-id-in",["literal",t]];default:return t.length>200&&!t.some((e=>typeof e!=typeof t[0]))?["filter-in-large",e,["literal",t.sort(Kr)]]:["filter-in-small",e,["literal",t]]}}function ei(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function ti(e){return["!",e]}function ri(e){return Zr(le(e.value))?$r(ae({},e,{expressionContext:"filter",valueSpec:{value:"boolean"}})):ii(e)}function ii(e){const t=e.value,r=e.key;if("array"!==Sr(t))return[new ne(r,t,`array expected, ${Sr(t)} found`)];const i=e.styleSpec;let n,o=[];if(t.length<1)return[new ne(r,t,"filter array must have at least 1 element")];switch(o=o.concat(Gr({key:`${r}[0]`,value:t[0],valueSpec:i.filter_operator,style:e.style,styleSpec:e.styleSpec})),se(t[0])){case"<":case"<=":case">":case">=":t.length>=2&&"$type"===se(t[1])&&o.push(new ne(r,t,`"$type" cannot be use with operator "${t[0]}"`));case"==":case"!=":3!==t.length&&o.push(new ne(r,t,`filter array for operator "${t[0]}" must have 3 elements`));case"in":case"!in":t.length>=2&&(n=Sr(t[1]),"string"!==n&&o.push(new ne(`${r}[1]`,t[1],`string expected, ${n} found`)));for(let a=2;a<t.length;a++)n=Sr(t[a]),"$type"===se(t[1])?o=o.concat(Gr({key:`${r}[${a}]`,value:t[a],valueSpec:i.geometry_type,style:e.style,styleSpec:e.styleSpec})):"string"!==n&&"number"!==n&&"boolean"!==n&&o.push(new ne(`${r}[${a}]`,t[a],`string, number, or boolean expected, ${n} found`));break;case"any":case"all":case"none":for(let i=1;i<t.length;i++)o=o.concat(ii({key:`${r}[${i}]`,value:t[i],style:e.style,styleSpec:e.styleSpec}));break;case"has":case"!has":n=Sr(t[1]),2!==t.length?o.push(new ne(r,t,`filter array for "${t[0]}" operator must have 2 elements`)):"string"!==n&&o.push(new ne(`${r}[1]`,t[1],`string expected, ${n} found`));break;case"within":n=Sr(t[1]),2!==t.length?o.push(new ne(r,t,`filter array for "${t[0]}" operator must have 2 elements`)):"object"!==n&&o.push(new ne(`${r}[1]`,t[1],`object expected, ${n} found`))}return o}function ni(e,t){const r=e.key,i=e.style,n=e.styleSpec,o=e.value,a=e.objectKey,s=n[`${t}_${e.layerType}`];if(!s)return[];const l=a.match(/^(.*)-transition$/);if("paint"===t&&l&&s[l[1]]&&s[l[1]].transition)return fi({key:r,value:o,valueSpec:n.transition,style:i,styleSpec:n});const c=e.valueSpec||s[a];if(!c)return[new ne(r,o,`unknown property "${a}"`)];let u;if("string"===Sr(o)&&vr(c)&&!c.tokens&&(u=/^{([^}]+)}$/.exec(o)))return[new ne(r,o,`"${a}" does not support interpolation syntax\nUse an identity property function instead: \`{ "type": "identity", "property": ${JSON.stringify(u[1])} }\`.`)];const h=[];return"symbol"===e.layerType&&("text-field"===a&&i&&!i.glyphs&&h.push(new ne(r,o,'use of "text-field" requires a style "glyphs" property')),"text-font"===a&&Er(le(o))&&"identity"===se(o.type)&&h.push(new ne(r,o,'"text-font" does not support identity functions'))),h.concat(fi({key:e.key,value:o,valueSpec:c,style:i,styleSpec:n,expressionContext:"property",propertyType:t,propertyKey:a}))}function oi(e){return ni(e,"paint")}function ai(e){return ni(e,"layout")}function si(e){let t=[];const r=e.value,i=e.key,n=e.style,o=e.styleSpec;r.type||r.ref||t.push(new ne(i,r,'either "type" or "ref" is required'));let a=se(r.type);const s=se(r.ref);if(r.id){const o=se(r.id);for(let a=0;a<e.arrayIndex;a++){const e=n.layers[a];se(e.id)===o&&t.push(new ne(i,r.id,`duplicate layer id "${r.id}", previously used at line ${e.id.__line__}`))}}if("ref"in r){let e;["type","source","source-layer","filter","layout"].forEach((e=>{e in r&&t.push(new ne(i,r[e],`"${e}" is prohibited for ref layers`))})),n.layers.forEach((t=>{se(t.id)===s&&(e=t)})),e?e.ref?t.push(new ne(i,r.ref,"ref cannot reference another ref layer")):a=se(e.type):t.push(new ne(i,r.ref,`ref layer "${s}" not found`))}else if("background"!==a)if(r.source){const e=n.sources&&n.sources[r.source],o=e&&se(e.type);e?"vector"===o&&"raster"===a?t.push(new ne(i,r.source,`layer "${r.id}" requires a raster source`)):"raster"===o&&"raster"!==a?t.push(new ne(i,r.source,`layer "${r.id}" requires a vector source`)):"vector"!==o||r["source-layer"]?"raster-dem"===o&&"hillshade"!==a?t.push(new ne(i,r.source,"raster-dem source can only be used with layer type 'hillshade'.")):"line"!==a||!r.paint||!r.paint["line-gradient"]||"geojson"===o&&e.lineMetrics||t.push(new ne(i,r,`layer "${r.id}" specifies a line-gradient, which requires a GeoJSON source with \`lineMetrics\` enabled.`)):t.push(new ne(i,r,`layer "${r.id}" must specify a "source-layer"`)):t.push(new ne(i,r.source,`source "${r.source}" not found`))}else t.push(new ne(i,r,'missing required property "source"'));return t=t.concat(Nr({key:i,value:r,valueSpec:o.layer,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":()=>[],type:()=>fi({key:`${i}.type`,value:r.type,valueSpec:o.layer.type,style:e.style,styleSpec:e.styleSpec,object:r,objectKey:"type"}),filter:ri,layout:e=>Nr({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":e=>ai(ae({layerType:a},e))}}),paint:e=>Nr({layer:r,key:e.key,value:e.value,style:e.style,styleSpec:e.styleSpec,objectElementValidators:{"*":e=>oi(ae({layerType:a},e))}})}})),t}function li(e){const t=e.value,r=e.key,i=Sr(t);return"string"!==i?[new ne(r,t,`string expected, ${i} found`)]:[]}const ci={promoteId:function({key:e,value:t}){if("string"===Sr(t))return li({key:e,value:t});{const r=[];for(const i in t)r.push(...li({key:`${e}.${i}`,value:t[i]}));return r}}};function ui(e){const t=e.value,r=e.key,i=e.styleSpec,n=e.style;if(!t.type)return[new ne(r,t,'"type" is required')];const o=se(t.type);let a;switch(o){case"vector":case"raster":case"raster-dem":return a=Nr({key:r,value:t,valueSpec:i[`source_${o.replace("-","_")}`],style:e.style,styleSpec:i,objectElementValidators:ci}),a;case"geojson":if(a=Nr({key:r,value:t,valueSpec:i.source_geojson,style:n,styleSpec:i,objectElementValidators:ci}),t.cluster)for(const e in t.clusterProperties){const[i,n]=t.clusterProperties[e],o="string"==typeof i?[i,["accumulated"],["get",e]]:i;a.push(...$r({key:`${r}.${e}.map`,value:n,expressionContext:"cluster-map"})),a.push(...$r({key:`${r}.${e}.reduce`,value:o,expressionContext:"cluster-reduce"}))}return a;case"video":return Nr({key:r,value:t,valueSpec:i.source_video,style:n,styleSpec:i});case"image":return Nr({key:r,value:t,valueSpec:i.source_image,style:n,styleSpec:i});case"canvas":return[new ne(r,null,"Please use runtime APIs to add canvas sources, rather than including them in stylesheets.","source.canvas")];default:return Gr({key:`${r}.type`,value:t.type,valueSpec:{values:["vector","raster","raster-dem","geojson","video","image"]},style:n,styleSpec:i})}}function hi(e){const t=e.value,r=e.styleSpec,i=r.light,n=e.style;let o=[];const a=Sr(t);if(void 0===t)return o;if("object"!==a)return o=o.concat([new ne("light",t,`object expected, ${a} found`)]),o;for(const e in t){const a=e.match(/^(.*)-transition$/);o=o.concat(a&&i[a[1]]&&i[a[1]].transition?fi({key:e,value:t[e],valueSpec:r.transition,style:n,styleSpec:r}):i[e]?fi({key:e,value:t[e],valueSpec:i[e],style:n,styleSpec:r}):[new ne(e,t[e],`unknown property "${e}"`)])}return o}function pi(e){const t=e.value,r=e.styleSpec,i=r.terrain,n=e.style;let o=[];const a=Sr(t);if(void 0===t)return o;if("object"!==a)return o=o.concat([new ne("terrain",t,`object expected, ${a} found`)]),o;for(const e in t)o=o.concat(i[e]?fi({key:e,value:t[e],valueSpec:i[e],style:n,styleSpec:r}):[new ne(e,t[e],`unknown property "${e}"`)]);return o}const di={"*":()=>[],array:Ur,boolean:function(e){const t=e.value,r=e.key,i=Sr(t);return"boolean"!==i?[new ne(r,t,`boolean expected, ${i} found`)]:[]},number:Vr,color:function(e){const t=e.key,r=e.value,i=Sr(r);return"string"!==i?[new ne(t,r,`color expected, ${i} found`)]:null===Ie(r)?[new ne(t,r,`color expected, "${r}" found`)]:[]},constants:oe,enum:Gr,filter:ri,function:qr,layer:si,object:Nr,source:ui,light:hi,terrain:pi,string:li,formatted:function(e){return 0===li(e).length?[]:$r(e)},resolvedImage:function(e){return 0===li(e).length?[]:$r(e)},padding:function(e){const t=e.key,r=e.value;if("array"===Sr(r)){if(r.length<1||r.length>4)return[new ne(t,r,`padding requires 1 to 4 values; ${r.length} values found`)];const e={type:"number"};let i=[];for(let n=0;n<r.length;n++)i=i.concat(fi({key:`${t}[${n}]`,value:r[n],valueSpec:e}));return i}return Vr({key:t,value:r,valueSpec:{}})}};function fi(e){const t=e.value,r=e.valueSpec,i=e.styleSpec;return r.expression&&Er(se(t))?qr(e):r.expression&&Or(le(t))?$r(e):r.type&&di[r.type]?di[r.type](e):Nr(ae({},e,{valueSpec:r.type?i[r.type]:r}))}function mi(e){const t=e.value,r=e.key,i=li(e);return i.length||(-1===t.indexOf("{fontstack}")&&i.push(new ne(r,t,'"glyphs" url must include a "{fontstack}" token')),-1===t.indexOf("{range}")&&i.push(new ne(r,t,'"glyphs" url must include a "{range}" token'))),i}function yi(e,t=ie){let r=[];return r=r.concat(fi({key:"",value:e,valueSpec:t.$root,styleSpec:t,style:e,objectElementValidators:{glyphs:mi,"*":()=>[]}})),e.constants&&(r=r.concat(oe({key:"constants",value:e.constants,style:e,styleSpec:t}))),gi(r)}function gi(e){return[].concat(e).sort(((e,t)=>e.line-t.line))}function _i(e){return function(...t){return gi(e.apply(this,t))}}yi.source=_i(ui),yi.light=_i(hi),yi.terrain=_i(pi),yi.layer=_i(si),yi.filter=_i(ri),yi.paintProperty=_i(oi),yi.layoutProperty=_i(ai);const bi=yi,vi=bi.light,xi=bi.paintProperty,wi=bi.layoutProperty;function Si(e,t){let r=!1;if(t&&t.length)for(const i of t)e.fire(new te(new Error(i.message))),r=!0;return r}class Ei{constructor(e,t,r){const i=this.cells=[];if(e instanceof ArrayBuffer){this.arrayBuffer=e;const n=new Int32Array(this.arrayBuffer);e=n[0],this.d=(t=n[1])+2*(r=n[2]);for(let e=0;e<this.d*this.d;e++){const t=n[3+e],r=n[3+e+1];i.push(t===r?null:n.subarray(t,r))}const o=n[3+i.length+1];this.keys=n.subarray(n[3+i.length],o),this.bboxes=n.subarray(o),this.insert=this._insertReadonly}else{this.d=t+2*r;for(let e=0;e<this.d*this.d;e++)i.push([]);this.keys=[],this.bboxes=[]}this.n=t,this.extent=e,this.padding=r,this.scale=t/e,this.uid=0;const n=r/t*e;this.min=-n,this.max=e+n}insert(e,t,r,i,n){this._forEachCell(t,r,i,n,this._insertCell,this.uid++,void 0,void 0),this.keys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)}_insertReadonly(){throw new Error("Cannot insert into a GridIndex created from an ArrayBuffer.")}_insertCell(e,t,r,i,n,o){this.cells[n].push(o)}query(e,t,r,i,n){const o=this.min,a=this.max;if(e<=o&&t<=o&&a<=r&&a<=i&&!n)return Array.prototype.slice.call(this.keys);{const o=[];return this._forEachCell(e,t,r,i,this._queryCell,o,{},n),o}}_queryCell(e,t,r,i,n,o,a,s){const l=this.cells[n];if(null!==l){const n=this.keys,c=this.bboxes;for(let u=0;u<l.length;u++){const h=l[u];if(void 0===a[h]){const l=4*h;(s?s(c[l+0],c[l+1],c[l+2],c[l+3]):e<=c[l+2]&&t<=c[l+3]&&r>=c[l+0]&&i>=c[l+1])?(a[h]=!0,o.push(n[h])):a[h]=!1}}}}_forEachCell(e,t,r,i,n,o,a,s){const l=this._convertToCellCoord(e),c=this._convertToCellCoord(t),u=this._convertToCellCoord(r),h=this._convertToCellCoord(i);for(let p=l;p<=u;p++)for(let l=c;l<=h;l++){const c=this.d*l+p;if((!s||s(this._convertFromCellCoord(p),this._convertFromCellCoord(l),this._convertFromCellCoord(p+1),this._convertFromCellCoord(l+1)))&&n.call(this,e,t,r,i,c,o,a,s))return}}_convertFromCellCoord(e){return(e-this.padding)/this.scale}_convertToCellCoord(e){return Math.max(0,Math.min(this.d-1,Math.floor(e*this.scale)+this.padding))}toArrayBuffer(){if(this.arrayBuffer)return this.arrayBuffer;const e=this.cells,t=3+this.cells.length+1+1;let r=0;for(let e=0;e<this.cells.length;e++)r+=this.cells[e].length;const i=new Int32Array(t+r+this.keys.length+this.bboxes.length);i[0]=this.extent,i[1]=this.n,i[2]=this.padding;let n=t;for(let t=0;t<e.length;t++){const r=e[t];i[3+t]=n,i.set(r,n),n+=r.length}return i[3+e.length]=n,i.set(this.keys,n),n+=this.keys.length,i[3+e.length+1]=n,i.set(this.bboxes,n),n+=this.bboxes.length,i.buffer}static serialize(e,t){const r=e.toArrayBuffer();return t&&t.push(r),{buffer:r}}static deserialize(e){return new Ei(e.buffer)}}const Ti={};function ki(e,t,r={}){if(Ti[e])throw new Error(`${e} is already registered.`);Object.defineProperty(t,"_classRegistryKey",{value:e,writeable:!1}),Ti[e]={klass:t,omit:r.omit||[],shallow:r.shallow||[]}}ki("Object",Object),ki("TransferableGridIndex",Ei),ki("Color",De),ki("Error",Error),ki("AJAXError",V),ki("ResolvedImage",Fe),ki("StylePropertyFunction",Br),ki("StyleExpression",Mr,{omit:["_evaluator"]}),ki("ZoomDependentExpression",jr),ki("ZoomConstantExpression",Lr),ki("CompoundExpression",Ye,{omit:["_evaluate"]});for(const e in dr)dr[e]._classRegistryKey||ki(`Expression_${e}`,dr[e]);function Ai(e){return e&&"undefined"!=typeof ArrayBuffer&&(e instanceof ArrayBuffer||e.constructor&&"ArrayBuffer"===e.constructor.name)}function Ii(e,t){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob)return e;if(Ai(e))return t&&t.push(e),e;if(S(e))return t&&t.push(e),e;if(ArrayBuffer.isView(e)){const r=e;return t&&t.push(r.buffer),r}if(e instanceof ImageData)return t&&t.push(e.data.buffer),e;if(Array.isArray(e)){const r=[];for(const i of e)r.push(Ii(i,t));return r}if("object"==typeof e){const r=e.constructor,i=r._classRegistryKey;if(!i)throw new Error("can't serialize object of unregistered class");if(!Ti[i])throw new Error(`${i} is not registered.`);const n=r.serialize?r.serialize(e,t):{};if(r.serialize){if(t&&n===t[t.length-1])throw new Error("statically serialized object won't survive transfer of $name property")}else{for(const r in e){if(!e.hasOwnProperty(r))continue;if(Ti[i].omit.indexOf(r)>=0)continue;const o=e[r];n[r]=Ti[i].shallow.indexOf(r)>=0?o:Ii(o,t)}e instanceof Error&&(n.message=e.message)}if(n.$name)throw new Error("$name property is reserved for worker serialization logic.");return"Object"!==i&&(n.$name=i),n}throw new Error("can't serialize object of type "+typeof e)}function Pi(e){if(null==e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||e instanceof Boolean||e instanceof Number||e instanceof String||e instanceof Date||e instanceof RegExp||e instanceof Blob||Ai(e)||S(e)||ArrayBuffer.isView(e)||e instanceof ImageData)return e;if(Array.isArray(e))return e.map(Pi);if("object"==typeof e){const t=e.$name||"Object";if(!Ti[t])throw new Error(`can't deserialize unregistered class ${t}`);const{klass:r}=Ti[t];if(!r)throw new Error(`can't deserialize unregistered class ${t}`);if(r.deserialize)return r.deserialize(e);const i=Object.create(r.prototype);for(const r of Object.keys(e)){if("$name"===r)continue;const n=e[r];i[r]=Ti[t].shallow.indexOf(r)>=0?n:Pi(n)}return i}throw new Error("can't deserialize object of type "+typeof e)}class Ci{constructor(){this.first=!0}update(e,t){const r=Math.floor(e);return this.first?(this.first=!1,this.lastIntegerZoom=r,this.lastIntegerZoomTime=0,this.lastZoom=e,this.lastFloorZoom=r,!0):(this.lastFloorZoom>r?(this.lastIntegerZoom=r+1,this.lastIntegerZoomTime=t):this.lastFloorZoom<r&&(this.lastIntegerZoom=r,this.lastIntegerZoomTime=t),e!==this.lastZoom&&(this.lastZoom=e,this.lastFloorZoom=r,!0))}}const zi={"Latin-1 Supplement":e=>e>=128&&e<=255,Arabic:e=>e>=1536&&e<=1791,"Arabic Supplement":e=>e>=1872&&e<=1919,"Arabic Extended-A":e=>e>=2208&&e<=2303,"Hangul Jamo":e=>e>=4352&&e<=4607,"Unified Canadian Aboriginal Syllabics":e=>e>=5120&&e<=5759,Khmer:e=>e>=6016&&e<=6143,"Unified Canadian Aboriginal Syllabics Extended":e=>e>=6320&&e<=6399,"General Punctuation":e=>e>=8192&&e<=8303,"Letterlike Symbols":e=>e>=8448&&e<=8527,"Number Forms":e=>e>=8528&&e<=8591,"Miscellaneous Technical":e=>e>=8960&&e<=9215,"Control Pictures":e=>e>=9216&&e<=9279,"Optical Character Recognition":e=>e>=9280&&e<=9311,"Enclosed Alphanumerics":e=>e>=9312&&e<=9471,"Geometric Shapes":e=>e>=9632&&e<=9727,"Miscellaneous Symbols":e=>e>=9728&&e<=9983,"Miscellaneous Symbols and Arrows":e=>e>=11008&&e<=11263,"CJK Radicals Supplement":e=>e>=11904&&e<=12031,"Kangxi Radicals":e=>e>=12032&&e<=12255,"Ideographic Description Characters":e=>e>=12272&&e<=12287,"CJK Symbols and Punctuation":e=>e>=12288&&e<=12351,Hiragana:e=>e>=12352&&e<=12447,Katakana:e=>e>=12448&&e<=12543,Bopomofo:e=>e>=12544&&e<=12591,"Hangul Compatibility Jamo":e=>e>=12592&&e<=12687,Kanbun:e=>e>=12688&&e<=12703,"Bopomofo Extended":e=>e>=12704&&e<=12735,"CJK Strokes":e=>e>=12736&&e<=12783,"Katakana Phonetic Extensions":e=>e>=12784&&e<=12799,"Enclosed CJK Letters and Months":e=>e>=12800&&e<=13055,"CJK Compatibility":e=>e>=13056&&e<=13311,"CJK Unified Ideographs Extension A":e=>e>=13312&&e<=19903,"Yijing Hexagram Symbols":e=>e>=19904&&e<=19967,"CJK Unified Ideographs":e=>e>=19968&&e<=40959,"Yi Syllables":e=>e>=40960&&e<=42127,"Yi Radicals":e=>e>=42128&&e<=42191,"Hangul Jamo Extended-A":e=>e>=43360&&e<=43391,"Hangul Syllables":e=>e>=44032&&e<=55215,"Hangul Jamo Extended-B":e=>e>=55216&&e<=55295,"Private Use Area":e=>e>=57344&&e<=63743,"CJK Compatibility Ideographs":e=>e>=63744&&e<=64255,"Arabic Presentation Forms-A":e=>e>=64336&&e<=65023,"Vertical Forms":e=>e>=65040&&e<=65055,"CJK Compatibility Forms":e=>e>=65072&&e<=65103,"Small Form Variants":e=>e>=65104&&e<=65135,"Arabic Presentation Forms-B":e=>e>=65136&&e<=65279,"Halfwidth and Fullwidth Forms":e=>e>=65280&&e<=65519};function Mi(e){for(const t of e)if(Li(t.charCodeAt(0)))return!0;return!1}function Oi(e){for(const t of e)if(!Di(t.charCodeAt(0)))return!1;return!0}function Di(e){return!(zi.Arabic(e)||zi["Arabic Supplement"](e)||zi["Arabic Extended-A"](e)||zi["Arabic Presentation Forms-A"](e)||zi["Arabic Presentation Forms-B"](e))}function Li(e){return!(746!==e&&747!==e&&(e<4352||!(zi["Bopomofo Extended"](e)||zi.Bopomofo(e)||zi["CJK Compatibility Forms"](e)&&!(e>=65097&&e<=65103)||zi["CJK Compatibility Ideographs"](e)||zi["CJK Compatibility"](e)||zi["CJK Radicals Supplement"](e)||zi["CJK Strokes"](e)||!(!zi["CJK Symbols and Punctuation"](e)||e>=12296&&e<=12305||e>=12308&&e<=12319||12336===e)||zi["CJK Unified Ideographs Extension A"](e)||zi["CJK Unified Ideographs"](e)||zi["Enclosed CJK Letters and Months"](e)||zi["Hangul Compatibility Jamo"](e)||zi["Hangul Jamo Extended-A"](e)||zi["Hangul Jamo Extended-B"](e)||zi["Hangul Jamo"](e)||zi["Hangul Syllables"](e)||zi.Hiragana(e)||zi["Ideographic Description Characters"](e)||zi.Kanbun(e)||zi["Kangxi Radicals"](e)||zi["Katakana Phonetic Extensions"](e)||zi.Katakana(e)&&12540!==e||!(!zi["Halfwidth and Fullwidth Forms"](e)||65288===e||65289===e||65293===e||e>=65306&&e<=65310||65339===e||65341===e||65343===e||e>=65371&&e<=65503||65507===e||e>=65512&&e<=65519)||!(!zi["Small Form Variants"](e)||e>=65112&&e<=65118||e>=65123&&e<=65126)||zi["Unified Canadian Aboriginal Syllabics"](e)||zi["Unified Canadian Aboriginal Syllabics Extended"](e)||zi["Vertical Forms"](e)||zi["Yijing Hexagram Symbols"](e)||zi["Yi Syllables"](e)||zi["Yi Radicals"](e))))}function ji(e){return!(Li(e)||function(e){return!!(zi["Latin-1 Supplement"](e)&&(167===e||169===e||174===e||177===e||188===e||189===e||190===e||215===e||247===e)||zi["General Punctuation"](e)&&(8214===e||8224===e||8225===e||8240===e||8241===e||8251===e||8252===e||8258===e||8263===e||8264===e||8265===e||8273===e)||zi["Letterlike Symbols"](e)||zi["Number Forms"](e)||zi["Miscellaneous Technical"](e)&&(e>=8960&&e<=8967||e>=8972&&e<=8991||e>=8996&&e<=9e3||9003===e||e>=9085&&e<=9114||e>=9150&&e<=9165||9167===e||e>=9169&&e<=9179||e>=9186&&e<=9215)||zi["Control Pictures"](e)&&9251!==e||zi["Optical Character Recognition"](e)||zi["Enclosed Alphanumerics"](e)||zi["Geometric Shapes"](e)||zi["Miscellaneous Symbols"](e)&&!(e>=9754&&e<=9759)||zi["Miscellaneous Symbols and Arrows"](e)&&(e>=11026&&e<=11055||e>=11088&&e<=11097||e>=11192&&e<=11243)||zi["CJK Symbols and Punctuation"](e)||zi.Katakana(e)||zi["Private Use Area"](e)||zi["CJK Compatibility Forms"](e)||zi["Small Form Variants"](e)||zi["Halfwidth and Fullwidth Forms"](e)||8734===e||8756===e||8757===e||e>=9984&&e<=10087||e>=10102&&e<=10131||65532===e||65533===e)}(e))}function Ri(e){return e>=1424&&e<=2303||zi["Arabic Presentation Forms-A"](e)||zi["Arabic Presentation Forms-B"](e)}function Bi(e,t){return!(!t&&Ri(e)||e>=2304&&e<=3583||e>=3840&&e<=4255||zi.Khmer(e))}function Fi(e){for(const t of e)if(Ri(t.charCodeAt(0)))return!0;return!1}const Ni="deferred",Ui="loading",Vi="loaded";let qi=null,$i="unavailable",Gi=null;const Zi=function(e){e&&"string"==typeof e&&e.indexOf("NetworkError")>-1&&($i="error"),qi&&qi(e)};function Wi(){Xi.fire(new ee("pluginStateChange",{pluginStatus:$i,pluginURL:Gi}))}const Xi=new re,Ki=function(){return $i},Hi=function(){if($i!==Ni||!Gi)throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");$i=Ui,Wi(),Gi&&Z({url:Gi},(e=>{e?Zi(e):($i=Vi,Wi())}))},Ji={applyArabicShaping:null,processBidirectionalText:null,processStyledBidirectionalText:null,isLoaded:()=>$i===Vi||null!=Ji.applyArabicShaping,isLoading:()=>$i===Ui,setState(e){if(!g())throw new Error("Cannot set the state of the rtl-text-plugin when not in the web-worker context");$i=e.pluginStatus,Gi=e.pluginURL},isParsed(){if(!g())throw new Error("rtl-text-plugin is only parsed on the worker-threads");return null!=Ji.applyArabicShaping&&null!=Ji.processBidirectionalText&&null!=Ji.processStyledBidirectionalText},getPluginURL(){if(!g())throw new Error("rtl-text-plugin url can only be queried from the worker threads");return Gi}};class Yi{constructor(e,t){this.zoom=e,t?(this.now=t.now,this.fadeDuration=t.fadeDuration,this.zoomHistory=t.zoomHistory,this.transition=t.transition):(this.now=0,this.fadeDuration=0,this.zoomHistory=new Ci,this.transition={})}isSupportedScript(e){return function(e,t){for(const r of e)if(!Bi(r.charCodeAt(0),t))return!1;return!0}(e,Ji.isLoaded())}crossFadingFactor(){return 0===this.fadeDuration?1:Math.min((this.now-this.zoomHistory.lastIntegerZoomTime)/this.fadeDuration,1)}getCrossfadeParameters(){const e=this.zoom,t=e-Math.floor(e),r=this.crossFadingFactor();return e>this.zoomHistory.lastIntegerZoom?{fromScale:2,toScale:1,t:t+(1-t)*r}:{fromScale:.5,toScale:1,t:1-(1-r)*t}}}class Qi{constructor(e,t){this.property=e,this.value=t,this.expression=function(e,t){if(Er(e))return new Br(e,t);if(Or(e)){const r=Rr(e,t);if("error"===r.result)throw new Error(r.value.map((e=>`${e.key}: ${e.message}`)).join(", "));return r.value}{let r=e;return"color"===t.type&&"string"==typeof e?r=De.parse(e):"padding"!==t.type||"number"!=typeof e&&!Array.isArray(e)||(r=Be.parse(e)),{kind:"constant",evaluate:()=>r}}}(void 0===t?e.specification.default:t,e.specification)}isDataDriven(){return"source"===this.expression.kind||"composite"===this.expression.kind}possiblyEvaluate(e,t,r){return this.property.possiblyEvaluate(this,e,t,r)}}class en{constructor(e){this.property=e,this.value=new Qi(e,void 0)}transitioned(e,t){return new rn(this.property,this.value,t,s({},e.transition,this.transition),e.now)}untransitioned(){return new rn(this.property,this.value,null,{},0)}}class tn{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitionablePropertyValues)}getValue(e){return p(this._values[e].value.value)}setValue(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new en(this._values[e].property)),this._values[e].value=new Qi(this._values[e].property,null===t?void 0:p(t))}getTransition(e){return p(this._values[e].transition)}setTransition(e,t){Object.prototype.hasOwnProperty.call(this._values,e)||(this._values[e]=new en(this._values[e].property)),this._values[e].transition=p(t)||void 0}serialize(){const e={};for(const t of Object.keys(this._values)){const r=this.getValue(t);void 0!==r&&(e[t]=r);const i=this.getTransition(t);void 0!==i&&(e[`${t}-transition`]=i)}return e}transitioned(e,t){const r=new nn(this._properties);for(const i of Object.keys(this._values))r._values[i]=this._values[i].transitioned(e,t._values[i]);return r}untransitioned(){const e=new nn(this._properties);for(const t of Object.keys(this._values))e._values[t]=this._values[t].untransitioned();return e}}class rn{constructor(e,t,r,i,n){this.property=e,this.value=t,this.begin=n+i.delay||0,this.end=this.begin+i.duration||0,e.specification.transition&&(i.delay||i.duration)&&(this.prior=r)}possiblyEvaluate(e,t,r){const i=e.now||0,n=this.value.possiblyEvaluate(e,t,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(e,t,r);{const a=(i-this.begin)/(this.end-this.begin);return this.property.interpolate(o.possiblyEvaluate(e,t,r),n,function(e){if(e<=0)return 0;if(e>=1)return 1;const t=e*e,r=t*e;return 4*(e<.5?r:3*(e-t)+r-.75)}(a))}}return n}}class nn{constructor(e){this._properties=e,this._values=Object.create(e.defaultTransitioningPropertyValues)}possiblyEvaluate(e,t,r){const i=new sn(this._properties);for(const n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(e,t,r);return i}hasTransition(){for(const e of Object.keys(this._values))if(this._values[e].prior)return!0;return!1}}class on{constructor(e){this._properties=e,this._values=Object.create(e.defaultPropertyValues)}getValue(e){return p(this._values[e].value)}setValue(e,t){this._values[e]=new Qi(this._values[e].property,null===t?void 0:p(t))}serialize(){const e={};for(const t of Object.keys(this._values)){const r=this.getValue(t);void 0!==r&&(e[t]=r)}return e}possiblyEvaluate(e,t,r){const i=new sn(this._properties);for(const n of Object.keys(this._values))i._values[n]=this._values[n].possiblyEvaluate(e,t,r);return i}}class an{constructor(e,t,r){this.property=e,this.value=t,this.parameters=r}isConstant(){return"constant"===this.value.kind}constantOr(e){return"constant"===this.value.kind?this.value.value:e}evaluate(e,t,r,i){return this.property.evaluate(this.value,this.parameters,e,t,r,i)}}class sn{constructor(e){this._properties=e,this._values=Object.create(e.defaultPossiblyEvaluatedValues)}get(e){return this._values[e]}}class ln{constructor(e){this.specification=e}possiblyEvaluate(e,t){if(e.isDataDriven())throw new Error("Value should not be data driven");return e.expression.evaluate(t)}interpolate(e,t,r){const i=kt[this.specification.type];return i?i(e,t,r):e}}class cn{constructor(e,t){this.specification=e,this.overrides=t}possiblyEvaluate(e,t,r,i){return new an(this,"constant"===e.expression.kind||"camera"===e.expression.kind?{kind:"constant",value:e.expression.evaluate(t,null,{},r,i)}:e.expression,t)}interpolate(e,t,r){if("constant"!==e.value.kind||"constant"!==t.value.kind)return e;if(void 0===e.value.value||void 0===t.value.value)return new an(this,{kind:"constant",value:void 0},e.parameters);const i=kt[this.specification.type];return i?new an(this,{kind:"constant",value:i(e.value.value,t.value.value,r)},e.parameters):e}evaluate(e,t,r,i,n,o){return"constant"===e.kind?e.value:e.evaluate(t,r,i,n,o)}}class un extends cn{possiblyEvaluate(e,t,r,i){if(void 0===e.value)return new an(this,{kind:"constant",value:void 0},t);if("constant"===e.expression.kind){const n=e.expression.evaluate(t,null,{},r,i),o="resolvedImage"===e.property.specification.type&&"string"!=typeof n?n.name:n,a=this._calculate(o,o,o,t);return new an(this,{kind:"constant",value:a},t)}if("camera"===e.expression.kind){const r=this._calculate(e.expression.evaluate({zoom:t.zoom-1}),e.expression.evaluate({zoom:t.zoom}),e.expression.evaluate({zoom:t.zoom+1}),t);return new an(this,{kind:"constant",value:r},t)}return new an(this,e.expression,t)}evaluate(e,t,r,i,n,o){if("source"===e.kind){const a=e.evaluate(t,r,i,n,o);return this._calculate(a,a,a,t)}return"composite"===e.kind?this._calculate(e.evaluate({zoom:Math.floor(t.zoom)-1},r,i),e.evaluate({zoom:Math.floor(t.zoom)},r,i),e.evaluate({zoom:Math.floor(t.zoom)+1},r,i),t):e.value}_calculate(e,t,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}}class hn{constructor(e){this.specification=e}possiblyEvaluate(e,t,r,i){if(void 0!==e.value){if("constant"===e.expression.kind){const n=e.expression.evaluate(t,null,{},r,i);return this._calculate(n,n,n,t)}return this._calculate(e.expression.evaluate(new Yi(Math.floor(t.zoom-1),t)),e.expression.evaluate(new Yi(Math.floor(t.zoom),t)),e.expression.evaluate(new Yi(Math.floor(t.zoom+1),t)),t)}}_calculate(e,t,r,i){return i.zoom>i.zoomHistory.lastIntegerZoom?{from:e,to:t}:{from:r,to:t}}interpolate(e){return e}}class pn{constructor(e){this.specification=e}possiblyEvaluate(e,t,r,i){return!!e.expression.evaluate(t,null,{},r,i)}interpolate(){return!1}}class dn{constructor(e){this.properties=e,this.defaultPropertyValues={},this.defaultTransitionablePropertyValues={},this.defaultTransitioningPropertyValues={},this.defaultPossiblyEvaluatedValues={},this.overridableProperties=[];for(const t in e){const r=e[t];r.specification.overridable&&this.overridableProperties.push(t);const i=this.defaultPropertyValues[t]=new Qi(r,void 0),n=this.defaultTransitionablePropertyValues[t]=new en(r);this.defaultTransitioningPropertyValues[t]=n.untransitioned(),this.defaultPossiblyEvaluatedValues[t]=i.possiblyEvaluate({})}}}ki("DataDrivenProperty",cn),ki("DataConstantProperty",ln),ki("CrossFadedDataDrivenProperty",un),ki("CrossFadedProperty",hn),ki("ColorRampProperty",pn);const fn="-transition";class mn extends re{constructor(e,t){if(super(),this.id=e.id,this.type=e.type,this._featureFilter={filter:()=>!0,needGeometry:!1},"custom"!==e.type&&(this.metadata=e.metadata,this.minzoom=e.minzoom,this.maxzoom=e.maxzoom,"background"!==e.type&&(this.source=e.source,this.sourceLayer=e["source-layer"],this.filter=e.filter),t.layout&&(this._unevaluatedLayout=new on(t.layout)),t.paint)){this._transitionablePaint=new tn(t.paint);for(const t in e.paint)this.setPaintProperty(t,e.paint[t],{validate:!1});for(const t in e.layout)this.setLayoutProperty(t,e.layout[t],{validate:!1});this._transitioningPaint=this._transitionablePaint.untransitioned(),this.paint=new sn(t.paint)}}getCrossfadeParameters(){return this._crossfadeParameters}getLayoutProperty(e){return"visibility"===e?this.visibility:this._unevaluatedLayout.getValue(e)}setLayoutProperty(e,t,r={}){null!=t&&this._validate(wi,`layers.${this.id}.layout.${e}`,e,t,r)||("visibility"!==e?this._unevaluatedLayout.setValue(e,t):this.visibility=t)}getPaintProperty(e){return e.endsWith(fn)?this._transitionablePaint.getTransition(e.slice(0,-fn.length)):this._transitionablePaint.getValue(e)}setPaintProperty(e,t,r={}){if(null!=t&&this._validate(xi,`layers.${this.id}.paint.${e}`,e,t,r))return!1;if(e.endsWith(fn))return this._transitionablePaint.setTransition(e.slice(0,-fn.length),t||void 0),!1;{const r=this._transitionablePaint._values[e],i="cross-faded-data-driven"===r.property.specification["property-type"],n=r.value.isDataDriven(),o=r.value;this._transitionablePaint.setValue(e,t),this._handleSpecialPaintPropertyUpdate(e);const a=this._transitionablePaint._values[e].value;return a.isDataDriven()||n||i||this._handleOverridablePaintPropertyUpdate(e,o,a)}}_handleSpecialPaintPropertyUpdate(e){}_handleOverridablePaintPropertyUpdate(e,t,r){return!1}isHidden(e){return!!(this.minzoom&&e<this.minzoom)||!!(this.maxzoom&&e>=this.maxzoom)||"none"===this.visibility}updateTransitions(e){this._transitioningPaint=this._transitionablePaint.transitioned(e,this._transitioningPaint)}hasTransition(){return this._transitioningPaint.hasTransition()}recalculate(e,t){e.getCrossfadeParameters&&(this._crossfadeParameters=e.getCrossfadeParameters()),this._unevaluatedLayout&&(this.layout=this._unevaluatedLayout.possiblyEvaluate(e,void 0,t)),this.paint=this._transitioningPaint.possiblyEvaluate(e,void 0,t)}serialize(){const e={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&&(e.layout=e.layout||{},e.layout.visibility=this.visibility),h(e,((e,t)=>!(void 0===e||"layout"===t&&!Object.keys(e).length||"paint"===t&&!Object.keys(e).length)))}_validate(e,t,r,i,n={}){return(!n||!1!==n.validate)&&Si(this,e.call(bi,{key:t,layerType:this.type,objectKey:r,value:i,styleSpec:ie,style:{glyphs:!0,sprite:!0}}))}is3D(){return!1}isTileClipped(){return!1}hasOffscreenPass(){return!1}resize(){}isStateDependent(){for(const e in this.paint._values){const t=this.paint.get(e);if(t instanceof an&&vr(t.property.specification)&&("source"===t.value.kind||"composite"===t.value.kind)&&t.value.isStateDependent)return!0}return!1}}const yn={Int8:Int8Array,Uint8:Uint8Array,Int16:Int16Array,Uint16:Uint16Array,Int32:Int32Array,Uint32:Uint32Array,Float32:Float32Array};class gn{constructor(e,t){this._structArray=e,this._pos1=t*this.size,this._pos2=this._pos1/2,this._pos4=this._pos1/4,this._pos8=this._pos1/8}}class _n{constructor(){this.isTransferred=!1,this.capacity=-1,this.resize(0)}static serialize(e,t){return e._trim(),t&&(e.isTransferred=!0,t.push(e.arrayBuffer)),{length:e.length,arrayBuffer:e.arrayBuffer}}static deserialize(e){const t=Object.create(this.prototype);return t.arrayBuffer=e.arrayBuffer,t.length=e.length,t.capacity=e.arrayBuffer.byteLength/t.bytesPerElement,t._refreshViews(),t}_trim(){this.length!==this.capacity&&(this.capacity=this.length,this.arrayBuffer=this.arrayBuffer.slice(0,this.length*this.bytesPerElement),this._refreshViews())}clear(){this.length=0}resize(e){this.reserve(e),this.length=e}reserve(e){if(e>this.capacity){this.capacity=Math.max(e,Math.floor(5*this.capacity),128),this.arrayBuffer=new ArrayBuffer(this.capacity*this.bytesPerElement);const t=this.uint8;this._refreshViews(),t&&this.uint8.set(t)}}_refreshViews(){throw new Error("_refreshViews() must be implemented by each concrete StructArray layout")}}function bn(e,t=1){let r=0,i=0;return{members:e.map((e=>{const n=yn[e.type].BYTES_PER_ELEMENT,o=r=vn(r,Math.max(t,n)),a=e.components||1;return i=Math.max(i,n),r+=n*a,{name:e.name,type:e.type,components:a,offset:o}})),size:vn(r,Math.max(i,t)),alignment:t}}function vn(e,t){return Math.ceil(e/t)*t}class xn extends _n{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const i=2*e;return this.int16[i+0]=t,this.int16[i+1]=r,e}}xn.prototype.bytesPerElement=4,ki("StructArrayLayout2i4",xn);class wn extends _n{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){const o=4*e;return this.int16[o+0]=t,this.int16[o+1]=r,this.int16[o+2]=i,this.int16[o+3]=n,e}}wn.prototype.bytesPerElement=8,ki("StructArrayLayout4i8",wn);class Sn extends _n{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,i,n,o)}emplace(e,t,r,i,n,o,a){const s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=i,this.int16[s+3]=n,this.int16[s+4]=o,this.int16[s+5]=a,e}}Sn.prototype.bytesPerElement=12,ki("StructArrayLayout2i4i12",Sn);class En extends _n{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,i,n,o)}emplace(e,t,r,i,n,o,a){const s=4*e,l=8*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.uint8[l+4]=i,this.uint8[l+5]=n,this.uint8[l+6]=o,this.uint8[l+7]=a,e}}En.prototype.bytesPerElement=8,ki("StructArrayLayout2i4ub8",En);class Tn extends _n{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const i=2*e;return this.float32[i+0]=t,this.float32[i+1]=r,e}}Tn.prototype.bytesPerElement=8,ki("StructArrayLayout2f8",Tn);class kn extends _n{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o,a,s,l,c){const u=this.length;return this.resize(u+1),this.emplace(u,e,t,r,i,n,o,a,s,l,c)}emplace(e,t,r,i,n,o,a,s,l,c,u){const h=10*e;return this.uint16[h+0]=t,this.uint16[h+1]=r,this.uint16[h+2]=i,this.uint16[h+3]=n,this.uint16[h+4]=o,this.uint16[h+5]=a,this.uint16[h+6]=s,this.uint16[h+7]=l,this.uint16[h+8]=c,this.uint16[h+9]=u,e}}kn.prototype.bytesPerElement=20,ki("StructArrayLayout10ui20",kn);class An extends _n{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o,a,s,l,c,u,h){const p=this.length;return this.resize(p+1),this.emplace(p,e,t,r,i,n,o,a,s,l,c,u,h)}emplace(e,t,r,i,n,o,a,s,l,c,u,h,p){const d=12*e;return this.int16[d+0]=t,this.int16[d+1]=r,this.int16[d+2]=i,this.int16[d+3]=n,this.uint16[d+4]=o,this.uint16[d+5]=a,this.uint16[d+6]=s,this.uint16[d+7]=l,this.int16[d+8]=c,this.int16[d+9]=u,this.int16[d+10]=h,this.int16[d+11]=p,e}}An.prototype.bytesPerElement=24,ki("StructArrayLayout4i4ui4i24",An);class In extends _n{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){const n=3*e;return this.float32[n+0]=t,this.float32[n+1]=r,this.float32[n+2]=i,e}}In.prototype.bytesPerElement=12,ki("StructArrayLayout3f12",In);class Pn extends _n{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint32[1*e+0]=t,e}}Pn.prototype.bytesPerElement=4,ki("StructArrayLayout1ul4",Pn);class Cn extends _n{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o,a,s,l){const c=this.length;return this.resize(c+1),this.emplace(c,e,t,r,i,n,o,a,s,l)}emplace(e,t,r,i,n,o,a,s,l,c){const u=10*e,h=5*e;return this.int16[u+0]=t,this.int16[u+1]=r,this.int16[u+2]=i,this.int16[u+3]=n,this.int16[u+4]=o,this.int16[u+5]=a,this.uint32[h+3]=s,this.uint16[u+8]=l,this.uint16[u+9]=c,e}}Cn.prototype.bytesPerElement=20,ki("StructArrayLayout6i1ul2ui20",Cn);class zn extends _n{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n,o){const a=this.length;return this.resize(a+1),this.emplace(a,e,t,r,i,n,o)}emplace(e,t,r,i,n,o,a){const s=6*e;return this.int16[s+0]=t,this.int16[s+1]=r,this.int16[s+2]=i,this.int16[s+3]=n,this.int16[s+4]=o,this.int16[s+5]=a,e}}zn.prototype.bytesPerElement=12,ki("StructArrayLayout2i2i2i12",zn);class Mn extends _n{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r,i,n){const o=this.length;return this.resize(o+1),this.emplace(o,e,t,r,i,n)}emplace(e,t,r,i,n,o){const a=4*e,s=8*e;return this.float32[a+0]=t,this.float32[a+1]=r,this.float32[a+2]=i,this.int16[s+6]=n,this.int16[s+7]=o,e}}Mn.prototype.bytesPerElement=16,ki("StructArrayLayout2f1f2i16",Mn);class On extends _n{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){const o=12*e,a=3*e;return this.uint8[o+0]=t,this.uint8[o+1]=r,this.float32[a+1]=i,this.float32[a+2]=n,e}}On.prototype.bytesPerElement=12,ki("StructArrayLayout2ub2f12",On);class Dn extends _n{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){const n=3*e;return this.uint16[n+0]=t,this.uint16[n+1]=r,this.uint16[n+2]=i,e}}Dn.prototype.bytesPerElement=6,ki("StructArrayLayout3ui6",Dn);class Ln extends _n{_refreshViews(){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)}emplaceBack(e,t,r,i,n,o,a,s,l,c,u,h,p,d,f,m,y){const g=this.length;return this.resize(g+1),this.emplace(g,e,t,r,i,n,o,a,s,l,c,u,h,p,d,f,m,y)}emplace(e,t,r,i,n,o,a,s,l,c,u,h,p,d,f,m,y,g){const _=24*e,b=12*e,v=48*e;return this.int16[_+0]=t,this.int16[_+1]=r,this.uint16[_+2]=i,this.uint16[_+3]=n,this.uint32[b+2]=o,this.uint32[b+3]=a,this.uint32[b+4]=s,this.uint16[_+10]=l,this.uint16[_+11]=c,this.uint16[_+12]=u,this.float32[b+7]=h,this.float32[b+8]=p,this.uint8[v+36]=d,this.uint8[v+37]=f,this.uint8[v+38]=m,this.uint32[b+10]=y,this.int16[_+22]=g,e}}Ln.prototype.bytesPerElement=48,ki("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48",Ln);class jn extends _n{_refreshViews(){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)}emplaceBack(e,t,r,i,n,o,a,s,l,c,u,h,p,d,f,m,y,g,_,b,v,x,w,S,E,T,k,A){const I=this.length;return this.resize(I+1),this.emplace(I,e,t,r,i,n,o,a,s,l,c,u,h,p,d,f,m,y,g,_,b,v,x,w,S,E,T,k,A)}emplace(e,t,r,i,n,o,a,s,l,c,u,h,p,d,f,m,y,g,_,b,v,x,w,S,E,T,k,A,I){const P=34*e,C=17*e;return this.int16[P+0]=t,this.int16[P+1]=r,this.int16[P+2]=i,this.int16[P+3]=n,this.int16[P+4]=o,this.int16[P+5]=a,this.int16[P+6]=s,this.int16[P+7]=l,this.uint16[P+8]=c,this.uint16[P+9]=u,this.uint16[P+10]=h,this.uint16[P+11]=p,this.uint16[P+12]=d,this.uint16[P+13]=f,this.uint16[P+14]=m,this.uint16[P+15]=y,this.uint16[P+16]=g,this.uint16[P+17]=_,this.uint16[P+18]=b,this.uint16[P+19]=v,this.uint16[P+20]=x,this.uint16[P+21]=w,this.uint16[P+22]=S,this.uint32[C+12]=E,this.float32[C+13]=T,this.float32[C+14]=k,this.float32[C+15]=A,this.float32[C+16]=I,e}}jn.prototype.bytesPerElement=68,ki("StructArrayLayout8i15ui1ul4f68",jn);class Rn extends _n{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.float32[1*e+0]=t,e}}Rn.prototype.bytesPerElement=4,ki("StructArrayLayout1f4",Rn);class Bn extends _n{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.int16=new Int16Array(this.arrayBuffer)}emplaceBack(e,t,r){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){const n=3*e;return this.int16[n+0]=t,this.int16[n+1]=r,this.int16[n+2]=i,e}}Bn.prototype.bytesPerElement=6,ki("StructArrayLayout3i6",Bn);class Fn extends _n{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint32=new Uint32Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t,r){const i=this.length;return this.resize(i+1),this.emplace(i,e,t,r)}emplace(e,t,r,i){const n=4*e;return this.uint32[2*e+0]=t,this.uint16[n+2]=r,this.uint16[n+3]=i,e}}Fn.prototype.bytesPerElement=8,ki("StructArrayLayout1ul2ui8",Fn);class Nn extends _n{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e,t){const r=this.length;return this.resize(r+1),this.emplace(r,e,t)}emplace(e,t,r){const i=2*e;return this.uint16[i+0]=t,this.uint16[i+1]=r,e}}Nn.prototype.bytesPerElement=4,ki("StructArrayLayout2ui4",Nn);class Un extends _n{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.uint16=new Uint16Array(this.arrayBuffer)}emplaceBack(e){const t=this.length;return this.resize(t+1),this.emplace(t,e)}emplace(e,t){return this.uint16[1*e+0]=t,e}}Un.prototype.bytesPerElement=2,ki("StructArrayLayout1ui2",Un);class Vn extends _n{_refreshViews(){this.uint8=new Uint8Array(this.arrayBuffer),this.float32=new Float32Array(this.arrayBuffer)}emplaceBack(e,t,r,i){const n=this.length;return this.resize(n+1),this.emplace(n,e,t,r,i)}emplace(e,t,r,i,n){const o=4*e;return this.float32[o+0]=t,this.float32[o+1]=r,this.float32[o+2]=i,this.float32[o+3]=n,e}}Vn.prototype.bytesPerElement=16,ki("StructArrayLayout4f16",Vn);class qn extends gn{get anchorPointX(){return this._structArray.int16[this._pos2+0]}get anchorPointY(){return this._structArray.int16[this._pos2+1]}get x1(){return this._structArray.int16[this._pos2+2]}get y1(){return this._structArray.int16[this._pos2+3]}get x2(){return this._structArray.int16[this._pos2+4]}get y2(){return this._structArray.int16[this._pos2+5]}get featureIndex(){return this._structArray.uint32[this._pos4+3]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+8]}get bucketIndex(){return this._structArray.uint16[this._pos2+9]}get anchorPoint(){return new T(this.anchorPointX,this.anchorPointY)}}qn.prototype.size=20;class $n extends Cn{get(e){return new qn(this,e)}}ki("CollisionBoxArray",$n);class Gn extends gn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get glyphStartIndex(){return this._structArray.uint16[this._pos2+2]}get numGlyphs(){return this._structArray.uint16[this._pos2+3]}get vertexStartIndex(){return this._structArray.uint32[this._pos4+2]}get lineStartIndex(){return this._structArray.uint32[this._pos4+3]}get lineLength(){return this._structArray.uint32[this._pos4+4]}get segment(){return this._structArray.uint16[this._pos2+10]}get lowerSize(){return this._structArray.uint16[this._pos2+11]}get upperSize(){return this._structArray.uint16[this._pos2+12]}get lineOffsetX(){return this._structArray.float32[this._pos4+7]}get lineOffsetY(){return this._structArray.float32[this._pos4+8]}get writingMode(){return this._structArray.uint8[this._pos1+36]}get placedOrientation(){return this._structArray.uint8[this._pos1+37]}set placedOrientation(e){this._structArray.uint8[this._pos1+37]=e}get hidden(){return this._structArray.uint8[this._pos1+38]}set hidden(e){this._structArray.uint8[this._pos1+38]=e}get crossTileID(){return this._structArray.uint32[this._pos4+10]}set crossTileID(e){this._structArray.uint32[this._pos4+10]=e}get associatedIconIndex(){return this._structArray.int16[this._pos2+22]}}Gn.prototype.size=48;class Zn extends Ln{get(e){return new Gn(this,e)}}ki("PlacedSymbolArray",Zn);class Wn extends gn{get anchorX(){return this._structArray.int16[this._pos2+0]}get anchorY(){return this._structArray.int16[this._pos2+1]}get rightJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+2]}get centerJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+3]}get leftJustifiedTextSymbolIndex(){return this._structArray.int16[this._pos2+4]}get verticalPlacedTextSymbolIndex(){return this._structArray.int16[this._pos2+5]}get placedIconSymbolIndex(){return this._structArray.int16[this._pos2+6]}get verticalPlacedIconSymbolIndex(){return this._structArray.int16[this._pos2+7]}get key(){return this._structArray.uint16[this._pos2+8]}get textBoxStartIndex(){return this._structArray.uint16[this._pos2+9]}get textBoxEndIndex(){return this._structArray.uint16[this._pos2+10]}get verticalTextBoxStartIndex(){return this._structArray.uint16[this._pos2+11]}get verticalTextBoxEndIndex(){return this._structArray.uint16[this._pos2+12]}get iconBoxStartIndex(){return this._structArray.uint16[this._pos2+13]}get iconBoxEndIndex(){return this._structArray.uint16[this._pos2+14]}get verticalIconBoxStartIndex(){return this._structArray.uint16[this._pos2+15]}get verticalIconBoxEndIndex(){return this._structArray.uint16[this._pos2+16]}get featureIndex(){return this._structArray.uint16[this._pos2+17]}get numHorizontalGlyphVertices(){return this._structArray.uint16[this._pos2+18]}get numVerticalGlyphVertices(){return this._structArray.uint16[this._pos2+19]}get numIconVertices(){return this._structArray.uint16[this._pos2+20]}get numVerticalIconVertices(){return this._structArray.uint16[this._pos2+21]}get useRuntimeCollisionCircles(){return this._structArray.uint16[this._pos2+22]}get crossTileID(){return this._structArray.uint32[this._pos4+12]}set crossTileID(e){this._structArray.uint32[this._pos4+12]=e}get textBoxScale(){return this._structArray.float32[this._pos4+13]}get textOffset0(){return this._structArray.float32[this._pos4+14]}get textOffset1(){return this._structArray.float32[this._pos4+15]}get collisionCircleDiameter(){return this._structArray.float32[this._pos4+16]}}Wn.prototype.size=68;class Xn extends jn{get(e){return new Wn(this,e)}}ki("SymbolInstanceArray",Xn);class Kn extends Rn{getoffsetX(e){return this.float32[1*e+0]}}ki("GlyphOffsetArray",Kn);class Hn extends Bn{getx(e){return this.int16[3*e+0]}gety(e){return this.int16[3*e+1]}gettileUnitDistanceFromAnchor(e){return this.int16[3*e+2]}}ki("SymbolLineVertexArray",Hn);class Jn extends gn{get featureIndex(){return this._structArray.uint32[this._pos4+0]}get sourceLayerIndex(){return this._structArray.uint16[this._pos2+2]}get bucketIndex(){return this._structArray.uint16[this._pos2+3]}}Jn.prototype.size=8;class Yn extends Fn{get(e){return new Jn(this,e)}}ki("FeatureIndexArray",Yn);class Qn extends xn{}class eo extends xn{}class to extends xn{}class ro extends Sn{}class io extends En{}class no extends Tn{}class oo extends kn{}class ao extends An{}class so extends In{}class lo extends Pn{}class co extends zn{}class uo extends On{}class ho extends Dn{}class po extends Nn{}const fo=bn([{name:"a_pos",components:2,type:"Int16"}],4),{members:mo}=fo;class yo{constructor(e=[]){this.segments=e}prepareSegment(e,t,r,i){let n=this.segments[this.segments.length-1];return e>yo.MAX_VERTEX_ARRAY_LENGTH&&f(`Max vertices per segment is ${yo.MAX_VERTEX_ARRAY_LENGTH}: bucket requested ${e}`),(!n||n.vertexLength+e>yo.MAX_VERTEX_ARRAY_LENGTH||n.sortKey!==i)&&(n={vertexOffset:t.length,primitiveOffset:r.length,vertexLength:0,primitiveLength:0},void 0!==i&&(n.sortKey=i),this.segments.push(n)),n}get(){return this.segments}destroy(){for(const e of this.segments)for(const t in e.vaos)e.vaos[t].destroy()}static simpleSegment(e,t,r,i){return new yo([{vertexOffset:e,primitiveOffset:t,vertexLength:r,primitiveLength:i,vaos:{},sortKey:0}])}}function go(e,t){return 256*(e=o(Math.floor(e),0,255))+o(Math.floor(t),0,255)}yo.MAX_VERTEX_ARRAY_LENGTH=Math.pow(2,16)-1,ki("SegmentVector",yo);const _o=bn([{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"}]);var bo={exports:{}},vo={exports:{}};vo.exports=function(e,t){var r,i,n,o,a,s,l,c;for(i=e.length-(r=3&e.length),n=t,a=3432918353,s=461845907,c=0;c<i;)l=255&e.charCodeAt(c)|(255&e.charCodeAt(++c))<<8|(255&e.charCodeAt(++c))<<16|(255&e.charCodeAt(++c))<<24,++c,n=27492+(65535&(o=5*(65535&(n=(n^=l=(65535&(l=(l=(65535&l)*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295)<<13|n>>>19))+((5*(n>>>16)&65535)<<16)&4294967295))+((58964+(o>>>16)&65535)<<16);switch(l=0,r){case 3:l^=(255&e.charCodeAt(c+2))<<16;case 2:l^=(255&e.charCodeAt(c+1))<<8;case 1:n^=l=(65535&(l=(l=(65535&(l^=255&e.charCodeAt(c)))*a+(((l>>>16)*a&65535)<<16)&4294967295)<<15|l>>>17))*s+(((l>>>16)*s&65535)<<16)&4294967295}return n^=e.length,n=2246822507*(65535&(n^=n>>>16))+((2246822507*(n>>>16)&65535)<<16)&4294967295,n=3266489909*(65535&(n^=n>>>13))+((3266489909*(n>>>16)&65535)<<16)&4294967295,(n^=n>>>16)>>>0};var xo={exports:{}};xo.exports=function(e,t){for(var r,i=e.length,n=t^i,o=0;i>=4;)r=1540483477*(65535&(r=255&e.charCodeAt(o)|(255&e.charCodeAt(++o))<<8|(255&e.charCodeAt(++o))<<16|(255&e.charCodeAt(++o))<<24))+((1540483477*(r>>>16)&65535)<<16),n=1540483477*(65535&n)+((1540483477*(n>>>16)&65535)<<16)^(r=1540483477*(65535&(r^=r>>>24))+((1540483477*(r>>>16)&65535)<<16)),i-=4,++o;switch(i){case 3:n^=(255&e.charCodeAt(o+2))<<16;case 2:n^=(255&e.charCodeAt(o+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(o)))+((1540483477*(n>>>16)&65535)<<16)}return n=1540483477*(65535&(n^=n>>>13))+((1540483477*(n>>>16)&65535)<<16),(n^=n>>>15)>>>0};var wo=vo.exports,So=xo.exports;bo.exports=wo,bo.exports.murmur3=wo,bo.exports.murmur2=So;class Eo{constructor(){this.ids=[],this.positions=[],this.indexed=!1}add(e,t,r,i){this.ids.push(To(e)),this.positions.push(t,r,i)}getPositions(e){if(!this.indexed)throw new Error("Trying to get index, but feature positions are not indexed");const t=To(e);let r=0,i=this.ids.length-1;for(;r<i;){const e=r+i>>1;this.ids[e]>=t?i=e:r=e+1}const n=[];for(;this.ids[r]===t;)n.push({index:this.positions[3*r],start:this.positions[3*r+1],end:this.positions[3*r+2]}),r++;return n}static serialize(e,t){const r=new Float64Array(e.ids),i=new Uint32Array(e.positions);return ko(r,i,0,r.length-1),t&&t.push(r.buffer,i.buffer),{ids:r,positions:i}}static deserialize(e){const t=new Eo;return t.ids=e.ids,t.positions=e.positions,t.indexed=!0,t}}function To(e){const t=+e;return!isNaN(t)&&t<=Number.MAX_SAFE_INTEGER?t:bo.exports(String(e))}function ko(e,t,r,i){for(;r<i;){const n=e[r+i>>1];let o=r-1,a=i+1;for(;;){do{o++}while(e[o]<n);do{a--}while(e[a]>n);if(o>=a)break;Ao(e,o,a),Ao(t,3*o,3*a),Ao(t,3*o+1,3*a+1),Ao(t,3*o+2,3*a+2)}a-r<i-a?(ko(e,t,r,a),r=a+1):(ko(e,t,a+1,i),i=a)}}function Ao(e,t,r){const i=e[t];e[t]=e[r],e[r]=i}ki("FeaturePositionMap",Eo);class Io{constructor(e,t){this.gl=e.gl,this.location=t}}class Po extends Io{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1f(this.location,e))}}class Co extends Io{constructor(e,t){super(e,t),this.current=[0,0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]&&e[3]===this.current[3]||(this.current=e,this.gl.uniform4f(this.location,e[0],e[1],e[2],e[3]))}}class zo extends Io{constructor(e,t){super(e,t),this.current=De.transparent}set(e){e.r===this.current.r&&e.g===this.current.g&&e.b===this.current.b&&e.a===this.current.a||(this.current=e,this.gl.uniform4f(this.location,e.r,e.g,e.b,e.a))}}const Mo=new Float32Array(16);function Oo(e){return[go(255*e.r,255*e.g),go(255*e.b,255*e.a)]}class Do{constructor(e,t,r){this.value=e,this.uniformNames=t.map((e=>`u_${e}`)),this.type=r}setUniform(e,t,r){e.set(r.constantOr(this.value))}getBinding(e,t,r){return"color"===this.type?new zo(e,t):new Po(e,t)}}class Lo{constructor(e,t){this.uniformNames=t.map((e=>`u_${e}`)),this.patternFrom=null,this.patternTo=null,this.pixelRatioFrom=1,this.pixelRatioTo=1}setConstantPatternPositions(e,t){this.pixelRatioFrom=t.pixelRatio,this.pixelRatioTo=e.pixelRatio,this.patternFrom=t.tlbr,this.patternTo=e.tlbr}setUniform(e,t,r,i){const n="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;n&&e.set(n)}getBinding(e,t,r){return"u_pattern"===r.substr(0,9)?new Co(e,t):new Po(e,t)}}class jo{constructor(e,t,r,i){this.expression=e,this.type=r,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===r?2:1,offset:0}))),this.paintVertexArray=new i}populatePaintArray(e,t,r,i,n){const o=this.paintVertexArray.length,a=this.expression.evaluate(new Yi(0),t,{},i,[],n);this.paintVertexArray.resize(e),this._setPaintValue(o,e,a)}updatePaintArray(e,t,r,i){const n=this.expression.evaluate({zoom:0},r,i);this._setPaintValue(e,t,n)}_setPaintValue(e,t,r){if("color"===this.type){const i=Oo(r);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,i[0],i[1])}else{for(let i=e;i<t;i++)this.paintVertexArray.emplace(i,r);this.maxValue=Math.max(this.maxValue,Math.abs(r))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}}class Ro{constructor(e,t,r,i,n,o){this.expression=e,this.uniformNames=t.map((e=>`u_${e}_t`)),this.type=r,this.useIntegerZoom=i,this.zoom=n,this.maxValue=0,this.paintVertexAttributes=t.map((e=>({name:`a_${e}`,type:"Float32",components:"color"===r?4:2,offset:0}))),this.paintVertexArray=new o}populatePaintArray(e,t,r,i,n){const o=this.expression.evaluate(new Yi(this.zoom),t,{},i,[],n),a=this.expression.evaluate(new Yi(this.zoom+1),t,{},i,[],n),s=this.paintVertexArray.length;this.paintVertexArray.resize(e),this._setPaintValue(s,e,o,a)}updatePaintArray(e,t,r,i){const n=this.expression.evaluate({zoom:this.zoom},r,i),o=this.expression.evaluate({zoom:this.zoom+1},r,i);this._setPaintValue(e,t,n,o)}_setPaintValue(e,t,r,i){if("color"===this.type){const n=Oo(r),o=Oo(i);for(let r=e;r<t;r++)this.paintVertexArray.emplace(r,n[0],n[1],o[0],o[1])}else{for(let n=e;n<t;n++)this.paintVertexArray.emplace(n,r,i);this.maxValue=Math.max(this.maxValue,Math.abs(r),Math.abs(i))}}upload(e){this.paintVertexArray&&this.paintVertexArray.arrayBuffer&&(this.paintVertexBuffer&&this.paintVertexBuffer.buffer?this.paintVertexBuffer.updateData(this.paintVertexArray):this.paintVertexBuffer=e.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes,this.expression.isStateDependent))}destroy(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}setUniform(e,t){const r=this.useIntegerZoom?Math.floor(t.zoom):t.zoom,i=o(this.expression.interpolationFactor(r,this.zoom,this.zoom+1),0,1);e.set(i)}getBinding(e,t,r){return new Po(e,t)}}class Bo{constructor(e,t,r,i,n,o){this.expression=e,this.type=t,this.useIntegerZoom=r,this.zoom=i,this.layerId=o,this.zoomInPaintVertexArray=new n,this.zoomOutPaintVertexArray=new n}populatePaintArray(e,t,r){const i=this.zoomInPaintVertexArray.length;this.zoomInPaintVertexArray.resize(e),this.zoomOutPaintVertexArray.resize(e),this._setPaintValues(i,e,t.patterns&&t.patterns[this.layerId],r)}updatePaintArray(e,t,r,i,n){this._setPaintValues(e,t,r.patterns&&r.patterns[this.layerId],n)}_setPaintValues(e,t,r,i){if(!i||!r)return;const{min:n,mid:o,max:a}=r,s=i[n],l=i[o],c=i[a];if(s&&l&&c)for(let r=e;r<t;r++)this.zoomInPaintVertexArray.emplace(r,l.tl[0],l.tl[1],l.br[0],l.br[1],s.tl[0],s.tl[1],s.br[0],s.br[1],l.pixelRatio,s.pixelRatio),this.zoomOutPaintVertexArray.emplace(r,l.tl[0],l.tl[1],l.br[0],l.br[1],c.tl[0],c.tl[1],c.br[0],c.br[1],l.pixelRatio,c.pixelRatio)}upload(e){this.zoomInPaintVertexArray&&this.zoomInPaintVertexArray.arrayBuffer&&this.zoomOutPaintVertexArray&&this.zoomOutPaintVertexArray.arrayBuffer&&(this.zoomInPaintVertexBuffer=e.createVertexBuffer(this.zoomInPaintVertexArray,_o.members,this.expression.isStateDependent),this.zoomOutPaintVertexBuffer=e.createVertexBuffer(this.zoomOutPaintVertexArray,_o.members,this.expression.isStateDependent))}destroy(){this.zoomOutPaintVertexBuffer&&this.zoomOutPaintVertexBuffer.destroy(),this.zoomInPaintVertexBuffer&&this.zoomInPaintVertexBuffer.destroy()}}class Fo{constructor(e,t,r){this.binders={},this._buffers=[];const i=[];for(const n in e.paint._values){if(!r(n))continue;const o=e.paint.get(n);if(!(o instanceof an&&vr(o.property.specification)))continue;const a=Uo(n,e.type),s=o.value,l=o.property.specification.type,c=o.property.useIntegerZoom,u=o.property.specification["property-type"],h="cross-faded"===u||"cross-faded-data-driven"===u;if("constant"===s.kind)this.binders[n]=h?new Lo(s.value,a):new Do(s.value,a,l),i.push(`/u_${n}`);else if("source"===s.kind||h){const r=Vo(n,l,"source");this.binders[n]=h?new Bo(s,l,c,t,r,e.id):new jo(s,a,l,r),i.push(`/a_${n}`)}else{const e=Vo(n,l,"composite");this.binders[n]=new Ro(s,a,l,c,t,e),i.push(`/z_${n}`)}}this.cacheKey=i.sort().join("")}getMaxValue(e){const t=this.binders[e];return t instanceof jo||t instanceof Ro?t.maxValue:0}populatePaintArrays(e,t,r,i,n){for(const o in this.binders){const a=this.binders[o];(a instanceof jo||a instanceof Ro||a instanceof Bo)&&a.populatePaintArray(e,t,r,i,n)}}setConstantPatternPositions(e,t){for(const r in this.binders){const i=this.binders[r];i instanceof Lo&&i.setConstantPatternPositions(e,t)}}updatePaintArrays(e,t,r,i,n){let o=!1;for(const a in e){const s=t.getPositions(a);for(const t of s){const s=r.feature(t.index);for(const r in this.binders){const l=this.binders[r];if((l instanceof jo||l instanceof Ro||l instanceof Bo)&&!0===l.expression.isStateDependent){const c=i.paint.get(r);l.expression=c.value,l.updatePaintArray(t.start,t.end,s,e[a],n),o=!0}}}}return o}defines(){const e=[];for(const t in this.binders){const r=this.binders[t];(r instanceof Do||r instanceof Lo)&&e.push(...r.uniformNames.map((e=>`#define HAS_UNIFORM_${e}`)))}return e}getBinderAttributes(){const e=[];for(const t in this.binders){const r=this.binders[t];if(r instanceof jo||r instanceof Ro)for(let t=0;t<r.paintVertexAttributes.length;t++)e.push(r.paintVertexAttributes[t].name);else if(r instanceof Bo)for(let t=0;t<_o.members.length;t++)e.push(_o.members[t].name)}return e}getBinderUniforms(){const e=[];for(const t in this.binders){const r=this.binders[t];if(r instanceof Do||r instanceof Lo||r instanceof Ro)for(const t of r.uniformNames)e.push(t)}return e}getPaintVertexBuffers(){return this._buffers}getUniforms(e,t){const r=[];for(const i in this.binders){const n=this.binders[i];if(n instanceof Do||n instanceof Lo||n instanceof Ro)for(const o of n.uniformNames)if(t[o]){const a=n.getBinding(e,t[o],o);r.push({name:o,property:i,binding:a})}}return r}setUniforms(e,t,r,i){for(const{name:e,property:n,binding:o}of t)this.binders[n].setUniform(o,i,r.get(n),e)}updatePaintBuffers(e){this._buffers=[];for(const t in this.binders){const r=this.binders[t];if(e&&r instanceof Bo){const t=2===e.fromScale?r.zoomInPaintVertexBuffer:r.zoomOutPaintVertexBuffer;t&&this._buffers.push(t)}else(r instanceof jo||r instanceof Ro)&&r.paintVertexBuffer&&this._buffers.push(r.paintVertexBuffer)}}upload(e){for(const t in this.binders){const r=this.binders[t];(r instanceof jo||r instanceof Ro||r instanceof Bo)&&r.upload(e)}this.updatePaintBuffers()}destroy(){for(const e in this.binders){const t=this.binders[e];(t instanceof jo||t instanceof Ro||t instanceof Bo)&&t.destroy()}}}class No{constructor(e,t,r=(()=>!0)){this.programConfigurations={};for(const i of e)this.programConfigurations[i.id]=new Fo(i,t,r);this.needsUpload=!1,this._featureMap=new Eo,this._bufferOffset=0}populatePaintArrays(e,t,r,i,n,o){for(const r in this.programConfigurations)this.programConfigurations[r].populatePaintArrays(e,t,i,n,o);void 0!==t.id&&this._featureMap.add(t.id,r,this._bufferOffset,e),this._bufferOffset=e,this.needsUpload=!0}updatePaintArrays(e,t,r,i){for(const n of r)this.needsUpload=this.programConfigurations[n.id].updatePaintArrays(e,this._featureMap,t,n,i)||this.needsUpload}get(e){return this.programConfigurations[e]}upload(e){if(this.needsUpload){for(const t in this.programConfigurations)this.programConfigurations[t].upload(e);this.needsUpload=!1}}destroy(){for(const e in this.programConfigurations)this.programConfigurations[e].destroy()}}function Uo(e,t){return{"text-opacity":["opacity"],"icon-opacity":["opacity"],"text-color":["fill_color"],"icon-color":["fill_color"],"text-halo-color":["halo_color"],"icon-halo-color":["halo_color"],"text-halo-blur":["halo_blur"],"icon-halo-blur":["halo_blur"],"text-halo-width":["halo_width"],"icon-halo-width":["halo_width"],"line-gap-width":["gapwidth"],"line-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"],"fill-extrusion-pattern":["pattern_to","pattern_from","pixel_ratio_to","pixel_ratio_from"]}[e]||[e.replace(`${t}-`,"").replace(/-/g,"_")]}function Vo(e,t,r){const i={color:{source:Tn,composite:Vn},number:{source:Rn,composite:Tn}},n=function(e){return{"line-pattern":{source:oo,composite:oo},"fill-pattern":{source:oo,composite:oo},"fill-extrusion-pattern":{source:oo,composite:oo}}[e]}(e);return n&&n[r]||i[t][r]}ki("ConstantBinder",Do),ki("CrossFadedConstantBinder",Lo),ki("SourceExpressionBinder",jo),ki("CrossFadedCompositeBinder",Bo),ki("CompositeExpressionBinder",Ro),ki("ProgramConfiguration",Fo,{omit:["_buffers"]}),ki("ProgramConfigurationSet",No);var qo=8192;const $o=Math.pow(2,14)-1,Go=-$o-1;function Zo(e){const t=qo/e.extent,r=e.loadGeometry();for(let e=0;e<r.length;e++){const i=r[e];for(let e=0;e<i.length;e++){const r=i[e],n=Math.round(r.x*t),a=Math.round(r.y*t);r.x=o(n,Go,$o),r.y=o(a,Go,$o),(n<r.x||n>r.x+1||a<r.y||a>r.y+1)&&f("Geometry exceeds allowed extent, reduce your vector tile buffer size")}}return r}function Wo(e,t){return{type:e.type,id:e.id,properties:e.properties,geometry:t?Zo(e):[]}}function Xo(e,t,r,i,n){e.emplaceBack(2*t+(i+1)/2,2*r+(n+1)/2)}class Ko{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new eo,this.indexArray=new ho,this.segments=new yo,this.programConfigurations=new No(e.layers,e.zoom),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){const i=this.layers[0],n=[];let o=null,a=!1;"circle"===i.type&&(o=i.layout.get("circle-sort-key"),a=!o.isConstant());for(const{feature:t,id:i,index:s,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,c=Wo(t,e);if(!this.layers[0]._featureFilter.filter(new Yi(this.zoom),c,r))continue;const u=a?o.evaluate(c,{},r):void 0,h={id:i,properties:t.properties,type:t.type,sourceLayerIndex:l,index:s,geometry:e?c.geometry:Zo(t),patterns:{},sortKey:u};n.push(h)}a&&n.sort(((e,t)=>e.sortKey-t.sortKey));for(const i of n){const{geometry:n,index:o,sourceLayerIndex:a}=i,s=e[o].feature;this.addFeature(i,n,o,r),t.featureIndex.insert(s,n,o,a,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,mo),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}addFeature(e,t,r,i){for(const r of t)for(const t of r){const r=t.x,i=t.y;if(r<0||r>=qo||i<0||i>=qo)continue;const n=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray,e.sortKey),o=n.vertexLength;Xo(this.layoutVertexArray,r,i,-1,-1),Xo(this.layoutVertexArray,r,i,1,-1),Xo(this.layoutVertexArray,r,i,1,1),Xo(this.layoutVertexArray,r,i,-1,1),this.indexArray.emplaceBack(o,o+1,o+2),this.indexArray.emplaceBack(o,o+3,o+2),n.vertexLength+=4,n.primitiveLength+=2}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,{},i)}}function Ho(e,t){for(let r=0;r<e.length;r++)if(oa(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(oa(e,t[r]))return!0;return!!ea(e,t)}function Jo(e,t,r){return!!oa(e,t)||!!ra(t,e,r)}function Yo(e,t){if(1===e.length)return na(t,e[0]);for(let r=0;r<t.length;r++){const i=t[r];for(let t=0;t<i.length;t++)if(oa(e,i[t]))return!0}for(let r=0;r<e.length;r++)if(na(t,e[r]))return!0;for(let r=0;r<t.length;r++)if(ea(e,t[r]))return!0;return!1}function Qo(e,t,r){if(e.length>1){if(ea(e,t))return!0;for(let i=0;i<t.length;i++)if(ra(t[i],e,r))return!0}for(let i=0;i<e.length;i++)if(ra(e[i],t,r))return!0;return!1}function ea(e,t){if(0===e.length||0===t.length)return!1;for(let r=0;r<e.length-1;r++){const i=e[r],n=e[r+1];for(let e=0;e<t.length-1;e++)if(ta(i,n,t[e],t[e+1]))return!0}return!1}function ta(e,t,r,i){return m(e,r,i)!==m(t,r,i)&&m(e,t,r)!==m(e,t,i)}function ra(e,t,r){const i=r*r;if(1===t.length)return e.distSqr(t[0])<i;for(let r=1;r<t.length;r++)if(ia(e,t[r-1],t[r])<i)return!0;return!1}function ia(e,t,r){const i=t.distSqr(r);if(0===i)return e.distSqr(t);const n=((e.x-t.x)*(r.x-t.x)+(e.y-t.y)*(r.y-t.y))/i;return e.distSqr(n<0?t:n>1?r:r.sub(t)._mult(n)._add(t))}function na(e,t){let r,i,n,o=!1;for(let a=0;a<e.length;a++){r=e[a];for(let e=0,a=r.length-1;e<r.length;a=e++)i=r[e],n=r[a],i.y>t.y!=n.y>t.y&&t.x<(n.x-i.x)*(t.y-i.y)/(n.y-i.y)+i.x&&(o=!o)}return o}function oa(e,t){let r=!1;for(let i=0,n=e.length-1;i<e.length;n=i++){const o=e[i],a=e[n];o.y>t.y!=a.y>t.y&&t.x<(a.x-o.x)*(t.y-o.y)/(a.y-o.y)+o.x&&(r=!r)}return r}function aa(e,t,r){const i=r[0],n=r[2];if(e.x<i.x&&t.x<i.x||e.x>n.x&&t.x>n.x||e.y<i.y&&t.y<i.y||e.y>n.y&&t.y>n.y)return!1;const o=m(e,t,r[0]);return o!==m(e,t,r[1])||o!==m(e,t,r[2])||o!==m(e,t,r[3])}function sa(e,t,r){const i=t.paint.get(e).value;return"constant"===i.kind?i.value:r.programConfigurations.get(t.id).getMaxValue(e)}function la(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1])}function ca(e,t,r,i,n){if(!t[0]&&!t[1])return e;const o=T.convert(t)._mult(n);"viewport"===r&&o._rotate(-i);const a=[];for(let t=0;t<e.length;t++)a.push(e[t].sub(o));return a}ki("CircleBucket",Ko,{omit:["layers"]});const ua=new dn({"circle-sort-key":new cn(ie.layout_circle["circle-sort-key"])});var ha={paint:new dn({"circle-radius":new cn(ie.paint_circle["circle-radius"]),"circle-color":new cn(ie.paint_circle["circle-color"]),"circle-blur":new cn(ie.paint_circle["circle-blur"]),"circle-opacity":new cn(ie.paint_circle["circle-opacity"]),"circle-translate":new ln(ie.paint_circle["circle-translate"]),"circle-translate-anchor":new ln(ie.paint_circle["circle-translate-anchor"]),"circle-pitch-scale":new ln(ie.paint_circle["circle-pitch-scale"]),"circle-pitch-alignment":new ln(ie.paint_circle["circle-pitch-alignment"]),"circle-stroke-width":new cn(ie.paint_circle["circle-stroke-width"]),"circle-stroke-color":new cn(ie.paint_circle["circle-stroke-color"]),"circle-stroke-opacity":new cn(ie.paint_circle["circle-stroke-opacity"])}),layout:ua},pa=1e-6,da="undefined"!=typeof Float32Array?Float32Array:Array;function fa(){var e=new da(9);return da!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ma(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function ya(e,t,r){var i=t[0],n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],d=t[10],f=t[11],m=t[12],y=t[13],g=t[14],_=t[15],b=r[0],v=r[1],x=r[2],w=r[3];return e[0]=b*i+v*s+x*h+w*m,e[1]=b*n+v*l+x*p+w*y,e[2]=b*o+v*c+x*d+w*g,e[3]=b*a+v*u+x*f+w*_,e[4]=(b=r[4])*i+(v=r[5])*s+(x=r[6])*h+(w=r[7])*m,e[5]=b*n+v*l+x*p+w*y,e[6]=b*o+v*c+x*d+w*g,e[7]=b*a+v*u+x*f+w*_,e[8]=(b=r[8])*i+(v=r[9])*s+(x=r[10])*h+(w=r[11])*m,e[9]=b*n+v*l+x*p+w*y,e[10]=b*o+v*c+x*d+w*g,e[11]=b*a+v*u+x*f+w*_,e[12]=(b=r[12])*i+(v=r[13])*s+(x=r[14])*h+(w=r[15])*m,e[13]=b*n+v*l+x*p+w*y,e[14]=b*o+v*c+x*d+w*g,e[15]=b*a+v*u+x*f+w*_,e}Math.hypot||(Math.hypot=function(){for(var e=0,t=arguments.length;t--;)e+=arguments[t]*arguments[t];return Math.sqrt(e)});var ga,_a=ya;function ba(){var e=new da(3);return da!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function va(e,t,r){var i=new da(3);return i[0]=e,i[1]=t,i[2]=r,i}function xa(e,t,r){var i=t[0],n=t[1],o=t[2],a=t[3];return e[0]=r[0]*i+r[4]*n+r[8]*o+r[12]*a,e[1]=r[1]*i+r[5]*n+r[9]*o+r[13]*a,e[2]=r[2]*i+r[6]*n+r[10]*o+r[14]*a,e[3]=r[3]*i+r[7]*n+r[11]*o+r[15]*a,e}function wa(){var e=new da(4);return da!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Sa(e,t){const r=xa([],[e.x,e.y,0,1],t);return new T(r[0]/r[3],r[1]/r[3])}ba(),ga=new da(4),da!=Float32Array&&(ga[0]=0,ga[1]=0,ga[2]=0,ga[3]=0),ba(),va(1,0,0),va(0,1,0),wa(),wa(),fa(),function(){var e;e=new da(2),da!=Float32Array&&(e[0]=0,e[1]=0)}();class Ea extends Ko{}ki("HeatmapBucket",Ea,{omit:["layers"]});var Ta={paint:new dn({"heatmap-radius":new cn(ie.paint_heatmap["heatmap-radius"]),"heatmap-weight":new cn(ie.paint_heatmap["heatmap-weight"]),"heatmap-intensity":new ln(ie.paint_heatmap["heatmap-intensity"]),"heatmap-color":new pn(ie.paint_heatmap["heatmap-color"]),"heatmap-opacity":new ln(ie.paint_heatmap["heatmap-opacity"])})};function ka(e,{width:t,height:r},i,n){if(n){if(n instanceof Uint8ClampedArray)n=new Uint8Array(n.buffer);else if(n.length!==t*r*i)throw new RangeError(`mismatched image size. expected: ${n.length} but got: ${t*r*i}`)}else n=new Uint8Array(t*r*i);return e.width=t,e.height=r,e.data=n,e}function Aa(e,{width:t,height:r},i){if(t===e.width&&r===e.height)return;const n=ka({},{width:t,height:r},i);Ia(e,n,{x:0,y:0},{x:0,y:0},{width:Math.min(e.width,t),height:Math.min(e.height,r)},i),e.width=t,e.height=r,e.data=n.data}function Ia(e,t,r,i,n,o){if(0===n.width||0===n.height)return t;if(n.width>e.width||n.height>e.height||r.x>e.width-n.width||r.y>e.height-n.height)throw new RangeError("out of range source coordinates for image copy");if(n.width>t.width||n.height>t.height||i.x>t.width-n.width||i.y>t.height-n.height)throw new RangeError("out of range destination coordinates for image copy");const a=e.data,s=t.data;if(a===s)throw new Error("srcData equals dstData, so image is already copied");for(let l=0;l<n.height;l++){const c=((r.y+l)*e.width+r.x)*o,u=((i.y+l)*t.width+i.x)*o;for(let e=0;e<n.width*o;e++)s[u+e]=a[c+e]}return t}class Pa{constructor(e,t){ka(this,e,1,t)}resize(e){Aa(this,e,1)}clone(){return new Pa({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,i,n){Ia(e,t,r,i,n,1)}}class Ca{constructor(e,t){ka(this,e,4,t)}resize(e){Aa(this,e,4)}replace(e,t){t?this.data.set(e):this.data=e instanceof Uint8ClampedArray?new Uint8Array(e.buffer):e}clone(){return new Ca({width:this.width,height:this.height},new Uint8Array(this.data))}static copy(e,t,r,i,n){Ia(e,t,r,i,n,4)}}function za(e){const t={},r=e.resolution||256,i=e.clips?e.clips.length:1,n=e.image||new Ca({width:r,height:i});if(Math.log(r)/Math.LN2%1!=0)throw new Error(`width is not a power of 2 - ${r}`);const o=(r,i,o)=>{t[e.evaluationKey]=o;const a=e.expression.evaluate(t);n.data[r+i+0]=Math.floor(255*a.r/a.a),n.data[r+i+1]=Math.floor(255*a.g/a.a),n.data[r+i+2]=Math.floor(255*a.b/a.a),n.data[r+i+3]=Math.floor(255*a.a)};if(e.clips)for(let t=0,n=0;t<i;++t,n+=4*r)for(let i=0,a=0;i<r;i++,a+=4){const s=i/(r-1),{start:l,end:c}=e.clips[t];o(n,a,l*(1-s)+c*s)}else for(let e=0,t=0;e<r;e++,t+=4)o(0,t,e/(r-1));return n}ki("AlphaImage",Pa),ki("RGBAImage",Ca);var Ma={paint:new dn({"hillshade-illumination-direction":new ln(ie.paint_hillshade["hillshade-illumination-direction"]),"hillshade-illumination-anchor":new ln(ie.paint_hillshade["hillshade-illumination-anchor"]),"hillshade-exaggeration":new ln(ie.paint_hillshade["hillshade-exaggeration"]),"hillshade-shadow-color":new ln(ie.paint_hillshade["hillshade-shadow-color"]),"hillshade-highlight-color":new ln(ie.paint_hillshade["hillshade-highlight-color"]),"hillshade-accent-color":new ln(ie.paint_hillshade["hillshade-accent-color"])})};const Oa=bn([{name:"a_pos",components:2,type:"Int16"}],4),{members:Da}=Oa;var La={exports:{}};function ja(e,t,r){r=r||2;var i,n,o,a,s,l,c,u=t&&t.length,h=u?t[0]*r:e.length,p=Ra(e,0,h,r,!0),d=[];if(!p||p.next===p.prev)return d;if(u&&(p=function(e,t,r,i){var n,o,a,s=[];for(n=0,o=t.length;n<o;n++)(a=Ra(e,t[n]*i,n<o-1?t[n+1]*i:e.length,i,!1))===a.next&&(a.steiner=!0),s.push(Xa(a));for(s.sort($a),n=0;n<s.length;n++)r=Ga(s[n],r);return r}(e,t,p,r)),e.length>80*r){i=o=e[0],n=a=e[1];for(var f=r;f<h;f+=r)(s=e[f])<i&&(i=s),(l=e[f+1])<n&&(n=l),s>o&&(o=s),l>a&&(a=l);c=0!==(c=Math.max(o-i,a-n))?32767/c:0}return Fa(p,d,r,i,n,c,0),d}function Ra(e,t,r,i,n){var o,a;if(n===ss(e,t,r,i)>0)for(o=t;o<r;o+=i)a=ns(o,e[o],e[o+1],a);else for(o=r-i;o>=t;o-=i)a=ns(o,e[o],e[o+1],a);return a&&Ya(a,a.next)&&(os(a),a=a.next),a}function Ba(e,t){if(!e)return e;t||(t=e);var r,i=e;do{if(r=!1,i.steiner||!Ya(i,i.next)&&0!==Ja(i.prev,i,i.next))i=i.next;else{if(os(i),(i=t=i.prev)===i.next)break;r=!0}}while(r||i!==t);return t}function Fa(e,t,r,i,n,o,a){if(e){!a&&o&&function(e,t,r,i){var n=e;do{0===n.z&&(n.z=Wa(n.x,n.y,t,r,i)),n.prevZ=n.prev,n.nextZ=n.next,n=n.next}while(n!==e);n.prevZ.nextZ=null,n.prevZ=null,function(e){var t,r,i,n,o,a,s,l,c=1;do{for(r=e,e=null,o=null,a=0;r;){for(a++,i=r,s=0,t=0;t<c&&(s++,i=i.nextZ);t++);for(l=c;s>0||l>0&&i;)0!==s&&(0===l||!i||r.z<=i.z)?(n=r,r=r.nextZ,s--):(n=i,i=i.nextZ,l--),o?o.nextZ=n:e=n,n.prevZ=o,o=n;r=i}o.nextZ=null,c*=2}while(a>1)}(n)}(e,i,n,o);for(var s,l,c=e;e.prev!==e.next;)if(s=e.prev,l=e.next,o?Ua(e,i,n,o):Na(e))t.push(s.i/r|0),t.push(e.i/r|0),t.push(l.i/r|0),os(e),e=l.next,c=l.next;else if((e=l)===c){a?1===a?Fa(e=Va(Ba(e),t,r),t,r,i,n,o,2):2===a&&qa(e,t,r,i,n,o):Fa(Ba(e),t,r,i,n,o,1);break}}}function Na(e){var t=e.prev,r=e,i=e.next;if(Ja(t,r,i)>=0)return!1;for(var n=t.x,o=r.x,a=i.x,s=t.y,l=r.y,c=i.y,u=n<o?n<a?n:a:o<a?o:a,h=s<l?s<c?s:c:l<c?l:c,p=n>o?n>a?n:a:o>a?o:a,d=s>l?s>c?s:c:l>c?l:c,f=i.next;f!==t;){if(f.x>=u&&f.x<=p&&f.y>=h&&f.y<=d&&Ka(n,s,o,l,a,c,f.x,f.y)&&Ja(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function Ua(e,t,r,i){var n=e.prev,o=e,a=e.next;if(Ja(n,o,a)>=0)return!1;for(var s=n.x,l=o.x,c=a.x,u=n.y,h=o.y,p=a.y,d=s<l?s<c?s:c:l<c?l:c,f=u<h?u<p?u:p:h<p?h:p,m=s>l?s>c?s:c:l>c?l:c,y=u>h?u>p?u:p:h>p?h:p,g=Wa(d,f,t,r,i),_=Wa(m,y,t,r,i),b=e.prevZ,v=e.nextZ;b&&b.z>=g&&v&&v.z<=_;){if(b.x>=d&&b.x<=m&&b.y>=f&&b.y<=y&&b!==n&&b!==a&&Ka(s,u,l,h,c,p,b.x,b.y)&&Ja(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,v.x>=d&&v.x<=m&&v.y>=f&&v.y<=y&&v!==n&&v!==a&&Ka(s,u,l,h,c,p,v.x,v.y)&&Ja(v.prev,v,v.next)>=0)return!1;v=v.nextZ}for(;b&&b.z>=g;){if(b.x>=d&&b.x<=m&&b.y>=f&&b.y<=y&&b!==n&&b!==a&&Ka(s,u,l,h,c,p,b.x,b.y)&&Ja(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;v&&v.z<=_;){if(v.x>=d&&v.x<=m&&v.y>=f&&v.y<=y&&v!==n&&v!==a&&Ka(s,u,l,h,c,p,v.x,v.y)&&Ja(v.prev,v,v.next)>=0)return!1;v=v.nextZ}return!0}function Va(e,t,r){var i=e;do{var n=i.prev,o=i.next.next;!Ya(n,o)&&Qa(n,i,i.next,o)&&rs(n,o)&&rs(o,n)&&(t.push(n.i/r|0),t.push(i.i/r|0),t.push(o.i/r|0),os(i),os(i.next),i=e=o),i=i.next}while(i!==e);return Ba(i)}function qa(e,t,r,i,n,o){var a=e;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&Ha(a,s)){var l=is(a,s);return a=Ba(a,a.next),l=Ba(l,l.next),Fa(a,t,r,i,n,o,0),void Fa(l,t,r,i,n,o,0)}s=s.next}a=a.next}while(a!==e)}function $a(e,t){return e.x-t.x}function Ga(e,t){var r=function(e,t){var r,i=t,n=e.x,o=e.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&&s>a&&(a=s,r=i.x<i.next.x?i:i.next,s===n))return r}i=i.next}while(i!==t);if(!r)return null;var l,c=r,u=r.x,h=r.y,p=1/0;i=r;do{n>=i.x&&i.x>=u&&n!==i.x&&Ka(o<h?n:a,o,u,h,o<h?a:n,o,i.x,i.y)&&(l=Math.abs(o-i.y)/(n-i.x),rs(i,e)&&(l<p||l===p&&(i.x>r.x||i.x===r.x&&Za(r,i)))&&(r=i,p=l)),i=i.next}while(i!==c);return r}(e,t);if(!r)return t;var i=is(r,e);return Ba(i,i.next),Ba(r,r.next)}function Za(e,t){return Ja(e.prev,e,t.prev)<0&&Ja(t.next,e,e.next)<0}function Wa(e,t,r,i,n){return(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=(e-r)*n|0)|e<<8))|e<<4))|e<<2))|e<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-i)*n|0)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function Xa(e){var t=e,r=e;do{(t.x<r.x||t.x===r.x&&t.y<r.y)&&(r=t),t=t.next}while(t!==e);return r}function Ka(e,t,r,i,n,o,a,s){return(n-a)*(t-s)>=(e-a)*(o-s)&&(e-a)*(i-s)>=(r-a)*(t-s)&&(r-a)*(o-s)>=(n-a)*(i-s)}function Ha(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!function(e,t){var r=e;do{if(r.i!==e.i&&r.next.i!==e.i&&r.i!==t.i&&r.next.i!==t.i&&Qa(r,r.next,e,t))return!0;r=r.next}while(r!==e);return!1}(e,t)&&(rs(e,t)&&rs(t,e)&&function(e,t){var r=e,i=!1,n=(e.x+t.x)/2,o=(e.y+t.y)/2;do{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}while(r!==e);return i}(e,t)&&(Ja(e.prev,e,t.prev)||Ja(e,t.prev,t))||Ya(e,t)&&Ja(e.prev,e,e.next)>0&&Ja(t.prev,t,t.next)>0)}function Ja(e,t,r){return(t.y-e.y)*(r.x-t.x)-(t.x-e.x)*(r.y-t.y)}function Ya(e,t){return e.x===t.x&&e.y===t.y}function Qa(e,t,r,i){var n=ts(Ja(e,t,r)),o=ts(Ja(e,t,i)),a=ts(Ja(r,i,e)),s=ts(Ja(r,i,t));return n!==o&&a!==s||!(0!==n||!es(e,r,t))||!(0!==o||!es(e,i,t))||!(0!==a||!es(r,e,i))||!(0!==s||!es(r,t,i))}function es(e,t,r){return t.x<=Math.max(e.x,r.x)&&t.x>=Math.min(e.x,r.x)&&t.y<=Math.max(e.y,r.y)&&t.y>=Math.min(e.y,r.y)}function ts(e){return e>0?1:e<0?-1:0}function rs(e,t){return Ja(e.prev,e,e.next)<0?Ja(e,t,e.next)>=0&&Ja(e,e.prev,t)>=0:Ja(e,t,e.prev)<0||Ja(e,e.next,t)<0}function is(e,t){var r=new as(e.i,e.x,e.y),i=new as(t.i,t.x,t.y),n=e.next,o=t.prev;return e.next=t,t.prev=e,r.next=n,n.prev=r,i.next=r,r.prev=i,o.next=i,i.prev=o,i}function ns(e,t,r,i){var n=new as(e,t,r);return i?(n.next=i.next,n.prev=i,i.next.prev=n,i.next=n):(n.prev=n,n.next=n),n}function os(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function as(e,t,r){this.i=e,this.x=t,this.y=r,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function ss(e,t,r,i){for(var n=0,o=t,a=r-i;o<r;o+=i)n+=(e[a]-e[o])*(e[o+1]+e[a+1]),a=o;return n}function ls(e,t,r,i,n){cs(e,t,r||0,i||e.length-1,n||hs)}function cs(e,t,r,i,n){for(;i>r;){if(i-r>600){var o=i-r+1,a=t-r+1,s=Math.log(o),l=.5*Math.exp(2*s/3),c=.5*Math.sqrt(s*l*(o-l)/o)*(a-o/2<0?-1:1);cs(e,t,Math.max(r,Math.floor(t-a*l/o+c)),Math.min(i,Math.floor(t+(o-a)*l/o+c)),n)}var u=e[t],h=r,p=i;for(us(e,r,t),n(e[i],u)>0&&us(e,r,i);h<p;){for(us(e,h,p),h++,p--;n(e[h],u)<0;)h++;for(;n(e[p],u)>0;)p--}0===n(e[r],u)?us(e,r,p):us(e,++p,i),p<=t&&(r=p+1),t<=p&&(i=p-1)}}function us(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function hs(e,t){return e<t?-1:e>t?1:0}function ps(e,t){const r=e.length;if(r<=1)return[e];const i=[];let n,o;for(let t=0;t<r;t++){const r=y(e[t]);0!==r&&(e[t].area=Math.abs(r),void 0===o&&(o=r<0),o===r<0?(n&&i.push(n),n=[e[t]]):n.push(e[t]))}if(n&&i.push(n),t>1)for(let e=0;e<i.length;e++)i[e].length<=t||(ls(i[e],t,1,i[e].length-1,ds),i[e]=i[e].slice(0,t));return i}function ds(e,t){return t.area-e.area}function fs(e,t,r){const i=r.patternDependencies;let n=!1;for(const r of t){const t=r.paint.get(`${e}-pattern`);t.isConstant()||(n=!0);const o=t.constantOr(null);o&&(n=!0,i[o.to]=!0,i[o.from]=!0)}return n}function ms(e,t,r,i,n){const o=n.patternDependencies;for(const a of t){const t=a.paint.get(`${e}-pattern`).value;if("constant"!==t.kind){let e=t.evaluate({zoom:i-1},r,{},n.availableImages),s=t.evaluate({zoom:i},r,{},n.availableImages),l=t.evaluate({zoom:i+1},r,{},n.availableImages);e=e&&e.name?e.name:e,s=s&&s.name?s.name:s,l=l&&l.name?l.name:l,o[e]=!0,o[s]=!0,o[l]=!0,r.patterns[a.id]={min:e,mid:s,max:l}}}return r}La.exports=ja,La.exports.default=ja,ja.deviation=function(e,t,r,i){var n=t&&t.length,o=Math.abs(ss(e,0,n?t[0]*r:e.length,r));if(n)for(var a=0,s=t.length;a<s;a++)o-=Math.abs(ss(e,t[a]*r,a<s-1?t[a+1]*r:e.length,r));var l=0;for(a=0;a<i.length;a+=3){var c=i[a]*r,u=i[a+1]*r,h=i[a+2]*r;l+=Math.abs((e[c]-e[h])*(e[u+1]-e[c+1])-(e[c]-e[u])*(e[h+1]-e[c+1]))}return 0===o&&0===l?0:Math.abs((l-o)/o)},ja.flatten=function(e){for(var t=e[0][0].length,r={vertices:[],holes:[],dimensions:t},i=0,n=0;n<e.length;n++){for(var o=0;o<e[n].length;o++)for(var a=0;a<t;a++)r.vertices.push(e[n][o][a]);n>0&&r.holes.push(i+=e[n-1].length)}return r};class ys{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.layoutVertexArray=new to,this.indexArray=new ho,this.indexArray2=new po,this.programConfigurations=new No(e.layers,e.zoom),this.segments=new yo,this.segments2=new yo,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.hasPattern=fs("fill",this.layers,t);const i=this.layers[0].layout.get("fill-sort-key"),n=!i.isConstant(),o=[];for(const{feature:a,id:s,index:l,sourceLayerIndex:c}of e){const e=this.layers[0]._featureFilter.needGeometry,u=Wo(a,e);if(!this.layers[0]._featureFilter.filter(new Yi(this.zoom),u,r))continue;const h=n?i.evaluate(u,{},r,t.availableImages):void 0,p={id:s,properties:a.properties,type:a.type,sourceLayerIndex:c,index:l,geometry:e?u.geometry:Zo(a),patterns:{},sortKey:h};o.push(p)}n&&o.sort(((e,t)=>e.sortKey-t.sortKey));for(const i of o){const{geometry:n,index:o,sourceLayerIndex:a}=i;if(this.hasPattern){const e=ms("fill",this.layers,i,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(i,n,o,r,{});t.featureIndex.insert(e[o].feature,n,o,a,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}addFeatures(e,t,r){for(const e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,Da),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.indexBuffer2=e.createIndexBuffer(this.indexArray2)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}addFeature(e,t,r,i,n){for(const e of ps(t,500)){let t=0;for(const r of e)t+=r.length;const r=this.segments.prepareSegment(t,this.layoutVertexArray,this.indexArray),i=r.vertexLength,n=[],o=[];for(const t of e){if(0===t.length)continue;t!==e[0]&&o.push(n.length/2);const r=this.segments2.prepareSegment(t.length,this.layoutVertexArray,this.indexArray2),i=r.vertexLength;this.layoutVertexArray.emplaceBack(t[0].x,t[0].y),this.indexArray2.emplaceBack(i+t.length-1,i),n.push(t[0].x),n.push(t[0].y);for(let e=1;e<t.length;e++)this.layoutVertexArray.emplaceBack(t[e].x,t[e].y),this.indexArray2.emplaceBack(i+e-1,i+e),n.push(t[e].x),n.push(t[e].y);r.vertexLength+=t.length,r.primitiveLength+=t.length}const a=La.exports(n,o);for(let e=0;e<a.length;e+=3)this.indexArray.emplaceBack(i+a[e],i+a[e+1],i+a[e+2]);r.vertexLength+=t,r.primitiveLength+=a.length/3}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,n,i)}}ki("FillBucket",ys,{omit:["layers","patternFeatures"]});const gs=new dn({"fill-sort-key":new cn(ie.layout_fill["fill-sort-key"])});var _s={paint:new dn({"fill-antialias":new ln(ie.paint_fill["fill-antialias"]),"fill-opacity":new cn(ie.paint_fill["fill-opacity"]),"fill-color":new cn(ie.paint_fill["fill-color"]),"fill-outline-color":new cn(ie.paint_fill["fill-outline-color"]),"fill-translate":new ln(ie.paint_fill["fill-translate"]),"fill-translate-anchor":new ln(ie.paint_fill["fill-translate-anchor"]),"fill-pattern":new un(ie.paint_fill["fill-pattern"])}),layout:gs};const bs=bn([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4),vs=bn([{name:"a_centroid",components:2,type:"Int16"}],4),{members:xs}=bs;var ws={},Ss=T,Es=Ts;function Ts(e,t,r,i,n){this.properties={},this.extent=r,this.type=0,this._pbf=e,this._geometry=-1,this._keys=i,this._values=n,e.readFields(ks,this,t)}function ks(e,t,r){1==e?t.id=r.readVarint():2==e?function(e,t){for(var r=e.readVarint()+e.pos;e.pos<r;){var i=t._keys[e.readVarint()],n=t._values[e.readVarint()];t.properties[i]=n}}(r,t):3==e?t.type=r.readVarint():4==e&&(t._geometry=r.pos)}function As(e){for(var t,r,i=0,n=0,o=e.length,a=o-1;n<o;a=n++)i+=((r=e[a]).x-(t=e[n]).x)*(t.y+r.y);return i}Ts.types=["Unknown","Point","LineString","Polygon"],Ts.prototype.loadGeometry=function(){var e=this._pbf;e.pos=this._geometry;for(var t,r=e.readVarint()+e.pos,i=1,n=0,o=0,a=0,s=[];e.pos<r;){if(n<=0){var l=e.readVarint();i=7&l,n=l>>3}if(n--,1===i||2===i)o+=e.readSVarint(),a+=e.readSVarint(),1===i&&(t&&s.push(t),t=[]),t.push(new Ss(o,a));else{if(7!==i)throw new Error("unknown command "+i);t&&t.push(t[0].clone())}}return t&&s.push(t),s},Ts.prototype.bbox=function(){var e=this._pbf;e.pos=this._geometry;for(var t=e.readVarint()+e.pos,r=1,i=0,n=0,o=0,a=1/0,s=-1/0,l=1/0,c=-1/0;e.pos<t;){if(i<=0){var u=e.readVarint();r=7&u,i=u>>3}if(i--,1===r||2===r)(n+=e.readSVarint())<a&&(a=n),n>s&&(s=n),(o+=e.readSVarint())<l&&(l=o),o>c&&(c=o);else if(7!==r)throw new Error("unknown command "+r)}return[a,l,s,c]},Ts.prototype.toGeoJSON=function(e,t,r){var i,n,o=this.extent*Math.pow(2,r),a=this.extent*e,s=this.extent*t,l=this.loadGeometry(),c=Ts.types[this.type];function u(e){for(var t=0;t<e.length;t++){var r=e[t];e[t]=[360*(r.x+a)/o-180,360/Math.PI*Math.atan(Math.exp((180-360*(r.y+s)/o)*Math.PI/180))-90]}}switch(this.type){case 1:var h=[];for(i=0;i<l.length;i++)h[i]=l[i][0];u(l=h);break;case 2:for(i=0;i<l.length;i++)u(l[i]);break;case 3:for(l=function(e){var t=e.length;if(t<=1)return[e];for(var r,i,n=[],o=0;o<t;o++){var a=As(e[o]);0!==a&&(void 0===i&&(i=a<0),i===a<0?(r&&n.push(r),r=[e[o]]):r.push(e[o]))}return r&&n.push(r),n}(l),i=0;i<l.length;i++)for(n=0;n<l[i].length;n++)u(l[i][n])}1===l.length?l=l[0]:c="Multi"+c;var p={type:"Feature",geometry:{type:c,coordinates:l},properties:this.properties};return"id"in this&&(p.id=this.id),p};var Is=Es,Ps=Cs;function Cs(e,t){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=e,this._keys=[],this._values=[],this._features=[],e.readFields(zs,this,t),this.length=this._features.length}function zs(e,t,r){15===e?t.version=r.readVarint():1===e?t.name=r.readString():5===e?t.extent=r.readVarint():2===e?t._features.push(r.pos):3===e?t._keys.push(r.readString()):4===e&&t._values.push(function(e){for(var t=null,r=e.readVarint()+e.pos;e.pos<r;){var i=e.readVarint()>>3;t=1===i?e.readString():2===i?e.readFloat():3===i?e.readDouble():4===i?e.readVarint64():5===i?e.readVarint():6===i?e.readSVarint():7===i?e.readBoolean():null}return t}(r))}Cs.prototype.feature=function(e){if(e<0||e>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[e];var t=this._pbf.readVarint()+this._pbf.pos;return new Is(this._pbf,t,this.extent,this._keys,this._values)};var Ms=Ps;function Os(e,t,r){if(3===e){var i=new Ms(r,r.readVarint()+r.pos);i.length&&(t[i.name]=i)}}ws.VectorTile=function(e,t){this.layers=e.readFields(Os,{},t)},ws.VectorTileFeature=Es,ws.VectorTileLayer=Ps;const Ds=ws.VectorTileFeature.types,Ls=Math.pow(2,13);function js(e,t,r,i,n,o,a,s){e.emplaceBack(t,r,2*Math.floor(i*Ls)+a,n*Ls*2,o*Ls*2,Math.round(s))}class Rs{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.layoutVertexArray=new ro,this.centroidVertexArray=new Qn,this.indexArray=new ho,this.programConfigurations=new No(e.layers,e.zoom),this.segments=new yo,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.features=[],this.hasPattern=fs("fill-extrusion",this.layers,t);for(const{feature:i,id:n,index:o,sourceLayerIndex:a}of e){const e=this.layers[0]._featureFilter.needGeometry,s=Wo(i,e);if(!this.layers[0]._featureFilter.filter(new Yi(this.zoom),s,r))continue;const l={id:n,sourceLayerIndex:a,index:o,geometry:e?s.geometry:Zo(i),properties:i.properties,type:i.type,patterns:{}};this.hasPattern?this.features.push(ms("fill-extrusion",this.layers,l,this.zoom,t)):this.addFeature(l,l.geometry,o,r,{}),t.featureIndex.insert(i,l.geometry,o,a,this.index,!0)}}addFeatures(e,t,r){for(const e of this.features){const{geometry:i}=e;this.addFeature(e,i,e.index,t,r)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.centroidVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,xs),this.centroidVertexBuffer=e.createVertexBuffer(this.centroidVertexArray,vs.members,!0),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.centroidVertexBuffer.destroy())}addFeature(e,t,r,i,n){const o={x:0,y:0,vertexCount:0};for(const r of ps(t,500)){let t=0;for(const e of r)t+=e.length;let i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray);for(const e of r){if(0===e.length)continue;if(Fs(e))continue;let t=0;for(let r=0;r<e.length;r++){const n=e[r];if(r>=1){const a=e[r-1];if(!Bs(n,a)){i.vertexLength+4>yo.MAX_VERTEX_ARRAY_LENGTH&&(i=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));const e=n.sub(a)._perp()._unit(),r=a.dist(n);t+r>32768&&(t=0),js(this.layoutVertexArray,n.x,n.y,e.x,e.y,0,0,t),js(this.layoutVertexArray,n.x,n.y,e.x,e.y,0,1,t),o.x+=2*n.x,o.y+=2*n.y,o.vertexCount+=2,t+=r,js(this.layoutVertexArray,a.x,a.y,e.x,e.y,0,0,t),js(this.layoutVertexArray,a.x,a.y,e.x,e.y,0,1,t),o.x+=2*a.x,o.y+=2*a.y,o.vertexCount+=2;const s=i.vertexLength;this.indexArray.emplaceBack(s,s+2,s+1),this.indexArray.emplaceBack(s+1,s+2,s+3),i.vertexLength+=4,i.primitiveLength+=2}}}}if(i.vertexLength+t>yo.MAX_VERTEX_ARRAY_LENGTH&&(i=this.segments.prepareSegment(t,this.layoutVertexArray,this.indexArray)),"Polygon"!==Ds[e.type])continue;const n=[],a=[],s=i.vertexLength;for(const e of r)if(0!==e.length){e!==r[0]&&a.push(n.length/2);for(let t=0;t<e.length;t++){const r=e[t];js(this.layoutVertexArray,r.x,r.y,0,0,1,1,0),o.x+=r.x,o.y+=r.y,o.vertexCount+=1,n.push(r.x),n.push(r.y)}}const l=La.exports(n,a);for(let e=0;e<l.length;e+=3)this.indexArray.emplaceBack(s+l[e],s+l[e+2],s+l[e+1]);i.primitiveLength+=l.length/3,i.vertexLength+=t}for(let e=0;e<o.vertexCount;e++)this.centroidVertexArray.emplaceBack(Math.floor(o.x/o.vertexCount),Math.floor(o.y/o.vertexCount));this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,n,i)}}function Bs(e,t){return e.x===t.x&&(e.x<0||e.x>qo)||e.y===t.y&&(e.y<0||e.y>qo)}function Fs(e){return e.every((e=>e.x<0))||e.every((e=>e.x>qo))||e.every((e=>e.y<0))||e.every((e=>e.y>qo))}ki("FillExtrusionBucket",Rs,{omit:["layers","features"]});var Ns={paint:new dn({"fill-extrusion-opacity":new ln(ie["paint_fill-extrusion"]["fill-extrusion-opacity"]),"fill-extrusion-color":new cn(ie["paint_fill-extrusion"]["fill-extrusion-color"]),"fill-extrusion-translate":new ln(ie["paint_fill-extrusion"]["fill-extrusion-translate"]),"fill-extrusion-translate-anchor":new ln(ie["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]),"fill-extrusion-pattern":new un(ie["paint_fill-extrusion"]["fill-extrusion-pattern"]),"fill-extrusion-height":new cn(ie["paint_fill-extrusion"]["fill-extrusion-height"]),"fill-extrusion-base":new cn(ie["paint_fill-extrusion"]["fill-extrusion-base"]),"fill-extrusion-vertical-gradient":new ln(ie["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"])})};function Us(e,t){return e.x*t.x+e.y*t.y}function Vs(e,t){if(1===e.length){let r=0;const i=t[r++];let n;for(;!n||i.equals(n);)if(n=t[r++],!n)return 1/0;for(;r<t.length;r++){const o=t[r],a=e[0],s=n.sub(i),l=o.sub(i),c=a.sub(i),u=Us(s,s),h=Us(s,l),p=Us(l,l),d=Us(c,s),f=Us(c,l),m=u*p-h*h,y=(p*d-h*f)/m,g=(u*f-h*d)/m,_=i.z*(1-y-g)+n.z*y+o.z*g;if(isFinite(_))return _}return 1/0}{let e=1/0;for(const r of t)e=Math.min(e,r.z);return e}}const qs=bn([{name:"a_pos_normal",components:2,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4),{members:$s}=qs,Gs=bn([{name:"a_uv_x",components:1,type:"Float32"},{name:"a_split_index",components:1,type:"Float32"}]),{members:Zs}=Gs,Ws=ws.VectorTileFeature.types,Xs=Math.cos(Math.PI/180*37.5),Ks=Math.pow(2,14)/.5;class Hs{constructor(e){this.zoom=e.zoom,this.overscaling=e.overscaling,this.layers=e.layers,this.layerIds=this.layers.map((e=>e.id)),this.index=e.index,this.hasPattern=!1,this.patternFeatures=[],this.lineClipsArray=[],this.gradients={},this.layers.forEach((e=>{this.gradients[e.id]={}})),this.layoutVertexArray=new io,this.layoutVertexArray2=new no,this.indexArray=new ho,this.programConfigurations=new No(e.layers,e.zoom),this.segments=new yo,this.maxLineLength=0,this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id))}populate(e,t,r){this.hasPattern=fs("line",this.layers,t);const i=this.layers[0].layout.get("line-sort-key"),n=!i.isConstant(),o=[];for(const{feature:t,id:a,index:s,sourceLayerIndex:l}of e){const e=this.layers[0]._featureFilter.needGeometry,c=Wo(t,e);if(!this.layers[0]._featureFilter.filter(new Yi(this.zoom),c,r))continue;const u=n?i.evaluate(c,{},r):void 0,h={id:a,properties:t.properties,type:t.type,sourceLayerIndex:l,index:s,geometry:e?c.geometry:Zo(t),patterns:{},sortKey:u};o.push(h)}n&&o.sort(((e,t)=>e.sortKey-t.sortKey));for(const i of o){const{geometry:n,index:o,sourceLayerIndex:a}=i;if(this.hasPattern){const e=ms("line",this.layers,i,this.zoom,t);this.patternFeatures.push(e)}else this.addFeature(i,n,o,r,{});t.featureIndex.insert(e[o].feature,n,o,a,this.index)}}update(e,t,r){this.stateDependentLayers.length&&this.programConfigurations.updatePaintArrays(e,t,this.stateDependentLayers,r)}addFeatures(e,t,r){for(const e of this.patternFeatures)this.addFeature(e,e.geometry,e.index,t,r)}isEmpty(){return 0===this.layoutVertexArray.length}uploadPending(){return!this.uploaded||this.programConfigurations.needsUpload}upload(e){this.uploaded||(0!==this.layoutVertexArray2.length&&(this.layoutVertexBuffer2=e.createVertexBuffer(this.layoutVertexArray2,Zs)),this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,$s),this.indexBuffer=e.createIndexBuffer(this.indexArray)),this.programConfigurations.upload(e),this.uploaded=!0}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}lineFeatureClips(e){if(e.properties&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_start")&&Object.prototype.hasOwnProperty.call(e.properties,"mapbox_clip_end"))return{start:+e.properties.mapbox_clip_start,end:+e.properties.mapbox_clip_end}}addFeature(e,t,r,i,n){const o=this.layers[0].layout,a=o.get("line-join").evaluate(e,{}),s=o.get("line-cap"),l=o.get("line-miter-limit"),c=o.get("line-round-limit");this.lineClips=this.lineFeatureClips(e);for(const r of t)this.addLine(r,e,a,s,l,c);this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,e,r,n,i)}addLine(e,t,r,i,n,o){if(this.distance=0,this.scaledDistance=0,this.totalDistance=0,this.lineClips){this.lineClipsArray.push(this.lineClips);for(let t=0;t<e.length-1;t++)this.totalDistance+=e[t].dist(e[t+1]);this.updateScaledDistance(),this.maxLineLength=Math.max(this.maxLineLength,this.totalDistance)}const a="Polygon"===Ws[t.type];let s=e.length;for(;s>=2&&e[s-1].equals(e[s-2]);)s--;let l=0;for(;l<s-1&&e[l].equals(e[l+1]);)l++;if(s<(a?3:2))return;"bevel"===r&&(n=1.05);const c=this.overscaling<=16?122880/(512*this.overscaling):0,u=this.segments.prepareSegment(10*s,this.layoutVertexArray,this.indexArray);let h,p,d,f,m;this.e1=this.e2=-1,a&&(h=e[s-2],m=e[l].sub(h)._unit()._perp());for(let t=l;t<s;t++){if(d=t===s-1?a?e[l+1]:void 0:e[t+1],d&&e[t].equals(d))continue;m&&(f=m),h&&(p=h),h=e[t],m=d?d.sub(h)._unit()._perp():f,f=f||m;let y=f.add(m);0===y.x&&0===y.y||y._unit();const g=f.x*m.x+f.y*m.y,_=y.x*m.x+y.y*m.y,b=0!==_?1/_:1/0,v=2*Math.sqrt(2-2*_),x=_<Xs&&p&&d,w=f.x*m.y-f.y*m.x>0;if(x&&t>l){const e=h.dist(p);if(e>2*c){const t=h.sub(h.sub(p)._mult(c/e)._round());this.updateDistance(p,t),this.addCurrentVertex(t,f,0,0,u),p=t}}const S=p&&d;let E=S?r:a?"butt":i;if(S&&"round"===E&&(b<o?E="miter":b<=2&&(E="fakeround")),"miter"===E&&b>n&&(E="bevel"),"bevel"===E&&(b>2&&(E="flipbevel"),b<n&&(E="miter")),p&&this.updateDistance(p,h),"miter"===E)y._mult(b),this.addCurrentVertex(h,y,0,0,u);else if("flipbevel"===E){if(b>100)y=m.mult(-1);else{const e=b*f.add(m).mag()/f.sub(m).mag();y._perp()._mult(e*(w?-1:1))}this.addCurrentVertex(h,y,0,0,u),this.addCurrentVertex(h,y.mult(-1),0,0,u)}else if("bevel"===E||"fakeround"===E){const e=-Math.sqrt(b*b-1),t=w?e:0,r=w?0:e;if(p&&this.addCurrentVertex(h,f,t,r,u),"fakeround"===E){const e=Math.round(180*v/Math.PI/20);for(let t=1;t<e;t++){let r=t/e;if(.5!==r){const e=r-.5;r+=r*e*(r-1)*((1.0904+g*(g*(3.55645-1.43519*g)-3.2452))*e*e+(.848013+g*(.215638*g-1.06021)))}const i=m.sub(f)._mult(r)._add(f)._unit()._mult(w?-1:1);this.addHalfVertex(h,i.x,i.y,!1,w,0,u)}}d&&this.addCurrentVertex(h,m,-t,-r,u)}else if("butt"===E)this.addCurrentVertex(h,y,0,0,u);else if("square"===E){const e=p?1:-1;this.addCurrentVertex(h,y,e,e,u)}else"round"===E&&(p&&(this.addCurrentVertex(h,f,0,0,u),this.addCurrentVertex(h,f,1,1,u,!0)),d&&(this.addCurrentVertex(h,m,-1,-1,u,!0),this.addCurrentVertex(h,m,0,0,u)));if(x&&t<s-1){const e=h.dist(d);if(e>2*c){const t=h.add(d.sub(h)._mult(c/e)._round());this.updateDistance(h,t),this.addCurrentVertex(t,m,0,0,u),h=t}}}}addCurrentVertex(e,t,r,i,n,o=!1){const a=t.y*i-t.x,s=-t.y-t.x*i;this.addHalfVertex(e,t.x+t.y*r,t.y-t.x*r,o,!1,r,n),this.addHalfVertex(e,a,s,o,!0,-i,n),this.distance>Ks/2&&0===this.totalDistance&&(this.distance=0,this.addCurrentVertex(e,t,r,i,n,o))}addHalfVertex({x:e,y:t},r,i,n,o,a,s){const l=.5*(this.lineClips?this.scaledDistance*(Ks-1):this.scaledDistance);this.layoutVertexArray.emplaceBack((e<<1)+(n?1:0),(t<<1)+(o?1:0),Math.round(63*r)+128,Math.round(63*i)+128,1+(0===a?0:a<0?-1:1)|(63&l)<<2,l>>6),this.lineClips&&this.layoutVertexArray2.emplaceBack((this.scaledDistance-this.lineClips.start)/(this.lineClips.end-this.lineClips.start),this.lineClipsArray.length);const c=s.vertexLength++;this.e1>=0&&this.e2>=0&&(this.indexArray.emplaceBack(this.e1,this.e2,c),s.primitiveLength++),o?this.e2=c:this.e1=c}updateScaledDistance(){this.scaledDistance=this.lineClips?this.lineClips.start+(this.lineClips.end-this.lineClips.start)*this.distance/this.totalDistance:this.distance}updateDistance(e,t){this.distance+=e.dist(t),this.updateScaledDistance()}}ki("LineBucket",Hs,{omit:["layers","patternFeatures"]});const Js=new dn({"line-cap":new ln(ie.layout_line["line-cap"]),"line-join":new cn(ie.layout_line["line-join"]),"line-miter-limit":new ln(ie.layout_line["line-miter-limit"]),"line-round-limit":new ln(ie.layout_line["line-round-limit"]),"line-sort-key":new cn(ie.layout_line["line-sort-key"])});var Ys={paint:new dn({"line-opacity":new cn(ie.paint_line["line-opacity"]),"line-color":new cn(ie.paint_line["line-color"]),"line-translate":new ln(ie.paint_line["line-translate"]),"line-translate-anchor":new ln(ie.paint_line["line-translate-anchor"]),"line-width":new cn(ie.paint_line["line-width"]),"line-gap-width":new cn(ie.paint_line["line-gap-width"]),"line-offset":new cn(ie.paint_line["line-offset"]),"line-blur":new cn(ie.paint_line["line-blur"]),"line-dasharray":new hn(ie.paint_line["line-dasharray"]),"line-pattern":new un(ie.paint_line["line-pattern"]),"line-gradient":new pn(ie.paint_line["line-gradient"])}),layout:Js};const Qs=new class extends cn{possiblyEvaluate(e,t){return t=new Yi(Math.floor(t.zoom),{now:t.now,fadeDuration:t.fadeDuration,zoomHistory:t.zoomHistory,transition:t.transition}),super.possiblyEvaluate(e,t)}evaluate(e,t,r,i){return t=s({},t,{zoom:Math.floor(t.zoom)}),super.evaluate(e,t,r,i)}}(Ys.paint.properties["line-width"].specification);function el(e,t){return t>0?t+2*e:e}Qs.useIntegerZoom=!0;const tl=bn([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"},{name:"a_pixeloffset",components:4,type:"Int16"}],4),rl=bn([{name:"a_projected_pos",components:3,type:"Float32"}],4);bn([{name:"a_fade_opacity",components:1,type:"Uint32"}],4);const il=bn([{name:"a_placed",components:2,type:"Uint8"},{name:"a_shift",components:2,type:"Float32"}]);bn([{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"}]);const nl=bn([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),ol=bn([{name:"a_pos",components:2,type:"Float32"},{name:"a_radius",components:1,type:"Float32"},{name:"a_flags",components:2,type:"Int16"}],4);function al(e,t,r){return e.sections.forEach((e=>{e.text=function(e,t,r){const i=t.layout.get("text-transform").evaluate(r,{});return"uppercase"===i?e=e.toLocaleUpperCase():"lowercase"===i&&(e=e.toLocaleLowerCase()),Ji.applyArabicShaping&&(e=Ji.applyArabicShaping(e)),e}(e.text,t,r)})),e}bn([{name:"triangle",components:3,type:"Uint16"}]),bn([{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"}]),bn([{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"}]),bn([{type:"Float32",name:"offsetX"}]),bn([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}]);const sl={"!":"︕","#":"#",$:"$","%":"%","&":"&","(":"︵",")":"︶","*":"*","+":"+",",":"︐","-":"︲",".":"・","/":"/",":":"︓",";":"︔","<":"︿","=":"=",">":"﹀","?":"︖","@":"@","[":"﹇","\\":"\","]":"﹈","^":"^",_:"︳","`":"`","{":"︷","|":"―","}":"︸","~":"~","¢":"¢","£":"£","¥":"¥","¦":"¦","¬":"¬","¯":" ̄","–":"︲","—":"︱","‘":"﹃","’":"﹄","“":"﹁","”":"﹂","…":"︙","‧":"・","₩":"₩","、":"︑","。":"︒","〈":"︿","〉":"﹀","《":"︽","》":"︾","「":"﹁","」":"﹂","『":"﹃","』":"﹄","【":"︻","】":"︼","〔":"︹","〕":"︺","〖":"︗","〗":"︘","!":"︕","(":"︵",")":"︶",",":"︐","-":"︲",".":"・",":":"︓",";":"︔","<":"︿",">":"﹀","?":"︖","[":"﹇","]":"﹈","_":"︳","{":"︷","|":"―","}":"︸","⦅":"︵","⦆":"︶","。":"︒","「":"﹁","」":"﹂"};var ll=24,cl=pl,ul=function(e,t,r,i,n){var o,a,s=8*n-i-1,l=(1<<s)-1,c=l>>1,u=-7,h=r?n-1:0,p=r?-1:1,d=e[t+h];for(h+=p,o=d&(1<<-u)-1,d>>=-u,u+=s;u>0;o=256*o+e[t+h],h+=p,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=i;u>0;a=256*a+e[t+h],h+=p,u-=8);if(0===o)o=1-c;else{if(o===l)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,i),o-=c}return(d?-1:1)*a*Math.pow(2,o-i)},hl=function(e,t,r,i,n,o){var a,s,l,c=8*o-n-1,u=(1<<c)-1,h=u>>1,p=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,d=i?0:o-1,f=i?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+h>=1?p/l:p*Math.pow(2,1-h))*l>=2&&(a++,l/=2),a+h>=u?(s=0,a=u):a+h>=1?(s=(t*l-1)*Math.pow(2,n),a+=h):(s=t*Math.pow(2,h-1)*Math.pow(2,n),a=0));n>=8;e[r+d]=255&s,d+=f,s/=256,n-=8);for(a=a<<n|s,c+=n;c>0;e[r+d]=255&a,d+=f,a/=256,c-=8);e[r+d-f]|=128*m};function pl(e){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(e)?e:new Uint8Array(e||0),this.pos=0,this.type=0,this.length=this.buf.length}pl.Varint=0,pl.Fixed64=1,pl.Bytes=2,pl.Fixed32=5;var dl,fl=4294967296,ml=1/fl,yl="undefined"==typeof TextDecoder?null:new TextDecoder("utf8");function gl(e){return e.type===pl.Bytes?e.readVarint()+e.pos:e.pos+1}function _l(e,t,r){return r?4294967296*t+(e>>>0):4294967296*(t>>>0)+(e>>>0)}function bl(e,t,r){var i=t<=16383?1:t<=2097151?2:t<=268435455?3:Math.floor(Math.log(t)/(7*Math.LN2));r.realloc(i);for(var n=r.pos-1;n>=e;n--)r.buf[n+i]=r.buf[n]}function vl(e,t){for(var r=0;r<e.length;r++)t.writeVarint(e[r])}function xl(e,t){for(var r=0;r<e.length;r++)t.writeSVarint(e[r])}function wl(e,t){for(var r=0;r<e.length;r++)t.writeFloat(e[r])}function Sl(e,t){for(var r=0;r<e.length;r++)t.writeDouble(e[r])}function El(e,t){for(var r=0;r<e.length;r++)t.writeBoolean(e[r])}function Tl(e,t){for(var r=0;r<e.length;r++)t.writeFixed32(e[r])}function kl(e,t){for(var r=0;r<e.length;r++)t.writeSFixed32(e[r])}function Al(e,t){for(var r=0;r<e.length;r++)t.writeFixed64(e[r])}function Il(e,t){for(var r=0;r<e.length;r++)t.writeSFixed64(e[r])}function Pl(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+16777216*e[t+3]}function Cl(e,t,r){e[r]=t,e[r+1]=t>>>8,e[r+2]=t>>>16,e[r+3]=t>>>24}function zl(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16)+(e[t+3]<<24)}function Ml(e,t,r){1===e&&r.readMessage(Ol,t)}function Ol(e,t,r){if(3===e){const{id:e,bitmap:i,width:n,height:o,left:a,top:s,advance:l}=r.readMessage(Dl,{});t.push({id:e,bitmap:new Pa({width:n+6,height:o+6},i),metrics:{width:n,height:o,left:a,top:s,advance:l}})}}function Dl(e,t,r){1===e?t.id=r.readVarint():2===e?t.bitmap=r.readBytes():3===e?t.width=r.readVarint():4===e?t.height=r.readVarint():5===e?t.left=r.readSVarint():6===e?t.top=r.readSVarint():7===e&&(t.advance=r.readVarint())}function Ll(e){let t=0,r=0;for(const i of e)t+=i.w*i.h,r=Math.max(r,i.w);e.sort(((e,t)=>t.h-e.h));const i=[{x:0,y:0,w:Math.max(Math.ceil(Math.sqrt(t/.95)),r),h:1/0}];let n=0,o=0;for(const t of e)for(let e=i.length-1;e>=0;e--){const r=i[e];if(!(t.w>r.w||t.h>r.h)){if(t.x=r.x,t.y=r.y,o=Math.max(o,t.y+t.h),n=Math.max(n,t.x+t.w),t.w===r.w&&t.h===r.h){const t=i.pop();e<i.length&&(i[e]=t)}else t.h===r.h?(r.x+=t.w,r.w-=t.w):t.w===r.w?(r.y+=t.h,r.h-=t.h):(i.push({x:r.x+t.w,y:r.y,w:r.w-t.w,h:t.h}),r.y+=t.h,r.h-=t.h);break}}return{w:n,h:o,fill:t/(n*o)||0}}pl.prototype={destroy:function(){this.buf=null},readFields:function(e,t,r){for(r=r||this.length;this.pos<r;){var i=this.readVarint(),n=i>>3,o=this.pos;this.type=7&i,e(n,t,this),this.pos===o&&this.skip(i)}return t},readMessage:function(e,t){return this.readFields(e,t,this.readVarint()+this.pos)},readFixed32:function(){var e=Pl(this.buf,this.pos);return this.pos+=4,e},readSFixed32:function(){var e=zl(this.buf,this.pos);return this.pos+=4,e},readFixed64:function(){var e=Pl(this.buf,this.pos)+Pl(this.buf,this.pos+4)*fl;return this.pos+=8,e},readSFixed64:function(){var e=Pl(this.buf,this.pos)+zl(this.buf,this.pos+4)*fl;return this.pos+=8,e},readFloat:function(){var e=ul(this.buf,this.pos,!0,23,4);return this.pos+=4,e},readDouble:function(){var e=ul(this.buf,this.pos,!0,52,8);return this.pos+=8,e},readVarint:function(e){var t,r,i=this.buf;return t=127&(r=i[this.pos++]),r<128?t:(t|=(127&(r=i[this.pos++]))<<7,r<128?t:(t|=(127&(r=i[this.pos++]))<<14,r<128?t:(t|=(127&(r=i[this.pos++]))<<21,r<128?t:function(e,t,r){var i,n,o=r.buf;if(i=(112&(n=o[r.pos++]))>>4,n<128)return _l(e,i,t);if(i|=(127&(n=o[r.pos++]))<<3,n<128)return _l(e,i,t);if(i|=(127&(n=o[r.pos++]))<<10,n<128)return _l(e,i,t);if(i|=(127&(n=o[r.pos++]))<<17,n<128)return _l(e,i,t);if(i|=(127&(n=o[r.pos++]))<<24,n<128)return _l(e,i,t);if(i|=(1&(n=o[r.pos++]))<<31,n<128)return _l(e,i,t);throw new Error("Expected varint not more than 10 bytes")}(t|=(15&(r=i[this.pos]))<<28,e,this))))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var e=this.readVarint();return e%2==1?(e+1)/-2:e/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var e=this.readVarint()+this.pos,t=this.pos;return this.pos=e,e-t>=12&&yl?function(e,t,r){return yl.decode(e.subarray(t,r))}(this.buf,t,e):function(e,t,r){for(var i="",n=t;n<r;){var o,a,s,l=e[n],c=null,u=l>239?4:l>223?3:l>191?2:1;if(n+u>r)break;1===u?l<128&&(c=l):2===u?128==(192&(o=e[n+1]))&&(c=(31&l)<<6|63&o)<=127&&(c=null):3===u?(a=e[n+2],128==(192&(o=e[n+1]))&&128==(192&a)&&((c=(15&l)<<12|(63&o)<<6|63&a)<=2047||c>=55296&&c<=57343)&&(c=null)):4===u&&(a=e[n+2],s=e[n+3],128==(192&(o=e[n+1]))&&128==(192&a)&&128==(192&s)&&((c=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)<=65535||c>=1114112)&&(c=null)),null===c?(c=65533,u=1):c>65535&&(c-=65536,i+=String.fromCharCode(c>>>10&1023|55296),c=56320|1023&c),i+=String.fromCharCode(c),n+=u}return i}(this.buf,t,e)},readBytes:function(){var e=this.readVarint()+this.pos,t=this.buf.subarray(this.pos,e);return this.pos=e,t},readPackedVarint:function(e,t){if(this.type!==pl.Bytes)return e.push(this.readVarint(t));var r=gl(this);for(e=e||[];this.pos<r;)e.push(this.readVarint(t));return e},readPackedSVarint:function(e){if(this.type!==pl.Bytes)return e.push(this.readSVarint());var t=gl(this);for(e=e||[];this.pos<t;)e.push(this.readSVarint());return e},readPackedBoolean:function(e){if(this.type!==pl.Bytes)return e.push(this.readBoolean());var t=gl(this);for(e=e||[];this.pos<t;)e.push(this.readBoolean());return e},readPackedFloat:function(e){if(this.type!==pl.Bytes)return e.push(this.readFloat());var t=gl(this);for(e=e||[];this.pos<t;)e.push(this.readFloat());return e},readPackedDouble:function(e){if(this.type!==pl.Bytes)return e.push(this.readDouble());var t=gl(this);for(e=e||[];this.pos<t;)e.push(this.readDouble());return e},readPackedFixed32:function(e){if(this.type!==pl.Bytes)return e.push(this.readFixed32());var t=gl(this);for(e=e||[];this.pos<t;)e.push(this.readFixed32());return e},readPackedSFixed32:function(e){if(this.type!==pl.Bytes)return e.push(this.readSFixed32());var t=gl(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed32());return e},readPackedFixed64:function(e){if(this.type!==pl.Bytes)return e.push(this.readFixed64());var t=gl(this);for(e=e||[];this.pos<t;)e.push(this.readFixed64());return e},readPackedSFixed64:function(e){if(this.type!==pl.Bytes)return e.push(this.readSFixed64());var t=gl(this);for(e=e||[];this.pos<t;)e.push(this.readSFixed64());return e},skip:function(e){var t=7&e;if(t===pl.Varint)for(;this.buf[this.pos++]>127;);else if(t===pl.Bytes)this.pos=this.readVarint()+this.pos;else if(t===pl.Fixed32)this.pos+=4;else{if(t!==pl.Fixed64)throw new Error("Unimplemented type: "+t);this.pos+=8}},writeTag:function(e,t){this.writeVarint(e<<3|t)},realloc:function(e){for(var t=this.length||16;t<this.pos+e;)t*=2;if(t!==this.length){var r=new Uint8Array(t);r.set(this.buf),this.buf=r,this.length=t}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(e){this.realloc(4),Cl(this.buf,e,this.pos),this.pos+=4},writeSFixed32:function(e){this.realloc(4),Cl(this.buf,e,this.pos),this.pos+=4},writeFixed64:function(e){this.realloc(8),Cl(this.buf,-1&e,this.pos),Cl(this.buf,Math.floor(e*ml),this.pos+4),this.pos+=8},writeSFixed64:function(e){this.realloc(8),Cl(this.buf,-1&e,this.pos),Cl(this.buf,Math.floor(e*ml),this.pos+4),this.pos+=8},writeVarint:function(e){(e=+e||0)>268435455||e<0?function(e,t){var r,i;if(e>=0?(r=e%4294967296|0,i=e/4294967296|0):(i=~(-e/4294967296),4294967295^(r=~(-e%4294967296))?r=r+1|0:(r=0,i=i+1|0)),e>=0x10000000000000000||e<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");t.realloc(10),function(e,t,r){r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,e>>>=7,r.buf[r.pos++]=127&e|128,r.buf[r.pos]=127&(e>>>=7)}(r,0,t),function(e,t){var r=(7&e)<<4;t.buf[t.pos++]|=r|((e>>>=3)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e|((e>>>=7)?128:0),e&&(t.buf[t.pos++]=127&e)))))}(i,t)}(e,this):(this.realloc(4),this.buf[this.pos++]=127&e|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=127&(e>>>=7)|(e>127?128:0),e<=127||(this.buf[this.pos++]=e>>>7&127))))},writeSVarint:function(e){this.writeVarint(e<0?2*-e-1:2*e)},writeBoolean:function(e){this.writeVarint(Boolean(e))},writeString:function(e){e=String(e),this.realloc(4*e.length),this.pos++;var t=this.pos;this.pos=function(e,t,r){for(var i,n,o=0;o<t.length;o++){if((i=t.charCodeAt(o))>55295&&i<57344){if(!n){i>56319||o+1===t.length?(e[r++]=239,e[r++]=191,e[r++]=189):n=i;continue}if(i<56320){e[r++]=239,e[r++]=191,e[r++]=189,n=i;continue}i=n-55296<<10|i-56320|65536,n=null}else n&&(e[r++]=239,e[r++]=191,e[r++]=189,n=null);i<128?e[r++]=i:(i<2048?e[r++]=i>>6|192:(i<65536?e[r++]=i>>12|224:(e[r++]=i>>18|240,e[r++]=i>>12&63|128),e[r++]=i>>6&63|128),e[r++]=63&i|128)}return r}(this.buf,e,this.pos);var r=this.pos-t;r>=128&&bl(t,r,this),this.pos=t-1,this.writeVarint(r),this.pos+=r},writeFloat:function(e){this.realloc(4),hl(this.buf,e,this.pos,!0,23,4),this.pos+=4},writeDouble:function(e){this.realloc(8),hl(this.buf,e,this.pos,!0,52,8),this.pos+=8},writeBytes:function(e){var t=e.length;this.writeVarint(t),this.realloc(t);for(var r=0;r<t;r++)this.buf[this.pos++]=e[r]},writeRawMessage:function(e,t){this.pos++;var r=this.pos;e(t,this);var i=this.pos-r;i>=128&&bl(r,i,this),this.pos=r-1,this.writeVarint(i),this.pos+=i},writeMessage:function(e,t,r){this.writeTag(e,pl.Bytes),this.writeRawMessage(t,r)},writePackedVarint:function(e,t){t.length&&this.writeMessage(e,vl,t)},writePackedSVarint:function(e,t){t.length&&this.writeMessage(e,xl,t)},writePackedBoolean:function(e,t){t.length&&this.writeMessage(e,El,t)},writePackedFloat:function(e,t){t.length&&this.writeMessage(e,wl,t)},writePackedDouble:function(e,t){t.length&&this.writeMessage(e,Sl,t)},writePackedFixed32:function(e,t){t.length&&this.writeMessage(e,Tl,t)},writePackedSFixed32:function(e,t){t.length&&this.writeMessage(e,kl,t)},writePackedFixed64:function(e,t){t.length&&this.writeMessage(e,Al,t)},writePackedSFixed64:function(e,t){t.length&&this.writeMessage(e,Il,t)},writeBytesField:function(e,t){this.writeTag(e,pl.Bytes),this.writeBytes(t)},writeFixed32Field:function(e,t){this.writeTag(e,pl.Fixed32),this.writeFixed32(t)},writeSFixed32Field:function(e,t){this.writeTag(e,pl.Fixed32),this.writeSFixed32(t)},writeFixed64Field:function(e,t){this.writeTag(e,pl.Fixed64),this.writeFixed64(t)},writeSFixed64Field:function(e,t){this.writeTag(e,pl.Fixed64),this.writeSFixed64(t)},writeVarintField:function(e,t){this.writeTag(e,pl.Varint),this.writeVarint(t)},writeSVarintField:function(e,t){this.writeTag(e,pl.Varint),this.writeSVarint(t)},writeStringField:function(e,t){this.writeTag(e,pl.Bytes),this.writeString(t)},writeFloatField:function(e,t){this.writeTag(e,pl.Fixed32),this.writeFloat(t)},writeDoubleField:function(e,t){this.writeTag(e,pl.Fixed64),this.writeDouble(t)},writeBooleanField:function(e,t){this.writeVarintField(e,Boolean(t))}};class jl{constructor(e,{pixelRatio:t,version:r,stretchX:i,stretchY:n,content:o}){this.paddedRect=e,this.pixelRatio=t,this.stretchX=i,this.stretchY=n,this.content=o,this.version=r}get tl(){return[this.paddedRect.x+1,this.paddedRect.y+1]}get br(){return[this.paddedRect.x+this.paddedRect.w-1,this.paddedRect.y+this.paddedRect.h-1]}get tlbr(){return this.tl.concat(this.br)}get displaySize(){return[(this.paddedRect.w-2)/this.pixelRatio,(this.paddedRect.h-2)/this.pixelRatio]}}class Rl{constructor(e,t){const r={},i={};this.haveRenderCallbacks=[];const n=[];this.addImages(e,r,n),this.addImages(t,i,n);const{w:o,h:a}=Ll(n),s=new Ca({width:o||1,height:a||1});for(const t in e){const i=e[t],n=r[t].paddedRect;Ca.copy(i.data,s,{x:0,y:0},{x:n.x+1,y:n.y+1},i.data)}for(const e in t){const r=t[e],n=i[e].paddedRect,o=n.x+1,a=n.y+1,l=r.data.width,c=r.data.height;Ca.copy(r.data,s,{x:0,y:0},{x:o,y:a},r.data),Ca.copy(r.data,s,{x:0,y:c-1},{x:o,y:a-1},{width:l,height:1}),Ca.copy(r.data,s,{x:0,y:0},{x:o,y:a+c},{width:l,height:1}),Ca.copy(r.data,s,{x:l-1,y:0},{x:o-1,y:a},{width:1,height:c}),Ca.copy(r.data,s,{x:0,y:0},{x:o+l,y:a},{width:1,height:c})}this.image=s,this.iconPositions=r,this.patternPositions=i}addImages(e,t,r){for(const i in e){const n=e[i],o={x:0,y:0,w:n.data.width+2,h:n.data.height+2};r.push(o),t[i]=new jl(o,n),n.hasRenderCallback&&this.haveRenderCallbacks.push(i)}}patchUpdatedImages(e,t){e.dispatchRenderCallbacks(this.haveRenderCallbacks);for(const r in e.updatedImages)this.patchUpdatedImage(this.iconPositions[r],e.getImage(r),t),this.patchUpdatedImage(this.patternPositions[r],e.getImage(r),t)}patchUpdatedImage(e,t,r){if(!e||!t)return;if(e.version===t.version)return;e.version=t.version;const[i,n]=e.tl;r.update(t.data,void 0,{x:i,y:n})}}ki("ImagePosition",jl),ki("ImageAtlas",Rl),e.WritingMode=void 0,(dl=e.WritingMode||(e.WritingMode={}))[dl.none=0]="none",dl[dl.horizontal=1]="horizontal",dl[dl.vertical=2]="vertical",dl[dl.horizontalOnly=3]="horizontalOnly";const Bl=-17;class Fl{constructor(){this.scale=1,this.fontStack="",this.imageName=null}static forText(e,t){const r=new Fl;return r.scale=e||1,r.fontStack=t,r}static forImage(e){const t=new Fl;return t.imageName=e,t}}class Nl{constructor(){this.text="",this.sectionIndex=[],this.sections=[],this.imageSectionID=null}static fromFeature(e,t){const r=new Nl;for(let i=0;i<e.sections.length;i++){const n=e.sections[i];n.image?r.addImageSection(n):r.addTextSection(n,t)}return r}length(){return this.text.length}getSection(e){return this.sections[this.sectionIndex[e]]}getSectionIndex(e){return this.sectionIndex[e]}getCharCode(e){return this.text.charCodeAt(e)}verticalizePunctuation(){this.text=function(e){let t="";for(let r=0;r<e.length;r++){const i=e.charCodeAt(r+1)||null,n=e.charCodeAt(r-1)||null;t+=i&&ji(i)&&!sl[e[r+1]]||n&&ji(n)&&!sl[e[r-1]]||!sl[e[r]]?e[r]:sl[e[r]]}return t}(this.text)}trim(){let e=0;for(let t=0;t<this.text.length&&Vl[this.text.charCodeAt(t)];t++)e++;let t=this.text.length;for(let r=this.text.length-1;r>=0&&r>=e&&Vl[this.text.charCodeAt(r)];r--)t--;this.text=this.text.substring(e,t),this.sectionIndex=this.sectionIndex.slice(e,t)}substring(e,t){const r=new Nl;return r.text=this.text.substring(e,t),r.sectionIndex=this.sectionIndex.slice(e,t),r.sections=this.sections,r}toString(){return this.text}getMaxScale(){return this.sectionIndex.reduce(((e,t)=>Math.max(e,this.sections[t].scale)),0)}addTextSection(e,t){this.text+=e.text,this.sections.push(Fl.forText(e.scale,e.fontStack||t));const r=this.sections.length-1;for(let t=0;t<e.text.length;++t)this.sectionIndex.push(r)}addImageSection(e){const t=e.image?e.image.name:"";if(0===t.length)return void f("Can't add FormattedSection with an empty image.");const r=this.getNextImageSectionCharCode();r?(this.text+=String.fromCharCode(r),this.sections.push(Fl.forImage(t)),this.sectionIndex.push(this.sections.length-1)):f("Reached maximum number of images 6401")}getNextImageSectionCharCode(){return this.imageSectionID?this.imageSectionID>=63743?null:++this.imageSectionID:(this.imageSectionID=57344,this.imageSectionID)}}function Ul(t,r,i,n,o,a,s,l,c,u,h,p,d,f,m,y){const g=Nl.fromFeature(t,o);let _;p===e.WritingMode.vertical&&g.verticalizePunctuation();const{processBidirectionalText:b,processStyledBidirectionalText:v}=Ji;if(b&&1===g.sections.length){_=[];const e=b(g.toString(),Kl(g,u,a,r,n,f,m));for(const t of e){const e=new Nl;e.text=t,e.sections=g.sections;for(let r=0;r<t.length;r++)e.sectionIndex.push(0);_.push(e)}}else if(v){_=[];const e=v(g.text,g.sectionIndex,Kl(g,u,a,r,n,f,m));for(const t of e){const e=new Nl;e.text=t[0],e.sectionIndex=t[1],e.sections=g.sections,_.push(e)}}else _=function(e,t){const r=[],i=e.text;let n=0;for(const i of t)r.push(e.substring(n,i)),n=i;return n<i.length&&r.push(e.substring(n,i.length)),r}(g,Kl(g,u,a,r,n,f,m));const x=[],w={positionedLines:x,text:g.toString(),top:h[1],bottom:h[1],left:h[0],right:h[0],writingMode:p,iconsInText:!1,verticalizable:!1};return function(t,r,i,n,o,a,s,l,c,u,h,p){let d=0,f=Bl,m=0,y=0;const g="right"===l?1:"left"===l?0:.5;let _=0;for(const s of o){s.trim();const o=s.getMaxScale(),l=(o-1)*ll,v={positionedGlyphs:[],lineOffset:0};t.positionedLines[_]=v;const x=v.positionedGlyphs;let w=0;if(!s.length()){f+=a,++_;continue}for(let a=0;a<s.length();a++){const m=s.getSection(a),y=s.getSectionIndex(a),g=s.getCharCode(a);let _=0,v=null,S=null,E=null,T=ll;const k=!(c===e.WritingMode.horizontal||!h&&!Li(g)||h&&(Vl[g]||(b=g,zi.Arabic(b)||zi["Arabic Supplement"](b)||zi["Arabic Extended-A"](b)||zi["Arabic Presentation Forms-A"](b)||zi["Arabic Presentation Forms-B"](b))));if(m.imageName){const e=n[m.imageName];if(!e)continue;E=m.imageName,t.iconsInText=t.iconsInText||!0,S=e.paddedRect;const r=e.displaySize;m.scale=m.scale*ll/p,v={width:r[0],height:r[1],left:1,top:-3,advance:k?r[1]:r[0]},_=l+(ll-r[1]*m.scale),T=v.advance;const i=k?r[0]*m.scale-ll*o:r[1]*m.scale-ll*o;i>0&&i>w&&(w=i)}else{const e=i[m.fontStack],t=e&&e[g];if(t&&t.rect)S=t.rect,v=t.metrics;else{const e=r[m.fontStack],t=e&&e[g];if(!t)continue;v=t.metrics}_=(o-m.scale)*ll}k?(t.verticalizable=!0,x.push({glyph:g,imageName:E,x:d,y:f+_,vertical:k,scale:m.scale,fontStack:m.fontStack,sectionIndex:y,metrics:v,rect:S}),d+=T*m.scale+u):(x.push({glyph:g,imageName:E,x:d,y:f+_,vertical:k,scale:m.scale,fontStack:m.fontStack,sectionIndex:y,metrics:v,rect:S}),d+=v.advance*m.scale+u)}0!==x.length&&(m=Math.max(d-u,m),Jl(x,0,x.length-1,g,w)),d=0;const S=a*o+w;v.lineOffset=Math.max(w,l),f+=S,y=Math.max(S,y),++_}var b;const v=f-Bl,{horizontalAlign:x,verticalAlign:w}=Hl(s);(function(e,t,r,i,n,o,a,s,l){const c=(t-r)*n;let u=0;u=o!==a?-s*i-Bl:(-i*l+.5)*a;for(const t of e)for(const e of t.positionedGlyphs)e.x+=c,e.y+=u})(t.positionedLines,g,x,w,m,y,a,v,o.length),t.top+=-w*v,t.bottom=t.top+v,t.left+=-x*m,t.right=t.left+m}(w,r,i,n,_,s,l,c,p,u,d,y),!function(e){for(const t of e)if(0!==t.positionedGlyphs.length)return!1;return!0}(x)&&w}const Vl={9:!0,10:!0,11:!0,12:!0,13:!0,32:!0},ql={10:!0,32:!0,38:!0,40:!0,41:!0,43:!0,45:!0,47:!0,173:!0,183:!0,8203:!0,8208:!0,8211:!0,8231:!0};function $l(e,t,r,i,n,o){if(t.imageName){const e=i[t.imageName];return e?e.displaySize[0]*t.scale*ll/o+n:0}{const i=r[t.fontStack],o=i&&i[e];return o?o.metrics.advance*t.scale+n:0}}function Gl(e,t,r,i){const n=Math.pow(e-t,2);return i?e<t?n/2:2*n:n+Math.abs(r)*r}function Zl(e,t,r){let i=0;return 10===e&&(i-=1e4),r&&(i+=150),40!==e&&65288!==e||(i+=50),41!==t&&65289!==t||(i+=50),i}function Wl(e,t,r,i,n,o){let a=null,s=Gl(t,r,n,o);for(const e of i){const i=Gl(t-e.x,r,n,o)+e.badness;i<=s&&(a=e,s=i)}return{index:e,x:t,priorBreak:a,badness:s}}function Xl(e){return e?Xl(e.priorBreak).concat(e.index):[]}function Kl(e,t,r,i,n,o,a){if("point"!==o)return[];if(!e)return[];const s=[],l=function(e,t,r,i,n,o){let a=0;for(let r=0;r<e.length();r++){const s=e.getSection(r);a+=$l(e.getCharCode(r),s,i,n,t,o)}return a/Math.max(1,Math.ceil(a/r))}(e,t,r,i,n,a),c=e.text.indexOf("​")>=0;let u=0;for(let r=0;r<e.length();r++){const o=e.getSection(r),p=e.getCharCode(r);if(Vl[p]||(u+=$l(p,o,i,n,t,a)),r<e.length()-1){const t=!((h=p)<11904||!(zi["Bopomofo Extended"](h)||zi.Bopomofo(h)||zi["CJK Compatibility Forms"](h)||zi["CJK Compatibility Ideographs"](h)||zi["CJK Compatibility"](h)||zi["CJK Radicals Supplement"](h)||zi["CJK Strokes"](h)||zi["CJK Symbols and Punctuation"](h)||zi["CJK Unified Ideographs Extension A"](h)||zi["CJK Unified Ideographs"](h)||zi["Enclosed CJK Letters and Months"](h)||zi["Halfwidth and Fullwidth Forms"](h)||zi.Hiragana(h)||zi["Ideographic Description Characters"](h)||zi["Kangxi Radicals"](h)||zi["Katakana Phonetic Extensions"](h)||zi.Katakana(h)||zi["Vertical Forms"](h)||zi["Yi Radicals"](h)||zi["Yi Syllables"](h)));(ql[p]||t||o.imageName)&&s.push(Wl(r+1,u,l,s,Zl(p,e.getCharCode(r+1),t&&c),!1))}}var h;return Xl(Wl(e.length(),u,l,s,0,!0))}function Hl(e){let t=.5,r=.5;switch(e){case"right":case"top-right":case"bottom-right":t=1;break;case"left":case"top-left":case"bottom-left":t=0}switch(e){case"bottom":case"bottom-right":case"bottom-left":r=1;break;case"top":case"top-right":case"top-left":r=0}return{horizontalAlign:t,verticalAlign:r}}function Jl(e,t,r,i,n){if(!i&&!n)return;const o=e[r],a=(e[r].x+o.metrics.advance*o.scale)*i;for(let i=t;i<=r;i++)e[i].x-=a,e[i].y+=n}function Yl(e,t,r){const{horizontalAlign:i,verticalAlign:n}=Hl(r),o=t[0]-e.displaySize[0]*i,a=t[1]-e.displaySize[1]*n;return{image:e,top:a,bottom:a+e.displaySize[1],left:o,right:o+e.displaySize[0]}}function Ql(e,t,r,i,n,o){const a=e.image;let s;if(a.content){const e=a.content,t=a.pixelRatio||1;s=[e[0]/t,e[1]/t,a.displaySize[0]-e[2]/t,a.displaySize[1]-e[3]/t]}const l=t.left*o,c=t.right*o;let u,h,p,d;"width"===r||"both"===r?(d=n[0]+l-i[3],h=n[0]+c+i[1]):(d=n[0]+(l+c-a.displaySize[0])/2,h=d+a.displaySize[0]);const f=t.top*o,m=t.bottom*o;return"height"===r||"both"===r?(u=n[1]+f-i[0],p=n[1]+m+i[2]):(u=n[1]+(f+m-a.displaySize[1])/2,p=u+a.displaySize[1]),{image:a,top:u,right:h,bottom:p,left:d,collisionPadding:s}}const ec=128;function tc(e,t){const{expression:r}=t;if("constant"===r.kind)return{kind:"constant",layoutSize:r.evaluate(new Yi(e+1))};if("source"===r.kind)return{kind:"source"};{const{zoomStops:t,interpolationType:i}=r;let n=0;for(;n<t.length&&t[n]<=e;)n++;n=Math.max(0,n-1);let o=n;for(;o<t.length&&t[o]<e+1;)o++;o=Math.min(t.length-1,o);const a=t[n],s=t[o];return"composite"===r.kind?{kind:"composite",minZoom:a,maxZoom:s,interpolationType:i}:{kind:"camera",minZoom:a,maxZoom:s,minSize:r.evaluate(new Yi(a)),maxSize:r.evaluate(new Yi(s)),interpolationType:i}}}class rc extends T{constructor(e,t,r,i){super(e,t),this.angle=r,void 0!==i&&(this.segment=i)}clone(){return new rc(this.x,this.y,this.angle,this.segment)}}function ic(e,t,r,i,n){if(void 0===t.segment)return!0;let o=t,a=t.segment+1,s=0;for(;s>-r/2;){if(a--,a<0)return!1;s-=e[a].dist(o),o=e[a]}s+=e[a].dist(e[a+1]),a++;const l=[];let c=0;for(;s<r/2;){const t=e[a],r=e[a+1];if(!r)return!1;let o=e[a-1].angleTo(t)-t.angleTo(r);for(o=Math.abs((o+3*Math.PI)%(2*Math.PI)-Math.PI),l.push({distance:s,angleDelta:o}),c+=o;s-l[0].distance>i;)c-=l.shift().angleDelta;if(c>n)return!1;a++,s+=t.dist(r)}return!0}function nc(e){let t=0;for(let r=0;r<e.length-1;r++)t+=e[r].dist(e[r+1]);return t}function oc(e,t,r){return e?.6*t*r:0}function ac(e,t){return Math.max(e?e.right-e.left:0,t?t.right-t.left:0)}function sc(e,t,r,i,n,o){const a=oc(r,n,o),s=ac(r,i)*o;let l=0;const c=nc(e)/2;for(let r=0;r<e.length-1;r++){const i=e[r],n=e[r+1],o=i.dist(n);if(l+o>c){const u=(c-l)/o,h=Tt(i.x,n.x,u),p=Tt(i.y,n.y,u),d=new rc(h,p,n.angleTo(i),r);return d._round(),!a||ic(e,d,s,a,t)?d:void 0}l+=o}}function lc(e,t,r,i,n,o,a,s,l){const c=oc(i,o,a),u=ac(i,n),h=u*a,p=0===e[0].x||e[0].x===l||0===e[0].y||e[0].y===l;return t-h<t/4&&(t=h+t/4),cc(e,p?t/2*s%t:(u/2+2*o)*a*s%t,t,c,r,h,p,!1,l)}function cc(e,t,r,i,n,o,a,s,l){const c=o/2,u=nc(e);let h=0,p=t-r,d=[];for(let t=0;t<e.length-1;t++){const a=e[t],s=e[t+1],f=a.dist(s),m=s.angleTo(a);for(;p+r<h+f;){p+=r;const y=(p-h)/f,g=Tt(a.x,s.x,y),_=Tt(a.y,s.y,y);if(g>=0&&g<l&&_>=0&&_<l&&p-c>=0&&p+c<=u){const r=new rc(g,_,m,t);r._round(),i&&!ic(e,r,o,i,n)||d.push(r)}}h+=f}return s||d.length||a||(d=cc(e,h/2,r,i,n,o,a,!0,l)),d}function uc(e,t,r,i,n){const o=[];for(let a=0;a<e.length;a++){const s=e[a];let l;for(let e=0;e<s.length-1;e++){let a=s[e],c=s[e+1];a.x<t&&c.x<t||(a.x<t?a=new T(t,a.y+(t-a.x)/(c.x-a.x)*(c.y-a.y))._round():c.x<t&&(c=new T(t,a.y+(t-a.x)/(c.x-a.x)*(c.y-a.y))._round()),a.y<r&&c.y<r||(a.y<r?a=new T(a.x+(r-a.y)/(c.y-a.y)*(c.x-a.x),r)._round():c.y<r&&(c=new T(a.x+(r-a.y)/(c.y-a.y)*(c.x-a.x),r)._round()),a.x>=i&&c.x>=i||(a.x>=i?a=new T(i,a.y+(i-a.x)/(c.x-a.x)*(c.y-a.y))._round():c.x>=i&&(c=new T(i,a.y+(i-a.x)/(c.x-a.x)*(c.y-a.y))._round()),a.y>=n&&c.y>=n||(a.y>=n?a=new T(a.x+(n-a.y)/(c.y-a.y)*(c.x-a.x),n)._round():c.y>=n&&(c=new T(a.x+(n-a.y)/(c.y-a.y)*(c.x-a.x),n)._round()),l&&a.equals(l[l.length-1])||(l=[a],o.push(l)),l.push(c)))))}}return o}function hc(e,t,r,i){const n=[],o=e.image,a=o.pixelRatio,s=o.paddedRect.w-2,l=o.paddedRect.h-2,c=e.right-e.left,u=e.bottom-e.top,h=o.stretchX||[[0,s]],p=o.stretchY||[[0,l]],d=(e,t)=>e+t[1]-t[0],f=h.reduce(d,0),m=p.reduce(d,0),y=s-f,g=l-m;let _=0,b=f,v=0,x=m,w=0,S=y,E=0,k=g;if(o.content&&i){const e=o.content;_=pc(h,0,e[0]),v=pc(p,0,e[1]),b=pc(h,e[0],e[2]),x=pc(p,e[1],e[3]),w=e[0]-_,E=e[1]-v,S=e[2]-e[0]-b,k=e[3]-e[1]-x}const A=(i,n,s,l)=>{const h=fc(i.stretch-_,b,c,e.left),p=mc(i.fixed-w,S,i.stretch,f),d=fc(n.stretch-v,x,u,e.top),y=mc(n.fixed-E,k,n.stretch,m),g=fc(s.stretch-_,b,c,e.left),A=mc(s.fixed-w,S,s.stretch,f),I=fc(l.stretch-v,x,u,e.top),P=mc(l.fixed-E,k,l.stretch,m),C=new T(h,d),z=new T(g,d),M=new T(g,I),O=new T(h,I),D=new T(p/a,y/a),L=new T(A/a,P/a),j=t*Math.PI/180;if(j){const e=Math.sin(j),t=Math.cos(j),r=[t,-e,e,t];C._matMult(r),z._matMult(r),O._matMult(r),M._matMult(r)}const R=i.stretch+i.fixed,B=n.stretch+n.fixed;return{tl:C,tr:z,bl:O,br:M,tex:{x:o.paddedRect.x+1+R,y:o.paddedRect.y+1+B,w:s.stretch+s.fixed-R,h:l.stretch+l.fixed-B},writingMode:void 0,glyphOffset:[0,0],sectionIndex:0,pixelOffsetTL:D,pixelOffsetBR:L,minFontScaleX:S/a/c,minFontScaleY:k/a/u,isSDF:r}};if(i&&(o.stretchX||o.stretchY)){const e=dc(h,y,f),t=dc(p,g,m);for(let r=0;r<e.length-1;r++){const i=e[r],o=e[r+1];for(let e=0;e<t.length-1;e++)n.push(A(i,t[e],o,t[e+1]))}}else n.push(A({fixed:0,stretch:-1},{fixed:0,stretch:-1},{fixed:0,stretch:s+1},{fixed:0,stretch:l+1}));return n}function pc(e,t,r){let i=0;for(const n of e)i+=Math.max(t,Math.min(r,n[1]))-Math.max(t,Math.min(r,n[0]));return i}function dc(e,t,r){const i=[{fixed:-1,stretch:0}];for(const[t,r]of e){const e=i[i.length-1];i.push({fixed:t-e.stretch,stretch:e.stretch}),i.push({fixed:t-e.stretch,stretch:e.stretch+(r-t)})}return i.push({fixed:t+1,stretch:r}),i}function fc(e,t,r,i){return e/t*r+i}function mc(e,t,r,i){return e-t*r/i}ki("Anchor",rc);class yc{constructor(e,t,r,i,n,o,a,s,l,c){if(this.boxStartIndex=e.length,l){let e=o.top,t=o.bottom;const r=o.collisionPadding;r&&(e-=r[1],t+=r[3]);let i=t-e;i>0&&(i=Math.max(10,i),this.circleDiameter=i)}else{let l=o.top*a-s[0],u=o.bottom*a+s[2],h=o.left*a-s[3],p=o.right*a+s[1];const d=o.collisionPadding;if(d&&(h-=d[0]*a,l-=d[1]*a,p+=d[2]*a,u+=d[3]*a),c){const e=new T(h,l),t=new T(p,l),r=new T(h,u),i=new T(p,u),n=c*Math.PI/180;e._rotate(n),t._rotate(n),r._rotate(n),i._rotate(n),h=Math.min(e.x,t.x,r.x,i.x),p=Math.max(e.x,t.x,r.x,i.x),l=Math.min(e.y,t.y,r.y,i.y),u=Math.max(e.y,t.y,r.y,i.y)}e.emplaceBack(t.x,t.y,h,l,p,u,r,i,n)}this.boxEndIndex=e.length}}class gc{constructor(e=[],t=_c){if(this.data=e,this.length=this.data.length,this.compare=t,this.length>0)for(let e=(this.length>>1)-1;e>=0;e--)this._down(e)}push(e){this.data.push(e),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return this.length--,this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:r}=this,i=t[e];for(;e>0;){const n=e-1>>1,o=t[n];if(r(i,o)>=0)break;t[e]=o,e=n}t[e]=i}_down(e){const{data:t,compare:r}=this,i=this.length>>1,n=t[e];for(;e<i;){let i=1+(e<<1),o=t[i];const a=i+1;if(a<this.length&&r(t[a],o)<0&&(i=a,o=t[a]),r(o,n)>=0)break;t[e]=o,e=i}t[e]=n}}function _c(e,t){return e<t?-1:e>t?1:0}function bc(e,t=1,r=!1){let i=1/0,n=1/0,o=-1/0,a=-1/0;const s=e[0];for(let e=0;e<s.length;e++){const t=s[e];(!e||t.x<i)&&(i=t.x),(!e||t.y<n)&&(n=t.y),(!e||t.x>o)&&(o=t.x),(!e||t.y>a)&&(a=t.y)}const l=Math.min(o-i,a-n);let c=l/2;const u=new gc([],vc);if(0===l)return new T(i,n);for(let t=i;t<o;t+=l)for(let r=n;r<a;r+=l)u.push(new xc(t+c,r+c,c,e));let h=function(e){let t=0,r=0,i=0;const n=e[0];for(let e=0,o=n.length,a=o-1;e<o;a=e++){const o=n[e],s=n[a],l=o.x*s.y-s.x*o.y;r+=(o.x+s.x)*l,i+=(o.y+s.y)*l,t+=3*l}return new xc(r/t,i/t,0,e)}(e),p=u.length;for(;u.length;){const i=u.pop();(i.d>h.d||!h.d)&&(h=i,r&&console.log("found best %d after %d probes",Math.round(1e4*i.d)/1e4,p)),i.max-h.d<=t||(c=i.h/2,u.push(new xc(i.p.x-c,i.p.y-c,c,e)),u.push(new xc(i.p.x+c,i.p.y-c,c,e)),u.push(new xc(i.p.x-c,i.p.y+c,c,e)),u.push(new xc(i.p.x+c,i.p.y+c,c,e)),p+=4)}return r&&(console.log(`num probes: ${p}`),console.log(`best distance: ${h.d}`)),h.p}function vc(e,t){return t.max-e.max}function xc(e,t,r,i){this.p=new T(e,t),this.h=r,this.d=function(e,t){let r=!1,i=1/0;for(let n=0;n<t.length;n++){const o=t[n];for(let t=0,n=o.length,a=n-1;t<n;a=t++){const n=o[t],s=o[a];n.y>e.y!=s.y>e.y&&e.x<(s.x-n.x)*(e.y-n.y)/(s.y-n.y)+n.x&&(r=!r),i=Math.min(i,ia(e,n,s))}}return(r?1:-1)*Math.sqrt(i)}(this.p,i),this.max=this.d+this.h*Math.SQRT2}const wc=Number.POSITIVE_INFINITY;function Sc(e,t){return t[1]!==wc?function(e,t,r){let i=0,n=0;switch(t=Math.abs(t),r=Math.abs(r),e){case"top-right":case"top-left":case"top":n=r-7;break;case"bottom-right":case"bottom-left":case"bottom":n=7-r}switch(e){case"top-right":case"bottom-right":case"right":i=-t;break;case"top-left":case"bottom-left":case"left":i=t}return[i,n]}(e,t[0],t[1]):function(e,t){let r=0,i=0;t<0&&(t=0);const n=t/Math.sqrt(2);switch(e){case"top-right":case"top-left":i=n-7;break;case"bottom-right":case"bottom-left":i=7-n;break;case"bottom":i=7-t;break;case"top":i=t-7}switch(e){case"top-right":case"bottom-right":r=-n;break;case"top-left":case"bottom-left":r=n;break;case"left":r=t;break;case"right":r=-t}return[r,i]}(e,t[0])}function Ec(e){switch(e){case"right":case"top-right":case"bottom-right":return"right";case"left":case"top-left":case"bottom-left":return"left"}return"center"}function Tc(t,r,i,n,o,a,s,l,c,u,h){let p=a.textMaxSize.evaluate(r,{});void 0===p&&(p=s);const d=t.layers[0].layout,m=d.get("icon-offset").evaluate(r,{},h),y=Ic(i.horizontal),g=s/24,_=t.tilePixelRatio*g,b=t.tilePixelRatio*p/24,v=t.tilePixelRatio*l,x=t.tilePixelRatio*d.get("symbol-spacing"),w=d.get("text-padding")*t.tilePixelRatio,S=function(e,t,r,i=1){const n=e.get("icon-padding").evaluate(t,{},r),o=n&&n.values;return[o[0]*i,o[1]*i,o[2]*i,o[3]*i]}(d,r,h,t.tilePixelRatio),E=d.get("text-max-angle")/180*Math.PI,T="viewport"!==d.get("text-rotation-alignment")&&"point"!==d.get("symbol-placement"),k="map"===d.get("icon-rotation-alignment")&&"point"!==d.get("symbol-placement"),A=d.get("symbol-placement"),I=x/2,P=d.get("icon-text-fit");let C;n&&"none"!==P&&(t.allowVerticalPlacement&&i.vertical&&(C=Ql(n,i.vertical,P,d.get("icon-text-fit-padding"),m,g)),y&&(n=Ql(n,y,P,d.get("icon-text-fit-padding"),m,g)));const z=(l,p)=>{p.x<0||p.x>=qo||p.y<0||p.y>=qo||function(t,r,i,n,o,a,s,l,c,u,h,p,d,m,y,g,_,b,v,x,w,S,E,T,k){const A=t.addToLineVertexArray(r,i);let I,P,C,z,M=0,O=0,D=0,L=0,j=-1,R=-1;const B={};let F=bo.exports(""),N=0,U=0;if(void 0===l._unevaluatedLayout.getValue("text-radial-offset")?[N,U]=l.layout.get("text-offset").evaluate(w,{},T).map((e=>e*ll)):(N=l.layout.get("text-radial-offset").evaluate(w,{},T)*ll,U=wc),t.allowVerticalPlacement&&n.vertical){const e=l.layout.get("text-rotate").evaluate(w,{},T)+90;C=new yc(c,r,u,h,p,n.vertical,d,m,y,e),s&&(z=new yc(c,r,u,h,p,s,_,b,y,e))}if(o){const i=l.layout.get("icon-rotate").evaluate(w,{}),n="none"!==l.layout.get("icon-text-fit"),a=hc(o,i,E,n),d=s?hc(s,i,E,n):void 0;P=new yc(c,r,u,h,p,o,_,b,!1,i),M=4*a.length;const m=t.iconSizeData;let y=null;"source"===m.kind?(y=[ec*l.layout.get("icon-size").evaluate(w,{})],y[0]>kc&&f(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)):"composite"===m.kind&&(y=[ec*S.compositeIconSizes[0].evaluate(w,{},T),ec*S.compositeIconSizes[1].evaluate(w,{},T)],(y[0]>kc||y[1]>kc)&&f(`${t.layerIds[0]}: Value for "icon-size" is >= 255. Reduce your "icon-size".`)),t.addSymbols(t.icon,a,y,x,v,w,e.WritingMode.none,r,A.lineStartIndex,A.lineLength,-1,T),j=t.icon.placedSymbolArray.length-1,d&&(O=4*d.length,t.addSymbols(t.icon,d,y,x,v,w,e.WritingMode.vertical,r,A.lineStartIndex,A.lineLength,-1,T),R=t.icon.placedSymbolArray.length-1)}const V=Object.keys(n.horizontal);for(const i of V){const o=n.horizontal[i];if(!I){F=bo.exports(o.text);const e=l.layout.get("text-rotate").evaluate(w,{},T);I=new yc(c,r,u,h,p,o,d,m,y,e)}const s=1===o.positionedLines.length;if(D+=Ac(t,r,o,a,l,y,w,g,A,n.vertical?e.WritingMode.horizontal:e.WritingMode.horizontalOnly,s?V:[i],B,j,S,T),s)break}n.vertical&&(L+=Ac(t,r,n.vertical,a,l,y,w,g,A,e.WritingMode.vertical,["vertical"],B,R,S,T));const q=I?I.boxStartIndex:t.collisionBoxArray.length,$=I?I.boxEndIndex:t.collisionBoxArray.length,G=C?C.boxStartIndex:t.collisionBoxArray.length,Z=C?C.boxEndIndex:t.collisionBoxArray.length,W=P?P.boxStartIndex:t.collisionBoxArray.length,X=P?P.boxEndIndex:t.collisionBoxArray.length,K=z?z.boxStartIndex:t.collisionBoxArray.length,H=z?z.boxEndIndex:t.collisionBoxArray.length;let J=-1;const Y=(e,t)=>e&&e.circleDiameter?Math.max(e.circleDiameter,t):t;J=Y(I,J),J=Y(C,J),J=Y(P,J),J=Y(z,J);const Q=J>-1?1:0;Q&&(J*=k/ll),t.glyphOffsetArray.length>=Rc.MAX_GLYPHS&&f("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"),void 0!==w.sortKey&&t.addToSortKeyRanges(t.symbolInstances.length,w.sortKey),t.symbolInstances.emplaceBack(r.x,r.y,B.right>=0?B.right:-1,B.center>=0?B.center:-1,B.left>=0?B.left:-1,B.vertical||-1,j,R,F,q,$,G,Z,W,X,K,H,u,D,L,M,O,Q,0,d,N,U,J)}(t,p,l,i,n,o,C,t.layers[0],t.collisionBoxArray,r.index,r.sourceLayerIndex,t.index,_,[w,w,w,w],T,c,v,S,k,m,r,a,u,h,s)};if("line"===A)for(const e of uc(r.geometry,0,0,qo,qo)){const r=lc(e,x,E,i.vertical||y,n,24,b,t.overscaling,qo);for(const i of r){const r=y;r&&Pc(t,r.text,I,i)||z(e,i)}}else if("line-center"===A){for(const e of r.geometry)if(e.length>1){const t=sc(e,E,i.vertical||y,n,24,b);t&&z(e,t)}}else if("Polygon"===r.type)for(const e of ps(r.geometry,0)){const t=bc(e,16);z(e[0],new rc(t.x,t.y,0))}else if("LineString"===r.type)for(const e of r.geometry)z(e,new rc(e[0].x,e[0].y,0));else if("Point"===r.type)for(const e of r.geometry)for(const t of e)z([t],new rc(t.x,t.y,0))}const kc=32640;function Ac(e,t,r,i,n,o,a,s,l,c,u,h,p,d,m){const y=function(e,t,r,i,n,o,a,s){const l=i.layout.get("text-rotate").evaluate(o,{})*Math.PI/180,c=[];for(const e of t.positionedLines)for(const i of e.positionedGlyphs){if(!i.rect)continue;const o=i.rect||{};let u=4,h=!0,p=1,d=0;const f=(n||s)&&i.vertical,m=i.metrics.advance*i.scale/2;if(s&&t.verticalizable){const t=(i.scale-1)*ll,r=(ll-i.metrics.width*i.scale)/2;d=e.lineOffset/2-(i.imageName?-r:t)}if(i.imageName){const e=a[i.imageName];h=e.sdf,p=e.pixelRatio,u=1/p}const y=n?[i.x+m,i.y]:[0,0];let g=n?[0,0]:[i.x+m+r[0],i.y+r[1]-d],_=[0,0];f&&(_=g,g=[0,0]);const b=(i.metrics.left-u)*i.scale-m+g[0],v=(-i.metrics.top-u)*i.scale+g[1],x=b+o.w*i.scale/p,w=v+o.h*i.scale/p,S=new T(b,v),E=new T(x,v),k=new T(b,w),A=new T(x,w);if(f){const e=new T(-m,m-Bl),t=-Math.PI/2,r=12-m,n=new T(22-r,-(i.imageName?r:0)),o=new T(..._);S._rotateAround(t,e)._add(n)._add(o),E._rotateAround(t,e)._add(n)._add(o),k._rotateAround(t,e)._add(n)._add(o),A._rotateAround(t,e)._add(n)._add(o)}if(l){const e=Math.sin(l),t=Math.cos(l),r=[t,-e,e,t];S._matMult(r),E._matMult(r),k._matMult(r),A._matMult(r)}const I=new T(0,0),P=new T(0,0);c.push({tl:S,tr:E,bl:k,br:A,tex:o,writingMode:t.writingMode,glyphOffset:y,sectionIndex:i.sectionIndex,isSDF:h,pixelOffsetTL:I,pixelOffsetBR:P,minFontScaleX:0,minFontScaleY:0})}return c}(0,r,s,n,o,a,i,e.allowVerticalPlacement),g=e.textSizeData;let _=null;"source"===g.kind?(_=[ec*n.layout.get("text-size").evaluate(a,{})],_[0]>kc&&f(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)):"composite"===g.kind&&(_=[ec*d.compositeTextSizes[0].evaluate(a,{},m),ec*d.compositeTextSizes[1].evaluate(a,{},m)],(_[0]>kc||_[1]>kc)&&f(`${e.layerIds[0]}: Value for "text-size" is >= 255. Reduce your "text-size".`)),e.addSymbols(e.text,y,_,s,o,a,c,t,l.lineStartIndex,l.lineLength,p,m);for(const t of u)h[t]=e.text.placedSymbolArray.length-1;return 4*y.length}function Ic(e){for(const t in e)return e[t];return null}function Pc(e,t,r,i){const n=e.compareText;if(t in n){const e=n[t];for(let t=e.length-1;t>=0;t--)if(i.dist(e[t])<r)return!0}else n[t]=[];return n[t].push(i),!1}const Cc=ws.VectorTileFeature.types,zc=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function Mc(e,t,r,i,n,o,a,s,l,c,u,h,p){const d=s?Math.min(kc,Math.round(s[0])):0,f=s?Math.min(kc,Math.round(s[1])):0;e.emplaceBack(t,r,Math.round(32*i),Math.round(32*n),o,a,(d<<1)+(l?1:0),f,16*c,16*u,256*h,256*p)}function Oc(e,t,r){e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r),e.emplaceBack(t.x,t.y,r)}function Dc(e){for(const t of e.sections)if(Fi(t.text))return!0;return!1}class Lc{constructor(e){this.layoutVertexArray=new ao,this.indexArray=new ho,this.programConfigurations=e,this.segments=new yo,this.dynamicLayoutVertexArray=new so,this.opacityVertexArray=new lo,this.placedSymbolArray=new Zn}isEmpty(){return 0===this.layoutVertexArray.length&&0===this.indexArray.length&&0===this.dynamicLayoutVertexArray.length&&0===this.opacityVertexArray.length}upload(e,t,r,i){this.isEmpty()||(r&&(this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,tl.members),this.indexBuffer=e.createIndexBuffer(this.indexArray,t),this.dynamicLayoutVertexBuffer=e.createVertexBuffer(this.dynamicLayoutVertexArray,rl.members,!0),this.opacityVertexBuffer=e.createVertexBuffer(this.opacityVertexArray,zc,!0),this.opacityVertexBuffer.itemSize=1),(r||i)&&this.programConfigurations.upload(e))}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}ki("SymbolBuffers",Lc);class jc{constructor(e,t,r){this.layoutVertexArray=new e,this.layoutAttributes=t,this.indexArray=new r,this.segments=new yo,this.collisionVertexArray=new uo}upload(e){this.layoutVertexBuffer=e.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=e.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=e.createVertexBuffer(this.collisionVertexArray,il.members,!0)}destroy(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}ki("CollisionBuffers",jc);class Rc{constructor(t){this.collisionBoxArray=t.collisionBoxArray,this.zoom=t.zoom,this.overscaling=t.overscaling,this.layers=t.layers,this.layerIds=this.layers.map((e=>e.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=ma([]),this.placementViewportMatrix=ma([]);const r=this.layers[0]._unevaluatedLayout._values;this.textSizeData=tc(this.zoom,r["text-size"]),this.iconSizeData=tc(this.zoom,r["icon-size"]);const i=this.layers[0].layout,n=i.get("symbol-sort-key"),o=i.get("symbol-z-order");this.canOverlap="never"!==Vc(i,"text-overlap","text-allow-overlap")||"never"!==Vc(i,"icon-overlap","icon-allow-overlap")||i.get("text-ignore-placement")||i.get("icon-ignore-placement"),this.sortFeaturesByKey="viewport-y"!==o&&!n.isConstant(),this.sortFeaturesByY=("viewport-y"===o||"auto"===o&&!this.sortFeaturesByKey)&&this.canOverlap,"point"===i.get("symbol-placement")&&(this.writingModes=i.get("text-writing-mode").map((t=>e.WritingMode[t]))),this.stateDependentLayerIds=this.layers.filter((e=>e.isStateDependent())).map((e=>e.id)),this.sourceID=t.sourceID}createArrays(){this.text=new Lc(new No(this.layers,this.zoom,(e=>/^text/.test(e)))),this.icon=new Lc(new No(this.layers,this.zoom,(e=>/^icon/.test(e)))),this.glyphOffsetArray=new Kn,this.lineVertexArray=new Hn,this.symbolInstances=new Xn}calculateGlyphDependencies(e,t,r,i,n){for(let o=0;o<e.length;o++)if(t[e.charCodeAt(o)]=!0,(r||i)&&n){const r=sl[e.charAt(o)];r&&(t[r.charCodeAt(0)]=!0)}}populate(t,r,i){const n=this.layers[0],o=n.layout,a=o.get("text-font"),s=o.get("text-field"),l=o.get("icon-image"),c=("constant"!==s.value.kind||s.value.value instanceof Re&&!s.value.value.isEmpty()||s.value.value.toString().length>0)&&("constant"!==a.value.kind||a.value.value.length>0),u="constant"!==l.value.kind||!!l.value.value||Object.keys(l.parameters).length>0,h=o.get("symbol-sort-key");if(this.features=[],!c&&!u)return;const p=r.iconDependencies,d=r.glyphDependencies,f=r.availableImages,m=new Yi(this.zoom);for(const{feature:r,id:s,index:l,sourceLayerIndex:y}of t){const t=n._featureFilter.needGeometry,g=Wo(r,t);if(!n._featureFilter.filter(m,g,i))continue;let _,b;if(t||(g.geometry=Zo(r)),c){const e=n.getValueAndResolveTokens("text-field",g,i,f),t=Re.factory(e);Dc(t)&&(this.hasRTLText=!0),(!this.hasRTLText||"unavailable"===Ki()||this.hasRTLText&&Ji.isParsed())&&(_=al(t,n,g))}if(u){const e=n.getValueAndResolveTokens("icon-image",g,i,f);b=e instanceof Fe?e:Fe.fromString(e)}if(!_&&!b)continue;const v=this.sortFeaturesByKey?h.evaluate(g,{},i):void 0;if(this.features.push({id:s,text:_,icon:b,index:l,sourceLayerIndex:y,geometry:g.geometry,properties:r.properties,type:Cc[r.type],sortKey:v}),b&&(p[b.name]=!0),_){const t=a.evaluate(g,{},i).join(","),r="viewport"!==o.get("text-rotation-alignment")&&"point"!==o.get("symbol-placement");this.allowVerticalPlacement=this.writingModes&&this.writingModes.indexOf(e.WritingMode.vertical)>=0;for(const e of _.sections)if(e.image)p[e.image.name]=!0;else{const i=Mi(_.toString()),n=e.fontStack||t,o=d[n]=d[n]||{};this.calculateGlyphDependencies(e.text,o,r,this.allowVerticalPlacement,i)}}}"line"===o.get("symbol-placement")&&(this.features=function(e){const t={},r={},i=[];let n=0;function o(t){i.push(e[t]),n++}function a(e,t,n){const o=r[e];return delete r[e],r[t]=o,i[o].geometry[0].pop(),i[o].geometry[0]=i[o].geometry[0].concat(n[0]),o}function s(e,r,n){const o=t[r];return delete t[r],t[e]=o,i[o].geometry[0].shift(),i[o].geometry[0]=n[0].concat(i[o].geometry[0]),o}function l(e,t,r){const i=r?t[0][t[0].length-1]:t[0][0];return`${e}:${i.x}:${i.y}`}for(let c=0;c<e.length;c++){const u=e[c],h=u.geometry,p=u.text?u.text.toString():null;if(!p){o(c);continue}const d=l(p,h),f=l(p,h,!0);if(d in r&&f in t&&r[d]!==t[f]){const e=s(d,f,h),n=a(d,f,i[e].geometry);delete t[d],delete r[f],r[l(p,i[n].geometry,!0)]=n,i[e].geometry=null}else d in r?a(d,f,h):f in t?s(d,f,h):(o(c),t[d]=n-1,r[f]=n-1)}return i.filter((e=>e.geometry))}(this.features)),this.sortFeaturesByKey&&this.features.sort(((e,t)=>e.sortKey-t.sortKey))}update(e,t,r){this.stateDependentLayers.length&&(this.text.programConfigurations.updatePaintArrays(e,t,this.layers,r),this.icon.programConfigurations.updatePaintArrays(e,t,this.layers,r))}isEmpty(){return 0===this.symbolInstances.length&&!this.hasRTLText}uploadPending(){return!this.uploaded||this.text.programConfigurations.needsUpload||this.icon.programConfigurations.needsUpload}upload(e){!this.uploaded&&this.hasDebugData()&&(this.textCollisionBox.upload(e),this.iconCollisionBox.upload(e)),this.text.upload(e,this.sortFeaturesByY,!this.uploaded,this.text.programConfigurations.needsUpload),this.icon.upload(e,this.sortFeaturesByY,!this.uploaded,this.icon.programConfigurations.needsUpload),this.uploaded=!0}destroyDebugData(){this.textCollisionBox.destroy(),this.iconCollisionBox.destroy()}destroy(){this.text.destroy(),this.icon.destroy(),this.hasDebugData()&&this.destroyDebugData()}addToLineVertexArray(e,t){const r=this.lineVertexArray.length;if(void 0!==e.segment){let r=e.dist(t[e.segment+1]),i=e.dist(t[e.segment]);const n={};for(let i=e.segment+1;i<t.length;i++)n[i]={x:t[i].x,y:t[i].y,tileUnitDistanceFromAnchor:r},i<t.length-1&&(r+=t[i+1].dist(t[i]));for(let r=e.segment||0;r>=0;r--)n[r]={x:t[r].x,y:t[r].y,tileUnitDistanceFromAnchor:i},r>0&&(i+=t[r-1].dist(t[r]));for(let e=0;e<t.length;e++){const t=n[e];this.lineVertexArray.emplaceBack(t.x,t.y,t.tileUnitDistanceFromAnchor)}}return{lineStartIndex:r,lineLength:this.lineVertexArray.length-r}}addSymbols(t,r,i,n,o,a,s,l,c,u,h,p){const d=t.indexArray,f=t.layoutVertexArray,m=t.segments.prepareSegment(4*r.length,f,d,this.canOverlap?a.sortKey:void 0),y=this.glyphOffsetArray.length,g=m.vertexLength,_=this.allowVerticalPlacement&&s===e.WritingMode.vertical?Math.PI/2:0,b=a.text&&a.text.sections;for(let e=0;e<r.length;e++){const{tl:n,tr:o,bl:s,br:c,tex:u,pixelOffsetTL:h,pixelOffsetBR:y,minFontScaleX:g,minFontScaleY:v,glyphOffset:x,isSDF:w,sectionIndex:S}=r[e],E=m.vertexLength,T=x[1];Mc(f,l.x,l.y,n.x,T+n.y,u.x,u.y,i,w,h.x,h.y,g,v),Mc(f,l.x,l.y,o.x,T+o.y,u.x+u.w,u.y,i,w,y.x,h.y,g,v),Mc(f,l.x,l.y,s.x,T+s.y,u.x,u.y+u.h,i,w,h.x,y.y,g,v),Mc(f,l.x,l.y,c.x,T+c.y,u.x+u.w,u.y+u.h,i,w,y.x,y.y,g,v),Oc(t.dynamicLayoutVertexArray,l,_),d.emplaceBack(E,E+1,E+2),d.emplaceBack(E+1,E+2,E+3),m.vertexLength+=4,m.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(x[0]),e!==r.length-1&&S===r[e+1].sectionIndex||t.programConfigurations.populatePaintArrays(f.length,a,a.index,{},p,b&&b[S])}t.placedSymbolArray.emplaceBack(l.x,l.y,y,this.glyphOffsetArray.length-y,g,c,u,l.segment,i?i[0]:0,i?i[1]:0,n[0],n[1],s,0,!1,0,h)}_addCollisionDebugVertex(e,t,r,i,n,o){return t.emplaceBack(0,0),e.emplaceBack(r.x,r.y,i,n,Math.round(o.x),Math.round(o.y))}addCollisionDebugVertices(e,t,r,i,n,o,a){const s=n.segments.prepareSegment(4,n.layoutVertexArray,n.indexArray),l=s.vertexLength,c=n.layoutVertexArray,u=n.collisionVertexArray,h=a.anchorX,p=a.anchorY;this._addCollisionDebugVertex(c,u,o,h,p,new T(e,t)),this._addCollisionDebugVertex(c,u,o,h,p,new T(r,t)),this._addCollisionDebugVertex(c,u,o,h,p,new T(r,i)),this._addCollisionDebugVertex(c,u,o,h,p,new T(e,i)),s.vertexLength+=4;const d=n.indexArray;d.emplaceBack(l,l+1),d.emplaceBack(l+1,l+2),d.emplaceBack(l+2,l+3),d.emplaceBack(l+3,l),s.primitiveLength+=4}addDebugCollisionBoxes(e,t,r,i){for(let n=e;n<t;n++){const e=this.collisionBoxArray.get(n);this.addCollisionDebugVertices(e.x1,e.y1,e.x2,e.y2,i?this.textCollisionBox:this.iconCollisionBox,e.anchorPoint,r)}}generateCollisionDebugBuffers(){this.hasDebugData()&&this.destroyDebugData(),this.textCollisionBox=new jc(co,nl.members,po),this.iconCollisionBox=new jc(co,nl.members,po);for(let e=0;e<this.symbolInstances.length;e++){const t=this.symbolInstances.get(e);this.addDebugCollisionBoxes(t.textBoxStartIndex,t.textBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.verticalTextBoxStartIndex,t.verticalTextBoxEndIndex,t,!0),this.addDebugCollisionBoxes(t.iconBoxStartIndex,t.iconBoxEndIndex,t,!1),this.addDebugCollisionBoxes(t.verticalIconBoxStartIndex,t.verticalIconBoxEndIndex,t,!1)}}_deserializeCollisionBoxesForSymbol(e,t,r,i,n,o,a,s,l){const c={};for(let i=t;i<r;i++){const t=e.get(i);c.textBox={x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,anchorPointX:t.anchorPointX,anchorPointY:t.anchorPointY},c.textFeatureIndex=t.featureIndex;break}for(let t=i;t<n;t++){const r=e.get(t);c.verticalTextBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},c.verticalTextFeatureIndex=r.featureIndex;break}for(let t=o;t<a;t++){const r=e.get(t);c.iconBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},c.iconFeatureIndex=r.featureIndex;break}for(let t=s;t<l;t++){const r=e.get(t);c.verticalIconBox={x1:r.x1,y1:r.y1,x2:r.x2,y2:r.y2,anchorPointX:r.anchorPointX,anchorPointY:r.anchorPointY},c.verticalIconFeatureIndex=r.featureIndex;break}return c}deserializeCollisionBoxes(e){this.collisionArrays=[];for(let t=0;t<this.symbolInstances.length;t++){const r=this.symbolInstances.get(t);this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(e,r.textBoxStartIndex,r.textBoxEndIndex,r.verticalTextBoxStartIndex,r.verticalTextBoxEndIndex,r.iconBoxStartIndex,r.iconBoxEndIndex,r.verticalIconBoxStartIndex,r.verticalIconBoxEndIndex))}}hasTextData(){return this.text.segments.get().length>0}hasIconData(){return this.icon.segments.get().length>0}hasDebugData(){return this.textCollisionBox&&this.iconCollisionBox}hasTextCollisionBoxData(){return this.hasDebugData()&&this.textCollisionBox.segments.get().length>0}hasIconCollisionBoxData(){return this.hasDebugData()&&this.iconCollisionBox.segments.get().length>0}addIndicesForPlacedSymbol(e,t){const r=e.placedSymbolArray.get(t),i=r.vertexStartIndex+4*r.numGlyphs;for(let t=r.vertexStartIndex;t<i;t+=4)e.indexArray.emplaceBack(t,t+1,t+2),e.indexArray.emplaceBack(t+1,t+2,t+3)}getSortedSymbolIndexes(e){if(this.sortedAngle===e&&void 0!==this.symbolInstanceIndexes)return this.symbolInstanceIndexes;const t=Math.sin(e),r=Math.cos(e),i=[],n=[],o=[];for(let e=0;e<this.symbolInstances.length;++e){o.push(e);const a=this.symbolInstances.get(e);i.push(0|Math.round(t*a.anchorX+r*a.anchorY)),n.push(a.featureIndex)}return o.sort(((e,t)=>i[e]-i[t]||n[t]-n[e])),o}addToSortKeyRanges(e,t){const r=this.sortKeyRanges[this.sortKeyRanges.length-1];r&&r.sortKey===t?r.symbolInstanceEnd=e+1:this.sortKeyRanges.push({sortKey:t,symbolInstanceStart:e,symbolInstanceEnd:e+1})}sortFeatures(e){if(this.sortFeaturesByY&&this.sortedAngle!==e&&!(this.text.segments.get().length>1||this.icon.segments.get().length>1)){this.symbolInstanceIndexes=this.getSortedSymbolIndexes(e),this.sortedAngle=e,this.text.indexArray.clear(),this.icon.indexArray.clear(),this.featureSortOrder=[];for(const e of this.symbolInstanceIndexes){const t=this.symbolInstances.get(e);this.featureSortOrder.push(t.featureIndex),[t.rightJustifiedTextSymbolIndex,t.centerJustifiedTextSymbolIndex,t.leftJustifiedTextSymbolIndex].forEach(((e,t,r)=>{e>=0&&r.indexOf(e)===t&&this.addIndicesForPlacedSymbol(this.text,e)})),t.verticalPlacedTextSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.text,t.verticalPlacedTextSymbolIndex),t.placedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.placedIconSymbolIndex),t.verticalPlacedIconSymbolIndex>=0&&this.addIndicesForPlacedSymbol(this.icon,t.verticalPlacedIconSymbolIndex)}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}ki("SymbolBucket",Rc,{omit:["layers","collisionBoxArray","features","compareText"]}),Rc.MAX_GLYPHS=65535,Rc.addDynamicAttributes=Oc;const Bc=new dn({"symbol-placement":new ln(ie.layout_symbol["symbol-placement"]),"symbol-spacing":new ln(ie.layout_symbol["symbol-spacing"]),"symbol-avoid-edges":new ln(ie.layout_symbol["symbol-avoid-edges"]),"symbol-sort-key":new cn(ie.layout_symbol["symbol-sort-key"]),"symbol-z-order":new ln(ie.layout_symbol["symbol-z-order"]),"icon-allow-overlap":new ln(ie.layout_symbol["icon-allow-overlap"]),"icon-overlap":new ln(ie.layout_symbol["icon-overlap"]),"icon-ignore-placement":new ln(ie.layout_symbol["icon-ignore-placement"]),"icon-optional":new ln(ie.layout_symbol["icon-optional"]),"icon-rotation-alignment":new ln(ie.layout_symbol["icon-rotation-alignment"]),"icon-size":new cn(ie.layout_symbol["icon-size"]),"icon-text-fit":new ln(ie.layout_symbol["icon-text-fit"]),"icon-text-fit-padding":new ln(ie.layout_symbol["icon-text-fit-padding"]),"icon-image":new cn(ie.layout_symbol["icon-image"]),"icon-rotate":new cn(ie.layout_symbol["icon-rotate"]),"icon-padding":new cn(ie.layout_symbol["icon-padding"]),"icon-keep-upright":new ln(ie.layout_symbol["icon-keep-upright"]),"icon-offset":new cn(ie.layout_symbol["icon-offset"]),"icon-anchor":new cn(ie.layout_symbol["icon-anchor"]),"icon-pitch-alignment":new ln(ie.layout_symbol["icon-pitch-alignment"]),"text-pitch-alignment":new ln(ie.layout_symbol["text-pitch-alignment"]),"text-rotation-alignment":new ln(ie.layout_symbol["text-rotation-alignment"]),"text-field":new cn(ie.layout_symbol["text-field"]),"text-font":new cn(ie.layout_symbol["text-font"]),"text-size":new cn(ie.layout_symbol["text-size"]),"text-max-width":new cn(ie.layout_symbol["text-max-width"]),"text-line-height":new ln(ie.layout_symbol["text-line-height"]),"text-letter-spacing":new cn(ie.layout_symbol["text-letter-spacing"]),"text-justify":new cn(ie.layout_symbol["text-justify"]),"text-radial-offset":new cn(ie.layout_symbol["text-radial-offset"]),"text-variable-anchor":new ln(ie.layout_symbol["text-variable-anchor"]),"text-anchor":new cn(ie.layout_symbol["text-anchor"]),"text-max-angle":new ln(ie.layout_symbol["text-max-angle"]),"text-writing-mode":new ln(ie.layout_symbol["text-writing-mode"]),"text-rotate":new cn(ie.layout_symbol["text-rotate"]),"text-padding":new ln(ie.layout_symbol["text-padding"]),"text-keep-upright":new ln(ie.layout_symbol["text-keep-upright"]),"text-transform":new cn(ie.layout_symbol["text-transform"]),"text-offset":new cn(ie.layout_symbol["text-offset"]),"text-allow-overlap":new ln(ie.layout_symbol["text-allow-overlap"]),"text-overlap":new ln(ie.layout_symbol["text-overlap"]),"text-ignore-placement":new ln(ie.layout_symbol["text-ignore-placement"]),"text-optional":new ln(ie.layout_symbol["text-optional"])});var Fc={paint:new dn({"icon-opacity":new cn(ie.paint_symbol["icon-opacity"]),"icon-color":new cn(ie.paint_symbol["icon-color"]),"icon-halo-color":new cn(ie.paint_symbol["icon-halo-color"]),"icon-halo-width":new cn(ie.paint_symbol["icon-halo-width"]),"icon-halo-blur":new cn(ie.paint_symbol["icon-halo-blur"]),"icon-translate":new ln(ie.paint_symbol["icon-translate"]),"icon-translate-anchor":new ln(ie.paint_symbol["icon-translate-anchor"]),"text-opacity":new cn(ie.paint_symbol["text-opacity"]),"text-color":new cn(ie.paint_symbol["text-color"],{runtimeType:me,getOverride:e=>e.textColor,hasOverride:e=>!!e.textColor}),"text-halo-color":new cn(ie.paint_symbol["text-halo-color"]),"text-halo-width":new cn(ie.paint_symbol["text-halo-width"]),"text-halo-blur":new cn(ie.paint_symbol["text-halo-blur"]),"text-translate":new ln(ie.paint_symbol["text-translate"]),"text-translate-anchor":new ln(ie.paint_symbol["text-translate-anchor"])}),layout:Bc};class Nc{constructor(e){if(void 0===e.property.overrides)throw new Error("overrides must be provided to instantiate FormatSectionOverride class");this.type=e.property.overrides?e.property.overrides.runtimeType:he,this.defaultValue=e}evaluate(e){if(e.formattedSection){const t=this.defaultValue.property.overrides;if(t&&t.hasOverride(e.formattedSection))return t.getOverride(e.formattedSection)}return e.feature&&e.featureState?this.defaultValue.evaluate(e.feature,e.featureState):this.defaultValue.property.specification.default}eachChild(e){this.defaultValue.isConstant()||e(this.defaultValue.value._styleExpression.expression)}outputDefined(){return!1}serialize(){return null}}ki("FormatSectionOverride",Nc,{omit:["defaultValue"]});class Uc extends mn{constructor(e){super(e,Fc)}recalculate(e,t){if(super.recalculate(e,t),"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"]="map"===this.layout.get("text-rotation-alignment")?"map":"viewport"),"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")){const e=this.layout.get("text-writing-mode");if(e){const t=[];for(const r of e)t.indexOf(r)<0&&t.push(r);this.layout._values["text-writing-mode"]=t}else this.layout._values["text-writing-mode"]=["horizontal"]}this._setPaintOverrides()}getValueAndResolveTokens(e,t,r,i){const n=this.layout.get(e).evaluate(t,{},r,i),o=this._unevaluatedLayout._values[e];return o.isDataDriven()||Or(o.value)||!n?n:function(e,t){return t.replace(/{([^{}]+)}/g,((t,r)=>r in e?String(e[r]):""))}(t.properties,n)}createBucket(e){return new Rc(e)}queryRadius(){return 0}queryIntersectsFeature(){throw new Error("Should take a different path in FeatureIndex")}_setPaintOverrides(){for(const e of Fc.paint.overridableProperties){if(!Uc.hasPaintOverride(this.layout,e))continue;const t=this.paint.get(e),r=new Nc(t),i=new Mr(r,t.property.specification);let n=null;n="constant"===t.value.kind||"source"===t.value.kind?new Lr("source",i):new jr("composite",i,t.value.zoomStops),this.paint._values[e]=new an(t.property,n,t.parameters)}}_handleOverridablePaintPropertyUpdate(e,t,r){return!(!this.layout||t.isDataDriven()||r.isDataDriven())&&Uc.hasPaintOverride(this.layout,e)}static hasPaintOverride(e,t){const r=e.get("text-field"),i=Fc.paint.properties[t];let n=!1;const o=e=>{for(const t of e)if(i.overrides&&i.overrides.hasOverride(t))return void(n=!0)};if("constant"===r.value.kind&&r.value.value instanceof Re)o(r.value.value.sections);else if("source"===r.value.kind){const e=t=>{n||(t instanceof $e&&Ve(t.value)===be?o(t.value.sections):t instanceof ur?o(t.sections):t.eachChild(e))},t=r.value;t._styleExpression&&e(t._styleExpression.expression)}return n}}function Vc(e,t,r){let i="never";const n=e.get(t);return n?i=n:e.get(r)&&(i="always"),i}var qc={paint:new dn({"background-color":new ln(ie.paint_background["background-color"]),"background-pattern":new hn(ie.paint_background["background-pattern"]),"background-opacity":new ln(ie.paint_background["background-opacity"])})},$c={paint:new dn({"raster-opacity":new ln(ie.paint_raster["raster-opacity"]),"raster-hue-rotate":new ln(ie.paint_raster["raster-hue-rotate"]),"raster-brightness-min":new ln(ie.paint_raster["raster-brightness-min"]),"raster-brightness-max":new ln(ie.paint_raster["raster-brightness-max"]),"raster-saturation":new ln(ie.paint_raster["raster-saturation"]),"raster-contrast":new ln(ie.paint_raster["raster-contrast"]),"raster-resampling":new ln(ie.paint_raster["raster-resampling"]),"raster-fade-duration":new ln(ie.paint_raster["raster-fade-duration"])})};class Gc extends mn{constructor(e){super(e,{}),this.onAdd=e=>{this.implementation.onAdd&&this.implementation.onAdd(e,e.painter.context.gl)},this.onRemove=e=>{this.implementation.onRemove&&this.implementation.onRemove(e,e.painter.context.gl)},this.implementation=e}is3D(){return"3d"===this.implementation.renderingMode}hasOffscreenPass(){return void 0!==this.implementation.prerender}recalculate(){}updateTransitions(){}hasTransition(){return!1}serialize(){throw new Error("Custom layers cannot be serialized")}}const Zc={circle:class extends mn{constructor(e){super(e,ha)}createBucket(e){return new Ko(e)}queryRadius(e){const t=e;return sa("circle-radius",this,t)+sa("circle-stroke-width",this,t)+la(this.paint.get("circle-translate"))}queryIntersectsFeature(e,t,r,i,n,o,a,s){const l=ca(e,this.paint.get("circle-translate"),this.paint.get("circle-translate-anchor"),o.angle,a),c=this.paint.get("circle-radius").evaluate(t,r)+this.paint.get("circle-stroke-width").evaluate(t,r),u="map"===this.paint.get("circle-pitch-alignment"),h=u?l:function(e,t){return e.map((e=>Sa(e,t)))}(l,s),p=u?c*a:c;for(const e of i)for(const t of e){const e=u?t:Sa(t,s);let r=p;const i=xa([],[t.x,t.y,0,1],s);if("viewport"===this.paint.get("circle-pitch-scale")&&"map"===this.paint.get("circle-pitch-alignment")?r*=i[3]/o.cameraToCenterDistance:"map"===this.paint.get("circle-pitch-scale")&&"viewport"===this.paint.get("circle-pitch-alignment")&&(r*=o.cameraToCenterDistance/i[3]),Jo(h,e,r))return!0}return!1}},heatmap:class extends mn{constructor(e){super(e,Ta),this._updateColorRamp()}createBucket(e){return new Ea(e)}_handleSpecialPaintPropertyUpdate(e){"heatmap-color"===e&&this._updateColorRamp()}_updateColorRamp(){this.colorRamp=za({expression:this._transitionablePaint._values["heatmap-color"].value.expression,evaluationKey:"heatmapDensity",image:this.colorRamp}),this.colorRampTexture=null}resize(){this.heatmapFbo&&(this.heatmapFbo.destroy(),this.heatmapFbo=null)}queryRadius(){return 0}queryIntersectsFeature(){return!1}hasOffscreenPass(){return 0!==this.paint.get("heatmap-opacity")&&"none"!==this.visibility}},hillshade:class extends mn{constructor(e){super(e,Ma)}hasOffscreenPass(){return 0!==this.paint.get("hillshade-exaggeration")&&"none"!==this.visibility}},fill:class extends mn{constructor(e){super(e,_s)}recalculate(e,t){super.recalculate(e,t);const r=this.paint._values["fill-outline-color"];"constant"===r.value.kind&&void 0===r.value.value&&(this.paint._values["fill-outline-color"]=this.paint._values["fill-color"])}createBucket(e){return new ys(e)}queryRadius(){return la(this.paint.get("fill-translate"))}queryIntersectsFeature(e,t,r,i,n,o,a){return Yo(ca(e,this.paint.get("fill-translate"),this.paint.get("fill-translate-anchor"),o.angle,a),i)}isTileClipped(){return!0}},"fill-extrusion":class extends mn{constructor(e){super(e,Ns)}createBucket(e){return new Rs(e)}queryRadius(){return la(this.paint.get("fill-extrusion-translate"))}is3D(){return!0}queryIntersectsFeature(e,t,r,i,n,o,a,s){const l=ca(e,this.paint.get("fill-extrusion-translate"),this.paint.get("fill-extrusion-translate-anchor"),o.angle,a),c=this.paint.get("fill-extrusion-height").evaluate(t,r),u=this.paint.get("fill-extrusion-base").evaluate(t,r),h=function(e,t,r,i){const n=[];for(const r of e){const e=[r.x,r.y,0,1];xa(e,e,t),n.push(new T(e[0]/e[3],e[1]/e[3]))}return n}(l,s),p=function(e,t,r,i){const n=[],o=[],a=i[8]*t,s=i[9]*t,l=i[10]*t,c=i[11]*t,u=i[8]*r,h=i[9]*r,p=i[10]*r,d=i[11]*r;for(const t of e){const e=[],r=[];for(const n of t){const t=n.x,o=n.y,f=i[0]*t+i[4]*o+i[12],m=i[1]*t+i[5]*o+i[13],y=i[2]*t+i[6]*o+i[14],g=i[3]*t+i[7]*o+i[15],_=y+l,b=g+c,v=f+u,x=m+h,w=y+p,S=g+d,E=new T((f+a)/b,(m+s)/b);E.z=_/b,e.push(E);const k=new T(v/S,x/S);k.z=w/S,r.push(k)}n.push(e),o.push(r)}return[n,o]}(i,u,c,s);return function(e,t,r){let i=1/0;Yo(r,t)&&(i=Vs(r,t[0]));for(let n=0;n<t.length;n++){const o=t[n],a=e[n];for(let e=0;e<o.length-1;e++){const t=o[e],n=[t,o[e+1],a[e+1],a[e],t];Ho(r,n)&&(i=Math.min(i,Vs(r,n)))}}return i!==1/0&&i}(p[0],p[1],h)}},line:class extends mn{constructor(e){super(e,Ys),this.gradientVersion=0}_handleSpecialPaintPropertyUpdate(e){"line-gradient"===e&&(this.stepInterpolant=this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Et,this.gradientVersion=(this.gradientVersion+1)%Number.MAX_SAFE_INTEGER)}gradientExpression(){return this._transitionablePaint._values["line-gradient"].value.expression}recalculate(e,t){super.recalculate(e,t),this.paint._values["line-floorwidth"]=Qs.possiblyEvaluate(this._transitioningPaint._values["line-width"].value,e)}createBucket(e){return new Hs(e)}queryRadius(e){const t=e,r=el(sa("line-width",this,t),sa("line-gap-width",this,t)),i=sa("line-offset",this,t);return r/2+Math.abs(i)+la(this.paint.get("line-translate"))}queryIntersectsFeature(e,t,r,i,n,o,a){const s=ca(e,this.paint.get("line-translate"),this.paint.get("line-translate-anchor"),o.angle,a),l=a/2*el(this.paint.get("line-width").evaluate(t,r),this.paint.get("line-gap-width").evaluate(t,r)),c=this.paint.get("line-offset").evaluate(t,r);return c&&(i=function(e,t){const r=[];for(let i=0;i<e.length;i++){const n=e[i],o=[];for(let e=0;e<n.length;e++){const r=n[e-1],i=n[e],a=n[e+1],s=0===e?new T(0,0):i.sub(r)._unit()._perp(),l=e===n.length-1?new T(0,0):a.sub(i)._unit()._perp(),c=s._add(l)._unit(),u=c.x*l.x+c.y*l.y;0!==u&&c._mult(1/u),o.push(c._mult(t)._add(i))}r.push(o)}return r}(i,c*a)),function(e,t,r){for(let i=0;i<t.length;i++){const n=t[i];if(e.length>=3)for(let t=0;t<n.length;t++)if(oa(e,n[t]))return!0;if(Qo(e,n,r))return!0}return!1}(s,i,l)}isTileClipped(){return!0}},symbol:Uc,background:class extends mn{constructor(e){super(e,qc)}},raster:class extends mn{constructor(e){super(e,$c)}}};class Wc{constructor(e){this._callback=e,this._triggered=!1,"undefined"!=typeof MessageChannel&&(this._channel=new MessageChannel,this._channel.port2.onmessage=()=>{this._triggered=!1,this._callback()})}trigger(){this._triggered||(this._triggered=!0,this._channel?this._channel.port1.postMessage(!0):setTimeout((()=>{this._triggered=!1,this._callback()}),0))}remove(){delete this._channel,this._callback=()=>{}}}const Xc=6371008.8;class Kc{constructor(e,t){if(isNaN(e)||isNaN(t))throw new Error(`Invalid LngLat object: (${e}, ${t})`);if(this.lng=+e,this.lat=+t,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}wrap(){return new Kc(a(this.lng,-180,180),this.lat)}toArray(){return[this.lng,this.lat]}toString(){return`LngLat(${this.lng}, ${this.lat})`}distanceTo(e){const t=Math.PI/180,r=this.lat*t,i=e.lat*t,n=Math.sin(r)*Math.sin(i)+Math.cos(r)*Math.cos(i)*Math.cos((e.lng-this.lng)*t);return Xc*Math.acos(Math.min(n,1))}toBounds(e=0){const t=360*e/40075017,r=t/Math.cos(Math.PI/180*this.lat);return new Hc(new Kc(this.lng-r,this.lat-t),new Kc(this.lng+r,this.lat+t))}static convert(e){if(e instanceof Kc)return e;if(Array.isArray(e)&&(2===e.length||3===e.length))return new Kc(Number(e[0]),Number(e[1]));if(!Array.isArray(e)&&"object"==typeof e&&null!==e)return new Kc(Number("lng"in e?e.lng:e.lon),Number(e.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, an object {lon: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}class Hc{constructor(e,t){e&&(t?this.setSouthWest(e).setNorthEast(t):4===e.length?this.setSouthWest([e[0],e[1]]).setNorthEast([e[2],e[3]]):this.setSouthWest(e[0]).setNorthEast(e[1]))}setNorthEast(e){return this._ne=e instanceof Kc?new Kc(e.lng,e.lat):Kc.convert(e),this}setSouthWest(e){return this._sw=e instanceof Kc?new Kc(e.lng,e.lat):Kc.convert(e),this}extend(e){const t=this._sw,r=this._ne;let i,n;if(e instanceof Kc)i=e,n=e;else{if(!(e instanceof Hc))return Array.isArray(e)?4===e.length||e.every(Array.isArray)?this.extend(Hc.convert(e)):this.extend(Kc.convert(e)):this;if(i=e._sw,n=e._ne,!i||!n)return this}return t||r?(t.lng=Math.min(i.lng,t.lng),t.lat=Math.min(i.lat,t.lat),r.lng=Math.max(n.lng,r.lng),r.lat=Math.max(n.lat,r.lat)):(this._sw=new Kc(i.lng,i.lat),this._ne=new Kc(n.lng,n.lat)),this}getCenter(){return new Kc((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}getSouthWest(){return this._sw}getNorthEast(){return this._ne}getNorthWest(){return new Kc(this.getWest(),this.getNorth())}getSouthEast(){return new Kc(this.getEast(),this.getSouth())}getWest(){return this._sw.lng}getSouth(){return this._sw.lat}getEast(){return this._ne.lng}getNorth(){return this._ne.lat}toArray(){return[this._sw.toArray(),this._ne.toArray()]}toString(){return`LngLatBounds(${this._sw.toString()}, ${this._ne.toString()})`}isEmpty(){return!(this._sw&&this._ne)}contains(e){const{lng:t,lat:r}=Kc.convert(e);let i=this._sw.lng<=t&&t<=this._ne.lng;return this._sw.lng>this._ne.lng&&(i=this._sw.lng>=t&&t>=this._ne.lng),this._sw.lat<=r&&r<=this._ne.lat&&i}static convert(e){return e instanceof Hc?e:e?new Hc(e):e}}const Jc=2*Math.PI*Xc;function Yc(e){return Jc*Math.cos(e*Math.PI/180)}function Qc(e){return(180+e)/360}function eu(e){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+e*Math.PI/360)))/360}function tu(e,t){return e/Yc(t)}function ru(e){return 360/Math.PI*Math.atan(Math.exp((180-360*e)*Math.PI/180))-90}class iu{constructor(e,t,r=0){this.x=+e,this.y=+t,this.z=+r}static fromLngLat(e,t=0){const r=Kc.convert(e);return new iu(Qc(r.lng),eu(r.lat),tu(t,r.lat))}toLngLat(){return new Kc(360*this.x-180,ru(this.y))}toAltitude(){return this.z*Yc(ru(this.y))}meterInMercatorCoordinateUnits(){return 1/Jc*(e=ru(this.y),1/Math.cos(e*Math.PI/180));var e}}function nu(e,t,r){var i=2*Math.PI*6378137/256/Math.pow(2,r);return[e*i-2*Math.PI*6378137/2,t*i-2*Math.PI*6378137/2]}class ou{constructor(e,t,r){if(e<0||e>25||r<0||r>=Math.pow(2,e)||t<0||t>=Math.pow(2,e))throw new Error(`x=${t}, y=${r}, z=${e} outside of bounds. 0<=x<${Math.pow(2,e)}, 0<=y<${Math.pow(2,e)} 0<=z<=25 `);this.z=e,this.x=t,this.y=r,this.key=lu(0,e,e,t,r)}equals(e){return this.z===e.z&&this.x===e.x&&this.y===e.y}url(e,t,r){const i=(o=this.y,a=this.z,s=nu(256*(n=this.x),256*(o=Math.pow(2,a)-o-1),a),l=nu(256*(n+1),256*(o+1),a),s[0]+","+s[1]+","+l[0]+","+l[1]);var n,o,a,s,l;const c=function(e,t,r){let i,n="";for(let o=e;o>0;o--)i=1<<o-1,n+=(t&i?1:0)+(r&i?2:0);return n}(this.z,this.x,this.y);return e[(this.x+this.y)%e.length].replace(/{prefix}/g,(this.x%16).toString(16)+(this.y%16).toString(16)).replace(/{z}/g,String(this.z)).replace(/{x}/g,String(this.x)).replace(/{y}/g,String("tms"===r?Math.pow(2,this.z)-this.y-1:this.y)).replace(/{ratio}/g,t>1?"@2x":"").replace(/{quadkey}/g,c).replace(/{bbox-epsg-3857}/g,i)}isChildOf(e){const t=this.z-e.z;return t>0&&e.x===this.x>>t&&e.y===this.y>>t}getTilePoint(e){const t=Math.pow(2,this.z);return new T((e.x*t-this.x)*qo,(e.y*t-this.y)*qo)}toString(){return`${this.z}/${this.x}/${this.y}`}}class au{constructor(e,t){this.wrap=e,this.canonical=t,this.key=lu(e,t.z,t.z,t.x,t.y)}}class su{constructor(e,t,r,i,n){if(e<r)throw new Error(`overscaledZ should be >= z; overscaledZ = ${e}; z = ${r}`);this.overscaledZ=e,this.wrap=t,this.canonical=new ou(r,+i,+n),this.key=lu(t,e,r,i,n)}clone(){return new su(this.overscaledZ,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)}equals(e){return this.overscaledZ===e.overscaledZ&&this.wrap===e.wrap&&this.canonical.equals(e.canonical)}scaledTo(e){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const t=this.canonical.z-e;return e>this.canonical.z?new su(e,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y):new su(e,this.wrap,e,this.canonical.x>>t,this.canonical.y>>t)}calculateScaledKey(e,t){if(e>this.overscaledZ)throw new Error(`targetZ > this.overscaledZ; targetZ = ${e}; overscaledZ = ${this.overscaledZ}`);const r=this.canonical.z-e;return e>this.canonical.z?lu(this.wrap*+t,e,this.canonical.z,this.canonical.x,this.canonical.y):lu(this.wrap*+t,e,e,this.canonical.x>>r,this.canonical.y>>r)}isChildOf(e){if(e.wrap!==this.wrap)return!1;const t=this.canonical.z-e.canonical.z;return 0===e.overscaledZ||e.overscaledZ<this.overscaledZ&&e.canonical.x===this.canonical.x>>t&&e.canonical.y===this.canonical.y>>t}children(e){if(this.overscaledZ>=e)return[new su(this.overscaledZ+1,this.wrap,this.canonical.z,this.canonical.x,this.canonical.y)];const t=this.canonical.z+1,r=2*this.canonical.x,i=2*this.canonical.y;return[new su(t,this.wrap,t,r,i),new su(t,this.wrap,t,r+1,i),new su(t,this.wrap,t,r,i+1),new su(t,this.wrap,t,r+1,i+1)]}isLessThan(e){return this.wrap<e.wrap||!(this.wrap>e.wrap)&&(this.overscaledZ<e.overscaledZ||!(this.overscaledZ>e.overscaledZ)&&(this.canonical.x<e.canonical.x||!(this.canonical.x>e.canonical.x)&&this.canonical.y<e.canonical.y))}wrapped(){return new su(this.overscaledZ,0,this.canonical.z,this.canonical.x,this.canonical.y)}unwrapTo(e){return new su(this.overscaledZ,e,this.canonical.z,this.canonical.x,this.canonical.y)}overscaleFactor(){return Math.pow(2,this.overscaledZ-this.canonical.z)}toUnwrapped(){return new au(this.wrap,this.canonical)}toString(){return`${this.overscaledZ}/${this.canonical.x}/${this.canonical.y}`}getTilePoint(e){return this.canonical.getTilePoint(new iu(e.x-this.wrap,e.y))}}function lu(e,t,r,i,n){(e*=2)<0&&(e=-1*e-1);const o=1<<r;return(o*o*e+o*n+i).toString(36)+r.toString(36)+t.toString(36)}ki("CanonicalTileID",ou),ki("OverscaledTileID",su,{omit:["posMatrix"]});class cu{constructor(e,t,r){if(this.uid=e,t.height!==t.width)throw new RangeError("DEM tiles must be square");if(r&&"mapbox"!==r&&"terrarium"!==r)return void f(`"${r}" is not a valid encoding type. Valid types include "mapbox" and "terrarium".`);this.stride=t.height;const i=this.dim=t.height-2;this.data=new Uint32Array(t.data.buffer),this.encoding=r||"mapbox";for(let e=0;e<i;e++)this.data[this._idx(-1,e)]=this.data[this._idx(0,e)],this.data[this._idx(i,e)]=this.data[this._idx(i-1,e)],this.data[this._idx(e,-1)]=this.data[this._idx(e,0)],this.data[this._idx(e,i)]=this.data[this._idx(e,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)],this.min=Number.MAX_SAFE_INTEGER,this.max=Number.MIN_SAFE_INTEGER;for(let e=0;e<i;e++)for(let t=0;t<i;t++){const r=this.get(e,t);r>this.max&&(this.max=r),r<this.min&&(this.min=r)}}get(e,t){const r=new Uint8Array(this.data.buffer),i=4*this._idx(e,t);return("terrarium"===this.encoding?this._unpackTerrarium:this._unpackMapbox)(r[i],r[i+1],r[i+2])}getUnpackVector(){return"terrarium"===this.encoding?[256,1,1/256,32768]:[6553.6,25.6,.1,1e4]}_idx(e,t){if(e<-1||e>=this.dim+1||t<-1||t>=this.dim+1)throw new RangeError("out of range source coordinates for DEM data");return(t+1)*this.stride+(e+1)}_unpackMapbox(e,t,r){return(256*e*256+256*t+r)/10-1e4}_unpackTerrarium(e,t,r){return 256*e+t+r/256-32768}getPixels(){return new Ca({width:this.stride,height:this.stride},new Uint8Array(this.data.buffer))}backfillBorder(e,t,r){if(this.dim!==e.dim)throw new Error("dem dimension mismatch");let i=t*this.dim,n=t*this.dim+this.dim,o=r*this.dim,a=r*this.dim+this.dim;switch(t){case-1:i=n-1;break;case 1:n=i+1}switch(r){case-1:o=a-1;break;case 1:a=o+1}const s=-t*this.dim,l=-r*this.dim;for(let t=o;t<a;t++)for(let r=i;r<n;r++)this.data[this._idx(r,t)]=e.data[this._idx(r+s,t+l)]}}ki("DEMData",cu);class uu{constructor(e){this._stringToNumber={},this._numberToString=[];for(let t=0;t<e.length;t++){const r=e[t];this._stringToNumber[r]=t,this._numberToString[t]=r}}encode(e){return this._stringToNumber[e]}decode(e){if(e>=this._numberToString.length)throw new Error(`Out of bounds. Index requested n=${e} can't be >= this._numberToString.length ${this._numberToString.length}`);return this._numberToString[e]}}class hu{constructor(e,t,r,i,n){this.type="Feature",this._vectorTileFeature=e,e._z=t,e._x=r,e._y=i,this.properties=e.properties,this.id=n}get geometry(){return void 0===this._geometry&&(this._geometry=this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x,this._vectorTileFeature._y,this._vectorTileFeature._z).geometry),this._geometry}set geometry(e){this._geometry=e}toJSON(){const e={geometry:this.geometry};for(const t in this)"_geometry"!==t&&"_vectorTileFeature"!==t&&(e[t]=this[t]);return e}}class pu{constructor(e,t){this.tileID=e,this.x=e.canonical.x,this.y=e.canonical.y,this.z=e.canonical.z,this.grid=new Ei(qo,16,0),this.grid3D=new Ei(qo,16,0),this.featureIndexArray=new Yn,this.promoteId=t}insert(e,t,r,i,n,o){const a=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(r,i,n);const s=o?this.grid3D:this.grid;for(let e=0;e<t.length;e++){const r=t[e],i=[1/0,1/0,-1/0,-1/0];for(let e=0;e<r.length;e++){const t=r[e];i[0]=Math.min(i[0],t.x),i[1]=Math.min(i[1],t.y),i[2]=Math.max(i[2],t.x),i[3]=Math.max(i[3],t.y)}i[0]<qo&&i[1]<qo&&i[2]>=0&&i[3]>=0&&s.insert(a,i[0],i[1],i[2],i[3])}}loadVTLayers(){return this.vtLayers||(this.vtLayers=new ws.VectorTile(new cl(this.rawTileData)).layers,this.sourceLayerCoder=new uu(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"])),this.vtLayers}query(e,t,r,i){this.loadVTLayers();const n=e.params||{},o=qo/e.tileSize/e.scale,a=Xr(n.filter),s=e.queryGeometry,l=e.queryPadding*o,c=fu(s),u=this.grid.query(c.minX-l,c.minY-l,c.maxX+l,c.maxY+l),h=fu(e.cameraQueryGeometry),p=this.grid3D.query(h.minX-l,h.minY-l,h.maxX+l,h.maxY+l,((t,r,i,n)=>function(e,t,r,i,n){for(const o of e)if(t<=o.x&&r<=o.y&&i>=o.x&&n>=o.y)return!0;const o=[new T(t,r),new T(t,n),new T(i,n),new T(i,r)];if(e.length>2)for(const t of o)if(oa(e,t))return!0;for(let t=0;t<e.length-1;t++)if(aa(e[t],e[t+1],o))return!0;return!1}(e.cameraQueryGeometry,t-l,r-l,i+l,n+l)));for(const e of p)u.push(e);u.sort(mu);const d={};let f;for(let l=0;l<u.length;l++){const c=u[l];if(c===f)continue;f=c;const h=this.featureIndexArray.get(c);let p=null;this.loadMatchingFeature(d,h.bucketIndex,h.sourceLayerIndex,h.featureIndex,a,n.layers,n.availableImages,t,r,i,((t,r,i)=>(p||(p=Zo(t)),r.queryIntersectsFeature(s,t,i,p,this.z,e.transform,o,e.pixelPosMatrix))))}return d}loadMatchingFeature(e,t,r,i,n,o,a,l,c,u,h){const p=this.bucketLayerIDs[t];if(o&&!function(e,t){for(let r=0;r<e.length;r++)if(t.indexOf(e[r])>=0)return!0;return!1}(o,p))return;const d=this.sourceLayerCoder.decode(r),f=this.vtLayers[d].feature(i);if(n.needGeometry){const e=Wo(f,!0);if(!n.filter(new Yi(this.tileID.overscaledZ),e,this.tileID.canonical))return}else if(!n.filter(new Yi(this.tileID.overscaledZ),f))return;const m=this.getId(f,d);for(let t=0;t<p.length;t++){const r=p[t];if(o&&o.indexOf(r)<0)continue;const n=l[r];if(!n)continue;let d={};m&&u&&(d=u.getState(n.sourceLayer||"_geojsonTileLayer",m));const y=s({},c[r]);y.paint=du(y.paint,n.paint,f,d,a),y.layout=du(y.layout,n.layout,f,d,a);const g=!h||h(f,n,d);if(!g)continue;const _=new hu(f,this.z,this.x,this.y,m);_.layer=y;let b=e[r];void 0===b&&(b=e[r]=[]),b.push({featureIndex:i,feature:_,intersectionZ:g})}}lookupSymbolFeatures(e,t,r,i,n,o,a,s){const l={};this.loadVTLayers();const c=Xr(n);for(const n of e)this.loadMatchingFeature(l,r,i,n,c,o,a,s,t);return l}hasLayer(e){for(const t of this.bucketLayerIDs)for(const r of t)if(e===r)return!0;return!1}getId(e,t){let r=e.id;return this.promoteId&&(r=e.properties["string"==typeof this.promoteId?this.promoteId:this.promoteId[t]],"boolean"==typeof r&&(r=Number(r))),r}}function du(e,t,r,i,n){return u(e,((e,o)=>{const a=t instanceof sn?t.get(o):null;return a&&a.evaluate?a.evaluate(r,i,n):a}))}function fu(e){let t=1/0,r=1/0,i=-1/0,n=-1/0;for(const o of e)t=Math.min(t,o.x),r=Math.min(r,o.y),i=Math.max(i,o.x),n=Math.max(n,o.y);return{minX:t,minY:r,maxX:i,maxY:n}}function mu(e,t){return t-e}var yu;ki("FeatureIndex",pu,{omit:["rawTileData","sourceLayerCoder"]}),e.PerformanceMarkers=void 0,(yu=e.PerformanceMarkers||(e.PerformanceMarkers={})).create="create",yu.load="load",yu.fullLoad="fullLoad";let gu=null,_u=[];const bu=1e3/30,vu={mark(e){performance.mark(e)},frame(e){const t=e;null!=gu&&_u.push(t-gu),gu=t},clearMetrics(){gu=null,_u=[],performance.clearMeasures("loadTime"),performance.clearMeasures("fullLoadTime");for(const t in e.PerformanceMarkers)performance.clearMarks(e.PerformanceMarkers[t])},getPerformanceMetrics(){performance.measure("loadTime",e.PerformanceMarkers.create,e.PerformanceMarkers.load),performance.measure("fullLoadTime",e.PerformanceMarkers.create,e.PerformanceMarkers.fullLoad);const t=performance.getEntriesByName("loadTime")[0].duration,r=performance.getEntriesByName("fullLoadTime")[0].duration,i=_u.length,n=1/(_u.reduce(((e,t)=>e+t),0)/i/1e3),o=_u.filter((e=>e>bu)).reduce(((e,t)=>e+(t-bu)/bu),0);return{loadTime:t,fullLoadTime:r,fps:n,percentDroppedFrames:o/(i+o)*100}}};e.AJAXError=V,e.ARRAY_TYPE=da,e.Actor=class{constructor(e,t,r){this.target=e,this.parent=t,this.mapId=r,this.callbacks={},this.tasks={},this.taskQueue=[],this.cancelCallbacks={},c(["receive","process"],this),this.invoker=new Wc(this.process),this.target.addEventListener("message",this.receive,!1),this.globalScope=g()?e:window}send(e,t,r,i,n=!1){const o=Math.round(1e18*Math.random()).toString(36).substring(0,10);r&&(this.callbacks[o]=r);const a=w(this.globalScope)?void 0:[];return this.target.postMessage({id:o,type:e,hasCallback:!!r,targetMapId:i,mustQueue:n,sourceMapId:this.mapId,data:Ii(t,a)},a),{cancel:()=>{r&&delete this.callbacks[o],this.target.postMessage({id:o,type:"<cancel>",targetMapId:i,sourceMapId:this.mapId})}}}receive(e){const t=e.data,r=t.id;if(r&&(!t.targetMapId||this.mapId===t.targetMapId))if("<cancel>"===t.type){delete this.tasks[r];const e=this.cancelCallbacks[r];delete this.cancelCallbacks[r],e&&e()}else g()||t.mustQueue?(this.tasks[r]=t,this.taskQueue.push(r),this.invoker.trigger()):this.processTask(r,t)}process(){if(!this.taskQueue.length)return;const e=this.taskQueue.shift(),t=this.tasks[e];delete this.tasks[e],this.taskQueue.length&&this.invoker.trigger(),t&&this.processTask(e,t)}processTask(e,t){if("<response>"===t.type){const r=this.callbacks[e];delete this.callbacks[e],r&&(t.error?r(Pi(t.error)):r(null,Pi(t.data)))}else{let r=!1;const i=w(this.globalScope)?void 0:[],n=t.hasCallback?(t,n)=>{r=!0,delete this.cancelCallbacks[e],this.target.postMessage({id:e,type:"<response>",sourceMapId:this.mapId,error:t?Ii(t):null,data:Ii(n,i)},i)}:e=>{r=!0};let o=null;const a=Pi(t.data);if(this.parent[t.type])o=this.parent[t.type](t.sourceMapId,a,n);else if(this.parent.getWorkerSource){const e=t.type.split(".");o=this.parent.getWorkerSource(t.sourceMapId,e[0],a.source)[e[1]](a,n)}else n(new Error(`Could not find function ${t.type}`));!r&&o&&o.cancel&&(this.cancelCallbacks[e]=o.cancel)}}remove(){this.invoker.remove(),this.target.removeEventListener("message",this.receive,!1)}},e.AlphaImage=Pa,e.CanonicalTileID=ou,e.CollisionBoxArray=$n,e.CollisionCircleLayoutArray=class extends Mn{},e.Color=De,e.DEMData=cu,e.DataConstantProperty=ln,e.DictionaryCoder=uu,e.EXTENT=qo,e.ErrorEvent=te,e.EvaluationParameters=Yi,e.Event=ee,e.Evented=re,e.FeatureIndex=pu,e.FillBucket=ys,e.FillExtrusionBucket=Rs,e.GeoJSONFeature=hu,e.ImageAtlas=Rl,e.ImagePosition=jl,e.LineBucket=Hs,e.LineStripIndexArray=class extends Un{},e.LngLat=Kc,e.LngLatBounds=Hc,e.MercatorCoordinate=iu,e.ONE_EM=ll,e.OverscaledTileID=su,e.PerformanceUtils=vu,e.PosArray=Qn,e.Properties=dn,e.QuadTriangleArray=class extends Dn{},e.RGBAImage=Ca,e.RasterBoundsArray=class extends wn{},e.RequestPerformance=class{constructor(e){this._marks={start:[e.url,"start"].join("#"),end:[e.url,"end"].join("#"),measure:e.url.toString()},performance.mark(this._marks.start)}finish(){performance.mark(this._marks.end);let e=performance.getEntriesByName(this._marks.measure);return 0===e.length&&(performance.measure(this._marks.measure,this._marks.start,this._marks.end),e=performance.getEntriesByName(this._marks.measure),performance.clearMarks(this._marks.start),performance.clearMarks(this._marks.end),performance.clearMeasures(this._marks.measure)),e}},e.ResourceType=U,e.SegmentVector=yo,e.SymbolBucket=Rc,e.Transitionable=tn,e.TriangleIndexArray=ho,e.Uniform1f=Po,e.Uniform1i=class extends Io{constructor(e,t){super(e,t),this.current=0}set(e){this.current!==e&&(this.current=e,this.gl.uniform1i(this.location,e))}},e.Uniform2f=class extends Io{constructor(e,t){super(e,t),this.current=[0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]||(this.current=e,this.gl.uniform2f(this.location,e[0],e[1]))}},e.Uniform3f=class extends Io{constructor(e,t){super(e,t),this.current=[0,0,0]}set(e){e[0]===this.current[0]&&e[1]===this.current[1]&&e[2]===this.current[2]||(this.current=e,this.gl.uniform3f(this.location,e[0],e[1],e[2]))}},e.Uniform4f=Co,e.UniformColor=zo,e.UniformMatrix4f=class extends Io{constructor(e,t){super(e,t),this.current=Mo}set(e){if(e[12]!==this.current[12]||e[0]!==this.current[0])return this.current=e,void this.gl.uniformMatrix4fv(this.location,!1,e);for(let t=1;t<16;t++)if(e[t]!==this.current[t]){this.current=e,this.gl.uniformMatrix4fv(this.location,!1,e);break}}},e.UnwrappedTileID=au,e.ValidationError=ne,e.ZoomHistory=Ci,e.add=function(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e},e.addDynamicAttributes=Oc,e.asyncAll=function(e,t,r){if(!e.length)return r(null,[]);let i=e.length;const n=new Array(e.length);let o=null;e.forEach(((e,a)=>{t(e,((e,t)=>{e&&(o=e),n[a]=t,0==--i&&r(o,n)}))}))},e.bezier=i,e.bindAll=c,e.cacheEntryPossiblyAdded=function(e){D++,D>M&&(e.getActor().send("enforceCacheSizeLimit",z),D=0)},e.clamp=o,e.clearTileCache=function(e){const t=caches.delete(I);e&&t.catch(e).then((()=>e()))},e.clipLine=uc,e.clone=function(e){var t=new da(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t},e.clone$1=p,e.clone$2=function(e){var t=new da(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t},e.collisionCircleLayout=ol,e.config=A,e.copy=function(e,t){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},e.create=function(){var e=new da(16);return da!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e},e.create$1=fa,e.createExpression=Dr,e.createFilter=Xr,e.createLayout=bn,e.createStyleLayer=function(e){return"custom"===e.type?new Gc(e):new Zc[e.type](e)},e.cross=function(e,t,r){var i=t[0],n=t[1],o=t[2],a=r[0],s=r[1],l=r[2];return e[0]=n*l-o*s,e[1]=o*a-i*l,e[2]=i*s-n*a,e},e.dot=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]},e.dot$1=function(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]},e.ease=n,e.emitValidationErrors=Si,e.enforceCacheSizeLimit=function(e){O(),P&&P.then((t=>{t.keys().then((r=>{for(let i=0;i<r.length-e;i++)t.delete(r[i])}))}))},e.equals=function(e,t){var r=e[0],i=e[1],n=e[2],o=e[3],a=e[4],s=e[5],l=e[6],c=e[7],u=e[8],h=e[9],p=e[10],d=e[11],f=e[12],m=e[13],y=e[14],g=e[15],_=t[0],b=t[1],v=t[2],x=t[3],w=t[4],S=t[5],E=t[6],T=t[7],k=t[8],A=t[9],I=t[10],P=t[11],C=t[12],z=t[13],M=t[14],O=t[15];return Math.abs(r-_)<=pa*Math.max(1,Math.abs(r),Math.abs(_))&&Math.abs(i-b)<=pa*Math.max(1,Math.abs(i),Math.abs(b))&&Math.abs(n-v)<=pa*Math.max(1,Math.abs(n),Math.abs(v))&&Math.abs(o-x)<=pa*Math.max(1,Math.abs(o),Math.abs(x))&&Math.abs(a-w)<=pa*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(s-S)<=pa*Math.max(1,Math.abs(s),Math.abs(S))&&Math.abs(l-E)<=pa*Math.max(1,Math.abs(l),Math.abs(E))&&Math.abs(c-T)<=pa*Math.max(1,Math.abs(c),Math.abs(T))&&Math.abs(u-k)<=pa*Math.max(1,Math.abs(u),Math.abs(k))&&Math.abs(h-A)<=pa*Math.max(1,Math.abs(h),Math.abs(A))&&Math.abs(p-I)<=pa*Math.max(1,Math.abs(p),Math.abs(I))&&Math.abs(d-P)<=pa*Math.max(1,Math.abs(d),Math.abs(P))&&Math.abs(f-C)<=pa*Math.max(1,Math.abs(f),Math.abs(C))&&Math.abs(m-z)<=pa*Math.max(1,Math.abs(m),Math.abs(z))&&Math.abs(y-M)<=pa*Math.max(1,Math.abs(y),Math.abs(M))&&Math.abs(g-O)<=pa*Math.max(1,Math.abs(g),Math.abs(O))},e.evaluateSizeForFeature=function(e,{uSize:t,uSizeT:r},{lowerSize:i,upperSize:n}){return"source"===e.kind?i/ec:"composite"===e.kind?Tt(i/ec,n/ec,r):t},e.evaluateSizeForZoom=function(e,t){let r=0,i=0;if("constant"===e.kind)i=e.layoutSize;else if("source"!==e.kind){const{interpolationType:n,minZoom:a,maxZoom:s}=e,l=n?o($t.interpolationFactor(n,t,a,s),0,1):0;"camera"===e.kind?i=Tt(e.minSize,e.maxSize,l):r=l}return{uSizeT:r,uSize:i}},e.evaluateVariableOffset=Sc,e.evented=Xi,e.exported=E,e.exported$1=L,e.extend=s,e.filterObject=h,e.fromRotation=function(e,t){var r=Math.sin(t),i=Math.cos(t);return e[0]=i,e[1]=r,e[2]=0,e[3]=-r,e[4]=i,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e},e.fromScaling=function(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e},e.getAnchorAlignment=Hl,e.getAnchorJustification=Ec,e.getArrayBuffer=Z,e.getImage=J,e.getJSON=function(e,t){return G(s(e,{type:"json"}),t)},e.getOverlapMode=Vc,e.getRTLTextPluginStatus=Ki,e.getReferrer=q,e.getVideo=function(e,t){const r=window.document.createElement("video");r.muted=!0,r.onloadstart=function(){t(null,r)};for(let t=0;t<e.length;t++){const i=window.document.createElement("source");W(e[t])||(r.crossOrigin="Anonymous"),i.src=e[t],r.appendChild(i)}return{cancel:()=>{}}},e.identity=ma,e.invert=function(e,t){var r=t[0],i=t[1],n=t[2],o=t[3],a=t[4],s=t[5],l=t[6],c=t[7],u=t[8],h=t[9],p=t[10],d=t[11],f=t[12],m=t[13],y=t[14],g=t[15],_=r*s-i*a,b=r*l-n*a,v=r*c-o*a,x=i*l-n*s,w=i*c-o*s,S=n*c-o*l,E=u*m-h*f,T=u*y-p*f,k=u*g-d*f,A=h*y-p*m,I=h*g-d*m,P=p*g-d*y,C=_*P-b*I+v*A+x*k-w*T+S*E;return C?(e[0]=(s*P-l*I+c*A)*(C=1/C),e[1]=(n*I-i*P-o*A)*C,e[2]=(m*S-y*w+g*x)*C,e[3]=(p*w-h*S-d*x)*C,e[4]=(l*k-a*P-c*T)*C,e[5]=(r*P-n*k+o*T)*C,e[6]=(y*v-f*S-g*b)*C,e[7]=(u*S-p*v+d*b)*C,e[8]=(a*I-s*k+c*E)*C,e[9]=(i*k-r*I-o*E)*C,e[10]=(f*w-m*v+g*_)*C,e[11]=(h*v-u*w-d*_)*C,e[12]=(s*T-a*A-l*E)*C,e[13]=(r*A-i*T+n*E)*C,e[14]=(m*b-f*x-y*_)*C,e[15]=(u*x-h*b+p*_)*C,e):null},e.isImageBitmap=S,e.isSafari=w,e.isWorker=g,e.keysDifference=function(e,t){const r=[];for(const i in e)i in t||r.push(i);return r},e.lazyLoadRTLTextPlugin=function(){Ji.isLoading()||Ji.isLoaded()||"deferred"!==Ki()||Hi()},e.makeRequest=G,e.mapObject=u,e.mercatorXfromLng=Qc,e.mercatorYfromLat=eu,e.mercatorZfromAltitude=tu,e.mul=_a,e.mul$1=function(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e[3]=t[3]*r[3],e},e.multiply=ya,e.nextPowerOfTwo=function(e){return e<=1?1:Math.pow(2,Math.ceil(Math.log(e)/Math.LN2))},e.normalize=function(e,t){var r=t[0],i=t[1],n=t[2],o=r*r+i*i+n*n;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e},e.number=Tt,e.ortho=function(e,t,r,i,n,o,a){var s=1/(t-r),l=1/(i-n),c=1/(o-a);return e[0]=-2*s,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*s,e[13]=(n+i)*l,e[14]=(a+o)*c,e[15]=1,e},e.parseCacheControl=_,e.parseGlyphPbf=function(e){return new cl(e).readFields(Ml,[])},e.pbf=cl,e.performSymbolLayout=function(t){t.bucket.createArrays(),t.bucket.tilePixelRatio=qo/(512*t.bucket.overscaling),t.bucket.compareText={},t.bucket.iconsNeedLinear=!1;const r=t.bucket.layers[0].layout,i=t.bucket.layers[0]._unevaluatedLayout._values,n={layoutIconSize:i["icon-size"].possiblyEvaluate(new Yi(t.bucket.zoom+1),t.canonical),layoutTextSize:i["text-size"].possiblyEvaluate(new Yi(t.bucket.zoom+1),t.canonical),textMaxSize:i["text-size"].possiblyEvaluate(new Yi(18))};if("composite"===t.bucket.textSizeData.kind){const{minZoom:e,maxZoom:r}=t.bucket.textSizeData;n.compositeTextSizes=[i["text-size"].possiblyEvaluate(new Yi(e),t.canonical),i["text-size"].possiblyEvaluate(new Yi(r),t.canonical)]}if("composite"===t.bucket.iconSizeData.kind){const{minZoom:e,maxZoom:r}=t.bucket.iconSizeData;n.compositeIconSizes=[i["icon-size"].possiblyEvaluate(new Yi(e),t.canonical),i["icon-size"].possiblyEvaluate(new Yi(r),t.canonical)]}const o=r.get("text-line-height")*ll,a="viewport"!==r.get("text-rotation-alignment")&&"point"!==r.get("symbol-placement"),s=r.get("text-keep-upright"),l=r.get("text-size");for(const i of t.bucket.features){const c=r.get("text-font").evaluate(i,{},t.canonical).join(","),u=l.evaluate(i,{},t.canonical),h=n.layoutTextSize.evaluate(i,{},t.canonical),p=n.layoutIconSize.evaluate(i,{},t.canonical),d={horizontal:{},vertical:void 0},m=i.text;let y,g=[0,0];if(m){const n=m.toString(),l=r.get("text-letter-spacing").evaluate(i,{},t.canonical)*ll,p=Oi(n)?l:0,f=r.get("text-anchor").evaluate(i,{},t.canonical),y=r.get("text-variable-anchor");if(!y){const e=r.get("text-radial-offset").evaluate(i,{},t.canonical);g=e?Sc(f,[e*ll,wc]):r.get("text-offset").evaluate(i,{},t.canonical).map((e=>e*ll))}let _=a?"center":r.get("text-justify").evaluate(i,{},t.canonical);const b=r.get("symbol-placement"),v="point"===b?r.get("text-max-width").evaluate(i,{},t.canonical)*ll:0,x=()=>{t.bucket.allowVerticalPlacement&&Mi(n)&&(d.vertical=Ul(m,t.glyphMap,t.glyphPositions,t.imagePositions,c,v,o,f,"left",p,g,e.WritingMode.vertical,!0,b,h,u))};if(!a&&y){const r="auto"===_?y.map((e=>Ec(e))):[_];let i=!1;for(let n=0;n<r.length;n++){const a=r[n];if(!d.horizontal[a])if(i)d.horizontal[a]=d.horizontal[0];else{const r=Ul(m,t.glyphMap,t.glyphPositions,t.imagePositions,c,v,o,"center",a,p,g,e.WritingMode.horizontal,!1,b,h,u);r&&(d.horizontal[a]=r,i=1===r.positionedLines.length)}}x()}else{"auto"===_&&(_=Ec(f));const r=Ul(m,t.glyphMap,t.glyphPositions,t.imagePositions,c,v,o,f,_,p,g,e.WritingMode.horizontal,!1,b,h,u);r&&(d.horizontal[_]=r),x(),Mi(n)&&a&&s&&(d.vertical=Ul(m,t.glyphMap,t.glyphPositions,t.imagePositions,c,v,o,f,_,p,g,e.WritingMode.vertical,!1,b,h,u))}}let _=!1;if(i.icon&&i.icon.name){const e=t.imageMap[i.icon.name];e&&(y=Yl(t.imagePositions[i.icon.name],r.get("icon-offset").evaluate(i,{},t.canonical),r.get("icon-anchor").evaluate(i,{},t.canonical)),_=!!e.sdf,void 0===t.bucket.sdfIcons?t.bucket.sdfIcons=_:t.bucket.sdfIcons!==_&&f("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"),(e.pixelRatio!==t.bucket.pixelRatio||0!==r.get("icon-rotate").constantOr(1))&&(t.bucket.iconsNeedLinear=!0))}const b=Ic(d.horizontal)||d.vertical;t.bucket.iconsInText=!!b&&b.iconsInText,(b||y)&&Tc(t.bucket,i,d,y,t.imageMap,n,h,p,g,_,t.canonical)}t.showCollisionBoxes&&t.bucket.generateCollisionDebugBuffers()},e.perspective=function(e,t,r,i,n){var o,a=1/Math.tan(t/2);return e[0]=a/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,null!=n&&n!==1/0?(e[10]=(n+i)*(o=1/(i-n)),e[14]=2*n*i*o):(e[10]=-1,e[14]=-2*i),e},e.pick=function(e,t){const r={};for(let i=0;i<t.length;i++){const n=t[i];n in e&&(r[n]=e[n])}return r},e.plugin=Ji,e.pointGeometry=T,e.polygonIntersectsPolygon=Ho,e.potpack=Ll,e.refProperties=["type","source","source-layer","minzoom","maxzoom","filter","layout"],e.register=ki,e.registerForPluginStateChange=function(e){return e({pluginStatus:$i,pluginURL:Gi}),Xi.on("pluginStateChange",e),e},e.renderColorRamp=za,e.rotateX=function(e,t,r){var i=Math.sin(r),n=Math.cos(r),o=t[4],a=t[5],s=t[6],l=t[7],c=t[8],u=t[9],h=t[10],p=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*n+c*i,e[5]=a*n+u*i,e[6]=s*n+h*i,e[7]=l*n+p*i,e[8]=c*n-o*i,e[9]=u*n-a*i,e[10]=h*n-s*i,e[11]=p*n-l*i,e},e.rotateZ=function(e,t,r){var i=Math.sin(r),n=Math.cos(r),o=t[0],a=t[1],s=t[2],l=t[3],c=t[4],u=t[5],h=t[6],p=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*n+c*i,e[1]=a*n+u*i,e[2]=s*n+h*i,e[3]=l*n+p*i,e[4]=c*n-o*i,e[5]=u*n-a*i,e[6]=h*n-s*i,e[7]=p*n-l*i,e},e.scale=function(e,t,r){var i=r[0],n=r[1],o=r[2];return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*n,e[5]=t[5]*n,e[6]=t[6]*n,e[7]=t[7]*n,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e},e.scale$1=function(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e},e.setCacheLimits=function(e,t){z=e,M=t},e.setRTLTextPlugin=function(e,t,r=!1){if($i===Ni||$i===Ui||$i===Vi)throw new Error("setRTLTextPlugin cannot be called multiple times.");Gi=E.resolveURL(e),$i=Ni,qi=t,Wi(),r||Hi()},e.spec=ie,e.sphericalToCartesian=function([e,t,r]){return t+=90,t*=Math.PI/180,r*=Math.PI/180,{x:e*Math.cos(t)*Math.sin(r),y:e*Math.sin(t)*Math.sin(r),z:e*Math.cos(r)}},e.sqrLen=function(e){var t=e[0],r=e[1];return t*t+r*r},e.sub=function(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e},e.toEvaluationFeature=Wo,e.transformMat3=function(e,t,r){var i=t[0],n=t[1],o=t[2];return e[0]=i*r[0]+n*r[3]+o*r[6],e[1]=i*r[1]+n*r[4]+o*r[7],e[2]=i*r[2]+n*r[5]+o*r[8],e},e.transformMat4=xa,e.transformMat4$1=function(e,t,r){var i=t[0],n=t[1];return e[0]=r[0]*i+r[4]*n+r[12],e[1]=r[1]*i+r[5]*n+r[13],e},e.translate=function(e,t,r){var i,n,o,a,s,l,c,u,h,p,d,f,m=r[0],y=r[1],g=r[2];return t===e?(e[12]=t[0]*m+t[4]*y+t[8]*g+t[12],e[13]=t[1]*m+t[5]*y+t[9]*g+t[13],e[14]=t[2]*m+t[6]*y+t[10]*g+t[14],e[15]=t[3]*m+t[7]*y+t[11]*g+t[15]):(n=t[1],o=t[2],a=t[3],s=t[4],l=t[5],c=t[6],u=t[7],h=t[8],p=t[9],d=t[10],f=t[11],e[0]=i=t[0],e[1]=n,e[2]=o,e[3]=a,e[4]=s,e[5]=l,e[6]=c,e[7]=u,e[8]=h,e[9]=p,e[10]=d,e[11]=f,e[12]=i*m+s*y+h*g+t[12],e[13]=n*m+l*y+p*g+t[13],e[14]=o*m+c*y+d*g+t[14],e[15]=a*m+u*y+f*g+t[15]),e},e.triggerPluginCompletionEvent=Zi,e.unicodeBlockLookup=zi,e.uniqueId=function(){return l++},e.validateCustomStyleLayer=function(e){const t=[],r=e.id;return void 0===r&&t.push({message:`layers.${r}: missing required property "id"`}),void 0===e.render&&t.push({message:`layers.${r}: missing required method "render"`}),e.renderingMode&&"2d"!==e.renderingMode&&"3d"!==e.renderingMode&&t.push({message:`layers.${r}: property "renderingMode" must be either "2d" or "3d"`}),t},e.validateLight=vi,e.validateStyle=bi,e.vectorTile=ws,e.warnOnce=f,e.wrap=a})),i(["./shared"],(function(e){function t(e){const r=typeof e;if("number"===r||"boolean"===r||"string"===r||null==e)return JSON.stringify(e);if(Array.isArray(e)){let r="[";for(const i of e)r+=`${t(i)},`;return`${r}]`}const i=Object.keys(e).sort();let n="{";for(let r=0;r<i.length;r++)n+=`${JSON.stringify(i[r])}:${t(e[i[r]])},`;return`${n}}`}function r(r){let i="";for(const n of e.refProperties)i+=`/${t(r[n])}`;return i}class i{constructor(e){this.keyCache={},e&&this.replace(e)}replace(e){this._layerConfigs={},this._layers={},this.update(e,[])}update(t,i){for(const r of t){this._layerConfigs[r.id]=r;const t=this._layers[r.id]=e.createStyleLayer(r);t._featureFilter=e.createFilter(t.filter),this.keyCache[r.id]&&delete this.keyCache[r.id]}for(const e of i)delete this.keyCache[e],delete this._layerConfigs[e],delete this._layers[e];this.familiesBySource={};const n=function(e,t){const i={};for(let n=0;n<e.length;n++){const o=t&&t[e[n].id]||r(e[n]);t&&(t[e[n].id]=o);let a=i[o];a||(a=i[o]=[]),a.push(e[n])}const n=[];for(const e in i)n.push(i[e]);return n}(Object.values(this._layerConfigs),this.keyCache);for(const e of n){const t=e.map((e=>this._layers[e.id])),r=t[0];if("none"===r.visibility)continue;const i=r.source||"";let n=this.familiesBySource[i];n||(n=this.familiesBySource[i]={});const o=r.sourceLayer||"_geojsonTileLayer";let a=n[o];a||(a=n[o]=[]),a.push(t)}}}class n{constructor(t){const r={},i=[];for(const e in t){const n=t[e],o=r[e]={};for(const e in n){const t=n[+e];if(!t||0===t.bitmap.width||0===t.bitmap.height)continue;const r={x:0,y:0,w:t.bitmap.width+2,h:t.bitmap.height+2};i.push(r),o[e]={rect:r,metrics:t.metrics}}}const{w:n,h:o}=e.potpack(i),a=new e.AlphaImage({width:n||1,height:o||1});for(const i in t){const n=t[i];for(const t in n){const o=n[+t];if(!o||0===o.bitmap.width||0===o.bitmap.height)continue;const s=r[i][t].rect;e.AlphaImage.copy(o.bitmap,a,{x:0,y:0},{x:s.x+1,y:s.y+1},o.bitmap)}}this.image=a,this.positions=r}}e.register("GlyphAtlas",n);class o{constructor(t){this.tileID=new e.OverscaledTileID(t.tileID.overscaledZ,t.tileID.wrap,t.tileID.canonical.z,t.tileID.canonical.x,t.tileID.canonical.y),this.uid=t.uid,this.zoom=t.zoom,this.pixelRatio=t.pixelRatio,this.tileSize=t.tileSize,this.source=t.source,this.overscaling=this.tileID.overscaleFactor(),this.showCollisionBoxes=t.showCollisionBoxes,this.collectResourceTiming=!!t.collectResourceTiming,this.returnDependencies=!!t.returnDependencies,this.promoteId=t.promoteId}parse(t,r,i,o,s){this.status="parsing",this.data=t,this.collisionBoxArray=new e.CollisionBoxArray;const l=new e.DictionaryCoder(Object.keys(t.layers).sort()),c=new e.FeatureIndex(this.tileID,this.promoteId);c.bucketLayerIDs=[];const u={},h={featureIndex:c,iconDependencies:{},patternDependencies:{},glyphDependencies:{},availableImages:i},p=r.familiesBySource[this.source];for(const r in p){const n=t.layers[r];if(!n)continue;1===n.version&&e.warnOnce(`Vector tile source "${this.source}" layer "${r}" does not use vector tile spec v2 and therefore may have some rendering errors.`);const o=l.encode(r),s=[];for(let e=0;e<n.length;e++){const t=n.feature(e),i=c.getId(t,r);s.push({feature:t,id:i,index:e,sourceLayerIndex:o})}for(const t of p[r]){const r=t[0];r.source!==this.source&&e.warnOnce(`layer.source = ${r.source} does not equal this.source = ${this.source}`),r.minzoom&&this.zoom<Math.floor(r.minzoom)||r.maxzoom&&this.zoom>=r.maxzoom||"none"!==r.visibility&&(a(t,this.zoom,i),(u[r.id]=r.createBucket({index:c.bucketLayerIDs.length,layers:t,zoom:this.zoom,pixelRatio:this.pixelRatio,overscaling:this.overscaling,collisionBoxArray:this.collisionBoxArray,sourceLayerIndex:o,sourceID:this.source})).populate(s,h,this.tileID.canonical),c.bucketLayerIDs.push(t.map((e=>e.id))))}}let d,f,m,y;const g=e.mapObject(h.glyphDependencies,(e=>Object.keys(e).map(Number)));Object.keys(g).length?o.send("getGlyphs",{uid:this.uid,stacks:g},((e,t)=>{d||(d=e,f=t,v.call(this))})):f={};const _=Object.keys(h.iconDependencies);_.length?o.send("getImages",{icons:_,source:this.source,tileID:this.tileID,type:"icons"},((e,t)=>{d||(d=e,m=t,v.call(this))})):m={};const b=Object.keys(h.patternDependencies);function v(){if(d)return s(d);if(f&&m&&y){const t=new n(f),r=new e.ImageAtlas(m,y);for(const n in u){const o=u[n];o instanceof e.SymbolBucket?(a(o.layers,this.zoom,i),e.performSymbolLayout({bucket:o,glyphMap:f,glyphPositions:t.positions,imageMap:m,imagePositions:r.iconPositions,showCollisionBoxes:this.showCollisionBoxes,canonical:this.tileID.canonical})):o.hasPattern&&(o instanceof e.LineBucket||o instanceof e.FillBucket||o instanceof e.FillExtrusionBucket)&&(a(o.layers,this.zoom,i),o.addFeatures(h,this.tileID.canonical,r.patternPositions))}this.status="done",s(null,{buckets:Object.values(u).filter((e=>!e.isEmpty())),featureIndex:c,collisionBoxArray:this.collisionBoxArray,glyphAtlasImage:t.image,imageAtlas:r,glyphMap:this.returnDependencies?f:null,iconMap:this.returnDependencies?m:null,glyphPositions:this.returnDependencies?t.positions:null})}}b.length?o.send("getImages",{icons:b,source:this.source,tileID:this.tileID,type:"patterns"},((e,t)=>{d||(d=e,y=t,v.call(this))})):y={},v.call(this)}}function a(t,r,i){const n=new e.EvaluationParameters(r);for(const e of t)e.recalculate(n,i)}function s(t,r){const i=e.getArrayBuffer(t.request,((t,i,n,o)=>{t?r(t):i&&r(null,{vectorTile:new e.vectorTile.VectorTile(new e.pbf(i)),rawData:i,cacheControl:n,expires:o})}));return()=>{i.cancel(),r()}}class l{constructor(e,t,r,i){this.actor=e,this.layerIndex=t,this.availableImages=r,this.loadVectorData=i||s,this.loading={},this.loaded={}}loadTile(t,r){const i=t.uid;this.loading||(this.loading={});const n=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.RequestPerformance(t.request),a=this.loading[i]=new o(t);a.abort=this.loadVectorData(t,((t,o)=>{if(delete this.loading[i],t||!o)return a.status="done",this.loaded[i]=a,r(t);const s=o.rawData,l={};o.expires&&(l.expires=o.expires),o.cacheControl&&(l.cacheControl=o.cacheControl);const c={};if(n){const e=n.finish();e&&(c.resourceTiming=JSON.parse(JSON.stringify(e)))}a.vectorTile=o.vectorTile,a.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,((t,i)=>{if(t||!i)return r(t);r(null,e.extend({rawTileData:s.slice(0)},i,l,c))})),this.loaded=this.loaded||{},this.loaded[i]=a}))}reloadTile(e,t){const r=this.loaded,i=e.uid,n=this;if(r&&r[i]){const o=r[i];o.showCollisionBoxes=e.showCollisionBoxes;const a=(e,r)=>{const i=o.reloadCallback;i&&(delete o.reloadCallback,o.parse(o.vectorTile,n.layerIndex,this.availableImages,n.actor,i)),t(e,r)};"parsing"===o.status?o.reloadCallback=a:"done"===o.status&&(o.vectorTile?o.parse(o.vectorTile,this.layerIndex,this.availableImages,this.actor,a):a())}}abortTile(e,t){const r=this.loading,i=e.uid;r&&r[i]&&r[i].abort&&(r[i].abort(),delete r[i]),t()}removeTile(e,t){const r=this.loaded,i=e.uid;r&&r[i]&&delete r[i],t()}}class c{constructor(){this.loaded={}}loadTile(t,r){const{uid:i,encoding:n,rawImageData:o}=t,a=e.isImageBitmap(o)?this.getImageData(o):o,s=new e.DEMData(i,a,n);this.loaded=this.loaded||{},this.loaded[i]=s,r(null,s)}getImageData(t){this.offscreenCanvas&&this.offscreenCanvasContext||(this.offscreenCanvas=new OffscreenCanvas(t.width,t.height),this.offscreenCanvasContext=this.offscreenCanvas.getContext("2d")),this.offscreenCanvas.width=t.width,this.offscreenCanvas.height=t.height,this.offscreenCanvasContext.drawImage(t,0,0,t.width,t.height);const r=this.offscreenCanvasContext.getImageData(-1,-1,t.width+2,t.height+2);return this.offscreenCanvasContext.clearRect(0,0,this.offscreenCanvas.width,this.offscreenCanvas.height),new e.RGBAImage({width:r.width,height:r.height},r.data)}removeTile(e){const t=this.loaded,r=e.uid;t&&t[r]&&delete t[r]}}var u=function e(t,r){var i,n=t&&t.type;if("FeatureCollection"===n)for(i=0;i<t.features.length;i++)e(t.features[i],r);else if("GeometryCollection"===n)for(i=0;i<t.geometries.length;i++)e(t.geometries[i],r);else if("Feature"===n)e(t.geometry,r);else if("Polygon"===n)h(t.coordinates,r);else if("MultiPolygon"===n)for(i=0;i<t.coordinates.length;i++)h(t.coordinates[i],r);return t};function h(e,t){if(0!==e.length){p(e[0],t);for(var r=1;r<e.length;r++)p(e[r],!t)}}function p(e,t){for(var r=0,i=0,n=0,o=e.length,a=o-1;n<o;a=n++){var s=(e[n][0]-e[a][0])*(e[a][1]+e[n][1]),l=r+s;i+=Math.abs(r)>=Math.abs(s)?r-l+s:s-l+r,r=l}r+i>=0!=!!t&&e.reverse()}const d=e.vectorTile.VectorTileFeature.prototype.toGeoJSON;class f{constructor(t){this._feature=t,this.extent=e.EXTENT,this.type=t.type,this.properties=t.tags,"id"in t&&!isNaN(t.id)&&(this.id=parseInt(t.id,10))}loadGeometry(){if(1===this._feature.type){const t=[];for(const r of this._feature.geometry)t.push([new e.pointGeometry(r[0],r[1])]);return t}{const t=[];for(const r of this._feature.geometry){const i=[];for(const t of r)i.push(new e.pointGeometry(t[0],t[1]));t.push(i)}return t}}toGeoJSON(e,t,r){return d.call(this,e,t,r)}}class m{constructor(t){this.layers={_geojsonTileLayer:this},this.name="_geojsonTileLayer",this.extent=e.EXTENT,this.length=t.length,this._features=t}feature(e){return new f(this._features[e])}}var y={exports:{}},g=e.pointGeometry,_=e.vectorTile.VectorTileFeature,b=v;function v(e,t){this.options=t||{},this.features=e,this.length=e.length}function x(e,t){this.id="number"==typeof e.id?e.id:void 0,this.type=e.type,this.rawGeometry=1===e.type?[e.geometry]:e.geometry,this.properties=e.tags,this.extent=t||4096}v.prototype.feature=function(e){return new x(this.features[e],this.options.extent)},x.prototype.loadGeometry=function(){var e=this.rawGeometry;this.geometry=[];for(var t=0;t<e.length;t++){for(var r=e[t],i=[],n=0;n<r.length;n++)i.push(new g(r[n][0],r[n][1]));this.geometry.push(i)}return this.geometry},x.prototype.bbox=function(){this.geometry||this.loadGeometry();for(var e=this.geometry,t=1/0,r=-1/0,i=1/0,n=-1/0,o=0;o<e.length;o++)for(var a=e[o],s=0;s<a.length;s++){var l=a[s];t=Math.min(t,l.x),r=Math.max(r,l.x),i=Math.min(i,l.y),n=Math.max(n,l.y)}return[t,i,r,n]},x.prototype.toGeoJSON=_.prototype.toGeoJSON;var w=e.pbf,S=b;function E(e){var t=new w;return function(e,t){for(var r in e.layers)t.writeMessage(3,T,e.layers[r])}(e,t),t.finish()}function T(e,t){var r;t.writeVarintField(15,e.version||1),t.writeStringField(1,e.name||""),t.writeVarintField(5,e.extent||4096);var i={keys:[],values:[],keycache:{},valuecache:{}};for(r=0;r<e.length;r++)i.feature=e.feature(r),t.writeMessage(2,k,i);var n=i.keys;for(r=0;r<n.length;r++)t.writeStringField(3,n[r]);var o=i.values;for(r=0;r<o.length;r++)t.writeMessage(4,z,o[r])}function k(e,t){var r=e.feature;void 0!==r.id&&t.writeVarintField(1,r.id),t.writeMessage(2,A,e),t.writeVarintField(3,r.type),t.writeMessage(4,C,r)}function A(e,t){var r=e.feature,i=e.keys,n=e.values,o=e.keycache,a=e.valuecache;for(var s in r.properties){var l=r.properties[s],c=o[s];if(null!==l){void 0===c&&(i.push(s),o[s]=c=i.length-1),t.writeVarint(c);var u=typeof l;"string"!==u&&"boolean"!==u&&"number"!==u&&(l=JSON.stringify(l));var h=u+":"+l,p=a[h];void 0===p&&(n.push(l),a[h]=p=n.length-1),t.writeVarint(p)}}}function I(e,t){return(t<<3)+(7&e)}function P(e){return e<<1^e>>31}function C(e,t){for(var r=e.loadGeometry(),i=e.type,n=0,o=0,a=r.length,s=0;s<a;s++){var l=r[s],c=1;1===i&&(c=l.length),t.writeVarint(I(1,c));for(var u=3===i?l.length-1:l.length,h=0;h<u;h++){1===h&&1!==i&&t.writeVarint(I(2,u-1));var p=l[h].x-n,d=l[h].y-o;t.writeVarint(P(p)),t.writeVarint(P(d)),n+=p,o+=d}3===i&&t.writeVarint(I(7,1))}}function z(e,t){var r=typeof e;"string"===r?t.writeStringField(1,e):"boolean"===r?t.writeBooleanField(7,e):"number"===r&&(e%1!=0?t.writeDoubleField(3,e):e<0?t.writeSVarintField(6,e):t.writeVarintField(5,e))}function M(e,t,r,i,n,o){if(n-i<=r)return;const a=i+n>>1;O(e,t,a,i,n,o%2),M(e,t,r,i,a-1,o+1),M(e,t,r,a+1,n,o+1)}function O(e,t,r,i,n,o){for(;n>i;){if(n-i>600){const a=n-i+1,s=r-i+1,l=Math.log(a),c=.5*Math.exp(2*l/3),u=.5*Math.sqrt(l*c*(a-c)/a)*(s-a/2<0?-1:1);O(e,t,r,Math.max(i,Math.floor(r-s*c/a+u)),Math.min(n,Math.floor(r+(a-s)*c/a+u)),o)}const a=t[2*r+o];let s=i,l=n;for(D(e,t,i,r),t[2*n+o]>a&&D(e,t,i,n);s<l;){for(D(e,t,s,l),s++,l--;t[2*s+o]<a;)s++;for(;t[2*l+o]>a;)l--}t[2*i+o]===a?D(e,t,i,l):(l++,D(e,t,l,n)),l<=r&&(i=l+1),r<=l&&(n=l-1)}}function D(e,t,r,i){L(e,r,i),L(t,2*r,2*i),L(t,2*r+1,2*i+1)}function L(e,t,r){const i=e[t];e[t]=e[r],e[r]=i}function j(e,t,r,i){const n=e-r,o=t-i;return n*n+o*o}y.exports=E,y.exports.fromVectorTileJs=E,y.exports.fromGeojsonVt=function(e,t){t=t||{};var r={};for(var i in e)r[i]=new S(e[i].features,t),r[i].name=i,r[i].version=t.version,r[i].extent=t.extent;return E({layers:r})},y.exports.GeoJSONWrapper=S;const R=e=>e[0],B=e=>e[1];class F{constructor(e,t=R,r=B,i=64,n=Float64Array){this.nodeSize=i,this.points=e;const o=e.length<65536?Uint16Array:Uint32Array,a=this.ids=new o(e.length),s=this.coords=new n(2*e.length);for(let i=0;i<e.length;i++)a[i]=i,s[2*i]=t(e[i]),s[2*i+1]=r(e[i]);M(a,s,i,0,a.length-1,0)}range(e,t,r,i){return function(e,t,r,i,n,o,a){const s=[0,e.length-1,0],l=[];let c,u;for(;s.length;){const h=s.pop(),p=s.pop(),d=s.pop();if(p-d<=a){for(let a=d;a<=p;a++)c=t[2*a],u=t[2*a+1],c>=r&&c<=n&&u>=i&&u<=o&&l.push(e[a]);continue}const f=Math.floor((d+p)/2);c=t[2*f],u=t[2*f+1],c>=r&&c<=n&&u>=i&&u<=o&&l.push(e[f]);const m=(h+1)%2;(0===h?r<=c:i<=u)&&(s.push(d),s.push(f-1),s.push(m)),(0===h?n>=c:o>=u)&&(s.push(f+1),s.push(p),s.push(m))}return l}(this.ids,this.coords,e,t,r,i,this.nodeSize)}within(e,t,r){return function(e,t,r,i,n,o){const a=[0,e.length-1,0],s=[],l=n*n;for(;a.length;){const c=a.pop(),u=a.pop(),h=a.pop();if(u-h<=o){for(let n=h;n<=u;n++)j(t[2*n],t[2*n+1],r,i)<=l&&s.push(e[n]);continue}const p=Math.floor((h+u)/2),d=t[2*p],f=t[2*p+1];j(d,f,r,i)<=l&&s.push(e[p]);const m=(c+1)%2;(0===c?r-n<=d:i-n<=f)&&(a.push(h),a.push(p-1),a.push(m)),(0===c?r+n>=d:i+n>=f)&&(a.push(p+1),a.push(u),a.push(m))}return s}(this.ids,this.coords,e,t,r,this.nodeSize)}}const N={minZoom:0,maxZoom:16,minPoints:2,radius:40,extent:512,nodeSize:64,log:!1,generateId:!1,reduce:null,map:e=>e},U=Math.fround||(V=new Float32Array(1),e=>(V[0]=+e,V[0]));var V;class q{constructor(e){this.options=J(Object.create(N),e),this.trees=new Array(this.options.maxZoom+1)}load(e){const{log:t,minZoom:r,maxZoom:i,nodeSize:n}=this.options;t&&console.time("total time");const o=`prepare ${e.length} points`;t&&console.time(o),this.points=e;let a=[];for(let t=0;t<e.length;t++)e[t].geometry&&a.push(G(e[t],t));this.trees[i+1]=new F(a,Y,Q,n,Float32Array),t&&console.timeEnd(o);for(let e=i;e>=r;e--){const r=+Date.now();a=this._cluster(a,e),this.trees[e]=new F(a,Y,Q,n,Float32Array),t&&console.log("z%d: %d clusters in %dms",e,a.length,+Date.now()-r)}return t&&console.timeEnd("total time"),this}getClusters(e,t){let r=((e[0]+180)%360+360)%360-180;const i=Math.max(-90,Math.min(90,e[1]));let n=180===e[2]?180:((e[2]+180)%360+360)%360-180;const o=Math.max(-90,Math.min(90,e[3]));if(e[2]-e[0]>=360)r=-180,n=180;else if(r>n){const e=this.getClusters([r,i,180,o],t),a=this.getClusters([-180,i,n,o],t);return e.concat(a)}const a=this.trees[this._limitZoom(t)],s=a.range(X(r),K(o),X(n),K(i)),l=[];for(const e of s){const t=a.points[e];l.push(t.numPoints?Z(t):this.points[t.index])}return l}getChildren(e){const t=this._getOriginId(e),r=this._getOriginZoom(e),i="No cluster with the specified id.",n=this.trees[r];if(!n)throw new Error(i);const o=n.points[t];if(!o)throw new Error(i);const a=this.options.radius/(this.options.extent*Math.pow(2,r-1)),s=n.within(o.x,o.y,a),l=[];for(const t of s){const r=n.points[t];r.parentId===e&&l.push(r.numPoints?Z(r):this.points[r.index])}if(0===l.length)throw new Error(i);return l}getLeaves(e,t,r){const i=[];return this._appendLeaves(i,e,t=t||10,r=r||0,0),i}getTile(e,t,r){const i=this.trees[this._limitZoom(e)],n=Math.pow(2,e),{extent:o,radius:a}=this.options,s=a/o,l=(r-s)/n,c=(r+1+s)/n,u={features:[]};return this._addTileFeatures(i.range((t-s)/n,l,(t+1+s)/n,c),i.points,t,r,n,u),0===t&&this._addTileFeatures(i.range(1-s/n,l,1,c),i.points,n,r,n,u),t===n-1&&this._addTileFeatures(i.range(0,l,s/n,c),i.points,-1,r,n,u),u.features.length?u:null}getClusterExpansionZoom(e){let t=this._getOriginZoom(e)-1;for(;t<=this.options.maxZoom;){const r=this.getChildren(e);if(t++,1!==r.length)break;e=r[0].properties.cluster_id}return t}_appendLeaves(e,t,r,i,n){const o=this.getChildren(t);for(const t of o){const o=t.properties;if(o&&o.cluster?n+o.point_count<=i?n+=o.point_count:n=this._appendLeaves(e,o.cluster_id,r,i,n):n<i?n++:e.push(t),e.length===r)break}return n}_addTileFeatures(e,t,r,i,n,o){for(const a of e){const e=t[a],s=e.numPoints;let l,c,u;if(s)l=W(e),c=e.x,u=e.y;else{const t=this.points[e.index];l=t.properties,c=X(t.geometry.coordinates[0]),u=K(t.geometry.coordinates[1])}const h={type:1,geometry:[[Math.round(this.options.extent*(c*n-r)),Math.round(this.options.extent*(u*n-i))]],tags:l};let p;s?p=e.id:this.options.generateId?p=e.index:this.points[e.index].id&&(p=this.points[e.index].id),void 0!==p&&(h.id=p),o.features.push(h)}}_limitZoom(e){return Math.max(this.options.minZoom,Math.min(Math.floor(+e),this.options.maxZoom+1))}_cluster(e,t){const r=[],{radius:i,extent:n,reduce:o,minPoints:a}=this.options,s=i/(n*Math.pow(2,t));for(let i=0;i<e.length;i++){const n=e[i];if(n.zoom<=t)continue;n.zoom=t;const l=this.trees[t+1],c=l.within(n.x,n.y,s),u=n.numPoints||1;let h=u;for(const e of c){const r=l.points[e];r.zoom>t&&(h+=r.numPoints||1)}if(h>u&&h>=a){let e=n.x*u,a=n.y*u,s=o&&u>1?this._map(n,!0):null;const p=(i<<5)+(t+1)+this.points.length;for(const r of c){const i=l.points[r];if(i.zoom<=t)continue;i.zoom=t;const c=i.numPoints||1;e+=i.x*c,a+=i.y*c,i.parentId=p,o&&(s||(s=this._map(n,!0)),o(s,this._map(i)))}n.parentId=p,r.push($(e/h,a/h,p,h,s))}else if(r.push(n),h>1)for(const e of c){const i=l.points[e];i.zoom<=t||(i.zoom=t,r.push(i))}}return r}_getOriginId(e){return e-this.points.length>>5}_getOriginZoom(e){return(e-this.points.length)%32}_map(e,t){if(e.numPoints)return t?J({},e.properties):e.properties;const r=this.points[e.index].properties,i=this.options.map(r);return t&&i===r?J({},i):i}}function $(e,t,r,i,n){return{x:U(e),y:U(t),zoom:1/0,id:r,parentId:-1,numPoints:i,properties:n}}function G(e,t){const[r,i]=e.geometry.coordinates;return{x:U(X(r)),y:U(K(i)),zoom:1/0,index:t,parentId:-1}}function Z(e){return{type:"Feature",id:e.id,properties:W(e),geometry:{type:"Point",coordinates:[(t=e.x,360*(t-.5)),H(e.y)]}};var t}function W(e){const t=e.numPoints,r=t>=1e4?`${Math.round(t/1e3)}k`:t>=1e3?Math.round(t/100)/10+"k":t;return J(J({},e.properties),{cluster:!0,cluster_id:e.id,point_count:t,point_count_abbreviated:r})}function X(e){return e/360+.5}function K(e){const t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function H(e){const t=(180-360*e)*Math.PI/180;return 360*Math.atan(Math.exp(t))/Math.PI-90}function J(e,t){for(const r in t)e[r]=t[r];return e}function Y(e){return e.x}function Q(e){return e.y}function ee(e,t,r,i){for(var n,o=i,a=r-t>>1,s=r-t,l=e[t],c=e[t+1],u=e[r],h=e[r+1],p=t+3;p<r;p+=3){var d=te(e[p],e[p+1],l,c,u,h);if(d>o)n=p,o=d;else if(d===o){var f=Math.abs(p-a);f<s&&(n=p,s=f)}}o>i&&(n-t>3&&ee(e,t,n,i),e[n+2]=o,r-n>3&&ee(e,n,r,i))}function te(e,t,r,i,n,o){var a=n-r,s=o-i;if(0!==a||0!==s){var l=((e-r)*a+(t-i)*s)/(a*a+s*s);l>1?(r=n,i=o):l>0&&(r+=a*l,i+=s*l)}return(a=e-r)*a+(s=t-i)*s}function re(e,t,r,i){var n={id:void 0===e?null:e,type:t,geometry:r,tags:i,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0};return function(e){var t=e.geometry,r=e.type;if("Point"===r||"MultiPoint"===r||"LineString"===r)ie(e,t);else if("Polygon"===r||"MultiLineString"===r)for(var i=0;i<t.length;i++)ie(e,t[i]);else if("MultiPolygon"===r)for(i=0;i<t.length;i++)for(var n=0;n<t[i].length;n++)ie(e,t[i][n])}(n),n}function ie(e,t){for(var r=0;r<t.length;r+=3)e.minX=Math.min(e.minX,t[r]),e.minY=Math.min(e.minY,t[r+1]),e.maxX=Math.max(e.maxX,t[r]),e.maxY=Math.max(e.maxY,t[r+1])}function ne(e,t,r,i){if(t.geometry){var n=t.geometry.coordinates,o=t.geometry.type,a=Math.pow(r.tolerance/((1<<r.maxZoom)*r.extent),2),s=[],l=t.id;if(r.promoteId?l=t.properties[r.promoteId]:r.generateId&&(l=i||0),"Point"===o)oe(n,s);else if("MultiPoint"===o)for(var c=0;c<n.length;c++)oe(n[c],s);else if("LineString"===o)ae(n,s,a,!1);else if("MultiLineString"===o){if(r.lineMetrics){for(c=0;c<n.length;c++)ae(n[c],s=[],a,!1),e.push(re(l,"LineString",s,t.properties));return}se(n,s,a,!1)}else if("Polygon"===o)se(n,s,a,!0);else{if("MultiPolygon"!==o){if("GeometryCollection"===o){for(c=0;c<t.geometry.geometries.length;c++)ne(e,{id:l,geometry:t.geometry.geometries[c],properties:t.properties},r,i);return}throw new Error("Input data is not a valid GeoJSON object.")}for(c=0;c<n.length;c++){var u=[];se(n[c],u,a,!0),s.push(u)}}e.push(re(l,o,s,t.properties))}}function oe(e,t){t.push(le(e[0])),t.push(ce(e[1])),t.push(0)}function ae(e,t,r,i){for(var n,o,a=0,s=0;s<e.length;s++){var l=le(e[s][0]),c=ce(e[s][1]);t.push(l),t.push(c),t.push(0),s>0&&(a+=i?(n*c-l*o)/2:Math.sqrt(Math.pow(l-n,2)+Math.pow(c-o,2))),n=l,o=c}var u=t.length-3;t[2]=1,ee(t,0,u,r),t[u+2]=1,t.size=Math.abs(a),t.start=0,t.end=t.size}function se(e,t,r,i){for(var n=0;n<e.length;n++){var o=[];ae(e[n],o,r,i),t.push(o)}}function le(e){return e/360+.5}function ce(e){var t=Math.sin(e*Math.PI/180),r=.5-.25*Math.log((1+t)/(1-t))/Math.PI;return r<0?0:r>1?1:r}function ue(e,t,r,i,n,o,a,s){if(i/=t,o>=(r/=t)&&a<i)return e;if(a<r||o>=i)return null;for(var l=[],c=0;c<e.length;c++){var u=e[c],h=u.geometry,p=u.type,d=0===n?u.minX:u.minY,f=0===n?u.maxX:u.maxY;if(d>=r&&f<i)l.push(u);else if(!(f<r||d>=i)){var m=[];if("Point"===p||"MultiPoint"===p)he(h,m,r,i,n);else if("LineString"===p)pe(h,m,r,i,n,!1,s.lineMetrics);else if("MultiLineString"===p)fe(h,m,r,i,n,!1);else if("Polygon"===p)fe(h,m,r,i,n,!0);else if("MultiPolygon"===p)for(var y=0;y<h.length;y++){var g=[];fe(h[y],g,r,i,n,!0),g.length&&m.push(g)}if(m.length){if(s.lineMetrics&&"LineString"===p){for(y=0;y<m.length;y++)l.push(re(u.id,p,m[y],u.tags));continue}"LineString"!==p&&"MultiLineString"!==p||(1===m.length?(p="LineString",m=m[0]):p="MultiLineString"),"Point"!==p&&"MultiPoint"!==p||(p=3===m.length?"Point":"MultiPoint"),l.push(re(u.id,p,m,u.tags))}}}return l.length?l:null}function he(e,t,r,i,n){for(var o=0;o<e.length;o+=3){var a=e[o+n];a>=r&&a<=i&&(t.push(e[o]),t.push(e[o+1]),t.push(e[o+2]))}}function pe(e,t,r,i,n,o,a){for(var s,l,c=de(e),u=0===n?ye:ge,h=e.start,p=0;p<e.length-3;p+=3){var d=e[p],f=e[p+1],m=e[p+2],y=e[p+3],g=e[p+4],_=0===n?d:f,b=0===n?y:g,v=!1;a&&(s=Math.sqrt(Math.pow(d-y,2)+Math.pow(f-g,2))),_<r?b>r&&(l=u(c,d,f,y,g,r),a&&(c.start=h+s*l)):_>i?b<i&&(l=u(c,d,f,y,g,i),a&&(c.start=h+s*l)):me(c,d,f,m),b<r&&_>=r&&(l=u(c,d,f,y,g,r),v=!0),b>i&&_<=i&&(l=u(c,d,f,y,g,i),v=!0),!o&&v&&(a&&(c.end=h+s*l),t.push(c),c=de(e)),a&&(h+=s)}var x=e.length-3;d=e[x],f=e[x+1],m=e[x+2],(_=0===n?d:f)>=r&&_<=i&&me(c,d,f,m),x=c.length-3,o&&x>=3&&(c[x]!==c[0]||c[x+1]!==c[1])&&me(c,c[0],c[1],c[2]),c.length&&t.push(c)}function de(e){var t=[];return t.size=e.size,t.start=e.start,t.end=e.end,t}function fe(e,t,r,i,n,o){for(var a=0;a<e.length;a++)pe(e[a],t,r,i,n,o,!1)}function me(e,t,r,i){e.push(t),e.push(r),e.push(i)}function ye(e,t,r,i,n,o){var a=(o-t)/(i-t);return e.push(o),e.push(r+(n-r)*a),e.push(1),a}function ge(e,t,r,i,n,o){var a=(o-r)/(n-r);return e.push(t+(i-t)*a),e.push(o),e.push(1),a}function _e(e,t){for(var r=[],i=0;i<e.length;i++){var n,o=e[i],a=o.type;if("Point"===a||"MultiPoint"===a||"LineString"===a)n=be(o.geometry,t);else if("MultiLineString"===a||"Polygon"===a){n=[];for(var s=0;s<o.geometry.length;s++)n.push(be(o.geometry[s],t))}else if("MultiPolygon"===a)for(n=[],s=0;s<o.geometry.length;s++){for(var l=[],c=0;c<o.geometry[s].length;c++)l.push(be(o.geometry[s][c],t));n.push(l)}r.push(re(o.id,a,n,o.tags))}return r}function be(e,t){var r=[];r.size=e.size,void 0!==e.start&&(r.start=e.start,r.end=e.end);for(var i=0;i<e.length;i+=3)r.push(e[i]+t,e[i+1],e[i+2]);return r}function ve(e,t){if(e.transformed)return e;var r,i,n,o=1<<e.z,a=e.x,s=e.y;for(r=0;r<e.features.length;r++){var l=e.features[r],c=l.geometry,u=l.type;if(l.geometry=[],1===u)for(i=0;i<c.length;i+=2)l.geometry.push(xe(c[i],c[i+1],t,o,a,s));else for(i=0;i<c.length;i++){var h=[];for(n=0;n<c[i].length;n+=2)h.push(xe(c[i][n],c[i][n+1],t,o,a,s));l.geometry.push(h)}}return e.transformed=!0,e}function xe(e,t,r,i,n,o){return[Math.round(r*(e*i-n)),Math.round(r*(t*i-o))]}function we(e,t,r,i,n){for(var o=t===n.maxZoom?0:n.tolerance/((1<<t)*n.extent),a={features:[],numPoints:0,numSimplified:0,numFeatures:0,source:null,x:r,y:i,z:t,transformed:!1,minX:2,minY:1,maxX:-1,maxY:0},s=0;s<e.length;s++){a.numFeatures++,Se(a,e[s],o,n);var l=e[s].minX,c=e[s].minY,u=e[s].maxX,h=e[s].maxY;l<a.minX&&(a.minX=l),c<a.minY&&(a.minY=c),u>a.maxX&&(a.maxX=u),h>a.maxY&&(a.maxY=h)}return a}function Se(e,t,r,i){var n=t.geometry,o=t.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]),e.numPoints++,e.numSimplified++;else if("LineString"===o)Ee(a,n,e,r,!1,!1);else if("MultiLineString"===o||"Polygon"===o)for(s=0;s<n.length;s++)Ee(a,n[s],e,r,"Polygon"===o,0===s);else if("MultiPolygon"===o)for(var l=0;l<n.length;l++){var c=n[l];for(s=0;s<c.length;s++)Ee(a,c[s],e,r,!0,0===s)}if(a.length){var u=t.tags||null;if("LineString"===o&&i.lineMetrics){for(var h in u={},t.tags)u[h]=t.tags[h];u.mapbox_clip_start=n.start/n.size,u.mapbox_clip_end=n.end/n.size}var p={geometry:a,type:"Polygon"===o||"MultiPolygon"===o?3:"LineString"===o||"MultiLineString"===o?2:1,tags:u};null!==t.id&&(p.id=t.id),e.features.push(p)}}function Ee(e,t,r,i,n,o){var a=i*i;if(i>0&&t.size<(n?a:i))r.numPoints+=t.length/3;else{for(var s=[],l=0;l<t.length;l+=3)(0===i||t[l+2]>a)&&(r.numSimplified++,s.push(t[l]),s.push(t[l+1])),r.numPoints++;n&&function(e,t){for(var r=0,i=0,n=e.length,o=n-2;i<n;o=i,i+=2)r+=(e[i]-e[o])*(e[i+1]+e[o+1]);if(r>0===t)for(i=0,n=e.length;i<n/2;i+=2){var a=e[i],s=e[i+1];e[i]=e[n-2-i],e[i+1]=e[n-1-i],e[n-2-i]=a,e[n-1-i]=s}}(s,o),e.push(s)}}function Te(e,t){var r=(t=this.options=function(e,t){for(var r in t)e[r]=t[r];return e}(Object.create(this.options),t)).debug;if(r&&console.time("preprocess data"),t.maxZoom<0||t.maxZoom>24)throw new Error("maxZoom should be in the 0-24 range");if(t.promoteId&&t.generateId)throw new Error("promoteId and generateId cannot be used together.");var i=function(e,t){var r=[];if("FeatureCollection"===e.type)for(var i=0;i<e.features.length;i++)ne(r,e.features[i],t,i);else ne(r,"Feature"===e.type?e:{geometry:e},t);return r}(e,t);this.tiles={},this.tileCoords=[],r&&(console.timeEnd("preprocess data"),console.log("index: maxZoom: %d, maxPoints: %d",t.indexMaxZoom,t.indexMaxPoints),console.time("generate tiles"),this.stats={},this.total=0),i=function(e,t){var r=t.buffer/t.extent,i=e,n=ue(e,1,-1-r,r,0,-1,2,t),o=ue(e,1,1-r,2+r,0,-1,2,t);return(n||o)&&(i=ue(e,1,-r,1+r,0,-1,2,t)||[],n&&(i=_e(n,1).concat(i)),o&&(i=i.concat(_e(o,-1)))),i}(i,t),i.length&&this.splitTile(i,0,0,0),r&&(i.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 ke(e,t,r){return 32*((1<<e)*r+t)+e}function Ae(e,t){const r=e.tileID.canonical;if(!this._geoJSONIndex)return t(null,null);const i=this._geoJSONIndex.getTile(r.z,r.x,r.y);if(!i)return t(null,null);const n=new m(i.features);let o=y.exports(n);0===o.byteOffset&&o.byteLength===o.buffer.byteLength||(o=new Uint8Array(o)),t(null,{vectorTile:n,rawData:o.buffer})}Te.prototype.options={maxZoom:14,indexMaxZoom:5,indexMaxPoints:1e5,tolerance:3,extent:4096,buffer:64,lineMetrics:!1,promoteId:null,generateId:!1,debug:0},Te.prototype.splitTile=function(e,t,r,i,n,o,a){for(var s=[e,t,r,i],l=this.options,c=l.debug;s.length;){i=s.pop(),r=s.pop(),t=s.pop(),e=s.pop();var u=1<<t,h=ke(t,r,i),p=this.tiles[h];if(!p&&(c>1&&console.time("creation"),p=this.tiles[h]=we(e,t,r,i,l),this.tileCoords.push({z:t,x:r,y:i}),c)){c>1&&(console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)",t,r,i,p.numFeatures,p.numPoints,p.numSimplified),console.timeEnd("creation"));var d="z"+t;this.stats[d]=(this.stats[d]||0)+1,this.total++}if(p.source=e,n){if(t===l.maxZoom||t===n)continue;var f=1<<n-t;if(r!==Math.floor(o/f)||i!==Math.floor(a/f))continue}else if(t===l.indexMaxZoom||p.numPoints<=l.indexMaxPoints)continue;if(p.source=null,0!==e.length){c>1&&console.time("clipping");var m,y,g,_,b,v,x=.5*l.buffer/l.extent,w=.5-x,S=.5+x,E=1+x;m=y=g=_=null,b=ue(e,u,r-x,r+S,0,p.minX,p.maxX,l),v=ue(e,u,r+w,r+E,0,p.minX,p.maxX,l),e=null,b&&(m=ue(b,u,i-x,i+S,1,p.minY,p.maxY,l),y=ue(b,u,i+w,i+E,1,p.minY,p.maxY,l),b=null),v&&(g=ue(v,u,i-x,i+S,1,p.minY,p.maxY,l),_=ue(v,u,i+w,i+E,1,p.minY,p.maxY,l),v=null),c>1&&console.timeEnd("clipping"),s.push(m||[],t+1,2*r,2*i),s.push(y||[],t+1,2*r,2*i+1),s.push(g||[],t+1,2*r+1,2*i),s.push(_||[],t+1,2*r+1,2*i+1)}}},Te.prototype.getTile=function(e,t,r){var i=this.options,n=i.extent,o=i.debug;if(e<0||e>24)return null;var a=1<<e,s=ke(e,t=(t%a+a)%a,r);if(this.tiles[s])return ve(this.tiles[s],n);o>1&&console.log("drilling down to z%d-%d-%d",e,t,r);for(var l,c=e,u=t,h=r;!l&&c>0;)c--,u=Math.floor(u/2),h=Math.floor(h/2),l=this.tiles[ke(c,u,h)];return l&&l.source?(o>1&&console.log("found parent tile z%d-%d-%d",c,u,h),o>1&&console.time("drilling down"),this.splitTile(l.source,c,u,h,e,t,r),o>1&&console.timeEnd("drilling down"),this.tiles[s]?ve(this.tiles[s],n):null):null};class Ie extends l{constructor(e,t,r,i){super(e,t,r,Ae),i&&(this.loadGeoJSON=i)}loadData(t,r){var i;null===(i=this._pendingRequest)||void 0===i||i.cancel(),this._pendingCallback&&this._pendingCallback(null,{abandoned:!0});const n=!!(t&&t.request&&t.request.collectResourceTiming)&&new e.RequestPerformance(t.request);this._pendingCallback=r,this._pendingRequest=this.loadGeoJSON(t,((i,o)=>{if(delete this._pendingCallback,delete this._pendingRequest,i||!o)return r(i);if("object"!=typeof o)return r(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`));{u(o,!0);try{if(t.filter){const r=e.createExpression(t.filter,{type:"boolean","property-type":"data-driven",overridable:!1,transition:!1});if("error"===r.result)throw new Error(r.value.map((e=>`${e.key}: ${e.message}`)).join(", "));const i=o.features.filter((e=>r.value.evaluate({zoom:0},e)));o={type:"FeatureCollection",features:i}}this._geoJSONIndex=t.cluster?new q(function({superclusterOptions:t,clusterProperties:r}){if(!r||!t)return t;const i={},n={},o={accumulated:null,zoom:0},a={properties:null},s=Object.keys(r);for(const t of s){const[o,a]=r[t],s=e.createExpression(a),l=e.createExpression("string"==typeof o?[o,["accumulated"],["get",t]]:o);i[t]=s.value,n[t]=l.value}return t.map=e=>{a.properties=e;const t={};for(const e of s)t[e]=i[e].evaluate(o,a);return t},t.reduce=(e,t)=>{a.properties=t;for(const t of s)o.accumulated=e[t],e[t]=n[t].evaluate(o,a)},t}(t)).load(o.features):function(e,t){return new Te(e,t)}(o,t.geojsonVtOptions)}catch(i){return r(i)}this.loaded={};const a={};if(n){const e=n.finish();e&&(a.resourceTiming={},a.resourceTiming[t.source]=JSON.parse(JSON.stringify(e)))}r(null,a)}}))}reloadTile(e,t){const r=this.loaded;return r&&r[e.uid]?super.reloadTile(e,t):this.loadTile(e,t)}loadGeoJSON(t,r){if(t.request)return e.getJSON(t.request,r);if("string"==typeof t.data)try{r(null,JSON.parse(t.data))}catch(e){r(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`))}else r(new Error(`Input data given to '${t.source}' is not a valid GeoJSON object.`));return{cancel:()=>{}}}removeSource(e,t){this._pendingCallback&&this._pendingCallback(null,{abandoned:!0}),t()}getClusterExpansionZoom(e,t){try{t(null,this._geoJSONIndex.getClusterExpansionZoom(e.clusterId))}catch(e){t(e)}}getClusterChildren(e,t){try{t(null,this._geoJSONIndex.getChildren(e.clusterId))}catch(e){t(e)}}getClusterLeaves(e,t){try{t(null,this._geoJSONIndex.getLeaves(e.clusterId,e.limit,e.offset))}catch(e){t(e)}}}class Pe{constructor(t){this.self=t,this.actor=new e.Actor(t,this),this.layerIndexes={},this.availableImages={},this.workerSourceTypes={vector:l,geojson:Ie},this.workerSources={},this.demWorkerSources={},this.self.registerWorkerSource=(e,t)=>{if(this.workerSourceTypes[e])throw new Error(`Worker source with name "${e}" already registered.`);this.workerSourceTypes[e]=t},this.self.registerRTLTextPlugin=t=>{if(e.plugin.isParsed())throw new Error("RTL text plugin already registered.");e.plugin.applyArabicShaping=t.applyArabicShaping,e.plugin.processBidirectionalText=t.processBidirectionalText,e.plugin.processStyledBidirectionalText=t.processStyledBidirectionalText}}setReferrer(e,t){this.referrer=t}setImages(e,t,r){this.availableImages[e]=t;for(const r in this.workerSources[e]){const i=this.workerSources[e][r];for(const e in i)i[e].availableImages=t}r()}setLayers(e,t,r){this.getLayerIndex(e).replace(t),r()}updateLayers(e,t,r){this.getLayerIndex(e).update(t.layers,t.removedIds),r()}loadTile(e,t,r){this.getWorkerSource(e,t.type,t.source).loadTile(t,r)}loadDEMTile(e,t,r){this.getDEMWorkerSource(e,t.source).loadTile(t,r)}reloadTile(e,t,r){this.getWorkerSource(e,t.type,t.source).reloadTile(t,r)}abortTile(e,t,r){this.getWorkerSource(e,t.type,t.source).abortTile(t,r)}removeTile(e,t,r){this.getWorkerSource(e,t.type,t.source).removeTile(t,r)}removeDEMTile(e,t){this.getDEMWorkerSource(e,t.source).removeTile(t)}removeSource(e,t,r){if(!this.workerSources[e]||!this.workerSources[e][t.type]||!this.workerSources[e][t.type][t.source])return;const i=this.workerSources[e][t.type][t.source];delete this.workerSources[e][t.type][t.source],void 0!==i.removeSource?i.removeSource(t,r):r()}loadWorkerSource(e,t,r){try{this.self.importScripts(t.url),r()}catch(e){r(e.toString())}}syncRTLPluginState(t,r,i){try{e.plugin.setState(r);const t=e.plugin.getPluginURL();if(e.plugin.isLoaded()&&!e.plugin.isParsed()&&null!=t){this.self.importScripts(t);const r=e.plugin.isParsed();i(r?void 0:new Error(`RTL Text Plugin failed to import scripts from ${t}`),r)}}catch(e){i(e.toString())}}getAvailableImages(e){let t=this.availableImages[e];return t||(t=[]),t}getLayerIndex(e){let t=this.layerIndexes[e];return t||(t=this.layerIndexes[e]=new i),t}getWorkerSource(e,t,r){if(this.workerSources[e]||(this.workerSources[e]={}),this.workerSources[e][t]||(this.workerSources[e][t]={}),!this.workerSources[e][t][r]){const i={send:(t,r,i)=>{this.actor.send(t,r,i,e)}};this.workerSources[e][t][r]=new this.workerSourceTypes[t](i,this.getLayerIndex(e),this.getAvailableImages(e))}return this.workerSources[e][t][r]}getDEMWorkerSource(e,t){return this.demWorkerSources[e]||(this.demWorkerSources[e]={}),this.demWorkerSources[e][t]||(this.demWorkerSources[e][t]=new c),this.demWorkerSources[e][t]}enforceCacheSizeLimit(t,r){e.enforceCacheSizeLimit(r)}}return e.isWorker()&&(self.worker=new Pe(self)),Pe})),i(["./shared"],(function(e){var t=r;function r(e){return!function(e){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))return!1;var e,t,r=new Blob([""],{type:"text/javascript"}),i=URL.createObjectURL(r);try{t=new Worker(i),e=!0}catch(t){e=!1}return t&&t.terminate(),URL.revokeObjectURL(i),e}()?"Uint8ClampedArray"in window?ArrayBuffer.isView?function(){var e=document.createElement("canvas");e.width=e.height=1;var t=e.getContext("2d");if(!t)return!1;var r=t.getImageData(0,0,1,1);return r&&r.width===e.width}()?(void 0===i[t=e&&e.failIfMajorPerformanceCaveat]&&(i[t]=function(e){var t,i=function(e){var t=document.createElement("canvas"),i=Object.create(r.webGLContextAttributes);return i.failIfMajorPerformanceCaveat=e,t.getContext("webgl",i)||t.getContext("experimental-webgl",i)}(e);if(!i)return!1;try{t=i.createShader(i.VERTEX_SHADER)}catch(e){return!1}return!(!t||i.isContextLost())&&(i.shaderSource(t,"void main() {}"),i.compileShader(t),!0===i.getShaderParameter(t,i.COMPILE_STATUS))}(t)),i[t]?document.documentMode?"insufficient ECMAScript 6 support":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 t}(e)}var i={};function n(e,t){if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}if("object"==typeof e&&null!==e&&null!==t){if("object"!=typeof t)return!1;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const r in e)if(!n(e[r],t[r]))return!1;return!0}return e===t}r.webGLContextAttributes={antialias:!1,alpha:!0,stencil:!0,depth:!0};class o{static testProp(e){if(!o.docStyle)return e[0];for(let t=0;t<e.length;t++)if(e[t]in o.docStyle)return e[t];return e[0]}static create(e,t,r){const i=window.document.createElement(e);return void 0!==t&&(i.className=t),r&&r.appendChild(i),i}static createNS(e,t){return window.document.createElementNS(e,t)}static disableDrag(){o.docStyle&&o.selectProp&&(o.userSelect=o.docStyle[o.selectProp],o.docStyle[o.selectProp]="none")}static enableDrag(){o.docStyle&&o.selectProp&&(o.docStyle[o.selectProp]=o.userSelect)}static setTransform(e,t){e.style[o.transformProp]=t}static addEventListener(e,t,r,i={}){e.addEventListener(t,r,"passive"in i?i:i.capture)}static removeEventListener(e,t,r,i={}){e.removeEventListener(t,r,"passive"in i?i:i.capture)}static suppressClickInternal(e){e.preventDefault(),e.stopPropagation(),window.removeEventListener("click",o.suppressClickInternal,!0)}static suppressClick(){window.addEventListener("click",o.suppressClickInternal,!0),window.setTimeout((()=>{window.removeEventListener("click",o.suppressClickInternal,!0)}),0)}static mousePos(t,r){const i=t.getBoundingClientRect();return new e.pointGeometry(r.clientX-i.left-t.clientLeft,r.clientY-i.top-t.clientTop)}static touchPos(t,r){const i=t.getBoundingClientRect(),n=[];for(let o=0;o<r.length;o++)n.push(new e.pointGeometry(r[o].clientX-i.left-t.clientLeft,r[o].clientY-i.top-t.clientTop));return n}static mouseButton(e){return e.button}static remove(e){e.parentNode&&e.parentNode.removeChild(e)}}o.docStyle="undefined"!=typeof window&&window.document&&window.document.documentElement.style,o.selectProp=o.testProp(["userSelect","MozUserSelect","WebkitUserSelect","msUserSelect"]),o.transformProp=o.testProp(["transform","WebkitTransform"]);class a{constructor(e){this._transformRequestFn=e}transformRequest(e,t){return this._transformRequestFn&&this._transformRequestFn(e,t)||{url:e}}normalizeSpriteURL(e,t,r){const i=function(e){const t=e.match(s);if(!t)throw new Error(`Unable to parse URL "${e}"`);return{protocol:t[1],authority:t[2],path:t[3]||"/",params:t[4]?t[4].split("&"):[]}}(e);return i.path+=`${t}${r}`,function(e){const t=e.params.length?`?${e.params.join("&")}`:"";return`${e.protocol}://${e.authority}${e.path}${t}`}(i)}setTransformRequest(e){this._transformRequestFn=e}}const s=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;class l{constructor(e,t,r,i){this.context=e,this.format=r,this.texture=e.gl.createTexture(),this.update(t,i)}update(t,r,i){const{width:n,height:o}=t,a=!(this.size&&this.size[0]===n&&this.size[1]===o||i),{context:s}=this,{gl:l}=s;if(this.useMipmap=Boolean(r&&r.useMipmap),l.bindTexture(l.TEXTURE_2D,this.texture),s.pixelStoreUnpackFlipY.set(!1),s.pixelStoreUnpack.set(1),s.pixelStoreUnpackPremultiplyAlpha.set(this.format===l.RGBA&&(!r||!1!==r.premultiply)),a)this.size=[n,o],t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||e.isImageBitmap(t)?l.texImage2D(l.TEXTURE_2D,0,this.format,this.format,l.UNSIGNED_BYTE,t):l.texImage2D(l.TEXTURE_2D,0,this.format,n,o,0,this.format,l.UNSIGNED_BYTE,t.data);else{const{x:r,y:a}=i||{x:0,y:0};t instanceof HTMLImageElement||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageData||e.isImageBitmap(t)?l.texSubImage2D(l.TEXTURE_2D,0,r,a,l.RGBA,l.UNSIGNED_BYTE,t):l.texSubImage2D(l.TEXTURE_2D,0,r,a,n,o,l.RGBA,l.UNSIGNED_BYTE,t.data)}this.useMipmap&&this.isSizePowerOfTwo()&&l.generateMipmap(l.TEXTURE_2D)}bind(e,t,r){const{context:i}=this,{gl:n}=i;n.bindTexture(n.TEXTURE_2D,this.texture),r!==n.LINEAR_MIPMAP_NEAREST||this.isSizePowerOfTwo()||(r=n.LINEAR),e!==this.filter&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,e),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,r||e),this.filter=e),t!==this.wrap&&(n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,t),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,t),this.wrap=t)}isSizePowerOfTwo(){return this.size[0]===this.size[1]&&Math.log(this.size[0])/Math.LN2%1==0}destroy(){const{gl:e}=this.context;e.deleteTexture(this.texture),this.texture=null}}function c(e){const{userImage:t}=e;return!!(t&&t.render&&t.render())&&(e.data.replace(new Uint8Array(t.data.buffer)),!0)}class u extends e.Evented{constructor(){super(),this.images={},this.updatedImages={},this.callbackDispatchedThisFrame={},this.loaded=!1,this.requestors=[],this.patterns={},this.atlasImage=new e.RGBAImage({width:1,height:1}),this.dirty=!0}isLoaded(){return this.loaded}setLoaded(e){if(this.loaded!==e&&(this.loaded=e,e)){for(const{ids:e,callback:t}of this.requestors)this._notify(e,t);this.requestors=[]}}getImage(e){return this.images[e]}addImage(e,t){if(this.images[e])throw new Error(`Image id ${e} already exist, use updateImage instead`);this._validate(e,t)&&(this.images[e]=t)}_validate(t,r){let i=!0;return this._validateStretch(r.stretchX,r.data&&r.data.width)||(this.fire(new e.ErrorEvent(new Error(`Image "${t}" has invalid "stretchX" value`))),i=!1),this._validateStretch(r.stretchY,r.data&&r.data.height)||(this.fire(new e.ErrorEvent(new Error(`Image "${t}" has invalid "stretchY" value`))),i=!1),this._validateContent(r.content,r)||(this.fire(new e.ErrorEvent(new Error(`Image "${t}" has invalid "content" value`))),i=!1),i}_validateStretch(e,t){if(!e)return!0;let r=0;for(const i of e){if(i[0]<r||i[1]<i[0]||t<i[1])return!1;r=i[1]}return!0}_validateContent(e,t){return!(e&&(4!==e.length||e[0]<0||t.data.width<e[0]||e[1]<0||t.data.height<e[1]||e[2]<0||t.data.width<e[2]||e[3]<0||t.data.height<e[3]||e[2]<e[0]||e[3]<e[1]))}updateImage(e,t){const r=this.images[e];if(r.data.width!==t.data.width||r.data.height!==t.data.height)throw new Error(`size mismatch between old image (${r.data.width}x${r.data.height}) and new image (${t.data.width}x${t.data.height}).`);t.version=r.version+1,this.images[e]=t,this.updatedImages[e]=!0}removeImage(e){const t=this.images[e];delete this.images[e],delete this.patterns[e],t.userImage&&t.userImage.onRemove&&t.userImage.onRemove()}listImages(){return Object.keys(this.images)}getImages(e,t){let r=!0;if(!this.isLoaded())for(const t of e)this.images[t]||(r=!1);this.isLoaded()||r?this._notify(e,t):this.requestors.push({ids:e,callback:t})}_notify(t,r){const i={};for(const r of t){this.images[r]||this.fire(new e.Event("styleimagemissing",{id:r}));const t=this.images[r];t?i[r]={data:t.data.clone(),pixelRatio:t.pixelRatio,sdf:t.sdf,version:t.version,stretchX:t.stretchX,stretchY:t.stretchY,content:t.content,hasRenderCallback:Boolean(t.userImage&&t.userImage.render)}:e.warnOnce(`Image "${r}" 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)}getPixelSize(){const{width:e,height:t}=this.atlasImage;return{width:e,height:t}}getPattern(t){const r=this.patterns[t],i=this.getImage(t);if(!i)return null;if(r&&r.position.version===i.version)return r.position;if(r)r.position.version=i.version;else{const r={w:i.data.width+2,h:i.data.height+2,x:0,y:0},n=new e.ImagePosition(r,i);this.patterns[t]={bin:r,position:n}}return this._updatePatternAtlas(),this.patterns[t].position}bind(e){const t=e.gl;this.atlasTexture?this.dirty&&(this.atlasTexture.update(this.atlasImage),this.dirty=!1):this.atlasTexture=new l(e,this.atlasImage,t.RGBA),this.atlasTexture.bind(t.LINEAR,t.CLAMP_TO_EDGE)}_updatePatternAtlas(){const t=[];for(const e in this.patterns)t.push(this.patterns[e].bin);const{w:r,h:i}=e.potpack(t),n=this.atlasImage;n.resize({width:r||1,height:i||1});for(const t in this.patterns){const{bin:r}=this.patterns[t],i=r.x+1,o=r.y+1,a=this.images[t].data,s=a.width,l=a.height;e.RGBAImage.copy(a,n,{x:0,y:0},{x:i,y:o},{width:s,height:l}),e.RGBAImage.copy(a,n,{x:0,y:l-1},{x:i,y:o-1},{width:s,height:1}),e.RGBAImage.copy(a,n,{x:0,y:0},{x:i,y:o+l},{width:s,height:1}),e.RGBAImage.copy(a,n,{x:s-1,y:0},{x:i-1,y:o},{width:1,height:l}),e.RGBAImage.copy(a,n,{x:0,y:0},{x:i+s,y:o},{width:1,height:l})}this.dirty=!0}beginFrame(){this.callbackDispatchedThisFrame={}}dispatchRenderCallbacks(t){for(const r of t){if(this.callbackDispatchedThisFrame[r])continue;this.callbackDispatchedThisFrame[r]=!0;const t=this.images[r];t||e.warnOnce(`Image with ID: "${r}" was not found`),c(t)&&this.updateImage(r,t)}}}const h=1e20;function p(e,t,r,i,n,o,a,s,l){for(let c=t;c<t+i;c++)d(e,r*o+c,o,n,a,s,l);for(let c=r;c<r+n;c++)d(e,c*o+t,1,i,a,s,l)}function d(e,t,r,i,n,o,a){o[0]=0,a[0]=-h,a[1]=h,n[0]=e[t];for(let s=1,l=0,c=0;s<i;s++){n[s]=e[t+s*r];const i=s*s;do{const e=o[l];c=(n[s]-n[e]+i-e*e)/(s-e)/2}while(c<=a[l]&&--l>-1);l++,o[l]=s,a[l]=c,a[l+1]=h}for(let s=0,l=0;s<i;s++){for(;a[l+1]<s;)l++;const i=o[l],c=s-i;e[t+s*r]=n[i]+c*c}}class f{constructor(e,t){this.requestManager=e,this.localIdeographFontFamily=t,this.entries={}}setURL(e){this.url=e}getGlyphs(t,r){const i=[];for(const e in t)for(const r of t[e])i.push({stack:e,id:r});e.asyncAll(i,(({stack:e,id:t},r)=>{let i=this.entries[e];i||(i=this.entries[e]={glyphs:{},requests:{},ranges:{}});let n=i.glyphs[t];if(void 0!==n)return void r(null,{stack:e,id:t,glyph:n});if(n=this._tinySDF(i,e,t),n)return i.glyphs[t]=n,void r(null,{stack:e,id:t,glyph:n});const o=Math.floor(t/256);if(256*o>65535)return void r(new Error("glyphs > 65535 not supported"));if(i.ranges[o])return void r(null,{stack:e,id:t,glyph:n});let a=i.requests[o];a||(a=i.requests[o]=[],f.loadGlyphRange(e,o,this.url,this.requestManager,((e,t)=>{if(t){for(const e in t)this._doesCharSupportLocalGlyph(+e)||(i.glyphs[+e]=t[+e]);i.ranges[o]=!0}for(const r of a)r(e,t);delete i.requests[o]}))),a.push(((i,n)=>{i?r(i):n&&r(null,{stack:e,id:t,glyph:n[t]||null})}))}),((e,t)=>{if(e)r(e);else if(t){const e={};for(const{stack:r,id:i,glyph:n}of t)(e[r]||(e[r]={}))[i]=n&&{id:n.id,bitmap:n.bitmap.clone(),metrics:n.metrics};r(null,e)}}))}_doesCharSupportLocalGlyph(t){return!!this.localIdeographFontFamily&&(e.unicodeBlockLookup["CJK Unified Ideographs"](t)||e.unicodeBlockLookup["Hangul Syllables"](t)||e.unicodeBlockLookup.Hiragana(t)||e.unicodeBlockLookup.Katakana(t))}_tinySDF(t,r,i){const n=this.localIdeographFontFamily;if(!n)return;if(!this._doesCharSupportLocalGlyph(i))return;let o=t.tinySDF;if(!o){let e="400";/bold/i.test(r)?e="900":/medium/i.test(r)?e="500":/light/i.test(r)&&(e="200"),o=t.tinySDF=new f.TinySDF({fontSize:24,buffer:3,radius:8,cutoff:.25,fontFamily:n,fontWeight:e})}const a=o.draw(String.fromCharCode(i));return{id:i,bitmap:new e.AlphaImage({width:a.width||30,height:a.height||30},a.data),metrics:{width:a.glyphWidth||24,height:a.glyphHeight||24,left:a.glyphLeft||0,top:a.glyphTop-27||-8,advance:a.glyphAdvance||24}}}}f.loadGlyphRange=function(t,r,i,n,o){const a=256*r,s=a+255,l=n.transformRequest(i.replace("{fontstack}",t).replace("{range}",`${a}-${s}`),e.ResourceType.Glyphs);e.getArrayBuffer(l,((t,r)=>{if(t)o(t);else if(r){const t={};for(const i of e.parseGlyphPbf(r))t[i.id]=i;o(null,t)}}))},f.TinySDF=class{constructor({fontSize:e=24,buffer:t=3,radius:r=8,cutoff:i=.25,fontFamily:n="sans-serif",fontWeight:o="normal",fontStyle:a="normal"}={}){this.buffer=t,this.cutoff=i,this.radius=r;const s=this.size=e+4*t,l=this._createCanvas(s),c=this.ctx=l.getContext("2d",{willReadFrequently:!0});c.font=`${a} ${o} ${e}px ${n}`,c.textBaseline="alphabetic",c.textAlign="left",c.fillStyle="black",this.gridOuter=new Float64Array(s*s),this.gridInner=new Float64Array(s*s),this.f=new Float64Array(s),this.z=new Float64Array(s+1),this.v=new Uint16Array(s)}_createCanvas(e){const t=document.createElement("canvas");return t.width=t.height=e,t}draw(e){const{width:t,actualBoundingBoxAscent:r,actualBoundingBoxDescent:i,actualBoundingBoxLeft:n,actualBoundingBoxRight:o}=this.ctx.measureText(e),a=Math.ceil(r),s=Math.min(this.size-this.buffer,Math.ceil(o-n)),l=Math.min(this.size-this.buffer,a+Math.ceil(i)),c=s+2*this.buffer,u=l+2*this.buffer,d=Math.max(c*u,0),f=new Uint8ClampedArray(d),m={data:f,width:c,height:u,glyphWidth:s,glyphHeight:l,glyphTop:a,glyphLeft:0,glyphAdvance:t};if(0===s||0===l)return m;const{ctx:y,buffer:g,gridInner:_,gridOuter:b}=this;y.clearRect(g,g,s,l),y.fillText(e,g,g+a);const v=y.getImageData(g,g,s,l);b.fill(h,0,d),_.fill(0,0,d);for(let e=0;e<l;e++)for(let t=0;t<s;t++){const r=v.data[4*(e*s+t)+3]/255;if(0===r)continue;const i=(e+g)*c+t+g;if(1===r)b[i]=0,_[i]=h;else{const e=.5-r;b[i]=e>0?e*e:0,_[i]=e<0?e*e:0}}p(b,0,0,c,u,c,this.f,this.v,this.z),p(_,g,g,s,l,c,this.f,this.v,this.z);for(let e=0;e<d;e++){const t=Math.sqrt(b[e])-Math.sqrt(_[e]);f[e]=Math.round(255-255*(t/this.radius+this.cutoff))}return m}};const m=new e.Properties({anchor:new e.DataConstantProperty(e.spec.light.anchor),position:new class{constructor(){this.specification=e.spec.light.position}possiblyEvaluate(t,r){return e.sphericalToCartesian(t.expression.evaluate(r))}interpolate(t,r,i){return{x:e.number(t.x,r.x,i),y:e.number(t.y,r.y,i),z:e.number(t.z,r.z,i)}}},color:new e.DataConstantProperty(e.spec.light.color),intensity:new e.DataConstantProperty(e.spec.light.intensity)}),y="-transition";class g extends e.Evented{constructor(t){super(),this._transitionable=new e.Transitionable(m),this.setLight(t),this._transitioning=this._transitionable.untransitioned()}getLight(){return this._transitionable.serialize()}setLight(t,r={}){if(!this._validate(e.validateLight,t,r))for(const e in t){const r=t[e];e.endsWith(y)?this._transitionable.setTransition(e.slice(0,-y.length),r):this._transitionable.setValue(e,r)}}updateTransitions(e){this._transitioning=this._transitionable.transitioned(e,this._transitioning)}hasTransition(){return this._transitioning.hasTransition()}recalculate(e){this.properties=this._transitioning.possiblyEvaluate(e)}_validate(t,r,i){return(!i||!1!==i.validate)&&e.emitValidationErrors(this,t.call(e.validateStyle,e.extend({value:r,style:{glyphs:!0,sprite:!0},styleSpec:e.spec})))}}class _{constructor(e,t){this.width=e,this.height=t,this.nextRow=0,this.data=new Uint8Array(this.width*this.height),this.dashEntry={}}getDash(e,t){const r=e.join(",")+String(t);return this.dashEntry[r]||(this.dashEntry[r]=this.addDash(e,t)),this.dashEntry[r]}getDashRanges(e,t,r){const i=[];let n=e.length%2==1?-e[e.length-1]*r:0,o=e[0]*r,a=!0;i.push({left:n,right:o,isDash:a,zeroLength:0===e[0]});let s=e[0];for(let t=1;t<e.length;t++){a=!a;const l=e[t];n=s*r,s+=l,o=s*r,i.push({left:n,right:o,isDash:a,zeroLength:0===l})}return i}addRoundDash(e,t,r){const i=t/2;for(let t=-r;t<=r;t++){const n=this.width*(this.nextRow+r+t);let o=0,a=e[o];for(let s=0;s<this.width;s++){s/a.right>1&&(a=e[++o]);const l=Math.abs(s-a.left),c=Math.abs(s-a.right),u=Math.min(l,c);let h;const p=t/r*(i+1);if(a.isDash){const e=i-Math.abs(p);h=Math.sqrt(u*u+e*e)}else h=i-Math.sqrt(u*u+p*p);this.data[n+s]=Math.max(0,Math.min(255,h+128))}}}addRegularDash(e){for(let t=e.length-1;t>=0;--t){const r=e[t],i=e[t+1];r.zeroLength?e.splice(t,1):i&&i.isDash===r.isDash&&(i.left=r.left,e.splice(t,1))}const t=e[0],r=e[e.length-1];t.isDash===r.isDash&&(t.left=r.left-this.width,r.right=t.right+this.width);const i=this.width*this.nextRow;let n=0,o=e[n];for(let t=0;t<this.width;t++){t/o.right>1&&(o=e[++n]);const r=Math.abs(t-o.left),a=Math.abs(t-o.right),s=Math.min(r,a);this.data[i+t]=Math.max(0,Math.min(255,(o.isDash?s:-s)+128))}}addDash(t,r){const i=r?7:0,n=2*i+1;if(this.nextRow+n>this.height)return e.warnOnce("LineAtlas out of space"),null;let o=0;for(let e=0;e<t.length;e++)o+=t[e];if(0!==o){const e=this.width/o,n=this.getDashRanges(t,this.width,e);r?this.addRoundDash(n,e,i):this.addRegularDash(n)}const a={y:(this.nextRow+i+.5)/this.height,height:2*i/this.height,width:o};return this.nextRow+=n,this.dirty=!0,a}bind(e){const t=e.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))}}class b{constructor(t,r){this.workerPool=t,this.actors=[],this.currentActor=0,this.id=e.uniqueId();const i=this.workerPool.acquire(this.id);for(let e=0;e<i.length;e++){const t=new b.Actor(i[e],r,this.id);t.name=`Worker ${e}`,this.actors.push(t)}if(!this.actors.length)throw new Error("No actors found")}broadcast(t,r,i){e.asyncAll(this.actors,((e,i)=>{e.send(t,r,i)}),i=i||function(){})}getActor(){return this.currentActor=(this.currentActor+1)%this.actors.length,this.actors[this.currentActor]}remove(){this.actors.forEach((e=>{e.remove()})),this.actors=[],this.workerPool.release(this.id)}}function v(t,r,i){const n=function(r,n){if(r)return i(r);if(n){const r=e.pick(e.extend(n,t),["tiles","minzoom","maxzoom","attribution","bounds","scheme","tileSize","encoding"]);n.vector_layers&&(r.vectorLayers=n.vector_layers,r.vectorLayerIds=r.vectorLayers.map((e=>e.id))),i(null,r)}};return t.url?e.getJSON(r.transformRequest(t.url,e.ResourceType.Source),n):e.exported.frame((()=>n(null,t)))}b.Actor=e.Actor;class x{constructor(t,r,i){this.bounds=e.LngLatBounds.convert(this.validateBounds(t)),this.minzoom=r||0,this.maxzoom=i||24}validateBounds(e){return Array.isArray(e)&&4===e.length?[Math.max(-180,e[0]),Math.max(-90,e[1]),Math.min(180,e[2]),Math.min(90,e[3])]:[-180,-90,180,90]}contains(t){const r=Math.pow(2,t.z),i=Math.floor(e.mercatorXfromLng(this.bounds.getWest())*r),n=Math.floor(e.mercatorYfromLat(this.bounds.getNorth())*r),o=Math.ceil(e.mercatorXfromLng(this.bounds.getEast())*r),a=Math.ceil(e.mercatorYfromLat(this.bounds.getSouth())*r);return t.x>=i&&t.x<o&&t.y>=n&&t.y<a}}class w extends e.Evented{constructor(t,r,i,n){if(super(),this.id=t,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,e.extend(this,e.pick(r,["url","scheme","tileSize","promoteId"])),this._options=e.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)}load(){this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=v(this._options,this.map._requestManager,((t,r)=>{this._tileJSONRequest=null,this._loaded=!0,this.map.style.sourceCaches[this.id].clearTiles(),t?this.fire(new e.ErrorEvent(t)):r&&(e.extend(this,r),r.bounds&&(this.tileBounds=new x(r.bounds,this.minzoom,this.maxzoom)),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})))}))}loaded(){return this._loaded}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}onAdd(e){this.map=e,this.load()}setSourceProperty(e){this._tileJSONRequest&&this._tileJSONRequest.cancel(),e(),this.load()}setTiles(e){return this.setSourceProperty((()=>{this._options.tiles=e})),this}setUrl(e){return this.setSourceProperty((()=>{this.url=e,this._options.url=e})),this}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return e.extend({},this._options)}loadTile(t,r){const i=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme),n={request:this.map._requestManager.transformRequest(i,e.ResourceType.Tile),uid:t.uid,tileID:t.tileID,zoom:t.tileID.overscaledZ,tileSize:this.tileSize*t.tileID.overscaleFactor(),type:this.type,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};function o(i,n){return delete t.request,t.aborted?r(null):i&&404!==i.status?r(i):(n&&n.resourceTiming&&(t.resourceTiming=n.resourceTiming),this.map._refreshExpiredTiles&&n&&t.setExpiryData(n),t.loadVectorData(n,this.map.painter),e.cacheEntryPossiblyAdded(this.dispatcher),r(null),void(t.reloadCallback&&(this.loadTile(t,t.reloadCallback),t.reloadCallback=null)))}n.request.collectResourceTiming=this._collectResourceTiming,t.actor&&"expired"!==t.state?"loading"===t.state?t.reloadCallback=r:t.request=t.actor.send("reloadTile",n,o.bind(this)):(t.actor=this.dispatcher.getActor(),t.request=t.actor.send("loadTile",n,o.bind(this)))}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.actor&&e.actor.send("abortTile",{uid:e.uid,type:this.type,source:this.id},void 0)}unloadTile(e){e.unloadVectorData(),e.actor&&e.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id},void 0)}hasTransition(){return!1}}class S extends e.Evented{constructor(t,r,i,n){super(),this.id=t,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=e.extend({type:"raster"},r),e.extend(this,e.pick(r,["url","scheme","tileSize"]))}load(){this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this._tileJSONRequest=v(this._options,this.map._requestManager,((t,r)=>{this._tileJSONRequest=null,this._loaded=!0,t?this.fire(new e.ErrorEvent(t)):r&&(e.extend(this,r),r.bounds&&(this.tileBounds=new x(r.bounds,this.minzoom,this.maxzoom)),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})))}))}loaded(){return this._loaded}onAdd(e){this.map=e,this.load()}onRemove(){this._tileJSONRequest&&(this._tileJSONRequest.cancel(),this._tileJSONRequest=null)}serialize(){return e.extend({},this._options)}hasTile(e){return!this.tileBounds||this.tileBounds.contains(e.canonical)}loadTile(t,r){const i=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);t.request=e.getImage(this.map._requestManager.transformRequest(i,e.ResourceType.Tile),((i,n,o)=>{if(delete t.request,t.aborted)t.state="unloaded",r(null);else if(i)t.state="errored",r(i);else if(n){this.map._refreshExpiredTiles&&t.setExpiryData(o);const i=this.map.painter.context,a=i.gl;t.texture=this.map.painter.getTileTexture(n.width),t.texture?t.texture.update(n,{useMipmap:!0}):(t.texture=new l(i,n,a.RGBA,{useMipmap:!0}),t.texture.bind(a.LINEAR,a.CLAMP_TO_EDGE,a.LINEAR_MIPMAP_NEAREST),i.extTextureFilterAnisotropic&&a.texParameterf(a.TEXTURE_2D,i.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,i.extTextureFilterAnisotropicMax)),t.state="loaded",e.cacheEntryPossiblyAdded(this.dispatcher),r(null)}}))}abortTile(e,t){e.request&&(e.request.cancel(),delete e.request),t()}unloadTile(e,t){e.texture&&this.map.painter.saveTileTexture(e.texture),t()}hasTransition(){return!1}}let E;class T extends S{constructor(t,r,i,n){super(t,r,i,n),this.type="raster-dem",this.maxzoom=22,this._options=e.extend({type:"raster-dem"},r),this.encoding=r.encoding||"mapbox"}serialize(){return{type:"raster-dem",url:this.url,tileSize:this.tileSize,tiles:this.tiles,bounds:this.bounds,encoding:this.encoding}}loadTile(t,r){const i=t.tileID.canonical.url(this.tiles,this.map.getPixelRatio(),this.scheme);function n(e,i){e&&(t.state="errored",r(e)),i&&(t.dem=i,t.needsHillshadePrepare=!0,t.needsTerrainPrepare=!0,t.state="loaded",r(null))}t.request=e.getImage(this.map._requestManager.transformRequest(i,e.ResourceType.Tile),function(i,o){if(delete t.request,t.aborted)t.state="unloaded",r(null);else if(i)t.state="errored",r(i);else if(o){this.map._refreshExpiredTiles&&t.setExpiryData(o),delete o.cacheControl,delete o.expires;const r=e.isImageBitmap(o)&&(null==E&&(E="undefined"!=typeof OffscreenCanvas&&new OffscreenCanvas(1,1).getContext("2d")&&"function"==typeof createImageBitmap),E)?o:e.exported.getImageData(o,1),i={uid:t.uid,coord:t.tileID,source:this.id,rawImageData:r,encoding:this.encoding};t.actor&&"expired"!==t.state||(t.actor=this.dispatcher.getActor(),t.actor.send("loadDEMTile",i,n.bind(this)))}}.bind(this)),t.neighboringTiles=this._getNeighboringTiles(t.tileID)}_getNeighboringTiles(t){const r=t.canonical,i=Math.pow(2,r.z),n=(r.x-1+i)%i,o=0===r.x?t.wrap-1:t.wrap,a=(r.x+1+i)%i,s=r.x+1===i?t.wrap+1:t.wrap,l={};return l[new e.OverscaledTileID(t.overscaledZ,o,r.z,n,r.y).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,r.z,a,r.y).key]={backfilled:!1},r.y>0&&(l[new e.OverscaledTileID(t.overscaledZ,o,r.z,n,r.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,t.wrap,r.z,r.x,r.y-1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,r.z,a,r.y-1).key]={backfilled:!1}),r.y+1<i&&(l[new e.OverscaledTileID(t.overscaledZ,o,r.z,n,r.y+1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,t.wrap,r.z,r.x,r.y+1).key]={backfilled:!1},l[new e.OverscaledTileID(t.overscaledZ,s,r.z,a,r.y+1).key]={backfilled:!1}),l}unloadTile(e){e.demTexture&&this.map.painter.saveTileTexture(e.demTexture),e.fbo&&(e.fbo.destroy(),delete e.fbo),e.dem&&delete e.dem,delete e.neighboringTiles,e.state="unloaded",e.actor&&e.actor.send("removeDEMTile",{uid:e.uid,source:this.id})}}class k extends e.Evented{constructor(t,r,i,n){super(),this.id=t,this.type="geojson",this.minzoom=0,this.maxzoom=18,this.tileSize=512,this.isTileClipped=!0,this.reparseOverscaled=!0,this._removed=!1,this._pendingLoads=0,this.actor=i.getActor(),this.setEventedParent(n),this._data=r.data,this._options=e.extend({},r),this._collectResourceTiming=r.collectResourceTiming,void 0!==r.maxzoom&&(this.maxzoom=r.maxzoom),r.type&&(this.type=r.type),r.attribution&&(this.attribution=r.attribution),this.promoteId=r.promoteId;const o=e.EXTENT/this.tileSize;this.workerOptions=e.extend({source:this.id,cluster:r.cluster||!1,geojsonVtOptions:{buffer:(void 0!==r.buffer?r.buffer:128)*o,tolerance:(void 0!==r.tolerance?r.tolerance:.375)*o,extent:e.EXTENT,maxZoom:this.maxzoom,lineMetrics:r.lineMetrics||!1,generateId:r.generateId||!1},superclusterOptions:{maxZoom:void 0!==r.clusterMaxZoom?r.clusterMaxZoom:this.maxzoom-1,minPoints:Math.max(2,r.clusterMinPoints||2),extent:e.EXTENT,radius:(r.clusterRadius||50)*o,log:!1,generateId:r.generateId||!1},clusterProperties:r.clusterProperties,filter:r.filter},r.workerOptions)}load(){this._updateWorkerData("metadata")}onAdd(e){this.map=e,this.load()}setData(e){return this._data=e,this._updateWorkerData("content"),this}getClusterExpansionZoom(e,t){return this.actor.send("geojson.getClusterExpansionZoom",{clusterId:e,source:this.id},t),this}getClusterChildren(e,t){return this.actor.send("geojson.getClusterChildren",{clusterId:e,source:this.id},t),this}getClusterLeaves(e,t,r,i){return this.actor.send("geojson.getClusterLeaves",{source:this.id,clusterId:e,limit:t,offset:r},i),this}_updateWorkerData(t){const r=e.extend({},this.workerOptions),i=this._data;"string"==typeof i?(r.request=this.map._requestManager.transformRequest(e.exported.resolveURL(i),e.ResourceType.Source),r.request.collectResourceTiming=this._collectResourceTiming):r.data=JSON.stringify(i),this._pendingLoads++,this.fire(new e.Event("dataloading",{dataType:"source"})),this.actor.send(`${this.type}.loadData`,r,((r,i)=>{if(this._pendingLoads--,this._removed||i&&i.abandoned)return void this.fire(new e.Event("dataabort",{dataType:"source",sourceDataType:t}));let n=null;if(i&&i.resourceTiming&&i.resourceTiming[this.id]&&(n=i.resourceTiming[this.id].slice(0)),r)return void this.fire(new e.ErrorEvent(r));const o={dataType:"source",sourceDataType:t};this._collectResourceTiming&&n&&n.length>0&&e.extend(o,{resourceTiming:n}),this.fire(new e.Event("data",o))}))}loaded(){return 0===this._pendingLoads}loadTile(e,t){const r=e.actor?"reloadTile":"loadTile";e.actor=this.actor;const i={type:this.type,uid:e.uid,tileID:e.tileID,zoom:e.tileID.overscaledZ,maxZoom:this.maxzoom,tileSize:this.tileSize,source:this.id,pixelRatio:this.map.getPixelRatio(),showCollisionBoxes:this.map.showCollisionBoxes,promoteId:this.promoteId};e.request=this.actor.send(r,i,((i,n)=>(delete e.request,e.unloadVectorData(),e.aborted?t(null):i?t(i):(e.loadVectorData(n,this.map.painter,"reloadTile"===r),t(null)))))}abortTile(e){e.request&&(e.request.cancel(),delete e.request),e.aborted=!0}unloadTile(e){e.unloadVectorData(),this.actor.send("removeTile",{uid:e.uid,type:this.type,source:this.id})}onRemove(){this._removed=!0,this.actor.send("removeSource",{type:this.type,source:this.id})}serialize(){return e.extend({},this._options,{type:this.type,data:this._data})}hasTransition(){return!1}}var A=e.createLayout([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}]);class I extends e.Evented{constructor(e,t,r,i){super(),this.id=e,this.dispatcher=r,this.coordinates=t.coordinates,this.type="image",this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.tiles={},this._loaded=!1,this.setEventedParent(i),this.options=t}load(t,r){this._loaded=!1,this.fire(new e.Event("dataloading",{dataType:"source"})),this.url=this.options.url,e.getImage(this.map._requestManager.transformRequest(this.url,e.ResourceType.Image),((i,n)=>{this._loaded=!0,i?this.fire(new e.ErrorEvent(i)):n&&(this.image=n,t&&(this.coordinates=t),r&&r(),this._finishLoading())}))}loaded(){return this._loaded}updateImage(e){return this.image&&e.url?(this.options.url=e.url,this.load(e.coordinates,(()=>{this.texture=null})),this):this}_finishLoading(){this.map&&(this.setCoordinates(this.coordinates),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"metadata"})))}onAdd(e){this.map=e,this.load()}setCoordinates(t){this.coordinates=t;const r=t.map(e.MercatorCoordinate.fromLngLat);this.tileID=function(t){let r=1/0,i=1/0,n=-1/0,o=-1/0;for(const e of t)r=Math.min(r,e.x),i=Math.min(i,e.y),n=Math.max(n,e.x),o=Math.max(o,e.y);const a=Math.max(n-r,o-i),s=Math.max(0,Math.floor(-Math.log(a)/Math.LN2)),l=Math.pow(2,s);return new e.CanonicalTileID(s,Math.floor((r+n)/2*l),Math.floor((i+o)/2*l))}(r),this.minzoom=this.maxzoom=this.tileID.z;const i=r.map((e=>this.tileID.getTilePoint(e)._round()));return this._boundsArray=new e.RasterBoundsArray,this._boundsArray.emplaceBack(i[0].x,i[0].y,0,0),this._boundsArray.emplaceBack(i[1].x,i[1].y,e.EXTENT,0),this._boundsArray.emplaceBack(i[3].x,i[3].y,0,e.EXTENT),this._boundsArray.emplaceBack(i[2].x,i[2].y,e.EXTENT,e.EXTENT),this.boundsBuffer&&(this.boundsBuffer.destroy(),delete this.boundsBuffer),this.fire(new e.Event("data",{dataType:"source",sourceDataType:"content"})),this}prepare(){if(0===Object.keys(this.tiles).length||!this.image)return;const t=this.map.painter.context,r=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,A.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture||(this.texture=new l(t,this.image,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));for(const e in this.tiles){const t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture)}}loadTile(e,t){this.tileID&&this.tileID.equals(e.tileID.canonical)?(this.tiles[String(e.tileID.wrap)]=e,e.buckets={},t(null)):(e.state="errored",t(null))}serialize(){return{type:"image",url:this.options.url,coordinates:this.coordinates}}hasTransition(){return!1}}class P extends I{constructor(e,t,r,i){super(e,t,r,i),this.roundZoom=!0,this.type="video",this.options=t}load(){this._loaded=!1;const t=this.options;this.urls=[];for(const r of t.urls)this.urls.push(this.map._requestManager.transformRequest(r,e.ResourceType.Source).url);e.getVideo(this.urls,((t,r)=>{this._loaded=!0,t?this.fire(new e.ErrorEvent(t)):r&&(this.video=r,this.video.loop=!0,this.video.addEventListener("playing",(()=>{this.map.triggerRepaint()})),this.map&&this.video.play(),this._finishLoading())}))}pause(){this.video&&this.video.pause()}play(){this.video&&this.video.play()}seek(t){if(this.video){const r=this.video.seekable;t<r.start(0)||t>r.end(0)?this.fire(new e.ErrorEvent(new e.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=t}}getVideo(){return this.video}onAdd(e){this.map||(this.map=e,this.load(),this.video&&(this.video.play(),this.setCoordinates(this.coordinates)))}prepare(){if(0===Object.keys(this.tiles).length||this.video.readyState<2)return;const t=this.map.painter.context,r=t.gl;this.boundsBuffer||(this.boundsBuffer=t.createVertexBuffer(this._boundsArray,A.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?this.video.paused||(this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE),r.texSubImage2D(r.TEXTURE_2D,0,0,0,r.RGBA,r.UNSIGNED_BYTE,this.video)):(this.texture=new l(t,this.video,r.RGBA),this.texture.bind(r.LINEAR,r.CLAMP_TO_EDGE));for(const e in this.tiles){const t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture)}}serialize(){return{type:"video",urls:this.urls,coordinates:this.coordinates}}hasTransition(){return this.video&&!this.video.paused}}class C extends I{constructor(t,r,i,n){super(t,r,i,n),r.coordinates?Array.isArray(r.coordinates)&&4===r.coordinates.length&&!r.coordinates.some((e=>!Array.isArray(e)||2!==e.length||e.some((e=>"number"!=typeof e))))||this.fire(new e.ErrorEvent(new e.ValidationError(`sources.${t}`,null,'"coordinates" property must be an array of 4 longitude/latitude array pairs'))):this.fire(new e.ErrorEvent(new e.ValidationError(`sources.${t}`,null,'missing required property "coordinates"'))),r.animate&&"boolean"!=typeof r.animate&&this.fire(new e.ErrorEvent(new e.ValidationError(`sources.${t}`,null,'optional "animate" property must be a boolean value'))),r.canvas?"string"==typeof r.canvas||r.canvas instanceof HTMLCanvasElement||this.fire(new e.ErrorEvent(new e.ValidationError(`sources.${t}`,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 e.ErrorEvent(new e.ValidationError(`sources.${t}`,null,'missing required property "canvas"'))),this.options=r,this.animate=void 0===r.animate||r.animate}load(){this._loaded=!0,this.canvas||(this.canvas=this.options.canvas instanceof HTMLCanvasElement?this.options.canvas:document.getElementById(this.options.canvas)),this.width=this.canvas.width,this.height=this.canvas.height,this._hasInvalidDimensions()?this.fire(new e.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())}getCanvas(){return this.canvas}onAdd(e){this.map=e,this.load(),this.canvas&&this.animate&&this.play()}onRemove(){this.pause()}prepare(){let t=!1;if(this.canvas.width!==this.width&&(this.width=this.canvas.width,t=!0),this.canvas.height!==this.height&&(this.height=this.canvas.height,t=!0),this._hasInvalidDimensions())return;if(0===Object.keys(this.tiles).length)return;const r=this.map.painter.context,i=r.gl;this.boundsBuffer||(this.boundsBuffer=r.createVertexBuffer(this._boundsArray,A.members)),this.boundsSegments||(this.boundsSegments=e.SegmentVector.simpleSegment(0,0,4,2)),this.texture?(t||this._playing)&&this.texture.update(this.canvas,{premultiply:!0}):this.texture=new l(r,this.canvas,i.RGBA,{premultiply:!0});for(const e in this.tiles){const t=this.tiles[e];"loaded"!==t.state&&(t.state="loaded",t.texture=this.texture)}}serialize(){return{type:"canvas",coordinates:this.coordinates}}hasTransition(){return this._playing}_hasInvalidDimensions(){for(const e of[this.canvas.width,this.canvas.height])if(isNaN(e)||e<=0)return!0;return!1}}const z={vector:w,raster:S,"raster-dem":T,geojson:k,video:P,image:I,canvas:C};function M(t,r){const i=e.create();return e.translate(i,i,[1,1,0]),e.scale(i,i,[.5*t.width,.5*t.height,1]),e.multiply(i,i,t.calculatePosMatrix(r.toUnwrapped()))}function O(e,t,r,i,n,o){const a=function(e,t,r){if(e)for(const i of e){const e=t[i];if(e&&e.source===r&&"fill-extrusion"===e.type)return!0}else for(const e in t){const i=t[e];if(i.source===r&&"fill-extrusion"===i.type)return!0}return!1}(n&&n.layers,t,e.id),s=o.maxPitchScaleFactor(),l=e.tilesIn(i,s,a);l.sort(D);const c=[];for(const i of l)c.push({wrappedTileID:i.tileID.wrapped().key,queryResults:i.tile.queryRenderedFeatures(t,r,e._state,i.queryGeometry,i.cameraQueryGeometry,i.scale,n,o,s,M(e.transform,i.tileID))});const u=function(e){const t={},r={};for(const i of e){const e=i.queryResults,n=i.wrappedTileID,o=r[n]=r[n]||{};for(const r in e){const i=e[r],n=o[r]=o[r]||{},a=t[r]=t[r]||[];for(const e of i)n[e.featureIndex]||(n[e.featureIndex]=!0,a.push(e))}}return t}(c);for(const t in u)u[t].forEach((t=>{const r=t.feature,i=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=i}));return u}function D(e,t){const r=e.tileID,i=t.tileID;return r.overscaledZ-i.overscaledZ||r.canonical.y-i.canonical.y||r.wrap-i.wrap||r.canonical.x-i.canonical.x}class L{constructor(t,r){this.tileID=t,this.uid=e.uniqueId(),this.uses=0,this.tileSize=r,this.buckets={},this.expirationTime=null,this.queryPadding=0,this.hasSymbolBuckets=!1,this.hasRTLText=!1,this.dependencies={},this.textures=[],this.textureCoords={},this.expiredRequestCount=0,this.state="loading"}registerFadeDuration(t){const r=t+this.timeAdded;r<e.exported.now()||this.fadeEndTime&&r<this.fadeEndTime||(this.fadeEndTime=r)}wasRequested(){return"errored"===this.state||"loaded"===this.state||"reloading"===this.state}clearTextures(e){this.demTexture&&e.saveTileTexture(this.demTexture),this.textures.forEach((t=>e.saveTileTexture(t))),this.demTexture=null,this.textures=[],this.textureCoords={}}loadVectorData(t,r,i){if(this.hasData()&&this.unloadVectorData(),this.state="loaded",t){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(e,t){const r={};if(!t)return r;for(const i of e){const e=i.layerIds.map((e=>t.getLayer(e))).filter(Boolean);if(0!==e.length){i.layers=e,i.stateDependentLayerIds&&(i.stateDependentLayers=i.stateDependentLayerIds.map((t=>e.filter((e=>e.id===t))[0])));for(const t of e)r[t.id]=i}}return r}(t.buckets,r.style),this.hasSymbolBuckets=!1;for(const t in this.buckets){const r=this.buckets[t];if(r instanceof e.SymbolBucket){if(this.hasSymbolBuckets=!0,!i)break;r.justReloaded=!0}}if(this.hasRTLText=!1,this.hasSymbolBuckets)for(const t in this.buckets){const r=this.buckets[t];if(r instanceof e.SymbolBucket&&r.hasRTLText){this.hasRTLText=!0,e.lazyLoadRTLTextPlugin();break}}this.queryPadding=0;for(const e in this.buckets){const t=this.buckets[e];this.queryPadding=Math.max(this.queryPadding,r.style.getLayer(e).queryRadius(t))}t.imageAtlas&&(this.imageAtlas=t.imageAtlas),t.glyphAtlasImage&&(this.glyphAtlasImage=t.glyphAtlasImage)}else this.collisionBoxArray=new e.CollisionBoxArray}unloadVectorData(){for(const e in this.buckets)this.buckets[e].destroy();this.buckets={},this.imageAtlasTexture&&this.imageAtlasTexture.destroy(),this.imageAtlas&&(this.imageAtlas=null),this.glyphAtlasTexture&&this.glyphAtlasTexture.destroy(),this.latestFeatureIndex=null,this.state="unloaded"}getBucket(e){return this.buckets[e.id]}upload(e){for(const t in this.buckets){const r=this.buckets[t];r.uploadPending()&&r.upload(e)}const t=e.gl;this.imageAtlas&&!this.imageAtlas.uploaded&&(this.imageAtlasTexture=new l(e,this.imageAtlas.image,t.RGBA),this.imageAtlas.uploaded=!0),this.glyphAtlasImage&&(this.glyphAtlasTexture=new l(e,this.glyphAtlasImage,t.ALPHA),this.glyphAtlasImage=null)}prepare(e){this.imageAtlas&&this.imageAtlas.patchUpdatedImages(e,this.imageAtlasTexture)}queryRenderedFeatures(e,t,r,i,n,o,a,s,l,c){return this.latestFeatureIndex&&this.latestFeatureIndex.rawTileData?this.latestFeatureIndex.query({queryGeometry:i,cameraQueryGeometry:n,scale:o,tileSize:this.tileSize,pixelPosMatrix:c,transform:s,params:a,queryPadding:this.queryPadding*l},e,t,r):{}}querySourceFeatures(t,r){const i=this.latestFeatureIndex;if(!i||!i.rawTileData)return;const n=i.loadVTLayers(),o=r?r.sourceLayer:"",a=n._geojsonTileLayer||n[o];if(!a)return;const s=e.createFilter(r&&r.filter),{z:l,x:c,y:u}=this.tileID.canonical,h={z:l,x:c,y:u};for(let r=0;r<a.length;r++){const n=a.feature(r);if(s.needGeometry){const t=e.toEvaluationFeature(n,!0);if(!s.filter(new e.EvaluationParameters(this.tileID.overscaledZ),t,this.tileID.canonical))continue}else if(!s.filter(new e.EvaluationParameters(this.tileID.overscaledZ),n))continue;const p=i.getId(n,o),d=new e.GeoJSONFeature(n,l,c,u,p);d.tile=h,t.push(d)}}hasData(){return"loaded"===this.state||"reloading"===this.state||"expired"===this.state}patternsLoaded(){return this.imageAtlas&&!!Object.keys(this.imageAtlas.patternPositions).length}setExpiryData(t){const r=this.expirationTime;if(t.cacheControl){const r=e.parseCacheControl(t.cacheControl);r["max-age"]&&(this.expirationTime=Date.now()+1e3*r["max-age"])}else t.expires&&(this.expirationTime=new Date(t.expires).getTime());if(this.expirationTime){const e=Date.now();let t=!1;if(this.expirationTime>e)t=!1;else if(r)if(this.expirationTime<r)t=!0;else{const i=this.expirationTime-r;i?this.expirationTime=e+Math.max(i,3e4):t=!0}else t=!0;t?(this.expiredRequestCount++,this.state="expired"):this.expiredRequestCount=0}}getExpiryTimeout(){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)}setFeatureState(e,t){if(!this.latestFeatureIndex||!this.latestFeatureIndex.rawTileData||0===Object.keys(e).length)return;const r=this.latestFeatureIndex.loadVTLayers();for(const i in this.buckets){if(!t.style.hasLayer(i))continue;const n=this.buckets[i],o=n.layers[0].sourceLayer||"_geojsonTileLayer",a=r[o],s=e[o];if(!a||!s||0===Object.keys(s).length)continue;n.update(s,a,this.imageAtlas&&this.imageAtlas.patternPositions||{});const l=t&&t.style&&t.style.getLayer(i);l&&(this.queryPadding=Math.max(this.queryPadding,l.queryRadius(n)))}}holdingForFade(){return void 0!==this.symbolFadeHoldUntil}symbolFadeFinished(){return!this.symbolFadeHoldUntil||this.symbolFadeHoldUntil<e.exported.now()}clearFadeHold(){this.symbolFadeHoldUntil=void 0}setHoldDuration(t){this.symbolFadeHoldUntil=e.exported.now()+t}setDependencies(e,t){const r={};for(const e of t)r[e]=!0;this.dependencies[e]=r}hasDependency(e,t){for(const r of e){const e=this.dependencies[r];if(e)for(const r of t)if(e[r])return!0}return!1}}class j{constructor(e,t){this.max=e,this.onRemove=t,this.reset()}reset(){for(const e in this.data)for(const t of this.data[e])t.timeout&&clearTimeout(t.timeout),this.onRemove(t.value);return this.data={},this.order=[],this}add(e,t,r){const i=e.wrapped().key;void 0===this.data[i]&&(this.data[i]=[]);const n={value:t,timeout:void 0};if(void 0!==r&&(n.timeout=setTimeout((()=>{this.remove(e,n)}),r)),this.data[i].push(n),this.order.push(i),this.order.length>this.max){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}has(e){return e.wrapped().key in this.data}getAndRemove(e){return this.has(e)?this._getAndRemoveByKey(e.wrapped().key):null}_getAndRemoveByKey(e){const t=this.data[e].shift();return t.timeout&&clearTimeout(t.timeout),0===this.data[e].length&&delete this.data[e],this.order.splice(this.order.indexOf(e),1),t.value}getByKey(e){const t=this.data[e];return t?t[0].value:null}get(e){return this.has(e)?this.data[e.wrapped().key][0].value:null}remove(e,t){if(!this.has(e))return this;const r=e.wrapped().key,i=void 0===t?0:this.data[r].indexOf(t),n=this.data[r][i];return this.data[r].splice(i,1),n.timeout&&clearTimeout(n.timeout),0===this.data[r].length&&delete this.data[r],this.onRemove(n.value),this.order.splice(this.order.indexOf(r),1),this}setMaxSize(e){for(this.max=e;this.order.length>this.max;){const e=this._getAndRemoveByKey(this.order[0]);e&&this.onRemove(e)}return this}filter(e){const t=[];for(const r in this.data)for(const i of this.data[r])e(i.value)||t.push(i);for(const e of t)this.remove(e.value.tileID,e)}}class R{constructor(){this.state={},this.stateChanges={},this.deletedStates={}}updateState(t,r,i){const n=String(r);if(this.stateChanges[t]=this.stateChanges[t]||{},this.stateChanges[t][n]=this.stateChanges[t][n]||{},e.extend(this.stateChanges[t][n],i),null===this.deletedStates[t]){this.deletedStates[t]={};for(const e in this.state[t])e!==n&&(this.deletedStates[t][e]=null)}else if(this.deletedStates[t]&&null===this.deletedStates[t][n]){this.deletedStates[t][n]={};for(const e in this.state[t][n])i[e]||(this.deletedStates[t][n][e]=null)}else for(const e in i)this.deletedStates[t]&&this.deletedStates[t][n]&&null===this.deletedStates[t][n][e]&&delete this.deletedStates[t][n][e]}removeFeatureState(e,t,r){if(null===this.deletedStates[e])return;const i=String(t);if(this.deletedStates[e]=this.deletedStates[e]||{},r&&void 0!==t)null!==this.deletedStates[e][i]&&(this.deletedStates[e][i]=this.deletedStates[e][i]||{},this.deletedStates[e][i][r]=null);else if(void 0!==t)if(this.stateChanges[e]&&this.stateChanges[e][i])for(r in this.deletedStates[e][i]={},this.stateChanges[e][i])this.deletedStates[e][i][r]=null;else this.deletedStates[e][i]=null;else this.deletedStates[e]=null}getState(t,r){const i=String(r),n=e.extend({},(this.state[t]||{})[i],(this.stateChanges[t]||{})[i]);if(null===this.deletedStates[t])return{};if(this.deletedStates[t]){const e=this.deletedStates[t][r];if(null===e)return{};for(const t in e)delete n[t]}return n}initializeTileState(e,t){e.setFeatureState(this.state,t)}coalesceChanges(t,r){const i={};for(const t in this.stateChanges){this.state[t]=this.state[t]||{};const r={};for(const i in this.stateChanges[t])this.state[t][i]||(this.state[t][i]={}),e.extend(this.state[t][i],this.stateChanges[t][i]),r[i]=this.state[t][i];i[t]=r}for(const t in this.deletedStates){this.state[t]=this.state[t]||{};const r={};if(null===this.deletedStates[t])for(const e in this.state[t])r[e]={},this.state[t][e]={};else for(const e in this.deletedStates[t]){if(null===this.deletedStates[t][e])this.state[t][e]={};else for(const r of Object.keys(this.deletedStates[t][e]))delete this.state[t][e][r];r[e]=this.state[t][e]}i[t]=i[t]||{},e.extend(i[t],r)}if(this.stateChanges={},this.deletedStates={},0!==Object.keys(i).length)for(const e in t)t[e].setFeatureState(i,r)}}class B extends e.Evented{constructor(t,r,i){super(),this.id=t,this.dispatcher=i,this.on("data",(e=>{"source"===e.dataType&&"metadata"===e.sourceDataType&&(this._sourceLoaded=!0),this._sourceLoaded&&!this._paused&&"source"===e.dataType&&"content"===e.sourceDataType&&(this.reload(),this.transform&&this.update(this.transform,this.terrain))})),this.on("dataloading",(()=>{this._sourceErrored=!1})),this.on("error",(()=>{this._sourceErrored=this._source.loaded()})),this._source=function(t,r,i,n){const o=new z[r.type](t,r,i,n);if(o.id!==t)throw new Error(`Expected Source id to be ${t} instead of ${o.id}`);return e.bindAll(["load","abort","unload","serialize","prepare"],o),o}(t,r,i,this),this._tiles={},this._cache=new j(0,this._unloadTile.bind(this)),this._timers={},this._cacheTimers={},this._maxTileCacheSize=null,this._loadedParentTiles={},this._coveredTiles={},this._state=new R}onAdd(e){this.map=e,this._maxTileCacheSize=e?e._maxTileCacheSize:null,this._source&&this._source.onAdd&&this._source.onAdd(e)}onRemove(e){this.clearTiles(),this._source&&this._source.onRemove&&this._source.onRemove(e)}loaded(){if(this._sourceErrored)return!0;if(!this._sourceLoaded)return!1;if(!this._source.loaded())return!1;for(const e in this._tiles){const t=this._tiles[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}return!0}getSource(){return this._source}pause(){this._paused=!0}resume(){if(!this._paused)return;const e=this._shouldReloadOnResume;this._paused=!1,this._shouldReloadOnResume=!1,e&&this.reload(),this.transform&&this.update(this.transform,this.terrain)}_loadTile(e,t){return this._source.loadTile(e,t)}_unloadTile(e){if(this._source.unloadTile)return this._source.unloadTile(e,(()=>{}))}_abortTile(t){this._source.abortTile&&this._source.abortTile(t,(()=>{})),this._source.fire(new e.Event("dataabort",{tile:t,coord:t.tileID,dataType:"source"}))}serialize(){return this._source.serialize()}prepare(e){this._source.prepare&&this._source.prepare(),this._state.coalesceChanges(this._tiles,this.map?this.map.painter:null);for(const t in this._tiles){const r=this._tiles[t];r.upload(e),r.prepare(this.map.style.imageManager)}}getIds(){return Object.values(this._tiles).map((e=>e.tileID)).sort(F).map((e=>e.key))}getRenderableIds(t){const r=[];for(const e in this._tiles)this._isIdRenderable(e,t)&&r.push(this._tiles[e]);return t?r.sort(((t,r)=>{const i=t.tileID,n=r.tileID,o=new e.pointGeometry(i.canonical.x,i.canonical.y)._rotate(this.transform.angle),a=new e.pointGeometry(n.canonical.x,n.canonical.y)._rotate(this.transform.angle);return i.overscaledZ-n.overscaledZ||a.y-o.y||a.x-o.x})).map((e=>e.tileID.key)):r.map((e=>e.tileID)).sort(F).map((e=>e.key))}hasRenderableParent(e){const t=this.findLoadedParent(e,0);return!!t&&this._isIdRenderable(t.tileID.key)}_isIdRenderable(e,t){return this._tiles[e]&&this._tiles[e].hasData()&&!this._coveredTiles[e]&&(t||!this._tiles[e].holdingForFade())}reload(){if(this._paused)this._shouldReloadOnResume=!0;else{this._cache.reset();for(const e in this._tiles)"errored"!==this._tiles[e].state&&this._reloadTile(e,"reloading")}}_reloadTile(e,t){const r=this._tiles[e];r&&("loading"!==r.state&&(r.state=t),this._loadTile(r,this._tileLoaded.bind(this,r,e,t)))}_tileLoaded(t,r,i,n){if(n)return t.state="errored",void(404!==n.status?this._source.fire(new e.ErrorEvent(n,{tile:t})):this.update(this.transform,this.terrain));t.timeAdded=e.exported.now(),"expired"===i&&(t.refreshedUponExpiration=!0),this._setTileReloadTimer(r,t),"raster-dem"===this.getSource().type&&t.dem&&this._backfillDEM(t),this._state.initializeTileState(t,this.map?this.map.painter:null),t.aborted||this._source.fire(new e.Event("data",{dataType:"source",tile:t,coord:t.tileID}))}_backfillDEM(e){const t=this.getRenderableIds();for(let i=0;i<t.length;i++){const n=t[i];if(e.neighboringTiles&&e.neighboringTiles[n]){const t=this.getTileByID(n);r(e,t),r(t,e)}}function r(e,t){e.needsHillshadePrepare=!0,e.needsTerrainPrepare=!0;let r=t.tileID.canonical.x-e.tileID.canonical.x;const i=t.tileID.canonical.y-e.tileID.canonical.y,n=Math.pow(2,e.tileID.canonical.z),o=t.tileID.key;0===r&&0===i||Math.abs(i)>1||(Math.abs(r)>1&&(1===Math.abs(r+n)?r+=n:1===Math.abs(r-n)&&(r-=n)),t.dem&&e.dem&&(e.dem.backfillBorder(t.dem,r,i),e.neighboringTiles&&e.neighboringTiles[o]&&(e.neighboringTiles[o].backfilled=!0)))}}getTile(e){return this.getTileByID(e.key)}getTileByID(e){return this._tiles[e]}_retainLoadedChildren(e,t,r,i){for(const n in this._tiles){let o=this._tiles[n];if(i[n]||!o.hasData()||o.tileID.overscaledZ<=t||o.tileID.overscaledZ>r)continue;let a=o.tileID;for(;o&&o.tileID.overscaledZ>t+1;){const e=o.tileID.scaledTo(o.tileID.overscaledZ-1);o=this._tiles[e.key],o&&o.hasData()&&(a=e)}let s=a;for(;s.overscaledZ>t;)if(s=s.scaledTo(s.overscaledZ-1),e[s.key]){i[a.key]=a;break}}}findLoadedParent(e,t){if(e.key in this._loadedParentTiles){const r=this._loadedParentTiles[e.key];return r&&r.tileID.overscaledZ>=t?r:null}for(let r=e.overscaledZ-1;r>=t;r--){const t=e.scaledTo(r),i=this._getLoadedTile(t);if(i)return i}}_getLoadedTile(e){const t=this._tiles[e.key];return t&&t.hasData()?t:this._cache.getByKey(e.wrapped().key)}updateCacheSize(e){const t=Math.ceil(e.width/this._source.tileSize)+1,r=Math.ceil(e.height/this._source.tileSize)+1,i=Math.floor(t*r*5),n="number"==typeof this._maxTileCacheSize?Math.min(this._maxTileCacheSize,i):i;this._cache.setMaxSize(n)}handleWrapJump(e){const t=Math.round((e-(void 0===this._prevLng?e:this._prevLng))/360);if(this._prevLng=e,t){const e={};for(const r in this._tiles){const i=this._tiles[r];i.tileID=i.tileID.unwrapTo(i.tileID.wrap+t),e[i.tileID.key]=i}this._tiles=e;for(const e in this._timers)clearTimeout(this._timers[e]),delete this._timers[e];for(const e in this._tiles)this._setTileReloadTimer(e,this._tiles[e])}}update(t,r){if(this.transform=t,this.terrain=r,!this._sourceLoaded||this._paused)return;let i;this.updateCacheSize(t),this.handleWrapJump(this.transform.center.lng),this._coveredTiles={},this.used||this.usedForTerrain?this._source.tileID?i=t.getVisibleUnwrappedCoordinates(this._source.tileID).map((t=>new e.OverscaledTileID(t.canonical.z,t.wrap,t.canonical.z,t.canonical.x,t.canonical.y))):(i=t.coveringTiles({tileSize:this.usedForTerrain?this.tileSize:this._source.tileSize,minzoom:this._source.minzoom,maxzoom:this._source.maxzoom,roundZoom:!this.usedForTerrain&&this._source.roundZoom,reparseOverscaled:this._source.reparseOverscaled,terrain:r}),this._source.hasTile&&(i=i.filter((e=>this._source.hasTile(e))))):i=[];const n=t.coveringZoomLevel(this._source),o=Math.max(n-B.maxOverzooming,this._source.minzoom),a=Math.max(n+B.maxUnderzooming,this._source.minzoom);if(this.usedForTerrain){const e={};for(const t of i)if(t.canonical.z>this._source.minzoom){const r=t.scaledTo(t.canonical.z-1);e[r.key]=r;const i=t.scaledTo(Math.max(this._source.minzoom,Math.min(t.canonical.z,5)));e[i.key]=i}i=i.concat(Object.values(e))}const s=this._updateRetainedTiles(i,n);if(N(this._source.type)){const t={},l={},c=Object.keys(s);for(const r of c){const i=s[r],n=this._tiles[r];if(!n||n.fadeEndTime&&n.fadeEndTime<=e.exported.now())continue;const a=this.findLoadedParent(i,o);a&&(this._addTile(a.tileID),t[a.tileID.key]=a.tileID),l[r]=i}this._retainLoadedChildren(l,n,a,s);for(const e in t)s[e]||(this._coveredTiles[e]=!0,s[e]=t[e]);if(r){const e={},t={};for(const r of i)this._tiles[r.key].hasData()?e[r.key]=r:t[r.key]=r;for(const r in t){const i=t[r].children(this._source.maxzoom);this._tiles[i[0].key]&&this._tiles[i[1].key]&&this._tiles[i[2].key]&&this._tiles[i[3].key]&&(e[i[0].key]=s[i[0].key]=i[0],e[i[1].key]=s[i[1].key]=i[1],e[i[2].key]=s[i[2].key]=i[2],e[i[3].key]=s[i[3].key]=i[3],delete t[r])}for(const r in t){const i=this.findLoadedParent(t[r],this._source.minzoom);if(i){e[i.tileID.key]=s[i.tileID.key]=i.tileID;for(const t in e)e[t].isChildOf(i.tileID)&&delete e[t]}}for(const t in this._tiles)e[t]||(this._coveredTiles[t]=!0)}}for(const e in s)this._tiles[e].clearFadeHold();const l=e.keysDifference(this._tiles,s);for(const e of l){const t=this._tiles[e];t.hasSymbolBuckets&&!t.holdingForFade()?t.setHoldDuration(this.map._fadeDuration):t.hasSymbolBuckets&&!t.symbolFadeFinished()||this._removeTile(e)}this._updateLoadedParentTileCache()}releaseSymbolFadeTiles(){for(const e in this._tiles)this._tiles[e].holdingForFade()&&this._removeTile(e)}_updateRetainedTiles(e,t){const r={},i={},n=Math.max(t-B.maxOverzooming,this._source.minzoom),o=Math.max(t+B.maxUnderzooming,this._source.minzoom),a={};for(const i of e){const e=this._addTile(i);r[i.key]=i,e.hasData()||t<this._source.maxzoom&&(a[i.key]=i)}this._retainLoadedChildren(a,t,o,r);for(const o of e){let e=this._tiles[o.key];if(e.hasData())continue;if(t+1>this._source.maxzoom){const e=o.children(this._source.maxzoom)[0],t=this.getTile(e);if(t&&t.hasData()){r[e.key]=e;continue}}else{const e=o.children(this._source.maxzoom);if(r[e[0].key]&&r[e[1].key]&&r[e[2].key]&&r[e[3].key])continue}let a=e.wasRequested();for(let t=o.overscaledZ-1;t>=n;--t){const n=o.scaledTo(t);if(i[n.key])break;if(i[n.key]=!0,e=this.getTile(n),!e&&a&&(e=this._addTile(n)),e&&(r[n.key]=n,a=e.wasRequested(),e.hasData()))break}}return r}_updateLoadedParentTileCache(){this._loadedParentTiles={};for(const e in this._tiles){const t=[];let r,i=this._tiles[e].tileID;for(;i.overscaledZ>0;){if(i.key in this._loadedParentTiles){r=this._loadedParentTiles[i.key];break}t.push(i.key);const e=i.scaledTo(i.overscaledZ-1);if(r=this._getLoadedTile(e),r)break;i=e}for(const e of t)this._loadedParentTiles[e]=r}}_addTile(t){let r=this._tiles[t.key];if(r)return r;r=this._cache.getAndRemove(t),r&&(this._setTileReloadTimer(t.key,r),r.tileID=t,this._state.initializeTileState(r,this.map?this.map.painter:null),this._cacheTimers[t.key]&&(clearTimeout(this._cacheTimers[t.key]),delete this._cacheTimers[t.key],this._setTileReloadTimer(t.key,r)));const i=r;return r||(r=new L(t,this._source.tileSize*t.overscaleFactor()),this._loadTile(r,this._tileLoaded.bind(this,r,t.key,r.state))),r.uses++,this._tiles[t.key]=r,i||this._source.fire(new e.Event("dataloading",{tile:r,coord:r.tileID,dataType:"source"})),r}_setTileReloadTimer(e,t){e in this._timers&&(clearTimeout(this._timers[e]),delete this._timers[e]);const r=t.getExpiryTimeout();r&&(this._timers[e]=setTimeout((()=>{this._reloadTile(e,"expired"),delete this._timers[e]}),r))}_removeTile(e){const t=this._tiles[e];t&&(t.uses--,delete this._tiles[e],this._timers[e]&&(clearTimeout(this._timers[e]),delete this._timers[e]),t.uses>0||(t.hasData()&&"reloading"!==t.state?this._cache.add(t.tileID,t,t.getExpiryTimeout()):(t.aborted=!0,this._abortTile(t),this._unloadTile(t))))}clearTiles(){this._shouldReloadOnResume=!1,this._paused=!1;for(const e in this._tiles)this._removeTile(e);this._cache.reset()}tilesIn(t,r,i){const n=[],o=this.transform;if(!o)return n;const a=i?o.getCameraQueryGeometry(t):t,s=t.map((e=>o.pointCoordinate(e,this.terrain))),l=a.map((e=>o.pointCoordinate(e,this.terrain))),c=this.getIds();let u=1/0,h=1/0,p=-1/0,d=-1/0;for(const e of l)u=Math.min(u,e.x),h=Math.min(h,e.y),p=Math.max(p,e.x),d=Math.max(d,e.y);for(let t=0;t<c.length;t++){const i=this._tiles[c[t]];if(i.holdingForFade())continue;const a=i.tileID,f=Math.pow(2,o.zoom-i.tileID.overscaledZ),m=r*i.queryPadding*e.EXTENT/i.tileSize/f,y=[a.getTilePoint(new e.MercatorCoordinate(u,h)),a.getTilePoint(new e.MercatorCoordinate(p,d))];if(y[0].x-m<e.EXTENT&&y[0].y-m<e.EXTENT&&y[1].x+m>=0&&y[1].y+m>=0){const e=s.map((e=>a.getTilePoint(e))),t=l.map((e=>a.getTilePoint(e)));n.push({tile:i,tileID:a,queryGeometry:e,cameraQueryGeometry:t,scale:f})}}return n}getVisibleCoordinates(e){const t=this.getRenderableIds(e).map((e=>this._tiles[e].tileID));for(const e of t)e.posMatrix=this.transform.calculatePosMatrix(e.toUnwrapped());return t}hasTransition(){if(this._source.hasTransition())return!0;if(N(this._source.type))for(const t in this._tiles){const r=this._tiles[t];if(void 0!==r.fadeEndTime&&r.fadeEndTime>=e.exported.now())return!0}return!1}setFeatureState(e,t,r){this._state.updateState(e=e||"_geojsonTileLayer",t,r)}removeFeatureState(e,t,r){this._state.removeFeatureState(e=e||"_geojsonTileLayer",t,r)}getFeatureState(e,t){return this._state.getState(e=e||"_geojsonTileLayer",t)}setDependencies(e,t,r){const i=this._tiles[e];i&&i.setDependencies(t,r)}reloadTilesForDependencies(e,t){for(const r in this._tiles)this._tiles[r].hasDependency(e,t)&&this._reloadTile(r,"reloading");this._cache.filter((r=>!r.hasDependency(e,t)))}}function F(e,t){const r=Math.abs(2*e.wrap)-+(e.wrap<0),i=Math.abs(2*t.wrap)-+(t.wrap<0);return e.overscaledZ-t.overscaledZ||i-r||t.canonical.y-e.canonical.y||t.canonical.x-e.canonical.x}function N(e){return"raster"===e||"image"===e||"video"===e}B.maxOverzooming=10,B.maxUnderzooming=3;const U="mapboxgl_preloaded_worker_pool";class V{constructor(){this.active={}}acquire(e){if(!this.workers)for(this.workers=[];this.workers.length<V.workerCount;)this.workers.push(new Worker(xn.workerUrl));return this.active[e]=!0,this.workers.slice()}release(e){delete this.active[e],0===this.numActive()&&(this.workers.forEach((e=>{e.terminate()})),this.workers=null)}isPreloaded(){return!!this.active[U]}numActive(){return Object.keys(this.active).length}}const q=Math.floor(e.exported.hardwareConcurrency/2);let $;function G(){return $||($=new V),$}function Z(t,r){const i={};for(const e in t)"ref"!==e&&(i[e]=t[e]);return e.refProperties.forEach((e=>{e in r&&(i[e]=r[e])})),i}function W(e){e=e.slice();const t=Object.create(null);for(let r=0;r<e.length;r++)t[e[r].id]=e[r];for(let r=0;r<e.length;r++)"ref"in e[r]&&(e[r]=Z(e[r],t[e[r].ref]));return e}V.workerCount=Math.max(Math.min(q,6),1);const X={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 K(e,t,r){r.push({command:X.addSource,args:[e,t[e]]})}function H(e,t,r){t.push({command:X.removeSource,args:[e]}),r[e]=!0}function J(e,t,r,i){H(e,r,i),K(e,t,r)}function Y(e,t,r){let i;for(i in e[r])if(Object.prototype.hasOwnProperty.call(e[r],i)&&"data"!==i&&!n(e[r][i],t[r][i]))return!1;for(i in t[r])if(Object.prototype.hasOwnProperty.call(t[r],i)&&"data"!==i&&!n(e[r][i],t[r][i]))return!1;return!0}function Q(e,t,r,i,o,a){let s;for(s in t=t||{},e=e||{})Object.prototype.hasOwnProperty.call(e,s)&&(n(e[s],t[s])||r.push({command:a,args:[i,s,t[s],o]}));for(s in t)Object.prototype.hasOwnProperty.call(t,s)&&!Object.prototype.hasOwnProperty.call(e,s)&&(n(e[s],t[s])||r.push({command:a,args:[i,s,t[s],o]}))}function ee(e){return e.id}function te(e,t){return e[t.id]=t,e}class re{constructor(e,t){this.reset(e,t)}reset(e,t){this.points=e||[],this._distances=[0];for(let e=1;e<this.points.length;e++)this._distances[e]=this._distances[e-1]+this.points[e].dist(this.points[e-1]);this.length=this._distances[this._distances.length-1],this.padding=Math.min(t||0,.5*this.length),this.paddedLength=this.length-2*this.padding}lerp(t){if(1===this.points.length)return this.points[0];t=e.clamp(t,0,1);let r=1,i=this._distances[r];const n=t*this.paddedLength+this.padding;for(;i<n&&r<this._distances.length;)i=this._distances[++r];const o=r-1,a=this._distances[o],s=i-a,l=s>0?(n-a)/s:0;return this.points[o].mult(1-l).add(this.points[r].mult(l))}}function ie(e,t){let r=!0;return"always"===e||"never"!==e&&"never"!==t||(r=!1),r}class ne{constructor(e,t,r){const i=this.boxCells=[],n=this.circleCells=[];this.xCellCount=Math.ceil(e/r),this.yCellCount=Math.ceil(t/r);for(let e=0;e<this.xCellCount*this.yCellCount;e++)i.push([]),n.push([]);this.circleKeys=[],this.boxKeys=[],this.bboxes=[],this.circles=[],this.width=e,this.height=t,this.xScale=this.xCellCount/e,this.yScale=this.yCellCount/t,this.boxUid=0,this.circleUid=0}keysLength(){return this.boxKeys.length+this.circleKeys.length}insert(e,t,r,i,n){this._forEachCell(t,r,i,n,this._insertBoxCell,this.boxUid++),this.boxKeys.push(e),this.bboxes.push(t),this.bboxes.push(r),this.bboxes.push(i),this.bboxes.push(n)}insertCircle(e,t,r,i){this._forEachCell(t-i,r-i,t+i,r+i,this._insertCircleCell,this.circleUid++),this.circleKeys.push(e),this.circles.push(t),this.circles.push(r),this.circles.push(i)}_insertBoxCell(e,t,r,i,n,o){this.boxCells[n].push(o)}_insertCircleCell(e,t,r,i,n,o){this.circleCells[n].push(o)}_query(e,t,r,i,n,o,a){if(r<0||e>this.width||i<0||t>this.height)return[];const s=[];if(e<=0&&t<=0&&this.width<=r&&this.height<=i){if(n)return[{key:null,x1:e,y1:t,x2:r,y2:i}];for(let e=0;e<this.boxKeys.length;e++)s.push({key:this.boxKeys[e],x1:this.bboxes[4*e],y1:this.bboxes[4*e+1],x2:this.bboxes[4*e+2],y2:this.bboxes[4*e+3]});for(let e=0;e<this.circleKeys.length;e++){const t=this.circles[3*e],r=this.circles[3*e+1],i=this.circles[3*e+2];s.push({key:this.circleKeys[e],x1:t-i,y1:r-i,x2:t+i,y2:r+i})}}else this._forEachCell(e,t,r,i,this._queryCell,s,{hitTest:n,overlapMode:o,seenUids:{box:{},circle:{}}},a);return s}query(e,t,r,i){return this._query(e,t,r,i,!1,null)}hitTest(e,t,r,i,n,o){return this._query(e,t,r,i,!0,n,o).length>0}hitTestCircle(e,t,r,i,n){const o=e-r,a=e+r,s=t-r,l=t+r;if(a<0||o>this.width||l<0||s>this.height)return!1;const c=[];return this._forEachCell(o,s,a,l,this._queryCellCircle,c,{hitTest:!0,overlapMode:i,circle:{x:e,y:t,radius:r},seenUids:{box:{},circle:{}}},n),c.length>0}_queryCell(e,t,r,i,n,o,a,s){const{seenUids:l,hitTest:c,overlapMode:u}=a,h=this.boxCells[n];if(null!==h){const n=this.bboxes;for(const a of h)if(!l.box[a]){l.box[a]=!0;const h=4*a,p=this.boxKeys[a];if(e<=n[h+2]&&t<=n[h+3]&&r>=n[h+0]&&i>=n[h+1]&&(!s||s(p))&&(!c||!ie(u,p.overlapMode))&&(o.push({key:p,x1:n[h],y1:n[h+1],x2:n[h+2],y2:n[h+3]}),c))return!0}}const p=this.circleCells[n];if(null!==p){const n=this.circles;for(const a of p)if(!l.circle[a]){l.circle[a]=!0;const h=3*a,p=this.circleKeys[a];if(this._circleAndRectCollide(n[h],n[h+1],n[h+2],e,t,r,i)&&(!s||s(p))&&(!c||!ie(u,p.overlapMode))){const e=n[h],t=n[h+1],r=n[h+2];if(o.push({key:p,x1:e-r,y1:t-r,x2:e+r,y2:t+r}),c)return!0}}}return!1}_queryCellCircle(e,t,r,i,n,o,a,s){const{circle:l,seenUids:c,overlapMode:u}=a,h=this.boxCells[n];if(null!==h){const e=this.bboxes;for(const t of h)if(!c.box[t]){c.box[t]=!0;const r=4*t,i=this.boxKeys[t];if(this._circleAndRectCollide(l.x,l.y,l.radius,e[r+0],e[r+1],e[r+2],e[r+3])&&(!s||s(i))&&!ie(u,i.overlapMode))return o.push(!0),!0}}const p=this.circleCells[n];if(null!==p){const e=this.circles;for(const t of p)if(!c.circle[t]){c.circle[t]=!0;const r=3*t,i=this.circleKeys[t];if(this._circlesCollide(e[r],e[r+1],e[r+2],l.x,l.y,l.radius)&&(!s||s(i))&&!ie(u,i.overlapMode))return o.push(!0),!0}}}_forEachCell(e,t,r,i,n,o,a,s){const l=this._convertToXCellCoord(e),c=this._convertToYCellCoord(t),u=this._convertToXCellCoord(r),h=this._convertToYCellCoord(i);for(let p=l;p<=u;p++)for(let l=c;l<=h;l++)if(n.call(this,e,t,r,i,this.xCellCount*l+p,o,a,s))return}_convertToXCellCoord(e){return Math.max(0,Math.min(this.xCellCount-1,Math.floor(e*this.xScale)))}_convertToYCellCoord(e){return Math.max(0,Math.min(this.yCellCount-1,Math.floor(e*this.yScale)))}_circlesCollide(e,t,r,i,n,o){const a=i-e,s=n-t,l=r+o;return l*l>a*a+s*s}_circleAndRectCollide(e,t,r,i,n,o,a){const s=(o-i)/2,l=Math.abs(e-(i+s));if(l>s+r)return!1;const c=(a-n)/2,u=Math.abs(t-(n+c));if(u>c+r)return!1;if(l<=s||u<=c)return!0;const h=l-s,p=u-c;return h*h+p*p<=r*r}}function oe(t,r,i,n,o){const a=e.create();return r?(e.scale(a,a,[1/o,1/o,1]),i||e.rotateZ(a,a,n.angle)):e.multiply(a,n.labelPlaneMatrix,t),a}function ae(t,r,i,n,o){if(r){const r=e.clone(t);return e.scale(r,r,[o,o,1]),i||e.rotateZ(r,r,-n.angle),r}return n.glCoordMatrix}function se(t,r,i){let n;i?(n=[t.x,t.y,i(t.x,t.y),1],e.transformMat4(n,n,r)):(n=[t.x,t.y,0,1],_e(n,n,r));const o=n[3];return{point:new e.pointGeometry(n[0]/o,n[1]/o),signedDistanceFromCamera:o}}function le(e,t){return.5+e/t*.5}function ce(e,t){const r=e[0]/e[3],i=e[1]/e[3];return r>=-t[0]&&r<=t[0]&&i>=-t[1]&&i<=t[1]}function ue(t,r,i,n,o,a,s,l,c,u){const h=n?t.textSizeData:t.iconSizeData,p=e.evaluateSizeForZoom(h,i.transform.zoom),d=[256/i.width*2+1,256/i.height*2+1],f=n?t.text.dynamicLayoutVertexArray:t.icon.dynamicLayoutVertexArray;f.clear();const m=t.lineVertexArray,y=n?t.text.placedSymbolArray:t.icon.placedSymbolArray,g=i.transform.width/i.transform.height;let _=!1;for(let n=0;n<y.length;n++){const b=y.get(n);if(b.hidden||b.writingMode===e.WritingMode.vertical&&!_){ge(b.numGlyphs,f);continue}let v;if(_=!1,u?(v=[b.anchorX,b.anchorY,u(b.anchorX,b.anchorY),1],e.transformMat4(v,v,r)):(v=[b.anchorX,b.anchorY,0,1],_e(v,v,r)),!ce(v,d)){ge(b.numGlyphs,f);continue}const x=le(i.transform.cameraToCenterDistance,v[3]),w=e.evaluateSizeForFeature(h,p,b),S=s?w/x:w*x,E=new e.pointGeometry(b.anchorX,b.anchorY),T=se(E,o,u).point,k={},A=de(b,S,!1,l,r,o,a,t.glyphOffsetArray,m,f,T,E,k,g,c,u);_=A.useVertical,(A.notEnoughRoom||_||A.needsFlipping&&de(b,S,!0,l,r,o,a,t.glyphOffsetArray,m,f,T,E,k,g,c,u).notEnoughRoom)&&ge(b.numGlyphs,f)}n?t.text.dynamicLayoutVertexBuffer.updateData(f):t.icon.dynamicLayoutVertexBuffer.updateData(f)}function he(e,t,r,i,n,o,a,s,l,c,u,h,p){const d=s.glyphStartIndex+s.numGlyphs,f=s.lineStartIndex,m=s.lineStartIndex+s.lineLength,y=t.getoffsetX(s.glyphStartIndex),g=t.getoffsetX(d-1),_=me(e*y,r,i,n,o,a,s.segment,f,m,l,c,u,h,p);if(!_)return null;const b=me(e*g,r,i,n,o,a,s.segment,f,m,l,c,u,h,p);return b?{first:_,last:b}:null}function pe(t,r,i,n){return t===e.WritingMode.horizontal&&Math.abs(i.y-r.y)>Math.abs(i.x-r.x)*n?{useVertical:!0}:(t===e.WritingMode.vertical?r.y<i.y:r.x>i.x)?{needsFlipping:!0}:null}function de(t,r,i,n,o,a,s,l,c,u,h,p,d,f,m,y){const g=r/24,_=t.lineOffsetX*g,b=t.lineOffsetY*g;let v;if(t.numGlyphs>1){const e=t.glyphStartIndex+t.numGlyphs,r=t.lineStartIndex,o=t.lineStartIndex+t.lineLength,u=he(g,l,_,b,i,h,p,t,c,a,d,m,y);if(!u)return{notEnoughRoom:!0};const x=se(u.first.point,s,y).point,w=se(u.last.point,s,y).point;if(n&&!i){const e=pe(t.writingMode,x,w,f);if(e)return e}v=[u.first];for(let n=t.glyphStartIndex+1;n<e-1;n++)v.push(me(g*l.getoffsetX(n),_,b,i,h,p,t.segment,r,o,c,a,d,m,y));v.push(u.last)}else{if(n&&!i){const r=se(p,o,y).point,i=t.lineStartIndex+t.segment+1,n=new e.pointGeometry(c.getx(i),c.gety(i)),a=se(n,o,y),s=a.signedDistanceFromCamera>0?a.point:fe(p,n,r,1,o,y),l=pe(t.writingMode,r,s,f);if(l)return l}const r=me(g*l.getoffsetX(t.glyphStartIndex),_,b,i,h,p,t.segment,t.lineStartIndex,t.lineStartIndex+t.lineLength,c,a,d,m,y);if(!r)return{notEnoughRoom:!0};v=[r]}for(const t of v)e.addDynamicAttributes(u,t.point,t.angle);return{}}function fe(e,t,r,i,n,o){const a=se(e.add(e.sub(t)._unit()),n,o).point,s=r.sub(a);return r.add(s._mult(i/s.mag()))}function me(t,r,i,n,o,a,s,l,c,u,h,p,d,f){const m=n?t-r:t+r;let y=m>0?1:-1,g=0;n&&(y*=-1,g=Math.PI),y<0&&(g+=Math.PI);let _=y>0?l+s:l+s+1,b=o,v=o,x=0,w=0;const S=Math.abs(m),E=[];for(;x+w<=S;){if(_+=y,_<l||_>=c)return null;if(v=b,E.push(b),b=p[_],void 0===b){const t=new e.pointGeometry(u.getx(_),u.gety(_)),r=se(t,h,f);if(r.signedDistanceFromCamera>0)b=p[_]=r.point;else{const r=_-y;b=fe(0===x?a:new e.pointGeometry(u.getx(r),u.gety(r)),t,v,S-x+1,h,f)}}x+=w,w=v.dist(b)}const T=(S-x)/w,k=b.sub(v),A=k.mult(T)._add(v);A._add(k._unit()._perp()._mult(i*y));const I=g+Math.atan2(b.y-v.y,b.x-v.x);return E.push(A),{point:A,angle:d?I:0,path:E}}const ye=new Float32Array([-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0,-1/0,-1/0,0]);function ge(e,t){for(let r=0;r<e;r++){const e=t.length;t.resize(e+4),t.float32.set(ye,3*e)}}function _e(e,t,r){const i=t[0],n=t[1];return e[0]=r[0]*i+r[4]*n+r[12],e[1]=r[1]*i+r[5]*n+r[13],e[3]=r[3]*i+r[7]*n+r[15],e}const be=100;class ve{constructor(e,t=new ne(e.width+200,e.height+200,25),r=new ne(e.width+200,e.height+200,25)){this.transform=e,this.grid=t,this.ignoredGrid=r,this.pitchfactor=Math.cos(e._pitch)*e.cameraToCenterDistance,this.screenRightBoundary=e.width+be,this.screenBottomBoundary=e.height+be,this.gridRightBoundary=e.width+200,this.gridBottomBoundary=e.height+200,this.perspectiveRatioCutoff=.6}placeCollisionBox(e,t,r,i,n,o){const a=this.projectAndGetPerspectiveRatio(i,e.anchorPointX,e.anchorPointY,o),s=r*a.perspectiveRatio,l=e.x1*s+a.point.x,c=e.y1*s+a.point.y,u=e.x2*s+a.point.x,h=e.y2*s+a.point.y;return!this.isInsideGrid(l,c,u,h)||"always"!==t&&this.grid.hitTest(l,c,u,h,t,n)||a.perspectiveRatio<this.perspectiveRatioCutoff?{box:[],offscreen:!1}:{box:[l,c,u,h],offscreen:this.isOffscreen(l,c,u,h)}}placeCollisionCircles(t,r,i,n,o,a,s,l,c,u,h,p,d,f){const m=[],y=new e.pointGeometry(r.anchorX,r.anchorY),g=se(y,a,f),_=le(this.transform.cameraToCenterDistance,g.signedDistanceFromCamera),b=(u?o/_:o*_)/e.ONE_EM,v=se(y,s,f).point,x=he(b,n,r.lineOffsetX*b,r.lineOffsetY*b,!1,v,y,r,i,s,{},!1,f);let w=!1,S=!1,E=!0;if(x){const r=.5*p*_+d,i=new e.pointGeometry(-100,-100),n=new e.pointGeometry(this.screenRightBoundary,this.screenBottomBoundary),o=new re,a=x.first,s=x.last;let u=[];for(let e=a.path.length-1;e>=1;e--)u.push(a.path[e]);for(let e=1;e<s.path.length;e++)u.push(s.path[e]);const y=2.5*r;if(l){const e=u.map((e=>se(e,l,f)));u=e.some((e=>e.signedDistanceFromCamera<=0))?[]:e.map((e=>e.point))}let g=[];if(u.length>0){const t=u[0].clone(),r=u[0].clone();for(let e=1;e<u.length;e++)t.x=Math.min(t.x,u[e].x),t.y=Math.min(t.y,u[e].y),r.x=Math.max(r.x,u[e].x),r.y=Math.max(r.y,u[e].y);g=t.x>=i.x&&r.x<=n.x&&t.y>=i.y&&r.y<=n.y?[u]:r.x<i.x||t.x>n.x||r.y<i.y||t.y>n.y?[]:e.clipLine([u],i.x,i.y,n.x,n.y)}for(const e of g){o.reset(e,.25*r);let i=0;i=o.length<=.5*r?1:Math.ceil(o.paddedLength/y)+1;for(let e=0;e<i;e++){const n=e/Math.max(i-1,1),a=o.lerp(n),s=a.x+be,l=a.y+be;m.push(s,l,r,0);const u=s-r,p=l-r,d=s+r,f=l+r;if(E=E&&this.isOffscreen(u,p,d,f),S=S||this.isInsideGrid(u,p,d,f),"always"!==t&&this.grid.hitTestCircle(s,l,r,t,h)&&(w=!0,!c))return{circles:[],offscreen:!1,collisionDetected:w}}}}return{circles:!c&&w||!S||_<this.perspectiveRatioCutoff?[]:m,offscreen:E,collisionDetected:w}}queryRenderedSymbols(t){if(0===t.length||0===this.grid.keysLength()&&0===this.ignoredGrid.keysLength())return{};const r=[];let i=1/0,n=1/0,o=-1/0,a=-1/0;for(const s of t){const t=new e.pointGeometry(s.x+be,s.y+be);i=Math.min(i,t.x),n=Math.min(n,t.y),o=Math.max(o,t.x),a=Math.max(a,t.y),r.push(t)}const s=this.grid.query(i,n,o,a).concat(this.ignoredGrid.query(i,n,o,a)),l={},c={};for(const t of s){const i=t.key;if(void 0===l[i.bucketInstanceId]&&(l[i.bucketInstanceId]={}),l[i.bucketInstanceId][i.featureIndex])continue;const n=[new e.pointGeometry(t.x1,t.y1),new e.pointGeometry(t.x2,t.y1),new e.pointGeometry(t.x2,t.y2),new e.pointGeometry(t.x1,t.y2)];e.polygonIntersectsPolygon(r,n)&&(l[i.bucketInstanceId][i.featureIndex]=!0,void 0===c[i.bucketInstanceId]&&(c[i.bucketInstanceId]=[]),c[i.bucketInstanceId].push(i.featureIndex))}return c}insertCollisionBox(e,t,r,i,n,o){(r?this.ignoredGrid:this.grid).insert({bucketInstanceId:i,featureIndex:n,collisionGroupID:o,overlapMode:t},e[0],e[1],e[2],e[3])}insertCollisionCircles(e,t,r,i,n,o){const a=r?this.ignoredGrid:this.grid,s={bucketInstanceId:i,featureIndex:n,collisionGroupID:o,overlapMode:t};for(let t=0;t<e.length;t+=4)a.insertCircle(s,e[t],e[t+1],e[t+2])}projectAndGetPerspectiveRatio(t,r,i,n){let o;return n?(o=[r,i,n(r,i),1],e.transformMat4(o,o,t)):(o=[r,i,0,1],_e(o,o,t)),{point:new e.pointGeometry((o[0]/o[3]+1)/2*this.transform.width+be,(-o[1]/o[3]+1)/2*this.transform.height+be),perspectiveRatio:.5+this.transform.cameraToCenterDistance/o[3]*.5}}isOffscreen(e,t,r,i){return r<be||e>=this.screenRightBoundary||i<be||t>this.screenBottomBoundary}isInsideGrid(e,t,r,i){return r>=0&&e<this.gridRightBoundary&&i>=0&&t<this.gridBottomBoundary}getViewportMatrix(){const t=e.identity([]);return e.translate(t,t,[-100,-100,0]),t}}function xe(t,r,i){return r*(e.EXTENT/(t.tileSize*Math.pow(2,i-t.tileID.overscaledZ)))}class we{constructor(e,t,r,i){this.opacity=e?Math.max(0,Math.min(1,e.opacity+(e.placed?t:-t))):i&&r?1:0,this.placed=r}isHidden(){return 0===this.opacity&&!this.placed}}class Se{constructor(e,t,r,i,n){this.text=new we(e?e.text:null,t,r,n),this.icon=new we(e?e.icon:null,t,i,n)}isHidden(){return this.text.isHidden()&&this.icon.isHidden()}}class Ee{constructor(e,t,r){this.text=e,this.icon=t,this.skipFade=r}}class Te{constructor(){this.invProjMatrix=e.create(),this.viewportMatrix=e.create(),this.circles=[]}}class ke{constructor(e,t,r,i,n){this.bucketInstanceId=e,this.featureIndex=t,this.sourceLayerIndex=r,this.bucketIndex=i,this.tileID=n}}class Ae{constructor(e){this.crossSourceCollisions=e,this.maxGroupID=0,this.collisionGroups={}}get(e){if(this.crossSourceCollisions)return{ID:0,predicate:null};if(!this.collisionGroups[e]){const t=++this.maxGroupID;this.collisionGroups[e]={ID:t,predicate:e=>e.collisionGroupID===t}}return this.collisionGroups[e]}}function Ie(t,r,i,n,o){const{horizontalAlign:a,verticalAlign:s}=e.getAnchorAlignment(t),l=-(a-.5)*r,c=-(s-.5)*i,u=e.evaluateVariableOffset(t,n);return new e.pointGeometry(l+u[0]*o,c+u[1]*o)}function Pe(t,r,i,n,o,a){const{x1:s,x2:l,y1:c,y2:u,anchorPointX:h,anchorPointY:p}=t,d=new e.pointGeometry(r,i);return n&&d._rotate(o?a:-a),{x1:s+d.x,y1:c+d.y,x2:l+d.x,y2:u+d.y,anchorPointX:h,anchorPointY:p}}class Ce{constructor(e,t,r,i,n){this.transform=e.clone(),this.terrain=t,this.collisionIndex=new ve(this.transform),this.placements={},this.opacities={},this.variableOffsets={},this.stale=!1,this.commitTime=0,this.fadeDuration=r,this.retainedQueryData={},this.collisionGroups=new Ae(i),this.collisionCircleArrays={},this.prevPlacement=n,n&&(n.prevPlacement=void 0),this.placedOrientations={}}getBucketParts(t,r,i,n){const o=i.getBucket(r),a=i.latestFeatureIndex;if(!o||!a||r.id!==o.layerIds[0])return;const s=i.collisionBoxArray,l=o.layers[0].layout,c=Math.pow(2,this.transform.zoom-i.tileID.overscaledZ),u=i.tileSize/e.EXTENT,h=this.transform.calculatePosMatrix(i.tileID.toUnwrapped()),p="map"===l.get("text-pitch-alignment"),d="map"===l.get("text-rotation-alignment"),f=xe(i,1,this.transform.zoom),m=oe(h,p,d,this.transform,f);let y=null;if(p){const t=ae(h,p,d,this.transform,f);y=e.multiply([],this.transform.labelPlaneMatrix,t)}this.retainedQueryData[o.bucketInstanceId]=new ke(o.bucketInstanceId,a,o.sourceLayerIndex,o.index,i.tileID);const g={bucket:o,layout:l,posMatrix:h,textLabelPlaneMatrix:m,labelToScreenMatrix:y,scale:c,textPixelRatio:u,holdingForFade:i.holdingForFade(),collisionBoxArray:s,partiallyEvaluatedTextSize:e.evaluateSizeForZoom(o.textSizeData,this.transform.zoom),collisionGroup:this.collisionGroups.get(o.sourceID)};if(n)for(const e of o.sortKeyRanges){const{sortKey:r,symbolInstanceStart:i,symbolInstanceEnd:n}=e;t.push({sortKey:r,symbolInstanceStart:i,symbolInstanceEnd:n,parameters:g})}else t.push({symbolInstanceStart:0,symbolInstanceEnd:o.symbolInstances.length,parameters:g})}attemptAnchorPlacement(e,t,r,i,n,o,a,s,l,c,u,h,p,d,f,m){const y=[h.textOffset0,h.textOffset1],g=Ie(e,r,i,y,n),_=this.collisionIndex.placeCollisionBox(Pe(t,g.x,g.y,o,a,this.transform.angle),u,s,l,c.predicate,m);if((!f||0!==this.collisionIndex.placeCollisionBox(Pe(f,g.x,g.y,o,a,this.transform.angle),u,s,l,c.predicate,m).box.length)&&_.box.length>0){let t;if(this.prevPlacement&&this.prevPlacement.variableOffsets[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID]&&this.prevPlacement.placements[h.crossTileID].text&&(t=this.prevPlacement.variableOffsets[h.crossTileID].anchor),0===h.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");return this.variableOffsets[h.crossTileID]={textOffset:y,width:r,height:i,anchor:e,textBoxScale:n,prevAnchor:t},this.markUsedJustification(p,e,h,d),p.allowVerticalPlacement&&(this.markUsedOrientation(p,d,h),this.placedOrientations[h.crossTileID]=d),{shift:g,placedGlyphBoxes:_}}}placeLayerBucketPart(t,r,i){const{bucket:n,layout:o,posMatrix:a,textLabelPlaneMatrix:s,labelToScreenMatrix:l,textPixelRatio:c,holdingForFade:u,collisionBoxArray:h,partiallyEvaluatedTextSize:p,collisionGroup:d}=t.parameters,f=o.get("text-optional"),m=o.get("icon-optional"),y=e.getOverlapMode(o,"text-overlap","text-allow-overlap"),g="always"===y,_=e.getOverlapMode(o,"icon-overlap","icon-allow-overlap"),b="always"===_,v="map"===o.get("text-rotation-alignment"),x="map"===o.get("text-pitch-alignment"),w="none"!==o.get("icon-text-fit"),S="viewport-y"===o.get("symbol-z-order"),E=g&&(b||!n.hasIconData()||m),T=b&&(g||!n.hasTextData()||f);!n.collisionArrays&&h&&n.deserializeCollisionBoxes(h);const k=(t,h)=>{if(r[t.crossTileID])return;if(u)return void(this.placements[t.crossTileID]=new Ee(!1,!1,!1));let b=!1,S=!1,k=!0,A=null,I={box:null,offscreen:null},P={box:null,offscreen:null},C=null,z=null,M=null,O=0,D=0,L=0;h.textFeatureIndex?O=h.textFeatureIndex:t.useRuntimeCollisionCircles&&(O=t.featureIndex),h.verticalTextFeatureIndex&&(D=h.verticalTextFeatureIndex);const j=this.retainedQueryData[n.bucketInstanceId].tileID,R=this.terrain?(e,t)=>this.terrain.getElevation(j,e,t):null;for(const e of["textBox","verticalTextBox","iconBox","verticalIconBox"]){const t=h[e];t&&(t.elevation=R?R(t.anchorPointX,t.anchorPointY):0)}const B=h.textBox;if(B){const r=r=>{let i=e.WritingMode.horizontal;if(n.allowVerticalPlacement&&!r&&this.prevPlacement){const e=this.prevPlacement.placedOrientations[t.crossTileID];e&&(this.placedOrientations[t.crossTileID]=e,i=e,this.markUsedOrientation(n,i,t))}return i},i=(r,i)=>{if(n.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&h.verticalTextBox){for(const t of n.writingModes)if(t===e.WritingMode.vertical?(I=i(),P=I):I=r(),I&&I.box&&I.box.length)break}else I=r()};if(o.get("text-variable-anchor")){let s=o.get("text-variable-anchor");if(this.prevPlacement&&this.prevPlacement.variableOffsets[t.crossTileID]){const e=this.prevPlacement.variableOffsets[t.crossTileID];s.indexOf(e.anchor)>0&&(s=s.filter((t=>t!==e.anchor)),s.unshift(e.anchor))}const l=(e,r,i)=>{const o=e.x2-e.x1,l=e.y2-e.y1,u=t.textBoxScale,h=w&&"never"===_?r:null;let p={box:[],offscreen:!1};const f="never"!==y?2*s.length:s.length;for(let r=0;r<f;++r){const f=this.attemptAnchorPlacement(s[r%s.length],e,o,l,u,v,x,c,a,d,r>=s.length?y:"never",t,n,i,h,R);if(f&&(p=f.placedGlyphBoxes,p&&p.box&&p.box.length)){b=!0,A=f.shift;break}}return p};i((()=>l(B,h.iconBox,e.WritingMode.horizontal)),(()=>{const r=h.verticalTextBox;return n.allowVerticalPlacement&&!(I&&I.box&&I.box.length)&&t.numVerticalGlyphVertices>0&&r?l(r,h.verticalIconBox,e.WritingMode.vertical):{box:null,offscreen:null}})),I&&(b=I.box,k=I.offscreen);const u=r(I&&I.box);if(!b&&this.prevPlacement){const e=this.prevPlacement.variableOffsets[t.crossTileID];e&&(this.variableOffsets[t.crossTileID]=e,this.markUsedJustification(n,e.anchor,t,u))}}else{const o=(e,r)=>{const i=this.collisionIndex.placeCollisionBox(e,y,c,a,d.predicate,R);return i&&i.box&&i.box.length&&(this.markUsedOrientation(n,r,t),this.placedOrientations[t.crossTileID]=r),i};i((()=>o(B,e.WritingMode.horizontal)),(()=>{const r=h.verticalTextBox;return n.allowVerticalPlacement&&t.numVerticalGlyphVertices>0&&r?o(r,e.WritingMode.vertical):{box:null,offscreen:null}})),r(I&&I.box&&I.box.length)}}if(C=I,b=C&&C.box&&C.box.length>0,k=C&&C.offscreen,t.useRuntimeCollisionCircles){const r=n.text.placedSymbolArray.get(t.centerJustifiedTextSymbolIndex),c=e.evaluateSizeForFeature(n.textSizeData,p,r),u=o.get("text-padding");z=this.collisionIndex.placeCollisionCircles(y,r,n.lineVertexArray,n.glyphOffsetArray,c,a,s,l,i,x,d.predicate,t.collisionCircleDiameter,u,R),z.circles.length&&z.collisionDetected&&!i&&e.warnOnce("Collisions detected, but collision boxes are not shown"),b=g||z.circles.length>0&&!z.collisionDetected,k=k&&z.offscreen}if(h.iconFeatureIndex&&(L=h.iconFeatureIndex),h.iconBox){const e=e=>{const t=w&&A?Pe(e,A.x,A.y,v,x,this.transform.angle):e;return this.collisionIndex.placeCollisionBox(t,_,c,a,d.predicate,R)};P&&P.box&&P.box.length&&h.verticalIconBox?(M=e(h.verticalIconBox),S=M.box.length>0):(M=e(h.iconBox),S=M.box.length>0),k=k&&M.offscreen}const F=f||0===t.numHorizontalGlyphVertices&&0===t.numVerticalGlyphVertices,N=m||0===t.numIconVertices;if(F||N?N?F||(S=S&&b):b=S&&b:S=b=S&&b,b&&C&&C.box&&this.collisionIndex.insertCollisionBox(C.box,y,o.get("text-ignore-placement"),n.bucketInstanceId,P&&P.box&&D?D:O,d.ID),S&&M&&this.collisionIndex.insertCollisionBox(M.box,_,o.get("icon-ignore-placement"),n.bucketInstanceId,L,d.ID),z&&(b&&this.collisionIndex.insertCollisionCircles(z.circles,y,o.get("text-ignore-placement"),n.bucketInstanceId,O,d.ID),i)){const e=n.bucketInstanceId;let t=this.collisionCircleArrays[e];void 0===t&&(t=this.collisionCircleArrays[e]=new Te);for(let e=0;e<z.circles.length;e+=4)t.circles.push(z.circles[e+0]),t.circles.push(z.circles[e+1]),t.circles.push(z.circles[e+2]),t.circles.push(z.collisionDetected?1:0)}if(0===t.crossTileID)throw new Error("symbolInstance.crossTileID can't be 0");if(0===n.bucketInstanceId)throw new Error("bucket.bucketInstanceId can't be 0");this.placements[t.crossTileID]=new Ee(b||E,S||T,k||n.justReloaded),r[t.crossTileID]=!0};if(S){if(0!==t.symbolInstanceStart)throw new Error("bucket.bucketInstanceId should be 0");const e=n.getSortedSymbolIndexes(this.transform.angle);for(let t=e.length-1;t>=0;--t){const r=e[t];k(n.symbolInstances.get(r),n.collisionArrays[r])}}else for(let e=t.symbolInstanceStart;e<t.symbolInstanceEnd;e++)k(n.symbolInstances.get(e),n.collisionArrays[e]);if(i&&n.bucketInstanceId in this.collisionCircleArrays){const t=this.collisionCircleArrays[n.bucketInstanceId];e.invert(t.invProjMatrix,a),t.viewportMatrix=this.collisionIndex.getViewportMatrix()}n.justReloaded=!1}markUsedJustification(t,r,i,n){let o;o=n===e.WritingMode.vertical?i.verticalPlacedTextSymbolIndex:{left:i.leftJustifiedTextSymbolIndex,center:i.centerJustifiedTextSymbolIndex,right:i.rightJustifiedTextSymbolIndex}[e.getAnchorJustification(r)];const a=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex,i.verticalPlacedTextSymbolIndex];for(const e of a)e>=0&&(t.text.placedSymbolArray.get(e).crossTileID=o>=0&&e!==o?0:i.crossTileID)}markUsedOrientation(t,r,i){const n=r===e.WritingMode.horizontal||r===e.WritingMode.horizontalOnly?r:0,o=r===e.WritingMode.vertical?r:0,a=[i.leftJustifiedTextSymbolIndex,i.centerJustifiedTextSymbolIndex,i.rightJustifiedTextSymbolIndex];for(const e of a)t.text.placedSymbolArray.get(e).placedOrientation=n;i.verticalPlacedTextSymbolIndex&&(t.text.placedSymbolArray.get(i.verticalPlacedTextSymbolIndex).placedOrientation=o)}commit(e){this.commitTime=e,this.zoomAtLastRecencyCheck=this.transform.zoom;const t=this.prevPlacement;let r=!1;this.prevZoomAdjustment=t?t.zoomAdjustment(this.transform.zoom):0;const i=t?t.symbolFadeChange(e):1,n=t?t.opacities:{},o=t?t.variableOffsets:{},a=t?t.placedOrientations:{};for(const e in this.placements){const t=this.placements[e],o=n[e];o?(this.opacities[e]=new Se(o,i,t.text,t.icon),r=r||t.text!==o.text.placed||t.icon!==o.icon.placed):(this.opacities[e]=new Se(null,i,t.text,t.icon,t.skipFade),r=r||t.text||t.icon)}for(const e in n){const t=n[e];if(!this.opacities[e]){const n=new Se(t,i,!1,!1);n.isHidden()||(this.opacities[e]=n,r=r||t.text.placed||t.icon.placed)}}for(const e in o)this.variableOffsets[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.variableOffsets[e]=o[e]);for(const e in a)this.placedOrientations[e]||!this.opacities[e]||this.opacities[e].isHidden()||(this.placedOrientations[e]=a[e]);if(t&&void 0===t.lastPlacementChangeTime)throw new Error("Last placement time for previous placement is not defined");r?this.lastPlacementChangeTime=e:"number"!=typeof this.lastPlacementChangeTime&&(this.lastPlacementChangeTime=t?t.lastPlacementChangeTime:e)}updateLayerOpacities(e,t){const r={};for(const i of t){const t=i.getBucket(e);t&&i.latestFeatureIndex&&e.id===t.layerIds[0]&&this.updateBucketOpacities(t,r,i.collisionBoxArray)}}updateBucketOpacities(t,r,i){t.hasTextData()&&t.text.opacityVertexArray.clear(),t.hasIconData()&&t.icon.opacityVertexArray.clear(),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexArray.clear(),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexArray.clear();const n=t.layers[0].layout,o=new Se(null,0,!1,!1,!0),a=n.get("text-allow-overlap"),s=n.get("icon-allow-overlap"),l=n.get("text-variable-anchor"),c="map"===n.get("text-rotation-alignment"),u="map"===n.get("text-pitch-alignment"),h="none"!==n.get("icon-text-fit"),p=new Se(null,0,a&&(s||!t.hasIconData()||n.get("icon-optional")),s&&(a||!t.hasTextData()||n.get("text-optional")),!0);!t.collisionArrays&&i&&(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData())&&t.deserializeCollisionBoxes(i);const d=(e,t,r)=>{for(let i=0;i<t/4;i++)e.opacityVertexArray.emplaceBack(r)};for(let i=0;i<t.symbolInstances.length;i++){const n=t.symbolInstances.get(i),{numHorizontalGlyphVertices:a,numVerticalGlyphVertices:s,crossTileID:f}=n;let m=this.opacities[f];r[f]?m=o:m||(m=p,this.opacities[f]=m),r[f]=!0;const y=n.numIconVertices>0,g=this.placedOrientations[n.crossTileID],_=g===e.WritingMode.vertical,b=g===e.WritingMode.horizontal||g===e.WritingMode.horizontalOnly;if(a>0||s>0){const e=Fe(m.text);d(t.text,a,_?Ne:e),d(t.text,s,b?Ne:e);const r=m.text.isHidden();[n.rightJustifiedTextSymbolIndex,n.centerJustifiedTextSymbolIndex,n.leftJustifiedTextSymbolIndex].forEach((e=>{e>=0&&(t.text.placedSymbolArray.get(e).hidden=r||_?1:0)})),n.verticalPlacedTextSymbolIndex>=0&&(t.text.placedSymbolArray.get(n.verticalPlacedTextSymbolIndex).hidden=r||b?1:0);const i=this.variableOffsets[n.crossTileID];i&&this.markUsedJustification(t,i.anchor,n,g);const o=this.placedOrientations[n.crossTileID];o&&(this.markUsedJustification(t,"left",n,o),this.markUsedOrientation(t,o,n))}if(y){const e=Fe(m.icon),r=!(h&&n.verticalPlacedIconSymbolIndex&&_);n.placedIconSymbolIndex>=0&&(d(t.icon,n.numIconVertices,r?e:Ne),t.icon.placedSymbolArray.get(n.placedIconSymbolIndex).hidden=m.icon.isHidden()),n.verticalPlacedIconSymbolIndex>=0&&(d(t.icon,n.numVerticalIconVertices,r?Ne:e),t.icon.placedSymbolArray.get(n.verticalPlacedIconSymbolIndex).hidden=m.icon.isHidden())}if(t.hasIconCollisionBoxData()||t.hasTextCollisionBoxData()){const r=t.collisionArrays[i];if(r){let i=new e.pointGeometry(0,0);if(r.textBox||r.verticalTextBox){let e=!0;if(l){const t=this.variableOffsets[f];t?(i=Ie(t.anchor,t.width,t.height,t.textOffset,t.textBoxScale),c&&i._rotate(u?this.transform.angle:-this.transform.angle)):e=!1}r.textBox&&ze(t.textCollisionBox.collisionVertexArray,m.text.placed,!e||_,i.x,i.y),r.verticalTextBox&&ze(t.textCollisionBox.collisionVertexArray,m.text.placed,!e||b,i.x,i.y)}const n=Boolean(!b&&r.verticalIconBox);r.iconBox&&ze(t.iconCollisionBox.collisionVertexArray,m.icon.placed,n,h?i.x:0,h?i.y:0),r.verticalIconBox&&ze(t.iconCollisionBox.collisionVertexArray,m.icon.placed,!n,h?i.x:0,h?i.y:0)}}}if(t.sortFeatures(this.transform.angle),this.retainedQueryData[t.bucketInstanceId]&&(this.retainedQueryData[t.bucketInstanceId].featureSortOrder=t.featureSortOrder),t.hasTextData()&&t.text.opacityVertexBuffer&&t.text.opacityVertexBuffer.updateData(t.text.opacityVertexArray),t.hasIconData()&&t.icon.opacityVertexBuffer&&t.icon.opacityVertexBuffer.updateData(t.icon.opacityVertexArray),t.hasIconCollisionBoxData()&&t.iconCollisionBox.collisionVertexBuffer&&t.iconCollisionBox.collisionVertexBuffer.updateData(t.iconCollisionBox.collisionVertexArray),t.hasTextCollisionBoxData()&&t.textCollisionBox.collisionVertexBuffer&&t.textCollisionBox.collisionVertexBuffer.updateData(t.textCollisionBox.collisionVertexArray),t.text.opacityVertexArray.length!==t.text.layoutVertexArray.length/4)throw new Error(`bucket.text.opacityVertexArray.length (= ${t.text.opacityVertexArray.length}) !== bucket.text.layoutVertexArray.length (= ${t.text.layoutVertexArray.length}) / 4`);if(t.icon.opacityVertexArray.length!==t.icon.layoutVertexArray.length/4)throw new Error(`bucket.icon.opacityVertexArray.length (= ${t.icon.opacityVertexArray.length}) !== bucket.icon.layoutVertexArray.length (= ${t.icon.layoutVertexArray.length}) / 4`);if(t.bucketInstanceId in this.collisionCircleArrays){const e=this.collisionCircleArrays[t.bucketInstanceId];t.placementInvProjMatrix=e.invProjMatrix,t.placementViewportMatrix=e.viewportMatrix,t.collisionCircleArray=e.circles,delete this.collisionCircleArrays[t.bucketInstanceId]}}symbolFadeChange(e){return 0===this.fadeDuration?1:(e-this.commitTime)/this.fadeDuration+this.prevZoomAdjustment}zoomAdjustment(e){return Math.max(0,(this.transform.zoom-e)/1.5)}hasTransitions(e){return this.stale||e-this.lastPlacementChangeTime<this.fadeDuration}stillRecent(e,t){const r=this.zoomAtLastRecencyCheck===t?1-this.zoomAdjustment(t):1;return this.zoomAtLastRecencyCheck=t,this.commitTime+this.fadeDuration*r>e}setStale(){this.stale=!0}}function ze(e,t,r,i,n){e.emplaceBack(t?1:0,r?1:0,i||0,n||0),e.emplaceBack(t?1:0,r?1:0,i||0,n||0),e.emplaceBack(t?1:0,r?1:0,i||0,n||0),e.emplaceBack(t?1:0,r?1:0,i||0,n||0)}const Me=Math.pow(2,25),Oe=Math.pow(2,24),De=Math.pow(2,17),Le=Math.pow(2,16),je=Math.pow(2,9),Re=Math.pow(2,8),Be=Math.pow(2,1);function Fe(e){if(0===e.opacity&&!e.placed)return 0;if(1===e.opacity&&e.placed)return 4294967295;const t=e.placed?1:0,r=Math.floor(127*e.opacity);return r*Me+t*Oe+r*De+t*Le+r*je+t*Re+r*Be+t}const Ne=0;class Ue{constructor(e){this._sortAcrossTiles="viewport-y"!==e.layout.get("symbol-z-order")&&!e.layout.get("symbol-sort-key").isConstant(),this._currentTileIndex=0,this._currentPartIndex=0,this._seenCrossTileIDs={},this._bucketParts=[]}continuePlacement(e,t,r,i,n){const o=this._bucketParts;for(;this._currentTileIndex<e.length;)if(t.getBucketParts(o,i,e[this._currentTileIndex],this._sortAcrossTiles),this._currentTileIndex++,n())return!0;for(this._sortAcrossTiles&&(this._sortAcrossTiles=!1,o.sort(((e,t)=>e.sortKey-t.sortKey)));this._currentPartIndex<o.length;)if(t.placeLayerBucketPart(o[this._currentPartIndex],this._seenCrossTileIDs,r),this._currentPartIndex++,n())return!0;return!1}}class Ve{constructor(e,t,r,i,n,o,a,s){this.placement=new Ce(e,t,o,a,s),this._currentPlacementIndex=r.length-1,this._forceFullPlacement=i,this._showCollisionBoxes=n,this._done=!1}isDone(){return this._done}continuePlacement(t,r,i){const n=e.exported.now(),o=()=>{const t=e.exported.now()-n;return!this._forceFullPlacement&&t>2};for(;this._currentPlacementIndex>=0;){const e=r[t[this._currentPlacementIndex]],n=this.placement.collisionIndex.transform.zoom;if("symbol"===e.type&&(!e.minzoom||e.minzoom<=n)&&(!e.maxzoom||e.maxzoom>n)){if(this._inProgressLayer||(this._inProgressLayer=new Ue(e)),this._inProgressLayer.continuePlacement(i[e.source],this.placement,this._showCollisionBoxes,e,o))return;delete this._inProgressLayer}this._currentPlacementIndex--}this._done=!0}commit(e){return this.placement.commit(e),this.placement}}const qe=512/e.EXTENT/2;class $e{constructor(e,t,r){this.tileID=e,this.indexedSymbolInstances={},this.bucketInstanceId=r;for(let r=0;r<t.length;r++){const i=t.get(r),n=i.key;this.indexedSymbolInstances[n]||(this.indexedSymbolInstances[n]=[]),this.indexedSymbolInstances[n].push({crossTileID:i.crossTileID,coord:this.getScaledCoordinates(i,e)})}}getScaledCoordinates(t,r){const i=qe/Math.pow(2,r.canonical.z-this.tileID.canonical.z);return{x:Math.floor((r.canonical.x*e.EXTENT+t.anchorX)*i),y:Math.floor((r.canonical.y*e.EXTENT+t.anchorY)*i)}}findMatches(e,t,r){const i=this.tileID.canonical.z<t.canonical.z?1:Math.pow(2,this.tileID.canonical.z-t.canonical.z);for(let n=0;n<e.length;n++){const o=e.get(n);if(o.crossTileID)continue;const a=this.indexedSymbolInstances[o.key];if(!a)continue;const s=this.getScaledCoordinates(o,t);for(const e of a)if(Math.abs(e.coord.x-s.x)<=i&&Math.abs(e.coord.y-s.y)<=i&&!r[e.crossTileID]){r[e.crossTileID]=!0,o.crossTileID=e.crossTileID;break}}}}class Ge{constructor(){this.maxCrossTileID=0}generate(){return++this.maxCrossTileID}}class Ze{constructor(){this.indexes={},this.usedCrossTileIDs={},this.lng=0}handleWrapJump(e){const t=Math.round((e-this.lng)/360);if(0!==t)for(const e in this.indexes){const r=this.indexes[e],i={};for(const e in r){const n=r[e];n.tileID=n.tileID.unwrapTo(n.tileID.wrap+t),i[n.tileID.key]=n}this.indexes[e]=i}this.lng=e}addBucket(e,t,r){if(this.indexes[e.overscaledZ]&&this.indexes[e.overscaledZ][e.key]){if(this.indexes[e.overscaledZ][e.key].bucketInstanceId===t.bucketInstanceId)return!1;this.removeBucketCrossTileIDs(e.overscaledZ,this.indexes[e.overscaledZ][e.key])}for(let e=0;e<t.symbolInstances.length;e++)t.symbolInstances.get(e).crossTileID=0;this.usedCrossTileIDs[e.overscaledZ]||(this.usedCrossTileIDs[e.overscaledZ]={});const i=this.usedCrossTileIDs[e.overscaledZ];for(const r in this.indexes){const n=this.indexes[r];if(Number(r)>e.overscaledZ)for(const r in n){const o=n[r];o.tileID.isChildOf(e)&&o.findMatches(t.symbolInstances,e,i)}else{const o=n[e.scaledTo(Number(r)).key];o&&o.findMatches(t.symbolInstances,e,i)}}for(let e=0;e<t.symbolInstances.length;e++){const n=t.symbolInstances.get(e);n.crossTileID||(n.crossTileID=r.generate(),i[n.crossTileID]=!0)}return void 0===this.indexes[e.overscaledZ]&&(this.indexes[e.overscaledZ]={}),this.indexes[e.overscaledZ][e.key]=new $e(e,t.symbolInstances,t.bucketInstanceId),!0}removeBucketCrossTileIDs(e,t){for(const r in t.indexedSymbolInstances)for(const i of t.indexedSymbolInstances[r])delete this.usedCrossTileIDs[e][i.crossTileID]}removeStaleBuckets(e){let t=!1;for(const r in this.indexes){const i=this.indexes[r];for(const n in i)e[i[n].bucketInstanceId]||(this.removeBucketCrossTileIDs(r,i[n]),delete i[n],t=!0)}return t}}class We{constructor(){this.layerIndexes={},this.crossTileIDs=new Ge,this.maxBucketInstanceId=0,this.bucketsInCurrentPlacement={}}addLayer(e,t,r){let i=this.layerIndexes[e.id];void 0===i&&(i=this.layerIndexes[e.id]=new Ze);let n=!1;const o={};i.handleWrapJump(r);for(const r of t){const t=r.getBucket(e);t&&e.id===t.layerIds[0]&&(t.bucketInstanceId||(t.bucketInstanceId=++this.maxBucketInstanceId),i.addBucket(r.tileID,t,this.crossTileIDs)&&(n=!0),o[t.bucketInstanceId]=!0)}return i.removeStaleBuckets(o)&&(n=!0),n}pruneUnusedLayers(e){const t={};e.forEach((e=>{t[e]=!0}));for(const e in this.layerIndexes)t[e]||delete this.layerIndexes[e]}}var Xe=e.createLayout([{name:"a_pos",type:"Int16",components:2}]);class Ke extends e.Evented{constructor(e){super(),this.sourceCache=e,this._tiles={},this._renderableTilesKeys=[],this._sourceTileCache={},this.renderHistory=[],this.minzoom=0,this.maxzoom=22,this.tileSize=512,this.deltaZoom=1,this.renderHistorySize=e._cache.max,e.usedForTerrain=!0,e.tileSize=this.tileSize*2**this.deltaZoom}destruct(){this.sourceCache.usedForTerrain=!1,this.sourceCache.tileSize=null;for(const e in this._tiles){const t=this._tiles[e];t.textures.forEach((e=>e.destroy())),t.textures=[]}}update(t,r){this.sourceCache.update(t,r),this._renderableTilesKeys=[];for(const i of t.coveringTiles({tileSize:this.tileSize,minzoom:this.minzoom,maxzoom:this.maxzoom,reparseOverscaled:!1,terrain:r}))this._renderableTilesKeys.push(i.key),this._tiles[i.key]||(i.posMatrix=new Float64Array(16),e.ortho(i.posMatrix,0,e.EXTENT,0,e.EXTENT,0,1),this._tiles[i.key]=new L(i,this.tileSize))}removeOutdated(e){const t={};this.renderHistory=this.renderHistory.filter(((e,t)=>this.renderHistory.indexOf(e)===t)).slice(0,this.renderHistorySize);for(const e of this._renderableTilesKeys)t[e]=!0;for(const e of this.renderHistory)t[e]=!0;for(const r in this._tiles)t[r]||(this._tiles[r].clearTextures(e),delete this._tiles[r])}getRenderableTiles(){return this._renderableTilesKeys.map((e=>this.getTileByID(e)))}getTileByID(e){return this._tiles[e]}getTerrainCoords(t){const r={};for(const i of this._renderableTilesKeys){const n=this._tiles[i].tileID;if(n.canonical.equals(t.canonical)){const n=t.clone();n.posMatrix=new Float64Array(16),e.ortho(n.posMatrix,0,e.EXTENT,0,e.EXTENT,0,1),r[i]=n}else if(n.canonical.isChildOf(t.canonical)){const o=t.clone();o.posMatrix=new Float64Array(16);const a=n.canonical.z-t.canonical.z,s=n.canonical.x-(n.canonical.x>>a<<a),l=n.canonical.y-(n.canonical.y>>a<<a),c=e.EXTENT>>a;e.ortho(o.posMatrix,0,c,0,c,0,1),e.translate(o.posMatrix,o.posMatrix,[-s*c,-l*c,0]),r[i]=o}else if(t.canonical.isChildOf(n.canonical)){const o=t.clone();o.posMatrix=new Float64Array(16);const a=t.canonical.z-n.canonical.z,s=t.canonical.x-(t.canonical.x>>a<<a),l=t.canonical.y-(t.canonical.y>>a<<a),c=e.EXTENT>>a;e.ortho(o.posMatrix,0,e.EXTENT,0,e.EXTENT,0,1),e.translate(o.posMatrix,o.posMatrix,[s*c,l*c,0]),e.scale(o.posMatrix,o.posMatrix,[1/2**a,1/2**a,0]),r[i]=o}}return r}getSourceTile(e,t){const r=this.sourceCache._source;let i=e.overscaledZ-this.deltaZoom;if(i>r.maxzoom&&(i=r.maxzoom),i<r.minzoom)return null;this._sourceTileCache[e.key]||(this._sourceTileCache[e.key]=e.scaledTo(i).key);let n=this.sourceCache.getTileByID(this._sourceTileCache[e.key]);if((!n||!n.dem)&&t)for(;i>=r.minzoom&&(!n||!n.dem);)n=this.sourceCache.getTileByID(e.scaledTo(i--).key);return n}tilesAfterTime(e=Date.now()){return Object.values(this._tiles).filter((t=>t.timeLoaded>=e))}}class He{constructor(e,t,r){this.style=e,this.sourceCache=new Ke(t),this.options=r,this.exaggeration="number"==typeof r.exaggeration?r.exaggeration:1,this.elevationOffset="number"==typeof r.elevationOffset?r.elevationOffset:450,this.qualityFactor=2,this.meshSize=128,this._demMatrixCache={},this.coordsIndex=[],this._coordsTextureSize=1024,this.clearRerenderCache()}getDEMElevation(t,r,i,n=e.EXTENT){if(!(r>=0&&r<n&&i>=0&&i<n))return this.elevationOffset;let o=0;const a=this.getTerrainData(t);if(a.tile&&a.tile.dem){const t=e.transformMat4$1([],[r/n*e.EXTENT,i/n*e.EXTENT],a.u_terrain_matrix),s=[t[0]*a.tile.dem.dim,t[1]*a.tile.dem.dim],l=[Math.floor(s[0]),Math.floor(s[1])],c=a.tile.dem.get(l[0],l[1]),u=a.tile.dem.get(l[0],l[1]+1),h=a.tile.dem.get(l[0]+1,l[1]),p=a.tile.dem.get(l[0]+1,l[1]+1);o=e.number(e.number(c,u,s[0]-l[0]),e.number(h,p,s[0]-l[0]),s[1]-l[1])}return o}rememberForRerender(e,t){for(const r in this.sourceCache._tiles){const i=this.sourceCache._tiles[r];(i.tileID.equals(t)||i.tileID.isChildOf(t))&&(e===this.sourceCache.sourceCache.id&&(i.timeLoaded=Date.now()),this._rerender[e]=this._rerender[e]||{},this._rerender[e][i.tileID.key]=!0)}}needsRerender(e,t){return this._rerender[e]&&this._rerender[e][t.key]}clearRerenderCache(){this._rerender={}}getElevation(t,r,i,n=e.EXTENT){return(this.getDEMElevation(t,r,i,n)+this.elevationOffset)*this.exaggeration}getTerrainData(t){if(!this._emptyDemTexture){const t=this.style.map.painter.context,r=new e.RGBAImage({width:1,height:1},new Uint8Array(4));this._emptyDepthTexture=new l(t,r,t.gl.RGBA,{premultiply:!1}),this._emptyDemUnpack=[0,0,0,0],this._emptyDemTexture=new l(t,new e.RGBAImage({width:1,height:1}),t.gl.RGBA,{premultiply:!1}),this._emptyDemTexture.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._emptyDemMatrix=e.identity([])}const r=this.sourceCache.getSourceTile(t,!0);if(r&&r.dem&&(!r.demTexture||r.needsTerrainPrepare)){const e=this.style.map.painter.context;r.demTexture=this.style.map.painter.getTileTexture(r.dem.stride),r.demTexture?r.demTexture.update(r.dem.getPixels(),{premultiply:!1}):r.demTexture=new l(e,r.dem.getPixels(),e.gl.RGBA,{premultiply:!1}),r.demTexture.bind(e.gl.NEAREST,e.gl.CLAMP_TO_EDGE),r.needsTerrainPrepare=!1}const i=r&&r+r.tileID.key+t.key;if(i&&!this._demMatrixCache[i]){const i=this.sourceCache.sourceCache._source.maxzoom;let n=t.canonical.z-r.tileID.canonical.z;t.overscaledZ>t.canonical.z&&(t.canonical.z>=i?n=t.canonical.z-i:e.warnOnce("cannot calculate elevation if elevation maxzoom > source.maxzoom"));const o=t.canonical.x-(t.canonical.x>>n<<n),a=t.canonical.y-(t.canonical.y>>n<<n),s=e.fromScaling(new Float64Array(16),[1/(e.EXTENT<<n),1/(e.EXTENT<<n),0]);e.translate(s,s,[o*e.EXTENT,a*e.EXTENT,0]),this._demMatrixCache[t.key]={matrix:s,coord:t}}return{u_depth:2,u_terrain:3,u_terrain_dim:r&&r.dem&&r.dem.dim||1,u_terrain_matrix:i?this._demMatrixCache[t.key].matrix:this._emptyDemMatrix,u_terrain_unpack:r&&r.dem&&r.dem.getUnpackVector()||this._emptyDemUnpack,u_terrain_offset:this.elevationOffset,u_terrain_exaggeration:this.exaggeration,texture:(r&&r.demTexture||this._emptyDemTexture).texture,depthTexture:(this._fboDepthTexture||this._emptyDepthTexture).texture,tile:r}}getRTTFramebuffer(){const e=this.style.map.painter;if(!this._rttFramebuffer){const t=this.sourceCache.tileSize*this.qualityFactor;this._rttFramebuffer=e.context.createFramebuffer(t,t,!0),this._rttFramebuffer.depthAttachment.set(e.context.createRenderbuffer(e.context.gl.DEPTH_COMPONENT16,t,t))}return this._rttFramebuffer}getFramebuffer(e){const t=this.style.map.painter,r=t.width/devicePixelRatio,i=t.height/devicePixelRatio;return!this._fbo||this._fbo.width===r&&this._fbo.height===i||(this._fbo.destroy(),this._fboCoordsTexture.destroy(),this._fboDepthTexture.destroy(),delete this._fbo,delete this._fboDepthTexture,delete this._fboCoordsTexture),this._fboCoordsTexture||(this._fboCoordsTexture=new l(t.context,{width:r,height:i,data:null},t.context.gl.RGBA,{premultiply:!1}),this._fboCoordsTexture.bind(t.context.gl.NEAREST,t.context.gl.CLAMP_TO_EDGE)),this._fboDepthTexture||(this._fboDepthTexture=new l(t.context,{width:r,height:i,data:null},t.context.gl.RGBA,{premultiply:!1}),this._fboDepthTexture.bind(t.context.gl.NEAREST,t.context.gl.CLAMP_TO_EDGE)),this._fbo||(this._fbo=t.context.createFramebuffer(r,i,!0),this._fbo.depthAttachment.set(t.context.createRenderbuffer(t.context.gl.DEPTH_COMPONENT16,r,i))),this._fbo.colorAttachment.set("coords"===e?this._fboCoordsTexture.texture:this._fboDepthTexture.texture),this._fbo}getCoordsTexture(){const t=this.style.map.painter.context;if(this._coordsTexture)return this._coordsTexture;const r=new Uint8Array(this._coordsTextureSize*this._coordsTextureSize*4);for(let e=0,t=0;e<this._coordsTextureSize;e++)for(let i=0;i<this._coordsTextureSize;i++,t+=4)r[t+0]=255&i,r[t+1]=255&e,r[t+2]=i>>8<<4|e>>8,r[t+3]=0;const i=new e.RGBAImage({width:this._coordsTextureSize,height:this._coordsTextureSize},new Uint8Array(r.buffer)),n=new l(t,i,t.gl.RGBA,{premultiply:!1});return n.bind(t.gl.NEAREST,t.gl.CLAMP_TO_EDGE),this._coordsTexture=n,n}pointCoordinate(t){const r=new Uint8Array(4),i=this.style.map.painter,n=i.context,o=n.gl;n.bindFramebuffer.set(this.getFramebuffer("coords").framebuffer),o.readPixels(t.x,i.height/devicePixelRatio-t.y-1,1,1,o.RGBA,o.UNSIGNED_BYTE,r),n.bindFramebuffer.set(null);const a=r[0]+(r[2]>>4<<8),s=r[1]+((15&r[2])<<8),l=this.coordsIndex[255-r[3]],c=l&&this.sourceCache.getTileByID(l);if(!c)return null;const u=this._coordsTextureSize,h=(1<<c.tileID.canonical.z)*u;return new e.MercatorCoordinate((c.tileID.canonical.x*u+a)/h,(c.tileID.canonical.y*u+s)/h,this.getElevation(c.tileID,a,s,u))}getTerrainMesh(){if(this._mesh)return this._mesh;const t=this.style.map.painter.context,r=new e.PosArray,i=new e.TriangleIndexArray,n=this.meshSize,o=e.EXTENT/n,a=n*n;for(let e=0;e<=n;e++)for(let t=0;t<=n;t++)r.emplaceBack(t*o,e*o);for(let e=0;e<a;e+=n+1)for(let t=0;t<n;t++)i.emplaceBack(t+e,n+t+e+1,n+t+e+2),i.emplaceBack(t+e,n+t+e+2,t+e+1);return this._mesh={indexBuffer:t.createIndexBuffer(i),vertexBuffer:t.createVertexBuffer(r,Xe.members),segments:e.SegmentVector.simpleSegment(0,0,r.length,i.length)},this._mesh}getMinMaxElevation(e){const t=this.getTerrainData(e).tile,r={minElevation:null,maxElevation:null};return t&&t.dem&&(r.minElevation=(t.dem.min+this.elevationOffset)*this.exaggeration,r.maxElevation=(t.dem.max+this.elevationOffset)*this.exaggeration),r}}const Je=(t,r)=>e.emitValidationErrors(t,r&&r.filter((e=>"source.canvas"!==e.identifier))),Ye=e.pick(X,["addLayer","removeLayer","setPaintProperty","setLayoutProperty","setFilter","addSource","removeSource","setLayerZoomRange","setLight","setTransition","setGeoJSONSourceData"]),Qe=e.pick(X,["setCenter","setZoom","setBearing","setPitch"]),et=function(){const t={},r=e.spec.$version;for(const i in e.spec.$root){const n=e.spec.$root[i];if(n.required){let e=null;e="version"===i?r:"array"===n.type?[]:{},null!=e&&(t[i]=e)}}return t}();class tt extends e.Evented{constructor(t,r={}){super(),this.map=t,this.dispatcher=new b(G(),this),this.imageManager=new u,this.imageManager.setEventedParent(this),this.glyphManager=new f(t._requestManager,r.localIdeographFontFamily),this.lineAtlas=new _(256,512),this.crossTileSymbolIndex=new We,this._layers={},this._serializedLayers={},this._order=[],this.sourceCaches={},this.zoomHistory=new e.ZoomHistory,this._loaded=!1,this._availableImages=[],this._resetUpdates(),this.dispatcher.broadcast("setReferrer",e.getReferrer());const i=this;this._rtlTextPluginCallback=tt.registerForPluginStateChange((t=>{i.dispatcher.broadcast("syncRTLPluginState",{pluginStatus:t.pluginStatus,pluginURL:t.pluginURL},((t,r)=>{if(e.triggerPluginCompletionEvent(t),r&&r.every((e=>e)))for(const e in i.sourceCaches)i.sourceCaches[e].reload()}))})),this.on("data",(e=>{if("source"!==e.dataType||"metadata"!==e.sourceDataType)return;const t=this.sourceCaches[e.sourceId];if(!t)return;const r=t.getSource();if(r&&r.vectorLayerIds)for(const e in this._layers){const t=this._layers[e];t.source===r.id&&this._validateLayer(t)}}))}loadURL(t,r={}){this.fire(new e.Event("dataloading",{dataType:"style"}));const i="boolean"!=typeof r.validate||r.validate,n=this.map._requestManager.transformRequest(t,e.ResourceType.Style);this._request=e.getJSON(n,((t,r)=>{this._request=null,t?this.fire(new e.ErrorEvent(t)):r&&this._load(r,i)}))}loadJSON(t,r={}){this.fire(new e.Event("dataloading",{dataType:"style"})),this._request=e.exported.frame((()=>{this._request=null,this._load(t,!1!==r.validate)}))}loadEmpty(){this.fire(new e.Event("dataloading",{dataType:"style"})),this._load(et,!1)}_load(t,r){if(r&&Je(this,e.validateStyle(t)))return;this._loaded=!0,this.stylesheet=t;for(const e in t.sources)this.addSource(e,t.sources[e],{validate:!1});t.sprite?this._loadSprite(t.sprite):this.imageManager.setLoaded(!0),this.glyphManager.setURL(t.glyphs);const i=W(this.stylesheet.layers);this._order=i.map((e=>e.id)),this._layers={},this._serializedLayers={};for(let t of i)t=e.createStyleLayer(t),t.setEventedParent(this,{layer:{id:t.id}}),this._layers[t.id]=t,this._serializedLayers[t.id]=t.serialize();this.dispatcher.broadcast("setLayers",this._serializeLayers(this._order)),this.light=new g(this.stylesheet.light),this.setTerrain(this.stylesheet.terrain),this.fire(new e.Event("data",{dataType:"style"})),this.fire(new e.Event("style.load"))}_loadSprite(t){this._spriteRequest=function(t,r,i,n){let o,a,s;const l=i>1?"@2x":"";let c=e.getJSON(r.transformRequest(r.normalizeSpriteURL(t,l,".json"),e.ResourceType.SpriteJSON),((e,t)=>{c=null,s||(s=e,o=t,h())})),u=e.getImage(r.transformRequest(r.normalizeSpriteURL(t,l,".png"),e.ResourceType.SpriteImage),((e,t)=>{u=null,s||(s=e,a=t,h())}));function h(){if(s)n(s);else if(o&&a){const t=e.exported.getImageData(a),r={};for(const i in o){const{width:n,height:a,x:s,y:l,sdf:c,pixelRatio:u,stretchX:h,stretchY:p,content:d}=o[i],f=new e.RGBAImage({width:n,height:a});e.RGBAImage.copy(t,f,{x:s,y:l},{x:0,y:0},{width:n,height:a}),r[i]={data:f,pixelRatio:u,sdf:c,stretchX:h,stretchY:p,content:d}}n(null,r)}}return{cancel(){c&&(c.cancel(),c=null),u&&(u.cancel(),u=null)}}}(t,this.map._requestManager,this.map.getPixelRatio(),((t,r)=>{if(this._spriteRequest=null,t)this.fire(new e.ErrorEvent(t));else if(r)for(const e in r)this.imageManager.addImage(e,r[e]);this.imageManager.setLoaded(!0),this._availableImages=this.imageManager.listImages(),this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))}))}_validateLayer(t){const r=this.sourceCaches[t.source];if(!r)return;const i=t.sourceLayer;if(!i)return;const n=r.getSource();("geojson"===n.type||n.vectorLayerIds&&-1===n.vectorLayerIds.indexOf(i))&&this.fire(new e.ErrorEvent(new Error(`Source layer "${i}" does not exist on source "${n.id}" as specified by style layer "${t.id}".`)))}loaded(){if(!this._loaded)return!1;if(Object.keys(this._updatedSources).length)return!1;for(const e in this.sourceCaches)if(!this.sourceCaches[e].loaded())return!1;return!!this.imageManager.isLoaded()}_serializeLayers(e){const t=[];for(const r of e){const e=this._layers[r];"custom"!==e.type&&t.push(e.serialize())}return t}hasTransitions(){if(this.light&&this.light.hasTransition())return!0;for(const e in this.sourceCaches)if(this.sourceCaches[e].hasTransition())return!0;for(const e in this._layers)if(this._layers[e].hasTransition())return!0;return!1}_checkLoaded(){if(!this._loaded)throw new Error("Style is not done loading.")}update(t){if(!this._loaded)return;const r=this._changed;if(this._changed){const e=Object.keys(this._updatedLayers),r=Object.keys(this._removedLayers);(e.length||r.length)&&this._updateWorkerLayers(e,r);for(const e in this._updatedSources){const t=this._updatedSources[e];if("reload"===t)this._reloadSource(e);else{if("clear"!==t)throw new Error(`Invalid action ${t}`);this._clearSource(e)}}this._updateTilesForChangedImages();for(const e in this._updatedPaintProps)this._layers[e].updateTransitions(t);this.light.updateTransitions(t),this._resetUpdates()}const i={};for(const e in this.sourceCaches){const t=this.sourceCaches[e];i[e]=t.used,t.used=!1}for(const e of this._order){const r=this._layers[e];r.recalculate(t,this._availableImages),!r.isHidden(t.zoom)&&r.source&&(this.sourceCaches[r.source].used=!0)}for(const t in i){const r=this.sourceCaches[t];i[t]!==r.used&&r.fire(new e.Event("data",{sourceDataType:"visibility",dataType:"source",sourceId:t}))}this.light.recalculate(t),this.z=t.zoom,r&&this.fire(new e.Event("data",{dataType:"style"}))}_updateTilesForChangedImages(){const e=Object.keys(this._changedImages);if(e.length){for(const t in this.sourceCaches)this.sourceCaches[t].reloadTilesForDependencies(["icons","patterns"],e);this._changedImages={}}}_updateWorkerLayers(e,t){this.dispatcher.broadcast("updateLayers",{layers:this._serializeLayers(e),removedIds:t})}_resetUpdates(){this._changed=!1,this._updatedLayers={},this._removedLayers={},this._updatedSources={},this._updatedPaintProps={},this._changedImages={}}setTerrain(t){if(this._checkLoaded(),this._terrainDataCallback&&this.off("data",this._terrainDataCallback),this._terrainfreezeElevationCallback&&this.map.off("freezeElevation",this._terrainfreezeElevationCallback),t){const e=this.sourceCaches[t.source];if(!e)throw new Error(`cannot load terrain, because there exists no source with ID: ${t.source}`);this.terrain=new He(this,e,t),this.map.transform.updateElevation(this.terrain),this._terrainfreezeElevationCallback=e=>{e.freeze?this.map.transform.freezeElevation=!0:(this.map.transform.freezeElevation=!1,this.map.transform.recalculateZoom(this.terrain))},this._terrainDataCallback=e=>{e.tile&&(e.sourceId===t.source?(this.map.transform.updateElevation(this.terrain),this.terrain.rememberForRerender(e.sourceId,e.tile.tileID)):"geojson"===e.source.type&&this.terrain.rememberForRerender(e.sourceId,e.tile.tileID))},this.on("data",this._terrainDataCallback),this.map.on("freezeElevation",this._terrainfreezeElevationCallback)}else this.terrain&&this.terrain.sourceCache.destruct(),this.terrain=null,this.map.transform.updateElevation(this.terrain);this.map.fire(new e.Event("terrain",{terrain:t}))}setState(t){if(this._checkLoaded(),Je(this,e.validateStyle(t)))return!1;(t=e.clone$1(t)).layers=W(t.layers);const r=function(e,t){if(!e)return[{command:X.setStyle,args:[t]}];let r=[];try{if(!n(e.version,t.version))return[{command:X.setStyle,args:[t]}];n(e.center,t.center)||r.push({command:X.setCenter,args:[t.center]}),n(e.zoom,t.zoom)||r.push({command:X.setZoom,args:[t.zoom]}),n(e.bearing,t.bearing)||r.push({command:X.setBearing,args:[t.bearing]}),n(e.pitch,t.pitch)||r.push({command:X.setPitch,args:[t.pitch]}),n(e.sprite,t.sprite)||r.push({command:X.setSprite,args:[t.sprite]}),n(e.glyphs,t.glyphs)||r.push({command:X.setGlyphs,args:[t.glyphs]}),n(e.transition,t.transition)||r.push({command:X.setTransition,args:[t.transition]}),n(e.light,t.light)||r.push({command:X.setLight,args:[t.light]});const i={},o=[];!function(e,t,r,i){let o;for(o in t=t||{},e=e||{})Object.prototype.hasOwnProperty.call(e,o)&&(Object.prototype.hasOwnProperty.call(t,o)||H(o,r,i));for(o in t)Object.prototype.hasOwnProperty.call(t,o)&&(Object.prototype.hasOwnProperty.call(e,o)?n(e[o],t[o])||("geojson"===e[o].type&&"geojson"===t[o].type&&Y(e,t,o)?r.push({command:X.setGeoJSONSourceData,args:[o,t[o].data]}):J(o,t,r,i)):K(o,t,r))}(e.sources,t.sources,o,i);const a=[];e.layers&&e.layers.forEach((e=>{i[e.source]?r.push({command:X.removeLayer,args:[e.id]}):a.push(e)})),r=r.concat(o),function(e,t,r){t=t||[];const i=(e=e||[]).map(ee),o=t.map(ee),a=e.reduce(te,{}),s=t.reduce(te,{}),l=i.slice(),c=Object.create(null);let u,h,p,d,f,m,y;for(u=0,h=0;u<i.length;u++)p=i[u],Object.prototype.hasOwnProperty.call(s,p)?h++:(r.push({command:X.removeLayer,args:[p]}),l.splice(l.indexOf(p,h),1));for(u=0,h=0;u<o.length;u++)p=o[o.length-1-u],l[l.length-1-u]!==p&&(Object.prototype.hasOwnProperty.call(a,p)?(r.push({command:X.removeLayer,args:[p]}),l.splice(l.lastIndexOf(p,l.length-h),1)):h++,m=l[l.length-u],r.push({command:X.addLayer,args:[s[p],m]}),l.splice(l.length-u,0,p),c[p]=!0);for(u=0;u<o.length;u++)if(p=o[u],d=a[p],f=s[p],!c[p]&&!n(d,f))if(n(d.source,f.source)&&n(d["source-layer"],f["source-layer"])&&n(d.type,f.type)){for(y in Q(d.layout,f.layout,r,p,null,X.setLayoutProperty),Q(d.paint,f.paint,r,p,null,X.setPaintProperty),n(d.filter,f.filter)||r.push({command:X.setFilter,args:[p,f.filter]}),n(d.minzoom,f.minzoom)&&n(d.maxzoom,f.maxzoom)||r.push({command:X.setLayerZoomRange,args:[p,f.minzoom,f.maxzoom]}),d)Object.prototype.hasOwnProperty.call(d,y)&&"layout"!==y&&"paint"!==y&&"filter"!==y&&"metadata"!==y&&"minzoom"!==y&&"maxzoom"!==y&&(0===y.indexOf("paint.")?Q(d[y],f[y],r,p,y.slice(6),X.setPaintProperty):n(d[y],f[y])||r.push({command:X.setLayerProperty,args:[p,y,f[y]]}));for(y in f)Object.prototype.hasOwnProperty.call(f,y)&&!Object.prototype.hasOwnProperty.call(d,y)&&"layout"!==y&&"paint"!==y&&"filter"!==y&&"metadata"!==y&&"minzoom"!==y&&"maxzoom"!==y&&(0===y.indexOf("paint.")?Q(d[y],f[y],r,p,y.slice(6),X.setPaintProperty):n(d[y],f[y])||r.push({command:X.setLayerProperty,args:[p,y,f[y]]}))}else r.push({command:X.removeLayer,args:[p]}),m=l[l.lastIndexOf(p)+1],r.push({command:X.addLayer,args:[f,m]})}(a,t.layers,r)}catch(e){console.warn("Unable to compute style diff:",e),r=[{command:X.setStyle,args:[t]}]}return r}(this.serialize(),t).filter((e=>!(e.command in Qe)));if(0===r.length)return!1;const i=r.filter((e=>!(e.command in Ye)));if(i.length>0)throw new Error(`Unimplemented: ${i.map((e=>e.command)).join(", ")}.`);return r.forEach((e=>{"setTransition"!==e.command&&this[e.command].apply(this,e.args)})),this.stylesheet=t,!0}addImage(t,r){if(this.getImage(t))return this.fire(new e.ErrorEvent(new Error(`An image named "${t}" already exists.`)));this.imageManager.addImage(t,r),this._afterImageUpdated(t)}updateImage(e,t){this.imageManager.updateImage(e,t)}getImage(e){return this.imageManager.getImage(e)}removeImage(t){if(!this.getImage(t))return this.fire(new e.ErrorEvent(new Error(`An image named "${t}" does not exist.`)));this.imageManager.removeImage(t),this._afterImageUpdated(t)}_afterImageUpdated(t){this._availableImages=this.imageManager.listImages(),this._changedImages[t]=!0,this._changed=!0,this.dispatcher.broadcast("setImages",this._availableImages),this.fire(new e.Event("data",{dataType:"style"}))}listImages(){return this._checkLoaded(),this.imageManager.listImages()}addSource(t,r,i={}){if(this._checkLoaded(),void 0!==this.sourceCaches[t])throw new Error(`Source "${t}" already exists.`);if(!r.type)throw new Error(`The type property must be defined, but only the following properties were given: ${Object.keys(r).join(", ")}.`);if(["vector","raster","geojson","video","image"].indexOf(r.type)>=0&&this._validate(e.validateStyle.source,`sources.${t}`,r,null,i))return;this.map&&this.map._collectResourceTiming&&(r.collectResourceTiming=!0);const n=this.sourceCaches[t]=new B(t,r,this.dispatcher);n.style=this,n.setEventedParent(this,(()=>({isSourceLoaded:this.loaded(),source:n.serialize(),sourceId:t}))),n.onAdd(this.map),this._changed=!0}removeSource(t){if(this._checkLoaded(),void 0===this.sourceCaches[t])throw new Error("There is no source with this ID");for(const r in this._layers)if(this._layers[r].source===t)return this.fire(new e.ErrorEvent(new Error(`Source "${t}" cannot be removed while layer "${r}" is using it.`)));const r=this.sourceCaches[t];delete this.sourceCaches[t],delete this._updatedSources[t],r.fire(new e.Event("data",{sourceDataType:"metadata",dataType:"source",sourceId:t})),r.setEventedParent(null),r.onRemove(this.map),this._changed=!0}setGeoJSONSourceData(e,t){if(this._checkLoaded(),void 0===this.sourceCaches[e])throw new Error(`There is no source with this ID=${e}`);const r=this.sourceCaches[e].getSource();if("geojson"!==r.type)throw new Error(`geojsonSource.type is ${r.type}, which is !== 'geojson`);r.setData(t),this._changed=!0}getSource(e){return this.sourceCaches[e]&&this.sourceCaches[e].getSource()}addLayer(t,r,i={}){this._checkLoaded();const n=t.id;if(this.getLayer(n))return void this.fire(new e.ErrorEvent(new Error(`Layer "${n}" already exists on this map.`)));let o;if("custom"===t.type){if(Je(this,e.validateCustomStyleLayer(t)))return;o=e.createStyleLayer(t)}else{if("object"==typeof t.source&&(this.addSource(n,t.source),t=e.clone$1(t),t=e.extend(t,{source:n})),this._validate(e.validateStyle.layer,`layers.${n}`,t,{arrayIndex:-1},i))return;o=e.createStyleLayer(t),this._validateLayer(o),o.setEventedParent(this,{layer:{id:n}}),this._serializedLayers[o.id]=o.serialize()}const a=r?this._order.indexOf(r):this._order.length;if(r&&-1===a)this.fire(new e.ErrorEvent(new Error(`Cannot add layer "${n}" before non-existing layer "${r}".`)));else{if(this._order.splice(a,0,n),this._layerOrderChanged=!0,this._layers[n]=o,this._removedLayers[n]&&o.source&&"custom"!==o.type){const e=this._removedLayers[n];delete this._removedLayers[n],e.type!==o.type?this._updatedSources[o.source]="clear":(this._updatedSources[o.source]="reload",this.sourceCaches[o.source].pause())}this._updateLayer(o),o.onAdd&&o.onAdd(this.map)}}moveLayer(t,r){if(this._checkLoaded(),this._changed=!0,!this._layers[t])return void this.fire(new e.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style and cannot be moved.`)));if(t===r)return;const i=this._order.indexOf(t);this._order.splice(i,1);const n=r?this._order.indexOf(r):this._order.length;r&&-1===n?this.fire(new e.ErrorEvent(new Error(`Cannot move layer "${t}" before non-existing layer "${r}".`))):(this._order.splice(n,0,t),this._layerOrderChanged=!0)}removeLayer(t){this._checkLoaded();const r=this._layers[t];if(!r)return void this.fire(new e.ErrorEvent(new Error(`Cannot remove non-existing layer "${t}".`)));r.setEventedParent(null);const i=this._order.indexOf(t);this._order.splice(i,1),this._layerOrderChanged=!0,this._changed=!0,this._removedLayers[t]=r,delete this._layers[t],delete this._serializedLayers[t],delete this._updatedLayers[t],delete this._updatedPaintProps[t],r.onRemove&&r.onRemove(this.map)}getLayer(e){return this._layers[e]}hasLayer(e){return e in this._layers}setLayerZoomRange(t,r,i){this._checkLoaded();const n=this.getLayer(t);n?n.minzoom===r&&n.maxzoom===i||(null!=r&&(n.minzoom=r),null!=i&&(n.maxzoom=i),this._updateLayer(n)):this.fire(new e.ErrorEvent(new Error(`Cannot set the zoom range of non-existing layer "${t}".`)))}setFilter(t,r,i={}){this._checkLoaded();const o=this.getLayer(t);if(o){if(!n(o.filter,r))return null==r?(o.filter=void 0,void this._updateLayer(o)):void(this._validate(e.validateStyle.filter,`layers.${o.id}.filter`,r,null,i)||(o.filter=e.clone$1(r),this._updateLayer(o)))}else this.fire(new e.ErrorEvent(new Error(`Cannot filter non-existing layer "${t}".`)))}getFilter(t){return e.clone$1(this.getLayer(t).filter)}setLayoutProperty(t,r,i,o={}){this._checkLoaded();const a=this.getLayer(t);a?n(a.getLayoutProperty(r),i)||(a.setLayoutProperty(r,i,o),this._updateLayer(a)):this.fire(new e.ErrorEvent(new Error(`Cannot style non-existing layer "${t}".`)))}getLayoutProperty(t,r){const i=this.getLayer(t);if(i)return i.getLayoutProperty(r);this.fire(new e.ErrorEvent(new Error(`Cannot get style of non-existing layer "${t}".`)))}setPaintProperty(t,r,i,o={}){this._checkLoaded();const a=this.getLayer(t);a?n(a.getPaintProperty(r),i)||(a.setPaintProperty(r,i,o)&&this._updateLayer(a),this._changed=!0,this._updatedPaintProps[t]=!0):this.fire(new e.ErrorEvent(new Error(`Cannot style non-existing layer "${t}".`)))}getPaintProperty(e,t){return this.getLayer(e).getPaintProperty(t)}setFeatureState(t,r){this._checkLoaded();const i=t.source,n=t.sourceLayer,o=this.sourceCaches[i];if(void 0===o)return void this.fire(new e.ErrorEvent(new Error(`The source '${i}' does not exist in the map's style.`)));const a=o.getSource().type;"geojson"===a&&n?this.fire(new e.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))):"vector"!==a||n?(void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),o.setFeatureState(n,t.id,r)):this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}removeFeatureState(t,r){this._checkLoaded();const i=t.source,n=this.sourceCaches[i];if(void 0===n)return void this.fire(new e.ErrorEvent(new Error(`The source '${i}' does not exist in the map's style.`)));const o=n.getSource().type,a="vector"===o?t.sourceLayer:void 0;"vector"!==o||a?r&&"string"!=typeof t.id&&"number"!=typeof t.id?this.fire(new e.ErrorEvent(new Error("A feature id is required to remove its specific state property."))):n.removeFeatureState(a,t.id,r):this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")))}getFeatureState(t){this._checkLoaded();const r=t.source,i=t.sourceLayer,n=this.sourceCaches[r];if(void 0!==n)return"vector"!==n.getSource().type||i?(void 0===t.id&&this.fire(new e.ErrorEvent(new Error("The feature id parameter must be provided."))),n.getFeatureState(i,t.id)):void this.fire(new e.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));this.fire(new e.ErrorEvent(new Error(`The source '${r}' does not exist in the map's style.`)))}getTransition(){return e.extend({duration:300,delay:0},this.stylesheet&&this.stylesheet.transition)}serialize(){return e.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:e.mapObject(this.sourceCaches,(e=>e.serialize())),layers:this._serializeLayers(this._order)},(e=>void 0!==e))}_updateLayer(e){this._updatedLayers[e.id]=!0,e.source&&!this._updatedSources[e.source]&&"raster"!==this.sourceCaches[e.source].getSource().type&&(this._updatedSources[e.source]="reload",this.sourceCaches[e.source].pause()),this._changed=!0}_flattenAndSortRenderedFeatures(e){const t=e=>"fill-extrusion"===this._layers[e].type,r={},i=[];for(let n=this._order.length-1;n>=0;n--){const o=this._order[n];if(t(o)){r[o]=n;for(const t of e){const e=t[o];if(e)for(const t of e)i.push(t)}}}i.sort(((e,t)=>t.intersectionZ-e.intersectionZ));const n=[];for(let o=this._order.length-1;o>=0;o--){const a=this._order[o];if(t(a))for(let e=i.length-1;e>=0;e--){const t=i[e].feature;if(r[t.layer.id]<o)break;n.push(t),i.pop()}else for(const t of e){const e=t[a];if(e)for(const t of e)n.push(t.feature)}}return n}queryRenderedFeatures(t,r,i){r&&r.filter&&this._validate(e.validateStyle.filter,"queryRenderedFeatures.filter",r.filter,null,r);const n={};if(r&&r.layers){if(!Array.isArray(r.layers))return this.fire(new e.ErrorEvent(new Error("parameters.layers must be an Array."))),[];for(const t of r.layers){const r=this._layers[t];if(!r)return this.fire(new e.ErrorEvent(new Error(`The layer '${t}' does not exist in the map's style and cannot be queried for features.`))),[];n[r.source]=!0}}const o=[];r.availableImages=this._availableImages;for(const e in this.sourceCaches)r.layers&&!n[e]||o.push(O(this.sourceCaches[e],this._layers,this._serializedLayers,t,r,i));return this.placement&&o.push(function(e,t,r,i,n,o,a){const s={},l=o.queryRenderedSymbols(i),c=[];for(const e of Object.keys(l).map(Number))c.push(a[e]);c.sort(D);for(const r of c){const i=r.featureIndex.lookupSymbolFeatures(l[r.bucketInstanceId],t,r.bucketIndex,r.sourceLayerIndex,n.filter,n.layers,n.availableImages,e);for(const e in i){const t=s[e]=s[e]||[],n=i[e];n.sort(((e,t)=>{const i=r.featureSortOrder;if(i){const r=i.indexOf(e.featureIndex);return i.indexOf(t.featureIndex)-r}return t.featureIndex-e.featureIndex}));for(const e of n)t.push(e)}}for(const t in s)s[t].forEach((i=>{const n=i.feature,o=r[e[t].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=o}));return s}(this._layers,this._serializedLayers,this.sourceCaches,t,r,this.placement.collisionIndex,this.placement.retainedQueryData)),this._flattenAndSortRenderedFeatures(o)}querySourceFeatures(t,r){r&&r.filter&&this._validate(e.validateStyle.filter,"querySourceFeatures.filter",r.filter,null,r);const i=this.sourceCaches[t];return i?function(e,t){const r=e.getRenderableIds().map((t=>e.getTileByID(t))),i=[],n={};for(let e=0;e<r.length;e++){const o=r[e],a=o.tileID.canonical.key;n[a]||(n[a]=!0,o.querySourceFeatures(i,t))}return i}(i,r):[]}addSourceType(e,t,r){return tt.getSourceType(e)?r(new Error(`A source type called "${e}" already exists.`)):(tt.setSourceType(e,t),t.workerSourceURL?void this.dispatcher.broadcast("loadWorkerSource",{name:e,url:t.workerSourceURL},r):r(null,null))}getLight(){return this.light.getLight()}setLight(t,r={}){this._checkLoaded();const i=this.light.getLight();let o=!1;for(const e in t)if(!n(t[e],i[e])){o=!0;break}if(!o)return;const a={now:e.exported.now(),transition:e.extend({duration:300,delay:0},this.stylesheet.transition)};this.light.setLight(t,r),this.light.updateTransitions(a)}_validate(t,r,i,n,o={}){return(!o||!1!==o.validate)&&Je(this,t.call(e.validateStyle,e.extend({key:r,style:this.serialize(),value:i,styleSpec:e.spec},n)))}_remove(){this._request&&(this._request.cancel(),this._request=null),this._spriteRequest&&(this._spriteRequest.cancel(),this._spriteRequest=null),e.evented.off("pluginStateChange",this._rtlTextPluginCallback);for(const e in this._layers)this._layers[e].setEventedParent(null);for(const e in this.sourceCaches){const t=this.sourceCaches[e];t.setEventedParent(null),t.onRemove(this.map)}this.imageManager.setEventedParent(null),this.setEventedParent(null),this.dispatcher.remove()}_clearSource(e){this.sourceCaches[e].clearTiles()}_reloadSource(e){this.sourceCaches[e].resume(),this.sourceCaches[e].reload()}_updateSources(e){for(const t in this.sourceCaches)this.sourceCaches[t].update(e,this.terrain)}_generateCollisionBoxes(){for(const e in this.sourceCaches)this._reloadSource(e)}_updatePlacement(t,r,i,n,o=!1){let a=!1,s=!1;const l={};for(const e of this._order){const r=this._layers[e];if("symbol"!==r.type)continue;if(!l[r.source]){const e=this.sourceCaches[r.source];l[r.source]=e.getRenderableIds(!0).map((t=>e.getTileByID(t))).sort(((e,t)=>t.tileID.overscaledZ-e.tileID.overscaledZ||(e.tileID.isLessThan(t.tileID)?-1:1)))}const i=this.crossTileSymbolIndex.addLayer(r,l[r.source],t.center.lng);a=a||i}if(this.crossTileSymbolIndex.pruneUnusedLayers(this._order),((o=o||this._layerOrderChanged||0===i)||!this.pauseablePlacement||this.pauseablePlacement.isDone()&&!this.placement.stillRecent(e.exported.now(),t.zoom))&&(this.pauseablePlacement=new Ve(t,this.terrain,this._order,o,r,i,n,this.placement),this._layerOrderChanged=!1),this.pauseablePlacement.isDone()?this.placement.setStale():(this.pauseablePlacement.continuePlacement(this._order,this._layers,l),this.pauseablePlacement.isDone()&&(this.placement=this.pauseablePlacement.commit(e.exported.now()),s=!0),a&&this.pauseablePlacement.placement.setStale()),s||a)for(const e of this._order){const t=this._layers[e];"symbol"===t.type&&this.placement.updateLayerOpacities(t,l[t.source])}return!this.pauseablePlacement.isDone()||this.placement.hasTransitions(e.exported.now())}_releaseSymbolFadeTiles(){for(const e in this.sourceCaches)this.sourceCaches[e].releaseSymbolFadeTiles()}getImages(e,t,r){this.imageManager.getImages(t.icons,r),this._updateTilesForChangedImages();const i=this.sourceCaches[t.source];i&&i.setDependencies(t.tileID.key,t.type,t.icons)}getGlyphs(e,t,r){this.glyphManager.getGlyphs(t.stacks,r)}getResource(t,r,i){return e.makeRequest(r,i)}}tt.getSourceType=function(e){return z[e]},tt.setSourceType=function(e,t){z[e]=t},tt.registerForPluginStateChange=e.registerForPluginStateChange;var rt="attribute vec2 a_pos;uniform mat4 u_matrix;varying vec2 v_texture_pos;varying float v_depth;void main() {v_texture_pos=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),1.0);v_depth=gl_Position.z/gl_Position.w;}";const it={prelude:nt("#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;}\n#ifdef TERRAIN3D\nuniform sampler2D u_terrain;uniform float u_terrain_dim;uniform mat4 u_terrain_matrix;uniform vec4 u_terrain_unpack;uniform float u_terrain_offset;uniform float u_terrain_exaggeration;uniform highp sampler2D u_depth;\n#endif\nconst highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitShifts=vec4(1.)/bitSh;highp float unpack(highp vec4 color) {return dot(color,bitShifts);}highp float depthOpacity(vec3 frag) {\n#ifdef TERRAIN3D\nhighp float d=unpack(texture2D(u_depth,frag.xy*0.5+0.5))+0.0001-frag.z;return 1.0-max(0.0,min(1.0,-d*500.0));\n#else\nreturn 1.0;\n#endif\n}float calculate_visibility(vec4 pos) {\n#ifdef TERRAIN3D\nvec3 frag=pos.xyz/pos.w;highp float d=depthOpacity(frag);if (d > 0.95) return 1.0;return (d+depthOpacity(frag+vec3(0.0,0.01,0.0)))/2.0;\n#else\nreturn 1.0;\n#endif\n}float ele(vec2 pos) {\n#ifdef TERRAIN3D\nvec4 rgb=(texture2D(u_terrain,pos)*255.0)*u_terrain_unpack;return rgb.r+rgb.g+rgb.b-u_terrain_unpack.a;\n#else\nreturn 0.0;\n#endif\n}float get_elevation(vec2 pos) {\n#ifdef TERRAIN3D\nvec2 coord=(u_terrain_matrix*vec4(pos,0.0,1.0)).xy*u_terrain_dim+1.0;vec2 f=fract(coord);vec2 c=(floor(coord)+0.5)/(u_terrain_dim+2.0);float d=1.0/(u_terrain_dim+2.0);float tl=ele(c);float tr=ele(c+vec2(d,0.0));float bl=ele(c+vec2(0.0,d));float br=ele(c+vec2(d,d));float elevation=mix(mix(tl,tr,f.x),mix(bl,br,f.x),f.y);return (elevation+u_terrain_offset)*u_terrain_exaggeration;\n#else\nreturn 0.0;\n#endif\n}"),background:nt("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);}"),backgroundPattern:nt("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\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);}"),circle:nt("varying vec3 v_data;varying float v_visibility;\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=v_visibility*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;varying float v_visibility;\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);float ele=get_elevation(circle_center);v_visibility=calculate_visibility(u_matrix*vec4(circle_center,ele,1.0));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,ele,1);} else {gl_Position=u_matrix*vec4(circle_center,ele,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);}"),clippingMask:nt("void main() {gl_FragColor=vec4(1.0);}","attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"),heatmap:nt("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;}"),heatmapTexture:nt("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\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;}"),collisionBox:nt("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}","attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,get_elevation(a_pos),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;}"),collisionCircle:nt("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}","attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"),debug:nt("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}","attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,get_elevation(a_pos),1);}"),fill:nt("#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);}"),fillOutline:nt("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;}"),fillOutlinePattern:nt("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\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;}"),fillPattern:nt("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform 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);}"),fillExtrusion:nt("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;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying 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;\n#ifdef TERRAIN3D\nfloat baseDelta=10.0;float ele=get_elevation(a_centroid);\n#else\nfloat baseDelta=0.0;float ele=0.0;\n#endif\nbase=max(0.0,ele+base-baseDelta);height=max(0.0,ele+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;}"),fillExtrusionPattern:nt("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\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;\n#ifdef TERRAIN3D\nattribute vec2 a_centroid;\n#endif\nvarying 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;\n#ifdef TERRAIN3D\nfloat baseDelta=10.0;float ele=get_elevation(a_centroid);\n#else\nfloat baseDelta=0.0;float ele=0.0;\n#endif\nbase=max(0.0,ele+base-baseDelta);height=max(0.0,ele+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;}"),hillshadePrepare:nt("#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;}"),hillshade:nt("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\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;}"),line:nt("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;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_width2=vec2(outset,inset);}"),lineGradient:nt("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\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;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_width2=vec2(outset,inset);}"),linePattern:nt("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform 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;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"),lineSDF:nt("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\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;\n#ifdef TERRAIN3D\nv_gamma_scale=1.0;\n#else\nfloat 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;\n#endif\nv_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);}"),raster:nt("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\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;}"),symbolIcon:nt("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;float ele=get_elevation(a_pos);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,ele,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),ele,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,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;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),z,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;float visibility=calculate_visibility(projectedPoint);v_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));}"),symbolSDF:nt("#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;float ele=get_elevation(a_pos);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,ele,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),ele,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,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"),symbolTextAndIcon:nt("#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;float ele=get_elevation(a_pos);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,ele,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),ele,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,ele,1.0);float z=float(u_pitch_with_map)*projected_pos.z/projected_pos.w;gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),z,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float visibility=calculate_visibility(projectedPoint);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(visibility,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);}"),terrain:nt("uniform sampler2D u_texture;varying vec2 v_texture_pos;void main() {gl_FragColor=texture2D(u_texture,v_texture_pos);}",rt),terrainDepth:nt("varying float v_depth;const highp vec4 bitSh=vec4(256.*256.*256.,256.*256.,256.,1.);const highp vec4 bitMsk=vec4(0.,vec3(1./256.0));highp vec4 pack(highp float value) {highp vec4 comp=fract(value*bitSh);comp-=comp.xxyz*bitMsk;return comp;}void main() {gl_FragColor=pack(v_depth);}",rt),terrainCoords:nt("precision mediump float;uniform sampler2D u_texture;uniform float u_terrain_coords_id;varying vec2 v_texture_pos;void main() {vec4 rgba=texture2D(u_texture,v_texture_pos);gl_FragColor=vec4(rgba.r,rgba.g,rgba.b,u_terrain_coords_id);}",rt)};function nt(e,t){const r=/#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g,i=t.match(/attribute ([\w]+) ([\w]+)/g),n=e.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),o=t.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g),a=o?o.concat(n):n,s={};return{fragmentSource:e=e.replace(r,((e,t,r,i,n)=>(s[n]=!0,"define"===t?`\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:t=t.replace(r,((e,t,r,i,n)=>{const o="float"===i?"vec2":"vec4",a=n.match(/color/)?"color":o;return s[n]?"define"===t?`\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"===a?`\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_${a}(a_${n}, u_${n}_t);\n#else\n ${r} ${i} ${n} = u_${n};\n#endif\n`:"define"===t?`\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"===a?`\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_${a}(a_${n}, u_${n}_t);\n#else\n ${r} ${i} ${n} = u_${n};\n#endif\n`})),staticAttributes:i,staticUniforms:a}}class ot{constructor(){this.boundProgram=null,this.boundLayoutVertexBuffer=null,this.boundPaintVertexBuffers=[],this.boundIndexBuffer=null,this.boundVertexOffset=null,this.boundDynamicVertexBuffer=null,this.vao=null}bind(e,t,r,i,n,o,a,s,l){this.context=e;let c=this.boundPaintVertexBuffers.length!==i.length;for(let e=0;!c&&e<i.length;e++)this.boundPaintVertexBuffers[e]!==i[e]&&(c=!0);e.extVertexArrayObject&&this.vao&&this.boundProgram===t&&this.boundLayoutVertexBuffer===r&&!c&&this.boundIndexBuffer===n&&this.boundVertexOffset===o&&this.boundDynamicVertexBuffer===a&&this.boundDynamicVertexBuffer2===s&&this.boundDynamicVertexBuffer3===l?(e.bindVertexArrayOES.set(this.vao),a&&a.bind(),n&&n.dynamicDraw&&n.bind(),s&&s.bind(),l&&l.bind()):this.freshBind(t,r,i,n,o,a,s,l)}freshBind(e,t,r,i,n,o,a,s){let l;const c=e.numAttributes,u=this.context,h=u.gl;if(u.extVertexArrayObject)this.vao&&this.destroy(),this.vao=u.extVertexArrayObject.createVertexArrayOES(),u.bindVertexArrayOES.set(this.vao),l=0,this.boundProgram=e,this.boundLayoutVertexBuffer=t,this.boundPaintVertexBuffers=r,this.boundIndexBuffer=i,this.boundVertexOffset=n,this.boundDynamicVertexBuffer=o,this.boundDynamicVertexBuffer2=a,this.boundDynamicVertexBuffer3=s;else{l=u.currentNumAttributes||0;for(let e=c;e<l;e++)h.disableVertexAttribArray(e)}t.enableAttributes(h,e);for(const t of r)t.enableAttributes(h,e);o&&o.enableAttributes(h,e),a&&a.enableAttributes(h,e),s&&s.enableAttributes(h,e),t.bind(),t.setVertexAttribPointers(h,e,n);for(const t of r)t.bind(),t.setVertexAttribPointers(h,e,n);o&&(o.bind(),o.setVertexAttribPointers(h,e,n)),i&&i.bind(),a&&(a.bind(),a.setVertexAttribPointers(h,e,n)),s&&(s.bind(),s.setVertexAttribPointers(h,e,n)),u.currentNumAttributes=c}destroy(){this.vao&&(this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao),this.vao=null)}}function at(e){const t=[];for(let r=0;r<e.length;r++){if(null===e[r])continue;const i=e[r].split(" ");t.push(i.pop())}return t}class st{constructor(t,r,i,n,o,a,s){const l=t.gl;this.program=l.createProgram();const c=at(i.staticAttributes),u=n?n.getBinderAttributes():[],h=c.concat(u),p=it.prelude.staticUniforms?at(it.prelude.staticUniforms):[],d=i.staticUniforms?at(i.staticUniforms):[],f=n?n.getBinderUniforms():[],m=p.concat(d).concat(f),y=[];for(const e of m)y.indexOf(e)<0&&y.push(e);const g=n?n.defines():[];a&&g.push("#define OVERDRAW_INSPECTOR;"),s&&g.push("#define TERRAIN3D;");const _=g.concat(it.prelude.fragmentSource,i.fragmentSource).join("\n"),b=g.concat(it.prelude.vertexSource,i.vertexSource).join("\n"),v=l.createShader(l.FRAGMENT_SHADER);if(l.isContextLost())return void(this.failedToCreate=!0);l.shaderSource(v,_),l.compileShader(v),l.attachShader(this.program,v);const x=l.createShader(l.VERTEX_SHADER);if(l.isContextLost())return void(this.failedToCreate=!0);l.shaderSource(x,b),l.compileShader(x),l.attachShader(this.program,x),this.attributes={};const w={};this.numAttributes=h.length;for(let e=0;e<this.numAttributes;e++)h[e]&&(l.bindAttribLocation(this.program,e,h[e]),this.attributes[h[e]]=e);l.linkProgram(this.program),l.deleteShader(x),l.deleteShader(v);for(let e=0;e<y.length;e++){const t=y[e];if(t&&!w[t]){const e=l.getUniformLocation(this.program,t);e&&(w[t]=e)}}this.fixedUniforms=o(t,w),this.terrainUniforms=((t,r)=>({u_depth:new e.Uniform1i(t,r.u_depth),u_terrain:new e.Uniform1i(t,r.u_terrain),u_terrain_dim:new e.Uniform1f(t,r.u_terrain_dim),u_terrain_matrix:new e.UniformMatrix4f(t,r.u_terrain_matrix),u_terrain_unpack:new e.Uniform4f(t,r.u_terrain_unpack),u_terrain_offset:new e.Uniform1f(t,r.u_terrain_offset),u_terrain_exaggeration:new e.Uniform1f(t,r.u_terrain_exaggeration)}))(t,w),this.binderUniforms=n?n.getUniforms(t,w):[]}draw(e,t,r,i,n,o,a,s,l,c,u,h,p,d,f,m,y,g){const _=e.gl;if(this.failedToCreate)return;if(e.program.set(this.program),e.setDepthMode(r),e.setStencilMode(i),e.setColorMode(n),e.setCullFace(o),s){e.activeTexture.set(_.TEXTURE2),_.bindTexture(_.TEXTURE_2D,s.depthTexture),e.activeTexture.set(_.TEXTURE3),_.bindTexture(_.TEXTURE_2D,s.texture);for(const e in this.terrainUniforms)this.terrainUniforms[e].set(s[e])}for(const e in this.fixedUniforms)this.fixedUniforms[e].set(a[e]);f&&f.setUniforms(e,this.binderUniforms,p,{zoom:d});let b=0;switch(t){case _.LINES:b=2;break;case _.TRIANGLES:b=3;break;case _.LINE_STRIP:b=1}for(const r of h.get()){const i=r.vaos||(r.vaos={});(i[l]||(i[l]=new ot)).bind(e,this,c,f?f.getPaintVertexBuffers():[],u,r.vertexOffset,m,y,g),_.drawElements(t,r.primitiveLength*b,_.UNSIGNED_SHORT,r.primitiveOffset*b*2)}}}function lt(e,t,r){const i=1/xe(r,1,t.transform.tileZoom),n=Math.pow(2,r.tileID.overscaledZ),o=r.tileSize*Math.pow(2,t.transform.tileZoom)/n,a=o*(r.tileID.canonical.x+r.tileID.wrap*n),s=o*r.tileID.canonical.y;return{u_image:0,u_texsize:r.imageAtlasTexture.size,u_scale:[i,e.fromScale,e.toScale],u_fade:e.t,u_pixel_coord_upper:[a>>16,s>>16],u_pixel_coord_lower:[65535&a,65535&s]}}const ct=(t,r,i,n)=>{const o=r.style.light,a=o.properties.get("position"),s=[a.x,a.y,a.z],l=e.create$1();"viewport"===o.properties.get("anchor")&&e.fromRotation(l,-r.transform.angle),e.transformMat3(s,s,l);const c=o.properties.get("color");return{u_matrix:t,u_lightpos:s,u_lightintensity:o.properties.get("intensity"),u_lightcolor:[c.r,c.g,c.b],u_vertical_gradient:+i,u_opacity:n}},ut=(t,r,i,n,o,a,s)=>e.extend(ct(t,r,i,n),lt(a,r,s),{u_height_factor:-Math.pow(2,o.overscaledZ)/s.tileSize/8}),ht=e=>({u_matrix:e}),pt=(t,r,i,n)=>e.extend(ht(t),lt(i,r,n)),dt=(e,t)=>({u_matrix:e,u_world:t}),ft=(t,r,i,n,o)=>e.extend(pt(t,r,i,n),{u_world:o}),mt=(e,t,r,i)=>{const n=e.transform;let o,a;if("map"===i.paint.get("circle-pitch-alignment")){const e=xe(r,1,n.zoom);o=!0,a=[e,e]}else o=!1,a=n.pixelsToGLUnits;return{u_camera_to_center_distance:n.cameraToCenterDistance,u_scale_with_map:+("map"===i.paint.get("circle-pitch-scale")),u_matrix:e.translatePosMatrix(t.posMatrix,r,i.paint.get("circle-translate"),i.paint.get("circle-translate-anchor")),u_pitch_with_map:+o,u_device_pixel_ratio:e.pixelRatio,u_extrude_scale:a}},yt=(e,t,r)=>{const i=xe(r,1,t.zoom),n=Math.pow(2,t.zoom-r.tileID.overscaledZ),o=r.tileID.overscaleFactor();return{u_matrix:e,u_camera_to_center_distance:t.cameraToCenterDistance,u_pixels_to_tile_units:i,u_extrude_scale:[t.pixelsToGLUnits[0]/(i*n),t.pixelsToGLUnits[1]/(i*n)],u_overscale_factor:o}},gt=(e,t,r=1)=>({u_matrix:e,u_color:t,u_overlay:0,u_overlay_scale:r}),_t=e=>({u_matrix:e}),bt=(e,t,r,i)=>({u_matrix:e,u_extrude_scale:xe(t,1,r),u_intensity:i});function vt(t,r){const i=Math.pow(2,r.canonical.z),n=r.canonical.y;return[new e.MercatorCoordinate(0,n/i).toLngLat().lat,new e.MercatorCoordinate(0,(n+1)/i).toLngLat().lat]}const xt=(e,t,r,i)=>{const n=e.transform;return{u_matrix:kt(e,t,r,i),u_ratio:1/xe(t,1,n.zoom),u_device_pixel_ratio:e.pixelRatio,u_units_to_pixels:[1/n.pixelsToGLUnits[0],1/n.pixelsToGLUnits[1]]}},wt=(t,r,i,n,o)=>e.extend(xt(t,r,i,o),{u_image:0,u_image_height:n}),St=(e,t,r,i,n)=>{const o=e.transform,a=Tt(t,o);return{u_matrix:kt(e,t,r,n),u_texsize:t.imageAtlasTexture.size,u_ratio:1/xe(t,1,o.zoom),u_device_pixel_ratio:e.pixelRatio,u_image:0,u_scale:[a,i.fromScale,i.toScale],u_fade:i.t,u_units_to_pixels:[1/o.pixelsToGLUnits[0],1/o.pixelsToGLUnits[1]]}},Et=(t,r,i,n,o,a)=>{const s=t.lineAtlas,l=Tt(r,t.transform),c="round"===i.layout.get("line-cap"),u=s.getDash(n.from,c),h=s.getDash(n.to,c),p=u.width*o.fromScale,d=h.width*o.toScale;return e.extend(xt(t,r,i,a),{u_patternscale_a:[l/p,-u.height/2],u_patternscale_b:[l/d,-h.height/2],u_sdfgamma:s.width/(256*Math.min(p,d)*t.pixelRatio)/2,u_image:0,u_tex_y_a:u.y,u_tex_y_b:h.y,u_mix:o.t})};function Tt(e,t){return 1/xe(e,1,t.tileZoom)}function kt(e,t,r,i){return e.translatePosMatrix(i?i.posMatrix:t.tileID.posMatrix,t,r.paint.get("line-translate"),r.paint.get("line-translate-anchor"))}const At=(e,t,r,i,n)=>{return{u_matrix:e,u_tl_parent:t,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:(a=n.paint.get("raster-saturation"),a>0?1-1/(1.001-a):-a),u_contrast_factor:(o=n.paint.get("raster-contrast"),o>0?1/(1-o):1+o),u_spin_weights:It(n.paint.get("raster-hue-rotate"))};var o,a};function It(e){e*=Math.PI/180;const t=Math.sin(e),r=Math.cos(e);return[(2*r+1)/3,(-Math.sqrt(3)*t-r+1)/3,(Math.sqrt(3)*t-r+1)/3]}const Pt=(e,t,r,i,n,o,a,s,l,c)=>{const u=n.transform;return{u_is_size_zoom_constant:+("constant"===e||"source"===e),u_is_size_feature_constant:+("constant"===e||"camera"===e),u_size_t:t?t.uSizeT:0,u_size:t?t.uSize:0,u_camera_to_center_distance:u.cameraToCenterDistance,u_pitch:u.pitch/360*2*Math.PI,u_rotate_symbol:+r,u_aspect_ratio:u.width/u.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:+l,u_pitch_with_map:+i,u_texsize:c,u_texture:0}},Ct=(t,r,i,n,o,a,s,l,c,u,h)=>{const p=o.transform;return e.extend(Pt(t,r,i,n,o,a,s,l,c,u),{u_gamma_scale:n?Math.cos(p._pitch)*p.cameraToCenterDistance:1,u_device_pixel_ratio:o.pixelRatio,u_is_halo:+h})},zt=(t,r,i,n,o,a,s,l,c,u)=>e.extend(Ct(t,r,i,n,o,a,s,l,!0,c,!0),{u_texsize_icon:u,u_texture_icon:1}),Mt=(e,t,r)=>({u_matrix:e,u_opacity:t,u_color:r}),Ot=(t,r,i,n,o,a)=>e.extend(function(e,t,r,i){const n=r.imageManager.getPattern(e.from.toString()),o=r.imageManager.getPattern(e.to.toString()),{width:a,height:s}=r.imageManager.getPixelSize(),l=Math.pow(2,i.tileID.overscaledZ),c=i.tileSize*Math.pow(2,r.transform.tileZoom)/l,u=c*(i.tileID.canonical.x+i.tileID.wrap*l),h=c*i.tileID.canonical.y;return{u_image:0,u_pattern_tl_a:n.tl,u_pattern_br_a:n.br,u_pattern_tl_b:o.tl,u_pattern_br_b:o.br,u_texsize:[a,s],u_mix:t.t,u_pattern_size_a:n.displaySize,u_pattern_size_b:o.displaySize,u_scale_a:t.fromScale,u_scale_b:t.toScale,u_tile_units_to_pixels:1/xe(i,1,r.transform.tileZoom),u_pixel_coord_upper:[u>>16,h>>16],u_pixel_coord_lower:[65535&u,65535&h]}}(n,a,i,o),{u_matrix:t,u_opacity:r}),Dt={fillExtrusion:(t,r)=>({u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_lightpos:new e.Uniform3f(t,r.u_lightpos),u_lightintensity:new e.Uniform1f(t,r.u_lightintensity),u_lightcolor:new e.Uniform3f(t,r.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,r.u_vertical_gradient),u_opacity:new e.Uniform1f(t,r.u_opacity)}),fillExtrusionPattern:(t,r)=>({u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_lightpos:new e.Uniform3f(t,r.u_lightpos),u_lightintensity:new e.Uniform1f(t,r.u_lightintensity),u_lightcolor:new e.Uniform3f(t,r.u_lightcolor),u_vertical_gradient:new e.Uniform1f(t,r.u_vertical_gradient),u_height_factor:new e.Uniform1f(t,r.u_height_factor),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade),u_opacity:new e.Uniform1f(t,r.u_opacity)}),fill:(t,r)=>({u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}),fillPattern:(t,r)=>({u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}),fillOutline:(t,r)=>({u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world)}),fillOutlinePattern:(t,r)=>({u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world),u_image:new e.Uniform1i(t,r.u_image),u_texsize:new e.Uniform2f(t,r.u_texsize),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}),circle:(t,r)=>({u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_scale_with_map:new e.Uniform1i(t,r.u_scale_with_map),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_extrude_scale:new e.Uniform2f(t,r.u_extrude_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}),collisionBox:(t,r)=>({u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pixels_to_tile_units:new e.Uniform1f(t,r.u_pixels_to_tile_units),u_extrude_scale:new e.Uniform2f(t,r.u_extrude_scale),u_overscale_factor:new e.Uniform1f(t,r.u_overscale_factor)}),collisionCircle:(t,r)=>({u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_inv_matrix:new e.UniformMatrix4f(t,r.u_inv_matrix),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_viewport_size:new e.Uniform2f(t,r.u_viewport_size)}),debug:(t,r)=>({u_color:new e.UniformColor(t,r.u_color),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_overlay:new e.Uniform1i(t,r.u_overlay),u_overlay_scale:new e.Uniform1f(t,r.u_overlay_scale)}),clippingMask:(t,r)=>({u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}),heatmap:(t,r)=>({u_extrude_scale:new e.Uniform1f(t,r.u_extrude_scale),u_intensity:new e.Uniform1f(t,r.u_intensity),u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}),heatmapTexture:(t,r)=>({u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_world:new e.Uniform2f(t,r.u_world),u_image:new e.Uniform1i(t,r.u_image),u_color_ramp:new e.Uniform1i(t,r.u_color_ramp),u_opacity:new e.Uniform1f(t,r.u_opacity)}),hillshade:(t,r)=>({u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_latrange:new e.Uniform2f(t,r.u_latrange),u_light:new e.Uniform2f(t,r.u_light),u_shadow:new e.UniformColor(t,r.u_shadow),u_highlight:new e.UniformColor(t,r.u_highlight),u_accent:new e.UniformColor(t,r.u_accent)}),hillshadePrepare:(t,r)=>({u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_image:new e.Uniform1i(t,r.u_image),u_dimension:new e.Uniform2f(t,r.u_dimension),u_zoom:new e.Uniform1f(t,r.u_zoom),u_unpack:new e.Uniform4f(t,r.u_unpack)}),line:(t,r)=>({u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels)}),lineGradient:(t,r)=>({u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_image:new e.Uniform1i(t,r.u_image),u_image_height:new e.Uniform1f(t,r.u_image_height)}),linePattern:(t,r)=>({u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_texsize:new e.Uniform2f(t,r.u_texsize),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_image:new e.Uniform1i(t,r.u_image),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_scale:new e.Uniform3f(t,r.u_scale),u_fade:new e.Uniform1f(t,r.u_fade)}),lineSDF:(t,r)=>({u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_ratio:new e.Uniform1f(t,r.u_ratio),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_units_to_pixels:new e.Uniform2f(t,r.u_units_to_pixels),u_patternscale_a:new e.Uniform2f(t,r.u_patternscale_a),u_patternscale_b:new e.Uniform2f(t,r.u_patternscale_b),u_sdfgamma:new e.Uniform1f(t,r.u_sdfgamma),u_image:new e.Uniform1i(t,r.u_image),u_tex_y_a:new e.Uniform1f(t,r.u_tex_y_a),u_tex_y_b:new e.Uniform1f(t,r.u_tex_y_b),u_mix:new e.Uniform1f(t,r.u_mix)}),raster:(t,r)=>({u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_tl_parent:new e.Uniform2f(t,r.u_tl_parent),u_scale_parent:new e.Uniform1f(t,r.u_scale_parent),u_buffer_scale:new e.Uniform1f(t,r.u_buffer_scale),u_fade_t:new e.Uniform1f(t,r.u_fade_t),u_opacity:new e.Uniform1f(t,r.u_opacity),u_image0:new e.Uniform1i(t,r.u_image0),u_image1:new e.Uniform1i(t,r.u_image1),u_brightness_low:new e.Uniform1f(t,r.u_brightness_low),u_brightness_high:new e.Uniform1f(t,r.u_brightness_high),u_saturation_factor:new e.Uniform1f(t,r.u_saturation_factor),u_contrast_factor:new e.Uniform1f(t,r.u_contrast_factor),u_spin_weights:new e.Uniform3f(t,r.u_spin_weights)}),symbolIcon:(t,r)=>({u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texture:new e.Uniform1i(t,r.u_texture)}),symbolSDF:(t,r)=>({u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texture:new e.Uniform1i(t,r.u_texture),u_gamma_scale:new e.Uniform1f(t,r.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,r.u_is_halo)}),symbolTextAndIcon:(t,r)=>({u_is_size_zoom_constant:new e.Uniform1i(t,r.u_is_size_zoom_constant),u_is_size_feature_constant:new e.Uniform1i(t,r.u_is_size_feature_constant),u_size_t:new e.Uniform1f(t,r.u_size_t),u_size:new e.Uniform1f(t,r.u_size),u_camera_to_center_distance:new e.Uniform1f(t,r.u_camera_to_center_distance),u_pitch:new e.Uniform1f(t,r.u_pitch),u_rotate_symbol:new e.Uniform1i(t,r.u_rotate_symbol),u_aspect_ratio:new e.Uniform1f(t,r.u_aspect_ratio),u_fade_change:new e.Uniform1f(t,r.u_fade_change),u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_label_plane_matrix:new e.UniformMatrix4f(t,r.u_label_plane_matrix),u_coord_matrix:new e.UniformMatrix4f(t,r.u_coord_matrix),u_is_text:new e.Uniform1i(t,r.u_is_text),u_pitch_with_map:new e.Uniform1i(t,r.u_pitch_with_map),u_texsize:new e.Uniform2f(t,r.u_texsize),u_texsize_icon:new e.Uniform2f(t,r.u_texsize_icon),u_texture:new e.Uniform1i(t,r.u_texture),u_texture_icon:new e.Uniform1i(t,r.u_texture_icon),u_gamma_scale:new e.Uniform1f(t,r.u_gamma_scale),u_device_pixel_ratio:new e.Uniform1f(t,r.u_device_pixel_ratio),u_is_halo:new e.Uniform1i(t,r.u_is_halo)}),background:(t,r)=>({u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_opacity:new e.Uniform1f(t,r.u_opacity),u_color:new e.UniformColor(t,r.u_color)}),backgroundPattern:(t,r)=>({u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_opacity:new e.Uniform1f(t,r.u_opacity),u_image:new e.Uniform1i(t,r.u_image),u_pattern_tl_a:new e.Uniform2f(t,r.u_pattern_tl_a),u_pattern_br_a:new e.Uniform2f(t,r.u_pattern_br_a),u_pattern_tl_b:new e.Uniform2f(t,r.u_pattern_tl_b),u_pattern_br_b:new e.Uniform2f(t,r.u_pattern_br_b),u_texsize:new e.Uniform2f(t,r.u_texsize),u_mix:new e.Uniform1f(t,r.u_mix),u_pattern_size_a:new e.Uniform2f(t,r.u_pattern_size_a),u_pattern_size_b:new e.Uniform2f(t,r.u_pattern_size_b),u_scale_a:new e.Uniform1f(t,r.u_scale_a),u_scale_b:new e.Uniform1f(t,r.u_scale_b),u_pixel_coord_upper:new e.Uniform2f(t,r.u_pixel_coord_upper),u_pixel_coord_lower:new e.Uniform2f(t,r.u_pixel_coord_lower),u_tile_units_to_pixels:new e.Uniform1f(t,r.u_tile_units_to_pixels)}),terrain:(t,r)=>({u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_texture:new e.Uniform1i(t,r.u_texture)}),terrainDepth:(t,r)=>({u_matrix:new e.UniformMatrix4f(t,r.u_matrix)}),terrainCoords:(t,r)=>({u_matrix:new e.UniformMatrix4f(t,r.u_matrix),u_texture:new e.Uniform1i(t,r.u_texture),u_terrain_coords_id:new e.Uniform1f(t,r.u_terrain_coords_id)})};class Lt{constructor(e,t,r){this.context=e;const i=e.gl;this.buffer=i.createBuffer(),this.dynamicDraw=Boolean(r),this.context.unbindVAO(),e.bindElementBuffer.set(this.buffer),i.bufferData(i.ELEMENT_ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?i.DYNAMIC_DRAW:i.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer}bind(){this.context.bindElementBuffer.set(this.buffer)}updateData(e){const t=this.context.gl;if(!this.dynamicDraw)throw new Error("Attempted to update data while not in dynamic mode.");this.context.unbindVAO(),this.bind(),t.bufferSubData(t.ELEMENT_ARRAY_BUFFER,0,e.arrayBuffer)}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}const jt={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"};class Rt{constructor(e,t,r,i){this.length=t.length,this.attributes=r,this.itemSize=t.bytesPerElement,this.dynamicDraw=i,this.context=e;const n=e.gl;this.buffer=n.createBuffer(),e.bindVertexBuffer.set(this.buffer),n.bufferData(n.ARRAY_BUFFER,t.arrayBuffer,this.dynamicDraw?n.DYNAMIC_DRAW:n.STATIC_DRAW),this.dynamicDraw||delete t.arrayBuffer}bind(){this.context.bindVertexBuffer.set(this.buffer)}updateData(e){if(e.length!==this.length)throw new Error(`Length of new data is ${e.length}, which doesn't match current length of ${this.length}`);const t=this.context.gl;this.bind(),t.bufferSubData(t.ARRAY_BUFFER,0,e.arrayBuffer)}enableAttributes(e,t){for(let r=0;r<this.attributes.length;r++){const i=t.attributes[this.attributes[r].name];void 0!==i&&e.enableVertexAttribArray(i)}}setVertexAttribPointers(e,t,r){for(let i=0;i<this.attributes.length;i++){const n=this.attributes[i],o=t.attributes[n.name];void 0!==o&&e.vertexAttribPointer(o,n.components,e[jt[n.type]],!1,this.itemSize,n.offset+this.itemSize*(r||0))}}destroy(){this.buffer&&(this.context.gl.deleteBuffer(this.buffer),delete this.buffer)}}class Bt{constructor(e){this.gl=e.gl,this.default=this.getDefault(),this.current=this.default,this.dirty=!1}get(){return this.current}set(e){}getDefault(){return this.default}setDefault(){this.set(this.default)}}class Ft extends Bt{getDefault(){return e.Color.transparent}set(e){const t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.clearColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class Nt extends Bt{getDefault(){return 1}set(e){(e!==this.current||this.dirty)&&(this.gl.clearDepth(e),this.current=e,this.dirty=!1)}}class Ut extends Bt{getDefault(){return 0}set(e){(e!==this.current||this.dirty)&&(this.gl.clearStencil(e),this.current=e,this.dirty=!1)}}class Vt extends Bt{getDefault(){return[!0,!0,!0,!0]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.colorMask(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class qt extends Bt{getDefault(){return!0}set(e){(e!==this.current||this.dirty)&&(this.gl.depthMask(e),this.current=e,this.dirty=!1)}}class $t extends Bt{getDefault(){return 255}set(e){(e!==this.current||this.dirty)&&(this.gl.stencilMask(e),this.current=e,this.dirty=!1)}}class Gt extends Bt{getDefault(){return{func:this.gl.ALWAYS,ref:0,mask:255}}set(e){const t=this.current;(e.func!==t.func||e.ref!==t.ref||e.mask!==t.mask||this.dirty)&&(this.gl.stencilFunc(e.func,e.ref,e.mask),this.current=e,this.dirty=!1)}}class Zt extends Bt{getDefault(){const e=this.gl;return[e.KEEP,e.KEEP,e.KEEP]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||this.dirty)&&(this.gl.stencilOp(e[0],e[1],e[2]),this.current=e,this.dirty=!1)}}class Wt extends Bt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.STENCIL_TEST):t.disable(t.STENCIL_TEST),this.current=e,this.dirty=!1}}class Xt extends Bt{getDefault(){return[0,1]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.depthRange(e[0],e[1]),this.current=e,this.dirty=!1)}}class Kt extends Bt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.DEPTH_TEST):t.disable(t.DEPTH_TEST),this.current=e,this.dirty=!1}}class Ht extends Bt{getDefault(){return this.gl.LESS}set(e){(e!==this.current||this.dirty)&&(this.gl.depthFunc(e),this.current=e,this.dirty=!1)}}class Jt extends Bt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.BLEND):t.disable(t.BLEND),this.current=e,this.dirty=!1}}class Yt extends Bt{getDefault(){const e=this.gl;return[e.ONE,e.ZERO]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||this.dirty)&&(this.gl.blendFunc(e[0],e[1]),this.current=e,this.dirty=!1)}}class Qt extends Bt{getDefault(){return e.Color.transparent}set(e){const t=this.current;(e.r!==t.r||e.g!==t.g||e.b!==t.b||e.a!==t.a||this.dirty)&&(this.gl.blendColor(e.r,e.g,e.b,e.a),this.current=e,this.dirty=!1)}}class er extends Bt{getDefault(){return this.gl.FUNC_ADD}set(e){(e!==this.current||this.dirty)&&(this.gl.blendEquation(e),this.current=e,this.dirty=!1)}}class tr extends Bt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;e?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),this.current=e,this.dirty=!1}}class rr extends Bt{getDefault(){return this.gl.BACK}set(e){(e!==this.current||this.dirty)&&(this.gl.cullFace(e),this.current=e,this.dirty=!1)}}class ir extends Bt{getDefault(){return this.gl.CCW}set(e){(e!==this.current||this.dirty)&&(this.gl.frontFace(e),this.current=e,this.dirty=!1)}}class nr extends Bt{getDefault(){return null}set(e){(e!==this.current||this.dirty)&&(this.gl.useProgram(e),this.current=e,this.dirty=!1)}}class or extends Bt{getDefault(){return this.gl.TEXTURE0}set(e){(e!==this.current||this.dirty)&&(this.gl.activeTexture(e),this.current=e,this.dirty=!1)}}class ar extends Bt{getDefault(){const e=this.gl;return[0,0,e.drawingBufferWidth,e.drawingBufferHeight]}set(e){const t=this.current;(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]||e[3]!==t[3]||this.dirty)&&(this.gl.viewport(e[0],e[1],e[2],e[3]),this.current=e,this.dirty=!1)}}class sr extends Bt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindFramebuffer(t.FRAMEBUFFER,e),this.current=e,this.dirty=!1}}class lr extends Bt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindRenderbuffer(t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class cr extends Bt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindTexture(t.TEXTURE_2D,e),this.current=e,this.dirty=!1}}class ur extends Bt{getDefault(){return null}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.bindBuffer(t.ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class hr extends Bt{getDefault(){return null}set(e){const t=this.gl;t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e),this.current=e,this.dirty=!1}}class pr extends Bt{constructor(e){super(e),this.vao=e.extVertexArrayObject}getDefault(){return null}set(e){this.vao&&(e!==this.current||this.dirty)&&(this.vao.bindVertexArrayOES(e),this.current=e,this.dirty=!1)}}class dr extends Bt{getDefault(){return 4}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,e),this.current=e,this.dirty=!1}}class fr extends Bt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e),this.current=e,this.dirty=!1}}class mr extends Bt{getDefault(){return!1}set(e){if(e===this.current&&!this.dirty)return;const t=this.gl;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,e),this.current=e,this.dirty=!1}}class yr extends Bt{constructor(e,t){super(e),this.context=e,this.parent=t}getDefault(){return null}}class gr extends yr{setDirty(){this.dirty=!0}set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),this.current=e,this.dirty=!1}}class _r extends yr{set(e){if(e===this.current&&!this.dirty)return;this.context.bindFramebuffer.set(this.parent);const t=this.gl;t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,e),this.current=e,this.dirty=!1}}class br{constructor(e,t,r,i){this.context=e,this.width=t,this.height=r;const n=e.gl,o=this.framebuffer=n.createFramebuffer();if(this.colorAttachment=new gr(e,o),i&&(this.depthAttachment=new _r(e,o)),n.checkFramebufferStatus(n.FRAMEBUFFER)!==n.FRAMEBUFFER_COMPLETE)throw new Error("Framebuffer is not complete")}destroy(){const e=this.context.gl,t=this.colorAttachment.get();if(t&&e.deleteTexture(t),this.depthAttachment){const t=this.depthAttachment.get();t&&e.deleteRenderbuffer(t)}e.deleteFramebuffer(this.framebuffer)}}class vr{constructor(e,t,r){this.blendFunction=e,this.blendColor=t,this.mask=r}}vr.Replace=[1,0],vr.disabled=new vr(vr.Replace,e.Color.transparent,[!1,!1,!1,!1]),vr.unblended=new vr(vr.Replace,e.Color.transparent,[!0,!0,!0,!0]),vr.alphaBlended=new vr([1,771],e.Color.transparent,[!0,!0,!0,!0]);class xr{constructor(e){this.gl=e,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.clearColor=new Ft(this),this.clearDepth=new Nt(this),this.clearStencil=new Ut(this),this.colorMask=new Vt(this),this.depthMask=new qt(this),this.stencilMask=new $t(this),this.stencilFunc=new Gt(this),this.stencilOp=new Zt(this),this.stencilTest=new Wt(this),this.depthRange=new Xt(this),this.depthTest=new Kt(this),this.depthFunc=new Ht(this),this.blend=new Jt(this),this.blendFunc=new Yt(this),this.blendColor=new Qt(this),this.blendEquation=new er(this),this.cullFace=new tr(this),this.cullFaceSide=new rr(this),this.frontFace=new ir(this),this.program=new nr(this),this.activeTexture=new or(this),this.viewport=new ar(this),this.bindFramebuffer=new sr(this),this.bindRenderbuffer=new lr(this),this.bindTexture=new cr(this),this.bindVertexBuffer=new ur(this),this.bindElementBuffer=new hr(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new pr(this),this.pixelStoreUnpack=new dr(this),this.pixelStoreUnpackPremultiplyAlpha=new fr(this),this.pixelStoreUnpackFlipY=new mr(this),this.extTextureFilterAnisotropic=e.getExtension("EXT_texture_filter_anisotropic")||e.getExtension("MOZ_EXT_texture_filter_anisotropic")||e.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=e.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=e.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&(e.getExtension("OES_texture_half_float_linear"),this.extRenderToTextureHalfFloat=e.getExtension("EXT_color_buffer_half_float")),this.extTimerQuery=e.getExtension("EXT_disjoint_timer_query"),this.maxTextureSize=e.getParameter(e.MAX_TEXTURE_SIZE)}setDefault(){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()}setDirty(){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}createIndexBuffer(e,t){return new Lt(this,e,t)}createVertexBuffer(e,t,r){return new Rt(this,e,t,r)}createRenderbuffer(e,t,r){const i=this.gl,n=i.createRenderbuffer();return this.bindRenderbuffer.set(n),i.renderbufferStorage(i.RENDERBUFFER,e,t,r),this.bindRenderbuffer.set(null),n}createFramebuffer(e,t,r){return new br(this,e,t,r)}clear({color:e,depth:t}){const r=this.gl;let i=0;e&&(i|=r.COLOR_BUFFER_BIT,this.clearColor.set(e),this.colorMask.set([!0,!0,!0,!0])),void 0!==t&&(i|=r.DEPTH_BUFFER_BIT,this.depthRange.set([0,1]),this.clearDepth.set(t),this.depthMask.set(!0)),r.clear(i)}setCullFace(e){!1===e.enable?this.cullFace.set(!1):(this.cullFace.set(!0),this.cullFaceSide.set(e.mode),this.frontFace.set(e.frontFace))}setDepthMode(e){e.func!==this.gl.ALWAYS||e.mask?(this.depthTest.set(!0),this.depthFunc.set(e.func),this.depthMask.set(e.mask),this.depthRange.set(e.range)):this.depthTest.set(!1)}setStencilMode(e){e.test.func!==this.gl.ALWAYS||e.mask?(this.stencilTest.set(!0),this.stencilMask.set(e.mask),this.stencilOp.set([e.fail,e.depthFail,e.pass]),this.stencilFunc.set({func:e.test.func,ref:e.ref,mask:e.test.mask})):this.stencilTest.set(!1)}setColorMode(e){n(e.blendFunction,vr.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(e.blendFunction),this.blendColor.set(e.blendColor)),this.colorMask.set(e.mask)}unbindVAO(){this.extVertexArrayObject&&this.bindVertexArrayOES.set(null)}}class wr{constructor(e,t,r){this.func=e,this.mask=t,this.range=r}}wr.ReadOnly=!1,wr.ReadWrite=!0,wr.disabled=new wr(519,wr.ReadOnly,[0,1]);const Sr=7680;class Er{constructor(e,t,r,i,n,o){this.test=e,this.ref=t,this.mask=r,this.fail=i,this.depthFail=n,this.pass=o}}Er.disabled=new Er({func:519,mask:0},0,0,Sr,Sr,Sr);class Tr{constructor(e,t,r){this.enable=e,this.mode=t,this.frontFace=r}}let kr;function Ar(t,r,i,n,o,a,s){const l=t.context,c=l.gl,u=t.useProgram("collisionBox"),h=[];let p=0,d=0;for(let f=0;f<n.length;f++){const m=n[f],y=r.getTile(m),g=y.getBucket(i);if(!g)continue;let _=m.posMatrix;0===o[0]&&0===o[1]||(_=t.translatePosMatrix(m.posMatrix,y,o,a));const b=s?g.textCollisionBox:g.iconCollisionBox,v=g.collisionCircleArray;if(v.length>0){const r=e.create(),i=_;e.mul(r,g.placementInvProjMatrix,t.transform.glCoordMatrix),e.mul(r,r,g.placementViewportMatrix),h.push({circleArray:v,circleOffset:d,transform:i,invTransform:r,coord:m}),p+=v.length/4,d=p}b&&u.draw(l,c.LINES,wr.disabled,Er.disabled,t.colorModeForRenderPass(),Tr.disabled,yt(_,t.transform,y),t.style.terrain&&t.style.terrain.getTerrainData(m),i.id,b.layoutVertexBuffer,b.indexBuffer,b.segments,null,t.transform.zoom,null,null,b.collisionVertexBuffer)}if(!s||!h.length)return;const f=t.useProgram("collisionCircle"),m=new e.CollisionCircleLayoutArray;m.resize(4*p),m._trim();let y=0;for(const e of h)for(let t=0;t<e.circleArray.length/4;t++){const r=4*t,i=e.circleArray[r+0],n=e.circleArray[r+1],o=e.circleArray[r+2],a=e.circleArray[r+3];m.emplace(y++,i,n,o,a,0),m.emplace(y++,i,n,o,a,1),m.emplace(y++,i,n,o,a,2),m.emplace(y++,i,n,o,a,3)}(!kr||kr.length<2*p)&&(kr=function(t){const r=2*t,i=new e.QuadTriangleArray;i.resize(r),i._trim();for(let e=0;e<r;e++){const t=6*e;i.uint16[t+0]=4*e+0,i.uint16[t+1]=4*e+1,i.uint16[t+2]=4*e+2,i.uint16[t+3]=4*e+2,i.uint16[t+4]=4*e+3,i.uint16[t+5]=4*e+0}return i}(p));const g=l.createIndexBuffer(kr,!0),_=l.createVertexBuffer(m,e.collisionCircleLayout.members,!0);for(const r of h){const n={u_matrix:r.transform,u_inv_matrix:r.invTransform,u_camera_to_center_distance:(b=t.transform).cameraToCenterDistance,u_viewport_size:[b.width,b.height]};f.draw(l,c.TRIANGLES,wr.disabled,Er.disabled,t.colorModeForRenderPass(),Tr.disabled,n,t.style.terrain&&t.style.terrain.getTerrainData(r.coord),i.id,_,g,e.SegmentVector.simpleSegment(0,2*r.circleOffset,r.circleArray.length,r.circleArray.length/2),null,t.transform.zoom,null,null,null)}var b;_.destroy(),g.destroy()}Tr.disabled=new Tr(!1,1029,2305),Tr.backCCW=new Tr(!0,1029,2305);const Ir=e.identity(new Float32Array(16));function Pr(t,r,i,n,o,a){const{horizontalAlign:s,verticalAlign:l}=e.getAnchorAlignment(t),c=-(s-.5)*r,u=-(l-.5)*i,h=e.evaluateVariableOffset(t,n);return new e.pointGeometry((c/o+h[0])*a,(u/o+h[1])*a)}function Cr(t,r,i,n,o,a,s,l,c,u,h){const p=t.text.placedSymbolArray,d=t.text.dynamicLayoutVertexArray,f=t.icon.dynamicLayoutVertexArray,m={};d.clear();for(let f=0;f<p.length;f++){const y=p.get(f),g=t.allowVerticalPlacement&&!y.placedOrientation,_=y.hidden||!y.crossTileID||g?null:n[y.crossTileID];if(_){const n=new e.pointGeometry(y.anchorX,y.anchorY),p=se(n,i?s:a,h),f=le(o.cameraToCenterDistance,p.signedDistanceFromCamera);let g=e.evaluateSizeForFeature(t.textSizeData,c,y)*f/e.ONE_EM;i&&(g*=t.tilePixelRatio/l);const{width:b,height:v,anchor:x,textOffset:w,textBoxScale:S}=_,E=Pr(x,b,v,w,S,g),T=i?se(n.add(E),a,h).point:p.point.add(r?E.rotate(-o.angle):E),k=t.allowVerticalPlacement&&y.placedOrientation===e.WritingMode.vertical?Math.PI/2:0;for(let t=0;t<y.numGlyphs;t++)e.addDynamicAttributes(d,T,k);u&&y.associatedIconIndex>=0&&(m[y.associatedIconIndex]={shiftedAnchor:T,angle:k})}else ge(y.numGlyphs,d)}if(u){f.clear();const r=t.icon.placedSymbolArray;for(let t=0;t<r.length;t++){const i=r.get(t);if(i.hidden)ge(i.numGlyphs,f);else{const r=m[t];if(r)for(let t=0;t<i.numGlyphs;t++)e.addDynamicAttributes(f,r.shiftedAnchor,r.angle);else ge(i.numGlyphs,f)}}t.icon.dynamicLayoutVertexBuffer.updateData(f)}t.text.dynamicLayoutVertexBuffer.updateData(d)}function zr(e,t,r){return r.iconsInText&&t?"symbolTextAndIcon":e?"symbolSDF":"symbolIcon"}function Mr(t,r,i,n,o,a,s,l,c,u,h,p){const d=t.context,f=d.gl,m=t.transform,y="map"===l,g="map"===c,_="viewport"!==l&&"point"!==i.layout.get("symbol-placement"),b=y&&!g&&!_,v=!i.layout.get("symbol-sort-key").isConstant();let x=!1;const w=t.depthModeForSublayer(0,wr.ReadOnly),S=i.layout.get("text-variable-anchor"),E=[];for(const l of n){const n=r.getTile(l),c=n.getBucket(i);if(!c)continue;const h=o?c.text:c.icon;if(!h||!h.segments.get().length)continue;const p=h.programConfigurations.get(i.id),d=o||c.sdfIcons,w=o?c.textSizeData:c.iconSizeData,T=g||0!==m.pitch,k=t.useProgram(zr(d,o,c),p),A=e.evaluateSizeForZoom(w,m.zoom),I=t.style.terrain&&t.style.terrain.getTerrainData(l);let P,C,z,M,O=[0,0],D=null;if(o){if(C=n.glyphAtlasTexture,z=f.LINEAR,P=n.glyphAtlasTexture.size,c.iconsInText){O=n.imageAtlasTexture.size,D=n.imageAtlasTexture;const e="composite"===w.kind||"camera"===w.kind;M=T||t.options.rotating||t.options.zooming||e?f.LINEAR:f.NEAREST}}else{const e=1!==i.layout.get("icon-size").constantOr(0)||c.iconsNeedLinear;C=n.imageAtlasTexture,z=d||t.options.rotating||t.options.zooming||e||T?f.LINEAR:f.NEAREST,P=n.imageAtlasTexture.size}const L=xe(n,1,t.transform.zoom),j=oe(l.posMatrix,g,y,t.transform,L),R=ae(l.posMatrix,g,y,t.transform,L),B=S&&c.hasTextData(),F="none"!==i.layout.get("icon-text-fit")&&B&&c.hasIconData();if(_){const e=t.style.terrain?(e,r)=>t.style.terrain.getElevation(l,e,r):null,r="map"===i.layout.get("text-rotation-alignment");ue(c,l.posMatrix,t,o,j,R,g,u,r,e)}const N=t.translatePosMatrix(l.posMatrix,n,a,s),U=_||o&&S||F?Ir:j,V=t.translatePosMatrix(R,n,a,s,!0),q=d&&0!==i.paint.get(o?"text-halo-width":"icon-halo-width").constantOr(1);let $;$=d?c.iconsInText?zt(w.kind,A,b,g,t,N,U,V,P,O):Ct(w.kind,A,b,g,t,N,U,V,o,P,!0):Pt(w.kind,A,b,g,t,N,U,V,o,P);const G={program:k,buffers:h,uniformValues:$,atlasTexture:C,atlasTextureIcon:D,atlasInterpolation:z,atlasInterpolationIcon:M,isSDF:d,hasHalo:q};if(v&&c.canOverlap){x=!0;const t=h.segments.get();for(const r of t)E.push({segments:new e.SegmentVector([r]),sortKey:r.sortKey,state:G,terrainData:I})}else E.push({segments:h.segments,sortKey:0,state:G,terrainData:I})}x&&E.sort(((e,t)=>e.sortKey-t.sortKey));for(const e of E){const r=e.state;if(d.activeTexture.set(f.TEXTURE0),r.atlasTexture.bind(r.atlasInterpolation,f.CLAMP_TO_EDGE),r.atlasTextureIcon&&(d.activeTexture.set(f.TEXTURE1),r.atlasTextureIcon&&r.atlasTextureIcon.bind(r.atlasInterpolationIcon,f.CLAMP_TO_EDGE)),r.isSDF){const n=r.uniformValues;r.hasHalo&&(n.u_is_halo=1,Or(r.buffers,e.segments,i,t,r.program,w,h,p,n,e.terrainData)),n.u_is_halo=0}Or(r.buffers,e.segments,i,t,r.program,w,h,p,r.uniformValues,e.terrainData)}}function Or(e,t,r,i,n,o,a,s,l,c){const u=i.context;n.draw(u,u.gl.TRIANGLES,o,a,s,Tr.disabled,l,c,r.id,e.layoutVertexBuffer,e.indexBuffer,t,r.paint,i.transform.zoom,e.programConfigurations.get(r.id),e.dynamicLayoutVertexBuffer,e.opacityVertexBuffer)}function Dr(e,t,r,i,n,o,a){const s=e.context.gl,l=r.paint.get("fill-pattern"),c=l&&l.constantOr(1),u=r.getCrossfadeParameters();let h,p,d,f,m;a?(p=c&&!r.getPaintProperty("fill-outline-color")?"fillOutlinePattern":"fillOutline",h=s.LINES):(p=c?"fillPattern":"fill",h=s.TRIANGLES);for(const y of i){const i=t.getTile(y);if(c&&!i.patternsLoaded())continue;const g=i.getBucket(r);if(!g)continue;const _=g.programConfigurations.get(r.id),b=e.useProgram(p,_),v=e.style.terrain&&e.style.terrain.getTerrainData(y);c&&(e.context.activeTexture.set(s.TEXTURE0),i.imageAtlasTexture.bind(s.LINEAR,s.CLAMP_TO_EDGE),_.updatePaintBuffers(u));const x=l.constantOr(null);if(x&&i.imageAtlas){const e=i.imageAtlas,t=e.patternPositions[x.to.toString()],r=e.patternPositions[x.from.toString()];t&&r&&_.setConstantPatternPositions(t,r)}const w=v?y:null,S=e.translatePosMatrix(w?w.posMatrix:y.posMatrix,i,r.paint.get("fill-translate"),r.paint.get("fill-translate-anchor"));if(a){f=g.indexBuffer2,m=g.segments2;const t=[s.drawingBufferWidth,s.drawingBufferHeight];d="fillOutlinePattern"===p&&c?ft(S,e,u,i,t):dt(S,t)}else f=g.indexBuffer,m=g.segments,d=c?pt(S,e,u,i):ht(S);b.draw(e.context,h,n,e.stencilModeForClipping(y),o,Tr.disabled,d,v,r.id,g.layoutVertexBuffer,f,m,r.paint,e.transform.zoom,_)}}function Lr(e,t,r,i,n,o,a){const s=e.context,l=s.gl,c=r.paint.get("fill-extrusion-pattern"),u=c.constantOr(1),h=r.getCrossfadeParameters(),p=r.paint.get("fill-extrusion-opacity");for(const d of i){const i=t.getTile(d),f=i.getBucket(r);if(!f)continue;const m=e.style.terrain&&e.style.terrain.getTerrainData(d),y=f.programConfigurations.get(r.id),g=e.useProgram(u?"fillExtrusionPattern":"fillExtrusion",y);u&&(e.context.activeTexture.set(l.TEXTURE0),i.imageAtlasTexture.bind(l.LINEAR,l.CLAMP_TO_EDGE),y.updatePaintBuffers(h));const _=c.constantOr(null);if(_&&i.imageAtlas){const e=i.imageAtlas,t=e.patternPositions[_.to.toString()],r=e.patternPositions[_.from.toString()];t&&r&&y.setConstantPatternPositions(t,r)}const b=e.translatePosMatrix(d.posMatrix,i,r.paint.get("fill-extrusion-translate"),r.paint.get("fill-extrusion-translate-anchor")),v=r.paint.get("fill-extrusion-vertical-gradient"),x=u?ut(b,e,v,p,d,h,i):ct(b,e,v,p);g.draw(s,s.gl.TRIANGLES,n,o,a,Tr.backCCW,x,m,r.id,f.layoutVertexBuffer,f.indexBuffer,f.segments,r.paint,e.transform.zoom,y,e.style.terrain&&f.centroidVertexBuffer)}}function jr(e,t,r,i,n,o,a){const s=e.context,l=s.gl,c=r.fbo;if(!c)return;const u=e.useProgram("hillshade"),h=e.style.terrain&&e.style.terrain.getTerrainData(t);s.activeTexture.set(l.TEXTURE0),l.bindTexture(l.TEXTURE_2D,c.colorAttachment.get()),u.draw(s,l.TRIANGLES,n,o,a,Tr.disabled,((e,t,r,i)=>{const n=r.paint.get("hillshade-shadow-color"),o=r.paint.get("hillshade-highlight-color"),a=r.paint.get("hillshade-accent-color");let s=r.paint.get("hillshade-illumination-direction")*(Math.PI/180);"viewport"===r.paint.get("hillshade-illumination-anchor")&&(s-=e.transform.angle);const l=!e.options.moving;return{u_matrix:i?i.posMatrix:e.transform.calculatePosMatrix(t.tileID.toUnwrapped(),l),u_image:0,u_latrange:vt(0,t.tileID),u_light:[r.paint.get("hillshade-exaggeration"),s],u_shadow:n,u_highlight:o,u_accent:a}})(e,r,i,h?t:null),h,i.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}function Rr(t,r,i,n,o,a){const s=t.context,c=s.gl,u=r.dem;if(u&&u.data){const h=u.dim,p=u.stride,d=u.getPixels();if(s.activeTexture.set(c.TEXTURE1),s.pixelStoreUnpackPremultiplyAlpha.set(!1),r.demTexture=r.demTexture||t.getTileTexture(p),r.demTexture){const e=r.demTexture;e.update(d,{premultiply:!1}),e.bind(c.NEAREST,c.CLAMP_TO_EDGE)}else r.demTexture=new l(s,d,c.RGBA,{premultiply:!1}),r.demTexture.bind(c.NEAREST,c.CLAMP_TO_EDGE);s.activeTexture.set(c.TEXTURE0);let f=r.fbo;if(!f){const e=new l(s,{width:h,height:h,data:null},c.RGBA);e.bind(c.LINEAR,c.CLAMP_TO_EDGE),f=r.fbo=s.createFramebuffer(h,h,!0),f.colorAttachment.set(e.texture)}s.bindFramebuffer.set(f.framebuffer),s.viewport.set([0,0,h,h]),t.useProgram("hillshadePrepare").draw(s,c.TRIANGLES,n,o,a,Tr.disabled,((t,r)=>{const i=r.stride,n=e.create();return e.ortho(n,0,e.EXTENT,-e.EXTENT,0,0,1),e.translate(n,n,[0,-e.EXTENT,0]),{u_matrix:n,u_image:1,u_dimension:[i,i],u_zoom:t.overscaledZ,u_unpack:r.getUnpackVector()}})(r.tileID,u),null,i.id,t.rasterBoundsBuffer,t.quadTriangleIndexBuffer,t.rasterBoundsSegments),r.needsHillshadePrepare=!1}}function Br(t,r,i,n,o,a){const s=n.paint.get("raster-fade-duration");if(!a&&s>0){const n=e.exported.now(),a=(n-t.timeAdded)/s,l=r?(n-r.timeAdded)/s:-1,c=i.getSource(),u=o.coveringZoomLevel({tileSize:c.tileSize,roundZoom:c.roundZoom}),h=!r||Math.abs(r.tileID.overscaledZ-u)>Math.abs(t.tileID.overscaledZ-u),p=h&&t.refreshedUponExpiration?1:e.clamp(h?a:1-l,0,1);return t.refreshedUponExpiration&&a>=1&&(t.refreshedUponExpiration=!1),r?{opacity:1,mix:1-p}:{opacity:p,mix:0}}return{opacity:1,mix:0}}const Fr=new e.Color(1,0,0,1),Nr=new e.Color(0,1,0,1),Ur=new e.Color(0,0,1,1),Vr=new e.Color(1,0,1,1),qr=new e.Color(0,1,1,1);function $r(e,t,r,i){Zr(e,0,t+r/2,e.transform.width,r,i)}function Gr(e,t,r,i){Zr(e,t-r/2,0,r,e.transform.height,i)}function Zr(e,t,r,i,n,o){const a=e.context,s=a.gl;s.enable(s.SCISSOR_TEST),s.scissor(t*e.pixelRatio,r*e.pixelRatio,i*e.pixelRatio,n*e.pixelRatio),a.clear({color:o}),s.disable(s.SCISSOR_TEST)}function Wr(t,r,i){const n=t.context,o=n.gl,a=i.posMatrix,s=t.useProgram("debug"),l=wr.disabled,c=Er.disabled,u=t.colorModeForRenderPass(),h="$debug",p=t.style.terrain&&t.style.terrain.getTerrainData(i);n.activeTexture.set(o.TEXTURE0),t.emptyTexture.bind(o.LINEAR,o.CLAMP_TO_EDGE);const d=r.getTileByID(i.key).latestRawTileData,f=Math.floor((d&&d.byteLength||0)/1024),m=r.getTile(i).tileSize,y=512/Math.min(m,512)*(i.overscaledZ/t.transform.zoom)*.5;let g=i.canonical.toString();i.overscaledZ!==i.canonical.z&&(g+=` => ${i.overscaledZ}`),function(e,t){e.initDebugOverlayCanvas();const r=e.debugOverlayCanvas,i=e.context.gl,n=e.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(t,5,5),n.strokeText(t,5,5),e.debugOverlayTexture.update(r),e.debugOverlayTexture.bind(i.LINEAR,i.CLAMP_TO_EDGE)}(t,`${g} ${f}kB`),s.draw(n,o.TRIANGLES,l,c,vr.alphaBlended,Tr.disabled,gt(a,e.Color.transparent,y),null,h,t.debugBuffer,t.quadTriangleIndexBuffer,t.debugSegments),s.draw(n,o.LINE_STRIP,l,c,u,Tr.disabled,gt(a,e.Color.red),p,h,t.debugBuffer,t.tileBorderIndexBuffer,t.debugSegments)}function Xr(e,t,r){const i=e.context,n=i.gl,o=e.colorModeForRenderPass(),a=new wr(n.LEQUAL,wr.ReadWrite,e.depthRangeFor3D),s=e.useProgram("terrain"),l=t.getTerrainMesh(),c=t.getTerrainData(r.tileID);i.bindFramebuffer.set(null),i.viewport.set([0,0,e.width,e.height]),i.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,t.getRTTFramebuffer().colorAttachment.get());const u=e.transform.calculatePosMatrix(r.tileID.toUnwrapped());s.draw(i,n.TRIANGLES,a,Er.disabled,o,Tr.backCCW,{u_matrix:u,u_texture:0},c,"terrain",l.vertexBuffer,l.indexBuffer,l.segments)}function Kr(e,t,r,i){const n=e.context,o=r.tileSize*t.qualityFactor;r.textures[i]||(r.textures[i]=e.getTileTexture(o)||new l(n,{width:o,height:o,data:null},n.gl.RGBA),r.textures[i].bind(n.gl.LINEAR,n.gl.CLAMP_TO_EDGE),0===i&&t.sourceCache.renderHistory.unshift(r.tileID.key));const a=t.getRTTFramebuffer();a.colorAttachment.set(r.textures[i].texture),n.bindFramebuffer.set(a.framebuffer),n.viewport.set([0,0,o,o])}class Hr{constructor(e){this._coordsDescendingInv={},this._coordsDescendingInvStr={},this.painter=e,this._renderToTexture={background:!0,fill:!0,line:!0,raster:!0},this._coordsDescendingInv={},this._coordsDescendingInvStr={},this._stacks=[],this._prevType=null,this._rerender={},this._renderableTiles=e.style.terrain.sourceCache.getRenderableTiles(),this._init()}_init(){const e=this.painter.style,t=e.terrain;for(const r in e.sourceCaches){this._coordsDescendingInv[r]={};const i=e.sourceCaches[r].getVisibleCoordinates();for(const e of i){const i=t.sourceCache.getTerrainCoords(e);for(const e in i)this._coordsDescendingInv[r][e]||(this._coordsDescendingInv[r][e]=[]),this._coordsDescendingInv[r][e].push(i[e])}}for(const t of e._order){const r=e._layers[t],i=r.source;if(this._renderToTexture[r.type]&&!this._coordsDescendingInvStr[i]){this._coordsDescendingInvStr[i]={};for(const e in this._coordsDescendingInv[i])this._coordsDescendingInvStr[i][e]=this._coordsDescendingInv[i][e].map((e=>e.key)).sort().join()}}return this._renderableTiles.forEach((e=>{for(const r in this._coordsDescendingInvStr){const i=this._coordsDescendingInvStr[r][e.tileID.key];i&&i!==e.textureCoords[r]&&e.clearTextures(this.painter),t.needsRerender(r,e.tileID)&&e.clearTextures(this.painter)}this._rerender[e.tileID.key]=!e.textures.length})),t.clearRerenderCache(),t.sourceCache.removeOutdated(this.painter),this}renderLayer(t){const r=t.type,i=this.painter,n=i.style._order,o=i.currentLayer,a=o+1===n.length;if(this._renderToTexture[r]&&(this._prevType&&this._renderToTexture[this._prevType]||this._stacks.push([]),this._prevType=r,this._stacks[this._stacks.length-1].push(n[o]),!a))return!0;if(this._renderToTexture[this._prevType]||"hillshade"===r||this._renderToTexture[r]&&a){this._prevType=r;const a=this._stacks.length-1,s=this._stacks[a]||[];for(const t of this._renderableTiles){if(Kr(i,i.style.terrain,t,a),this._rerender[t.tileID.key]){i.context.clear({color:e.Color.transparent});for(let e=0;e<s.length;e++){const r=i.style._layers[s[e]],n=r.source?this._coordsDescendingInv[r.source][t.tileID.key]:[t.tileID];i._renderTileClippingMasks(r,n),i.renderLayer(i,i.style.sourceCaches[r.source],r,n),r.source&&(t.textureCoords[r.source]=this._coordsDescendingInvStr[r.source][t.tileID.key])}}Xr(i,i.style.terrain,t)}if("hillshade"===r){this._stacks.push([n[o]]);for(const r of this._renderableTiles){const n=this._coordsDescendingInv[t.source][r.tileID.key];Kr(i,i.style.terrain,r,this._stacks.length-1),i.context.clear({color:e.Color.transparent}),i._renderTileClippingMasks(t,n),i.renderLayer(i,i.style.sourceCaches[t.source],t,n),Xr(i,i.style.terrain,r)}return!0}return this._renderToTexture[r]}return!1}}const Jr={symbol:function(t,r,i,n,o){if("translucent"!==t.renderPass)return;const a=Er.disabled,s=t.colorModeForRenderPass();i.layout.get("text-variable-anchor")&&function(t,r,i,n,o,a,s){const l=r.transform,c="map"===o,u="map"===a;for(const o of t){const t=n.getTile(o),a=t.getBucket(i);if(!a||!a.text||!a.text.segments.get().length)continue;const h=e.evaluateSizeForZoom(a.textSizeData,l.zoom),p=xe(t,1,r.transform.zoom),d=oe(o.posMatrix,u,c,r.transform,p),f="none"!==i.layout.get("icon-text-fit")&&a.hasIconData();if(h){const e=Math.pow(2,l.zoom-t.tileID.overscaledZ);Cr(a,c,u,s,l,d,o.posMatrix,e,h,f,r.style.terrain?(e,t)=>r.style.terrain.getElevation(o,e,t):null)}}}(n,t,i,r,i.layout.get("text-rotation-alignment"),i.layout.get("text-pitch-alignment"),o),0!==i.paint.get("icon-opacity").constantOr(1)&&Mr(t,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)&&Mr(t,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&&(Ar(t,r,i,n,i.paint.get("text-translate"),i.paint.get("text-translate-anchor"),!0),Ar(t,r,i,n,i.paint.get("icon-translate"),i.paint.get("icon-translate-anchor"),!1))},circle:function(t,r,i,n){if("translucent"!==t.renderPass)return;const o=i.paint.get("circle-opacity"),a=i.paint.get("circle-stroke-width"),s=i.paint.get("circle-stroke-opacity"),l=!i.layout.get("circle-sort-key").isConstant();if(0===o.constantOr(1)&&(0===a.constantOr(1)||0===s.constantOr(1)))return;const c=t.context,u=c.gl,h=t.depthModeForSublayer(0,wr.ReadOnly),p=Er.disabled,d=t.colorModeForRenderPass(),f=[];for(let o=0;o<n.length;o++){const a=n[o],s=r.getTile(a),c=s.getBucket(i);if(!c)continue;const u=c.programConfigurations.get(i.id),h=t.useProgram("circle",u),p=c.layoutVertexBuffer,d=c.indexBuffer,m=t.style.terrain&&t.style.terrain.getTerrainData(a),y={programConfiguration:u,program:h,layoutVertexBuffer:p,indexBuffer:d,uniformValues:mt(t,a,s,i),terrainData:m};if(l){const t=c.segments.get();for(const r of t)f.push({segments:new e.SegmentVector([r]),sortKey:r.sortKey,state:y})}else f.push({segments:c.segments,sortKey:0,state:y})}l&&f.sort(((e,t)=>e.sortKey-t.sortKey));for(const e of f){const{programConfiguration:r,program:n,layoutVertexBuffer:o,indexBuffer:a,uniformValues:s,terrainData:l}=e.state;n.draw(c,u.TRIANGLES,h,p,d,Tr.disabled,s,l,i.id,o,a,e.segments,i.paint,t.transform.zoom,r)}},heatmap:function(t,r,i,n){if(0!==i.paint.get("heatmap-opacity"))if("offscreen"===t.renderPass){const o=t.context,a=o.gl,s=Er.disabled,l=new vr([a.ONE,a.ONE],e.Color.transparent,[!0,!0,!0,!0]);!function(e,t,r){const i=e.gl;e.activeTexture.set(i.TEXTURE1),e.viewport.set([0,0,t.width/4,t.height/4]);let n=r.heatmapFbo;if(n)i.bindTexture(i.TEXTURE_2D,n.colorAttachment.get()),e.bindFramebuffer.set(n.framebuffer);else{const o=i.createTexture();i.bindTexture(i.TEXTURE_2D,o),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),n=r.heatmapFbo=e.createFramebuffer(t.width/4,t.height/4,!1),function(e,t,r,i){const n=e.gl;n.texImage2D(n.TEXTURE_2D,0,n.RGBA,t.width/4,t.height/4,0,n.RGBA,e.extRenderToTextureHalfFloat?e.extTextureHalfFloat.HALF_FLOAT_OES:n.UNSIGNED_BYTE,null),i.colorAttachment.set(r)}(e,t,o,n)}}(o,t,i),o.clear({color:e.Color.transparent});for(let e=0;e<n.length;e++){const c=n[e];if(r.hasRenderableParent(c))continue;const u=r.getTile(c),h=u.getBucket(i);if(!h)continue;const p=h.programConfigurations.get(i.id),d=t.useProgram("heatmap",p),{zoom:f}=t.transform;d.draw(o,a.TRIANGLES,wr.disabled,s,l,Tr.disabled,bt(c.posMatrix,u,f,i.paint.get("heatmap-intensity")),null,i.id,h.layoutVertexBuffer,h.indexBuffer,h.segments,i.paint,t.transform.zoom,p)}o.viewport.set([0,0,t.width,t.height])}else"translucent"===t.renderPass&&(t.context.setColorMode(t.colorModeForRenderPass()),function(t,r){const i=t.context,n=i.gl,o=r.heatmapFbo;if(!o)return;i.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,o.colorAttachment.get()),i.activeTexture.set(n.TEXTURE1);let a=r.colorRampTexture;a||(a=r.colorRampTexture=new l(i,r.colorRamp,n.RGBA)),a.bind(n.LINEAR,n.CLAMP_TO_EDGE),t.useProgram("heatmapTexture").draw(i,n.TRIANGLES,wr.disabled,Er.disabled,t.colorModeForRenderPass(),Tr.disabled,((t,r,i,n)=>{const o=e.create();e.ortho(o,0,t.width,t.height,0,0,1);const a=t.context.gl;return{u_matrix:o,u_world:[a.drawingBufferWidth,a.drawingBufferHeight],u_image:0,u_color_ramp:1,u_opacity:r.paint.get("heatmap-opacity")}})(t,r),null,r.id,t.viewportBuffer,t.quadTriangleIndexBuffer,t.viewportSegments,r.paint,t.transform.zoom)}(t,i))},line:function(t,r,i,n){if("translucent"!==t.renderPass)return;const o=i.paint.get("line-opacity"),a=i.paint.get("line-width");if(0===o.constantOr(1)||0===a.constantOr(1))return;const s=t.depthModeForSublayer(0,wr.ReadOnly),c=t.colorModeForRenderPass(),u=i.paint.get("line-dasharray"),h=i.paint.get("line-pattern"),p=h.constantOr(1),d=i.paint.get("line-gradient"),f=i.getCrossfadeParameters(),m=p?"linePattern":u?"lineSDF":d?"lineGradient":"line",y=t.context,g=y.gl;let _=!0;for(const o of n){const n=r.getTile(o);if(p&&!n.patternsLoaded())continue;const a=n.getBucket(i);if(!a)continue;const b=a.programConfigurations.get(i.id),v=t.context.program.get(),x=t.useProgram(m,b),w=_||x.program!==v,S=t.style.terrain&&t.style.terrain.getTerrainData(o),E=h.constantOr(null);if(E&&n.imageAtlas){const e=n.imageAtlas,t=e.patternPositions[E.to.toString()],r=e.patternPositions[E.from.toString()];t&&r&&b.setConstantPatternPositions(t,r)}const T=S?o:null,k=p?St(t,n,i,f,T):u?Et(t,n,i,u,f,T):d?wt(t,n,i,a.lineClipsArray.length,T):xt(t,n,i,T);if(p)y.activeTexture.set(g.TEXTURE0),n.imageAtlasTexture.bind(g.LINEAR,g.CLAMP_TO_EDGE),b.updatePaintBuffers(f);else if(u&&(w||t.lineAtlas.dirty))y.activeTexture.set(g.TEXTURE0),t.lineAtlas.bind(y);else if(d){const n=a.gradients[i.id];let s=n.texture;if(i.gradientVersion!==n.version){let c=256;if(i.stepInterpolant){const i=r.getSource().maxzoom,n=o.canonical.z===i?Math.ceil(1<<t.transform.maxZoom-o.canonical.z):1;c=e.clamp(e.nextPowerOfTwo(a.maxLineLength/e.EXTENT*1024*n),256,y.maxTextureSize)}n.gradient=e.renderColorRamp({expression:i.gradientExpression(),evaluationKey:"lineProgress",resolution:c,image:n.gradient||void 0,clips:a.lineClipsArray}),n.texture?n.texture.update(n.gradient):n.texture=new l(y,n.gradient,g.RGBA),n.version=i.gradientVersion,s=n.texture}y.activeTexture.set(g.TEXTURE0),s.bind(i.stepInterpolant?g.NEAREST:g.LINEAR,g.CLAMP_TO_EDGE)}x.draw(y,g.TRIANGLES,s,t.stencilModeForClipping(o),c,Tr.disabled,k,S,i.id,a.layoutVertexBuffer,a.indexBuffer,a.segments,i.paint,t.transform.zoom,b,a.layoutVertexBuffer2),_=!1}},fill:function(t,r,i,n){const o=i.paint.get("fill-color"),a=i.paint.get("fill-opacity");if(0===a.constantOr(1))return;const s=t.colorModeForRenderPass(),l=i.paint.get("fill-pattern"),c=t.opaquePassEnabledForLayer()&&!l.constantOr(1)&&1===o.constantOr(e.Color.transparent).a&&1===a.constantOr(0)?"opaque":"translucent";if(t.renderPass===c){const e=t.depthModeForSublayer(1,"opaque"===t.renderPass?wr.ReadWrite:wr.ReadOnly);Dr(t,r,i,n,e,s,!1)}if("translucent"===t.renderPass&&i.paint.get("fill-antialias")){const e=t.depthModeForSublayer(i.getPaintProperty("fill-outline-color")?2:0,wr.ReadOnly);Dr(t,r,i,n,e,s,!0)}},"fill-extrusion":function(e,t,r,i){const n=r.paint.get("fill-extrusion-opacity");if(0!==n&&"translucent"===e.renderPass){const o=new wr(e.context.gl.LEQUAL,wr.ReadWrite,e.depthRangeFor3D);if(1!==n||r.paint.get("fill-extrusion-pattern").constantOr(1))Lr(e,t,r,i,o,Er.disabled,vr.disabled),Lr(e,t,r,i,o,e.stencilModeFor3D(),e.colorModeForRenderPass());else{const n=e.colorModeForRenderPass();Lr(e,t,r,i,o,Er.disabled,n)}}},hillshade:function(e,t,r,i){if("offscreen"!==e.renderPass&&"translucent"!==e.renderPass)return;const n=e.context,o=e.depthModeForSublayer(0,wr.ReadOnly),a=e.colorModeForRenderPass(),[s,l]="translucent"===e.renderPass?e.stencilConfigForOverlap(i):[{},i];for(const i of l){const n=t.getTile(i);void 0!==n.needsHillshadePrepare&&n.needsHillshadePrepare&&"offscreen"===e.renderPass?Rr(e,n,r,o,Er.disabled,a):"translucent"===e.renderPass&&jr(e,i,n,r,o,s[i.overscaledZ],a)}n.viewport.set([0,0,e.width,e.height])},raster:function(e,t,r,i){if("translucent"!==e.renderPass)return;if(0===r.paint.get("raster-opacity"))return;if(!i.length)return;const n=e.context,o=n.gl,a=t.getSource(),s=e.useProgram("raster"),l=e.colorModeForRenderPass(),[c,u]=a instanceof I?[{},i]:e.stencilConfigForOverlap(i),h=u[u.length-1].overscaledZ,p=!e.options.moving;for(const i of u){const u=e.depthModeForSublayer(i.overscaledZ-h,1===r.paint.get("raster-opacity")?wr.ReadWrite:wr.ReadOnly,o.LESS),d=t.getTile(i);d.registerFadeDuration(r.paint.get("raster-fade-duration"));const f=t.findLoadedParent(i,0),m=Br(d,f,t,r,e.transform,e.style.terrain);let y,g;const _="nearest"===r.paint.get("raster-resampling")?o.NEAREST:o.LINEAR;n.activeTexture.set(o.TEXTURE0),d.texture.bind(_,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),n.activeTexture.set(o.TEXTURE1),f?(f.texture.bind(_,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST),y=Math.pow(2,f.tileID.overscaledZ-d.tileID.overscaledZ),g=[d.tileID.canonical.x*y%1,d.tileID.canonical.y*y%1]):d.texture.bind(_,o.CLAMP_TO_EDGE,o.LINEAR_MIPMAP_NEAREST);const b=e.style.terrain&&e.style.terrain.getTerrainData(i),v=b?i:null,x=v?v.posMatrix:e.transform.calculatePosMatrix(i.toUnwrapped(),p),w=At(x,g||[0,0],y||1,m,r);a instanceof I?s.draw(n,o.TRIANGLES,u,Er.disabled,l,Tr.disabled,w,b,r.id,a.boundsBuffer,e.quadTriangleIndexBuffer,a.boundsSegments):s.draw(n,o.TRIANGLES,u,c[i.overscaledZ],l,Tr.disabled,w,b,r.id,e.rasterBoundsBuffer,e.quadTriangleIndexBuffer,e.rasterBoundsSegments)}},background:function(e,t,r,i){const n=r.paint.get("background-color"),o=r.paint.get("background-opacity");if(0===o)return;const a=e.context,s=a.gl,l=e.transform,c=l.tileSize,u=r.paint.get("background-pattern");if(e.isPatternMissing(u))return;const h=!u&&1===n.a&&1===o&&e.opaquePassEnabledForLayer()?"opaque":"translucent";if(e.renderPass!==h)return;const p=Er.disabled,d=e.depthModeForSublayer(0,"opaque"===h?wr.ReadWrite:wr.ReadOnly),f=e.colorModeForRenderPass(),m=e.useProgram(u?"backgroundPattern":"background"),y=i||l.coveringTiles({tileSize:c,terrain:e.style.terrain});u&&(a.activeTexture.set(s.TEXTURE0),e.imageManager.bind(e.context));const g=r.getCrossfadeParameters();for(const t of y){const l=i?t.posMatrix:e.transform.calculatePosMatrix(t.toUnwrapped()),h=u?Ot(l,o,e,u,{tileID:t,tileSize:c},g):Mt(l,o,n),y=e.style.terrain&&e.style.terrain.getTerrainData(t);m.draw(a,s.TRIANGLES,d,p,f,Tr.disabled,h,y,r.id,e.tileExtentBuffer,e.quadTriangleIndexBuffer,e.tileExtentSegments)}},debug:function(e,t,r){for(let i=0;i<r.length;i++)Wr(e,t,r[i])},custom:function(e,t,r){const i=e.context,n=r.implementation;if("offscreen"===e.renderPass){const t=n.prerender;t&&(e.setCustomLayerDefaults(),i.setColorMode(e.colorModeForRenderPass()),t.call(n,i.gl,e.transform.customLayerMatrix()),i.setDirty(),e.setBaseState())}else if("translucent"===e.renderPass){e.setCustomLayerDefaults(),i.setColorMode(e.colorModeForRenderPass()),i.setStencilMode(Er.disabled);const t="3d"===n.renderingMode?new wr(e.context.gl.LEQUAL,wr.ReadWrite,e.depthRangeFor3D):e.depthModeForSublayer(0,wr.ReadOnly);i.setDepthMode(t),n.render(i.gl,e.transform.customLayerMatrix()),i.setDirty(),e.setBaseState(),i.bindFramebuffer.set(null)}}};class Yr{constructor(t,r){this.context=new xr(t),this.transform=r,this._tileTextures={},this.terrainFacilitator={dirty:!0,matrix:e.create(),renderTime:0},this.setup(),this.numSublayers=B.maxUnderzooming+B.maxOverzooming+1,this.depthEpsilon=1/Math.pow(2,16),this.crossTileSymbolIndex=new We,this.gpuTimers={}}resize(e,t,r){if(this.width=e*r,this.height=t*r,this.pixelRatio=r,this.context.viewport.set([0,0,this.width,this.height]),this.style)for(const e of this.style._order)this.style._layers[e].resize()}setup(){const t=this.context,r=new e.PosArray;r.emplaceBack(0,0),r.emplaceBack(e.EXTENT,0),r.emplaceBack(0,e.EXTENT),r.emplaceBack(e.EXTENT,e.EXTENT),this.tileExtentBuffer=t.createVertexBuffer(r,Xe.members),this.tileExtentSegments=e.SegmentVector.simpleSegment(0,0,4,2);const i=new e.PosArray;i.emplaceBack(0,0),i.emplaceBack(e.EXTENT,0),i.emplaceBack(0,e.EXTENT),i.emplaceBack(e.EXTENT,e.EXTENT),this.debugBuffer=t.createVertexBuffer(i,Xe.members),this.debugSegments=e.SegmentVector.simpleSegment(0,0,4,5);const n=new e.RasterBoundsArray;n.emplaceBack(0,0,0,0),n.emplaceBack(e.EXTENT,0,e.EXTENT,0),n.emplaceBack(0,e.EXTENT,0,e.EXTENT),n.emplaceBack(e.EXTENT,e.EXTENT,e.EXTENT,e.EXTENT),this.rasterBoundsBuffer=t.createVertexBuffer(n,A.members),this.rasterBoundsSegments=e.SegmentVector.simpleSegment(0,0,4,2);const o=new e.PosArray;o.emplaceBack(0,0),o.emplaceBack(1,0),o.emplaceBack(0,1),o.emplaceBack(1,1),this.viewportBuffer=t.createVertexBuffer(o,Xe.members),this.viewportSegments=e.SegmentVector.simpleSegment(0,0,4,2);const a=new e.LineStripIndexArray;a.emplaceBack(0),a.emplaceBack(1),a.emplaceBack(3),a.emplaceBack(2),a.emplaceBack(0),this.tileBorderIndexBuffer=t.createIndexBuffer(a);const s=new e.TriangleIndexArray;s.emplaceBack(0,1,2),s.emplaceBack(2,1,3),this.quadTriangleIndexBuffer=t.createIndexBuffer(s),this.emptyTexture=new l(t,{width:1,height:1,data:new Uint8Array([0,0,0,0])},t.gl.RGBA);const c=this.context.gl;this.stencilClearMode=new Er({func:c.ALWAYS,mask:0},0,255,c.ZERO,c.ZERO,c.ZERO)}clearStencil(){const t=this.context,r=t.gl;this.nextStencilID=1,this.currentStencilSource=void 0;const i=e.create();e.ortho(i,0,this.width,this.height,0,0,1),e.scale(i,i,[r.drawingBufferWidth,r.drawingBufferHeight,0]),this.useProgram("clippingMask").draw(t,r.TRIANGLES,wr.disabled,this.stencilClearMode,vr.disabled,Tr.disabled,_t(i),null,"$clipping",this.viewportBuffer,this.quadTriangleIndexBuffer,this.viewportSegments)}_renderTileClippingMasks(e,t){if(this.currentStencilSource===e.source||!e.isTileClipped()||!t||!t.length)return;this.currentStencilSource=e.source;const r=this.context,i=r.gl;this.nextStencilID+t.length>256&&this.clearStencil(),r.setColorMode(vr.disabled),r.setDepthMode(wr.disabled);const n=this.useProgram("clippingMask");this._tileClippingMaskIDs={};for(const e of t){const t=this._tileClippingMaskIDs[e.key]=this.nextStencilID++,o=this.style.terrain&&this.style.terrain.getTerrainData(e);n.draw(r,i.TRIANGLES,wr.disabled,new Er({func:i.ALWAYS,mask:0},t,255,i.KEEP,i.KEEP,i.REPLACE),vr.disabled,Tr.disabled,_t(e.posMatrix),o,"$clipping",this.tileExtentBuffer,this.quadTriangleIndexBuffer,this.tileExtentSegments)}}stencilModeFor3D(){this.currentStencilSource=void 0,this.nextStencilID+1>256&&this.clearStencil();const e=this.nextStencilID++,t=this.context.gl;return new Er({func:t.NOTEQUAL,mask:255},e,255,t.KEEP,t.KEEP,t.REPLACE)}stencilModeForClipping(e){const t=this.context.gl;return new Er({func:t.EQUAL,mask:255},this._tileClippingMaskIDs[e.key],0,t.KEEP,t.KEEP,t.REPLACE)}stencilConfigForOverlap(e){const t=this.context.gl,r=e.sort(((e,t)=>t.overscaledZ-e.overscaledZ)),i=r[r.length-1].overscaledZ,n=r[0].overscaledZ-i+1;if(n>1){this.currentStencilSource=void 0,this.nextStencilID+n>256&&this.clearStencil();const e={};for(let r=0;r<n;r++)e[r+i]=new Er({func:t.GEQUAL,mask:255},r+this.nextStencilID,255,t.KEEP,t.KEEP,t.REPLACE);return this.nextStencilID+=n,[e,r]}return[{[i]:Er.disabled},r]}colorModeForRenderPass(){const t=this.context.gl;if(this._showOverdrawInspector){const r=1/8;return new vr([t.CONSTANT_COLOR,t.ONE],new e.Color(r,r,r,0),[!0,!0,!0,!0])}return"opaque"===this.renderPass?vr.unblended:vr.alphaBlended}depthModeForSublayer(e,t,r){if(!this.opaquePassEnabledForLayer())return wr.disabled;const i=1-((1+this.currentLayer)*this.numSublayers+e)*this.depthEpsilon;return new wr(r||this.context.gl.LEQUAL,t,[i,i])}opaquePassEnabledForLayer(){return this.currentLayer<this.opaquePassCutoff}render(t,r){this.style=t,this.options=r,this.lineAtlas=t.lineAtlas,this.imageManager=t.imageManager,this.glyphManager=t.glyphManager,this.symbolFadeChange=t.placement.symbolFadeChange(e.exported.now()),this.imageManager.beginFrame();const i=this.style._order,n=this.style.sourceCaches,o=this.style.terrain&&new Hr(this);for(const e in n){const t=n[e];t.used&&t.prepare(this.context)}const a={},s={},l={};for(const e in n){const t=n[e];a[e]=t.getVisibleCoordinates(),s[e]=a[e].slice().reverse(),l[e]=t.getVisibleCoordinates(!0).reverse()}this.opaquePassCutoff=1/0;for(let e=0;e<i.length;e++)if(this.style._layers[i[e]].is3D()){this.opaquePassCutoff=e;break}if(o){this.opaquePassCutoff=0;const t=this.style.terrain.sourceCache.tilesAfterTime(this.terrainFacilitator.renderTime);(this.terrainFacilitator.dirty||!e.equals(this.terrainFacilitator.matrix,this.transform.projMatrix)||t.length)&&(e.copy(this.terrainFacilitator.matrix,this.transform.projMatrix),this.terrainFacilitator.renderTime=Date.now(),this.terrainFacilitator.dirty=!1,function(t,r){const i=t.context,n=i.gl,o=vr.unblended,a=new wr(n.LEQUAL,wr.ReadWrite,[0,1]),s=r.getTerrainMesh(),l=r.sourceCache.getRenderableTiles(),c=t.useProgram("terrainDepth");i.bindFramebuffer.set(r.getFramebuffer("depth").framebuffer),i.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),i.clear({color:e.Color.transparent,depth:1});for(const e of l){const l=r.getTerrainData(e.tileID),u=t.transform.calculatePosMatrix(e.tileID.toUnwrapped());c.draw(i,n.TRIANGLES,a,Er.disabled,o,Tr.backCCW,{u_matrix:u},l,"terrain",s.vertexBuffer,s.indexBuffer,s.segments)}i.bindFramebuffer.set(null),i.viewport.set([0,0,t.width,t.height])}(this,this.style.terrain),function(t,r){const i=t.context,n=i.gl,o=vr.unblended,a=new wr(n.LEQUAL,wr.ReadWrite,[0,1]),s=r.getTerrainMesh(),l=r.getCoordsTexture(),c=r.sourceCache.getRenderableTiles(),u=t.useProgram("terrainCoords");i.bindFramebuffer.set(r.getFramebuffer("coords").framebuffer),i.viewport.set([0,0,t.width/devicePixelRatio,t.height/devicePixelRatio]),i.clear({color:e.Color.transparent,depth:1}),r.coordsIndex=[];for(const e of c){const c=r.getTerrainData(e.tileID);i.activeTexture.set(n.TEXTURE0),n.bindTexture(n.TEXTURE_2D,l.texture);const h=t.transform.calculatePosMatrix(e.tileID.toUnwrapped());u.draw(i,n.TRIANGLES,a,Er.disabled,o,Tr.backCCW,{u_matrix:h,u_terrain_coords_id:(255-r.coordsIndex.length)/255,u_texture:0},c,"terrain",s.vertexBuffer,s.indexBuffer,s.segments),r.coordsIndex.push(e.tileID.key)}i.bindFramebuffer.set(null),i.viewport.set([0,0,t.width,t.height])}(this,this.style.terrain))}this.renderPass="offscreen";for(const e of i){const t=this.style._layers[e];if(!t.hasOffscreenPass()||t.isHidden(this.transform.zoom))continue;const r=s[t.source];("custom"===t.type||r.length)&&this.renderLayer(this,n[t.source],t,r)}if(this.context.bindFramebuffer.set(null),this.context.clear({color:r.showOverdrawInspector?e.Color.black:e.Color.transparent,depth:1}),this.clearStencil(),this._showOverdrawInspector=r.showOverdrawInspector,this.depthRangeFor3D=[0,1-(t._order.length+2)*this.numSublayers*this.depthEpsilon],!o)for(this.renderPass="opaque",this.currentLayer=i.length-1;this.currentLayer>=0;this.currentLayer--){const e=this.style._layers[i[this.currentLayer]],t=n[e.source],r=a[e.source];this._renderTileClippingMasks(e,r),this.renderLayer(this,t,e,r)}for(this.renderPass="translucent",this.currentLayer=0;this.currentLayer<i.length;this.currentLayer++){const e=this.style._layers[i[this.currentLayer]],t=n[e.source];if(o&&o.renderLayer(e))continue;const r=("symbol"===e.type?l:s)[e.source];this._renderTileClippingMasks(e,a[e.source]),this.renderLayer(this,t,e,r)}if(this.options.showTileBoundaries){let e,t;Object.values(this.style._layers).forEach((r=>{r.source&&!r.isHidden(this.transform.zoom)&&(r.source!==(t&&t.id)&&(t=this.style.sourceCaches[r.source]),(!e||e.getSource().maxzoom<t.getSource().maxzoom)&&(e=t))})),e&&Jr.debug(this,e,e.getVisibleCoordinates())}this.options.showPadding&&function(e){const t=e.transform.padding;$r(e,e.transform.height-(t.top||0),3,Fr),$r(e,t.bottom||0,3,Nr),Gr(e,t.left||0,3,Ur),Gr(e,e.transform.width-(t.right||0),3,Vr);const r=e.transform.centerPoint;!function(e,t,r,i){Zr(e,t-1,r-10,2,20,i),Zr(e,t-10,r-1,20,2,i)}(e,r.x,e.transform.height-r.y,qr)}(this),this.context.setDefault()}renderLayer(e,t,r,i){r.isHidden(this.transform.zoom)||("background"===r.type||"custom"===r.type||(i||[]).length)&&(this.id=r.id,this.gpuTimingStart(r),Jr[r.type](e,t,r,i,this.style.placement.variableOffsets),this.gpuTimingEnd())}gpuTimingStart(e){if(!this.options.gpuTiming)return;const t=this.context.extTimerQuery;let r=this.gpuTimers[e.id];r||(r=this.gpuTimers[e.id]={calls:0,cpuTime:0,query:t.createQueryEXT()}),r.calls++,t.beginQueryEXT(t.TIME_ELAPSED_EXT,r.query)}gpuTimingEnd(){if(!this.options.gpuTiming)return;const e=this.context.extTimerQuery;e.endQueryEXT(e.TIME_ELAPSED_EXT)}collectGpuTimers(){const e=this.gpuTimers;return this.gpuTimers={},e}queryGpuTimers(e){const t={};for(const r in e){const i=e[r],n=this.context.extTimerQuery,o=n.getQueryObjectEXT(i.query,n.QUERY_RESULT_EXT)/1e6;n.deleteQueryEXT(i.query),t[r]=o}return t}translatePosMatrix(t,r,i,n,o){if(!i[0]&&!i[1])return t;const a=o?"map"===n?this.transform.angle:0:"viewport"===n?-this.transform.angle:0;if(a){const e=Math.sin(a),t=Math.cos(a);i=[i[0]*t-i[1]*e,i[0]*e+i[1]*t]}const s=[o?i[0]:xe(r,i[0],this.transform.zoom),o?i[1]:xe(r,i[1],this.transform.zoom),0],l=new Float32Array(16);return e.translate(l,t,s),l}saveTileTexture(e){const t=this._tileTextures[e.size[0]];t?t.push(e):this._tileTextures[e.size[0]]=[e]}getTileTexture(e){const t=this._tileTextures[e];return t&&t.length>0?t.pop():null}isPatternMissing(e){if(!e)return!1;if(!e.from||!e.to)return!0;const t=this.imageManager.getPattern(e.from.toString()),r=this.imageManager.getPattern(e.to.toString());return!t||!r}useProgram(e,t){this.cache=this.cache||{};const r=e+(t?t.cacheKey:"")+(this._showOverdrawInspector?"/overdraw":"")+(this.style.terrain?"/terrain":"");return this.cache[r]||(this.cache[r]=new st(this.context,e,it[e],t,Dt[e],this._showOverdrawInspector,this.style.terrain)),this.cache[r]}setCustomLayerDefaults(){this.context.unbindVAO(),this.context.cullFace.setDefault(),this.context.activeTexture.setDefault(),this.context.pixelStoreUnpack.setDefault(),this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(),this.context.pixelStoreUnpackFlipY.setDefault()}setBaseState(){const e=this.context.gl;this.context.cullFace.set(!1),this.context.viewport.set([0,0,this.width,this.height]),this.context.blendEquation.set(e.FUNC_ADD)}initDebugOverlayCanvas(){null==this.debugOverlayCanvas&&(this.debugOverlayCanvas=document.createElement("canvas"),this.debugOverlayCanvas.width=512,this.debugOverlayCanvas.height=512,this.debugOverlayTexture=new l(this.context,this.debugOverlayCanvas,this.context.gl.RGBA))}destroy(){this.emptyTexture.destroy(),this.debugOverlayTexture&&this.debugOverlayTexture.destroy()}}class Qr{constructor(e,t){this.points=e,this.planes=t}static fromInvProjectionMatrix(t,r,i){const 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((i=>{const o=1/(i=e.transformMat4([],i,t))[3]/r*n;return e.mul$1(i,i,[o,o,1/i[3],o])})),a=[[0,1,2],[6,5,4],[0,3,7],[2,1,5],[3,2,6],[0,4,5]].map((t=>{const r=e.sub([],o[t[0]],o[t[1]]),i=e.sub([],o[t[2]],o[t[1]]),n=e.normalize([],e.cross([],r,i)),a=-e.dot(n,o[t[1]]);return n.concat(a)}));return new Qr(o,a)}}class ei{constructor(t,r){this.min=t,this.max=r,this.center=e.scale$1([],e.add([],this.min,this.max),.5)}quadrant(t){const r=[t%2==0,t<2],i=e.clone$2(this.min),n=e.clone$2(this.max);for(let e=0;e<r.length;e++)i[e]=r[e]?this.min[e]:this.center[e],n[e]=r[e]?this.center[e]:this.max[e];return n[2]=this.max[2],new ei(i,n)}distanceX(e){return Math.max(Math.min(this.max[0],e[0]),this.min[0])-e[0]}distanceY(e){return Math.max(Math.min(this.max[1],e[1]),this.min[1])-e[1]}intersects(t){const r=[[this.min[0],this.min[1],this.min[2],1],[this.max[0],this.min[1],this.min[2],1],[this.max[0],this.max[1],this.min[2],1],[this.min[0],this.max[1],this.min[2],1],[this.min[0],this.min[1],this.max[2],1],[this.max[0],this.min[1],this.max[2],1],[this.max[0],this.max[1],this.max[2],1],[this.min[0],this.max[1],this.max[2],1]];let i=!0;for(let n=0;n<t.planes.length;n++){const o=t.planes[n];let a=0;for(let t=0;t<r.length;t++)e.dot$1(o,r[t])>=0&&a++;if(0===a)return 0;a!==r.length&&(i=!1)}if(i)return 2;for(let e=0;e<3;e++){let r=Number.MAX_VALUE,i=-Number.MAX_VALUE;for(let n=0;n<t.points.length;n++){const o=t.points[n][e]-this.min[e];r=Math.min(r,o),i=Math.max(i,o)}if(i<0||r>this.max[e]-this.min[e])return 0}return 1}}class ti{constructor(e=0,t=0,r=0,i=0){if(isNaN(e)||e<0||isNaN(t)||t<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=e,this.bottom=t,this.left=r,this.right=i}interpolate(t,r,i){return null!=r.top&&null!=t.top&&(this.top=e.number(t.top,r.top,i)),null!=r.bottom&&null!=t.bottom&&(this.bottom=e.number(t.bottom,r.bottom,i)),null!=r.left&&null!=t.left&&(this.left=e.number(t.left,r.left,i)),null!=r.right&&null!=t.right&&(this.right=e.number(t.right,r.right,i)),this}getCenter(t,r){const i=e.clamp((this.left+t-this.right)/2,0,t),n=e.clamp((this.top+r-this.bottom)/2,0,r);return new e.pointGeometry(i,n)}equals(e){return this.top===e.top&&this.bottom===e.bottom&&this.left===e.left&&this.right===e.right}clone(){return new ti(this.top,this.bottom,this.left,this.right)}toJSON(){return{top:this.top,bottom:this.bottom,left:this.left,right:this.right}}}class ri{constructor(t,r,i,n,o){this.tileSize=512,this.maxValidLatitude=85.051129,this.freezeElevation=!1,this._renderWorldCopies=void 0===o||!!o,this._minZoom=t||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 e.LngLat(0,0),this._elevation=0,this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._edgeInsets=new ti,this._posMatrixCache={},this._alignedPosMatrixCache={}}clone(){const e=new ri(this._minZoom,this._maxZoom,this._minPitch,this.maxPitch,this._renderWorldCopies);return e.tileSize=this.tileSize,e.latRange=this.latRange,e.width=this.width,e.height=this.height,e._center=this._center,e._elevation=this._elevation,e.zoom=this.zoom,e.angle=this.angle,e._fov=this._fov,e._pitch=this._pitch,e._unmodified=this._unmodified,e._edgeInsets=this._edgeInsets.clone(),e._calcMatrices(),e}get minZoom(){return this._minZoom}set minZoom(e){this._minZoom!==e&&(this._minZoom=e,this.zoom=Math.max(this.zoom,e))}get maxZoom(){return this._maxZoom}set maxZoom(e){this._maxZoom!==e&&(this._maxZoom=e,this.zoom=Math.min(this.zoom,e))}get minPitch(){return this._minPitch}set minPitch(e){this._minPitch!==e&&(this._minPitch=e,this.pitch=Math.max(this.pitch,e))}get maxPitch(){return this._maxPitch}set maxPitch(e){this._maxPitch!==e&&(this._maxPitch=e,this.pitch=Math.min(this.pitch,e))}get renderWorldCopies(){return this._renderWorldCopies}set renderWorldCopies(e){void 0===e?e=!0:null===e&&(e=!1),this._renderWorldCopies=e}get worldSize(){return this.tileSize*this.scale}get centerOffset(){return this.centerPoint._sub(this.size._div(2))}get size(){return new e.pointGeometry(this.width,this.height)}get bearing(){return-this.angle/Math.PI*180}set bearing(t){const r=-e.wrap(t,-180,180)*Math.PI/180;var i;this.angle!==r&&(this._unmodified=!1,this.angle=r,this._calcMatrices(),this.rotationMatrix=(i=new e.ARRAY_TYPE(4),e.ARRAY_TYPE!=Float32Array&&(i[1]=0,i[2]=0),i[0]=1,i[3]=1,i),function(e,t,r){var i=t[0],n=t[1],o=t[2],a=t[3],s=Math.sin(r),l=Math.cos(r);e[0]=i*l+o*s,e[1]=n*l+a*s,e[2]=i*-s+o*l,e[3]=n*-s+a*l}(this.rotationMatrix,this.rotationMatrix,this.angle))}get pitch(){return this._pitch/Math.PI*180}set pitch(t){const r=e.clamp(t,this.minPitch,this.maxPitch)/180*Math.PI;this._pitch!==r&&(this._unmodified=!1,this._pitch=r,this._calcMatrices())}get fov(){return this._fov/Math.PI*180}set fov(e){e=Math.max(.01,Math.min(60,e)),this._fov!==e&&(this._unmodified=!1,this._fov=e/180*Math.PI,this._calcMatrices())}get zoom(){return this._zoom}set zoom(e){const t=Math.min(Math.max(e,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())}get center(){return this._center}set center(e){e.lat===this._center.lat&&e.lng===this._center.lng||(this._unmodified=!1,this._center=e,this._constrain(),this._calcMatrices())}get elevation(){return this._elevation}set elevation(e){e!==this._elevation&&(this._elevation=e,this._constrain(),this._calcMatrices())}get padding(){return this._edgeInsets.toJSON()}set padding(e){this._edgeInsets.equals(e)||(this._unmodified=!1,this._edgeInsets.interpolate(this._edgeInsets,e,1),this._calcMatrices())}get centerPoint(){return this._edgeInsets.getCenter(this.width,this.height)}isPaddingEqual(e){return this._edgeInsets.equals(e)}interpolatePadding(e,t,r){this._unmodified=!1,this._edgeInsets.interpolate(e,t,r),this._constrain(),this._calcMatrices()}coveringZoomLevel(e){const t=(e.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/e.tileSize));return Math.max(0,t)}getVisibleUnwrappedCoordinates(t){const r=[new e.UnwrappedTileID(0,t)];if(this._renderWorldCopies){const i=this.pointCoordinate(new e.pointGeometry(0,0)),n=this.pointCoordinate(new e.pointGeometry(this.width,0)),o=this.pointCoordinate(new e.pointGeometry(this.width,this.height)),a=this.pointCoordinate(new e.pointGeometry(0,this.height)),s=Math.floor(Math.min(i.x,n.x,o.x,a.x)),l=Math.floor(Math.max(i.x,n.x,o.x,a.x)),c=1;for(let i=s-c;i<=l+c;i++)0!==i&&r.push(new e.UnwrappedTileID(i,t))}return r}coveringTiles(t){var r,i;let n=this.coveringZoomLevel(t);const o=n;if(void 0!==t.minzoom&&n<t.minzoom)return[];void 0!==t.maxzoom&&n>t.maxzoom&&(n=t.maxzoom);const a=this.pointCoordinate(this.getCameraPoint()),s=e.MercatorCoordinate.fromLngLat(this.center),l=Math.pow(2,n),c=[l*a.x,l*a.y,0],u=[l*s.x,l*s.y,0],h=Qr.fromInvProjectionMatrix(this.invProjMatrix,this.worldSize,n);let p=t.minzoom||0;!t.terrain&&this.pitch<=60&&this._edgeInsets.top<.1&&(p=n);const d=t.terrain?2/Math.min(this.tileSize,t.tileSize)*this.tileSize:3,f=e=>({aabb:new ei([e*l,0,0],[(e+1)*l,l,0]),zoom:0,x:0,y:0,wrap:e,fullyVisible:!1}),m=[],y=[],g=n,_=t.reparseOverscaled?o:n;if(this._renderWorldCopies)for(let e=1;e<=3;e++)m.push(f(-e)),m.push(f(e));for(m.push(f(0));m.length>0;){const n=m.pop(),o=n.x,a=n.y;let s=n.fullyVisible;if(!s){const e=n.aabb.intersects(h);if(0===e)continue;s=2===e}const l=t.terrain?c:u,f=n.aabb.distanceX(l),b=n.aabb.distanceY(l),v=Math.max(Math.abs(f),Math.abs(b)),x=d+(1<<g-n.zoom)-2;if(n.zoom===g||v>x&&n.zoom>=p){const t=g-n.zoom,r=c[0]-.5-(o<<t),i=c[1]-.5-(a<<t);y.push({tileID:new e.OverscaledTileID(n.zoom===g?_:n.zoom,n.wrap,n.zoom,o,a),distanceSq:e.sqrLen([u[0]-.5-o,u[1]-.5-a]),tileDistanceToCamera:Math.sqrt(r*r+i*i)})}else for(let l=0;l<4;l++){const c=(o<<1)+l%2,u=(a<<1)+(l>>1),h=n.zoom+1;let p=n.aabb.quadrant(l);if(t.terrain){const o=new e.OverscaledTileID(h,n.wrap,h,c,u),a=t.terrain.getMinMaxElevation(o),s=null!==(r=a.minElevation)&&void 0!==r?r:this.elevation,l=null!==(i=a.maxElevation)&&void 0!==i?i:this.elevation;p=new ei([p.min[0],p.min[1],s],[p.max[0],p.max[1],l])}m.push({aabb:p,zoom:h,x:c,y:u,wrap:n.wrap,fullyVisible:s})}}return y.sort(((e,t)=>e.distanceSq-t.distanceSq)).map((e=>e.tileID))}resize(e,t){this.width=e,this.height=t,this.pixelsToGLUnits=[2/e,-2/t],this._constrain(),this._calcMatrices()}get unmodified(){return this._unmodified}zoomScale(e){return Math.pow(2,e)}scaleZoom(e){return Math.log(e)/Math.LN2}project(t){const r=e.clamp(t.lat,-this.maxValidLatitude,this.maxValidLatitude);return new e.pointGeometry(e.mercatorXfromLng(t.lng)*this.worldSize,e.mercatorYfromLat(r)*this.worldSize)}unproject(t){return new e.MercatorCoordinate(t.x/this.worldSize,t.y/this.worldSize).toLngLat()}get point(){return this.project(this.center)}updateElevation(e){this.freezeElevation||(this.elevation=e?this.getElevation(this._center,e):0)}getElevation(t,r){const i=e.MercatorCoordinate.fromLngLat(t),n=(1<<this.tileZoom)*e.EXTENT,o=i.x*n,a=i.y*n,s=Math.floor(o/e.EXTENT),l=Math.floor(a/e.EXTENT),c=new e.OverscaledTileID(this.tileZoom,0,this.tileZoom,s,l);return r.getElevation(c,o%e.EXTENT,a%e.EXTENT,e.EXTENT)}getCameraPosition(){return{lngLat:this.pointLocation(this.getCameraPoint()),altitude:Math.cos(this._pitch)*this.cameraToCenterDistance/this._pixelPerMeter+this.elevation}}recalculateZoom(t){const r=this.pointLocation(this.centerPoint,t),i=this.getElevation(r,t);if(!(this.elevation-i))return;const n=this.getCameraPosition(),o=e.MercatorCoordinate.fromLngLat(n.lngLat,n.altitude),a=e.MercatorCoordinate.fromLngLat(r,i),s=o.x-a.x,l=o.y-a.y,c=o.z-a.z,u=Math.sqrt(s*s+l*l+c*c),h=this.scaleZoom(this.cameraToCenterDistance/u/this.tileSize);this._elevation=i,this._center=r,this.zoom=h}setLocationAtPoint(t,r){const i=this.pointCoordinate(r),n=this.pointCoordinate(this.centerPoint),o=this.locationCoordinate(t),a=new e.MercatorCoordinate(o.x-(i.x-n.x),o.y-(i.y-n.y));this.center=this.coordinateLocation(a),this._renderWorldCopies&&(this.center=this.center.wrap())}locationPoint(e,t){return t?this.coordinatePoint(this.locationCoordinate(e),this.getElevation(e,t),this.pixelMatrix3D):this.coordinatePoint(this.locationCoordinate(e))}pointLocation(e,t){return this.coordinateLocation(this.pointCoordinate(e,t))}locationCoordinate(t){return e.MercatorCoordinate.fromLngLat(t)}coordinateLocation(e){return e&&e.toLngLat()}pointCoordinate(t,r){if(r){const e=r.pointCoordinate(t);if(null!=e)return e}const i=[t.x,t.y,0,1],n=[t.x,t.y,1,1];e.transformMat4(i,i,this.pixelMatrixInverse),e.transformMat4(n,n,this.pixelMatrixInverse);const o=i[3],a=n[3],s=i[1]/o,l=n[1]/a,c=i[2]/o,u=n[2]/a,h=c===u?0:(0-c)/(u-c);return new e.MercatorCoordinate(e.number(i[0]/o,n[0]/a,h)/this.worldSize,e.number(s,l,h)/this.worldSize)}coordinatePoint(t,r=0,i=this.pixelMatrix){const n=[t.x*this.worldSize,t.y*this.worldSize,r,1];return e.transformMat4(n,n,i),new e.pointGeometry(n[0]/n[3],n[1]/n[3])}getBounds(){const t=Math.max(0,this.height/2-this.getHorizon());return(new e.LngLatBounds).extend(this.pointLocation(new e.pointGeometry(0,t))).extend(this.pointLocation(new e.pointGeometry(this.width,t))).extend(this.pointLocation(new e.pointGeometry(this.width,this.height))).extend(this.pointLocation(new e.pointGeometry(0,this.height)))}getMaxBounds(){return this.latRange&&2===this.latRange.length&&this.lngRange&&2===this.lngRange.length?new e.LngLatBounds([this.lngRange[0],this.latRange[0]],[this.lngRange[1],this.latRange[1]]):null}getHorizon(){return Math.tan(Math.PI/2-this._pitch)*this.cameraToCenterDistance*.85}setMaxBounds(e){e?(this.lngRange=[e.getWest(),e.getEast()],this.latRange=[e.getSouth(),e.getNorth()],this._constrain()):(this.lngRange=null,this.latRange=[-this.maxValidLatitude,this.maxValidLatitude])}calculatePosMatrix(t,r=!1){const i=t.key,n=r?this._alignedPosMatrixCache:this._posMatrixCache;if(n[i])return n[i];const o=t.canonical,a=this.worldSize/this.zoomScale(o.z),s=o.x+Math.pow(2,o.z)*t.wrap,l=e.identity(new Float64Array(16));return e.translate(l,l,[s*a,o.y*a,0]),e.scale(l,l,[a/e.EXTENT,a/e.EXTENT,1]),e.multiply(l,r?this.alignedProjMatrix:this.projMatrix,l),n[i]=new Float32Array(l),n[i]}customLayerMatrix(){return this.mercatorMatrix.slice()}_constrain(){if(!this.center||!this.width||!this.height||this._constraining)return;this._constraining=!0;let t,r,i,n,o=-90,a=90,s=-180,l=180;const c=this.size,u=this._unmodified;if(this.latRange){const r=this.latRange;o=e.mercatorYfromLat(r[1])*this.worldSize,a=e.mercatorYfromLat(r[0])*this.worldSize,t=a-o<c.y?c.y/(a-o):0}if(this.lngRange){const t=this.lngRange;s=e.wrap(e.mercatorXfromLng(t[0])*this.worldSize,0,this.worldSize),l=e.wrap(e.mercatorXfromLng(t[1])*this.worldSize,0,this.worldSize),l<s&&(l+=this.worldSize),r=l-s<c.x?c.x/(l-s):0}const h=this.point,p=Math.max(r||0,t||0);if(p)return this.center=this.unproject(new e.pointGeometry(r?(l+s)/2:h.x,t?(a+o)/2:h.y)),this.zoom+=this.scaleZoom(p),this._unmodified=u,void(this._constraining=!1);if(this.latRange){const e=h.y,t=c.y/2;e-t<o&&(n=o+t),e+t>a&&(n=a-t)}if(this.lngRange){const t=(s+l)/2,r=e.wrap(h.x,t-this.worldSize/2,t+this.worldSize/2),n=c.x/2;r-n<s&&(i=s+n),r+n>l&&(i=l-n)}void 0===i&&void 0===n||(this.center=this.unproject(new e.pointGeometry(void 0!==i?i:h.x,void 0!==n?n:h.y)).wrap()),this._unmodified=u,this._constraining=!1}_calcMatrices(){if(!this.height)return;const t=this.centerOffset,r=this.point.x,i=this.point.y;this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height,this._pixelPerMeter=e.mercatorZfromAltitude(1,this.center.lat)*this.worldSize;let n=e.identity(new Float64Array(16));e.scale(n,n,[this.width/2,-this.height/2,1]),e.translate(n,n,[1,-1,0]),this.labelPlaneMatrix=n,n=e.identity(new Float64Array(16)),e.scale(n,n,[1,-1,1]),e.translate(n,n,[-1,-1,0]),e.scale(n,n,[2/this.width,2/this.height,1]),this.glCoordMatrix=n,this.cameraToSeaLevelDistance=this.cameraToCenterDistance+this._elevation*this._pixelPerMeter/Math.cos(this._pitch);const o=Math.PI/2+this._pitch,a=this._fov*(.5+t.y/this.height),s=Math.sin(a)*this.cameraToSeaLevelDistance/Math.sin(e.clamp(Math.PI-o-a,.01,Math.PI-.01)),l=this.getHorizon(),c=2*Math.atan(l/this.cameraToCenterDistance)*(.5+t.y/(2*l)),u=Math.sin(c)*this.cameraToSeaLevelDistance/Math.sin(e.clamp(Math.PI-o-c,.01,Math.PI-.01)),h=Math.cos(Math.PI/2-this._pitch)*s+this.cameraToSeaLevelDistance,p=Math.cos(Math.PI/2-this._pitch)*u+this.cameraToSeaLevelDistance,d=1.01*Math.min(h,p),f=this.height/50;n=new Float64Array(16),e.perspective(n,this._fov,this.width/this.height,f,d),n[8]=2*-t.x/this.width,n[9]=2*t.y/this.height,e.scale(n,n,[1,-1,1]),e.translate(n,n,[0,0,-this.cameraToCenterDistance]),e.rotateX(n,n,this._pitch),e.rotateZ(n,n,this.angle),e.translate(n,n,[-r,-i,0]),this.mercatorMatrix=e.scale([],n,[this.worldSize,this.worldSize,this.worldSize]),e.scale(n,n,[1,1,this._pixelPerMeter]),this.pixelMatrix=e.multiply(new Float64Array(16),this.labelPlaneMatrix,n),e.translate(n,n,[0,0,-this.elevation]),this.projMatrix=n,this.invProjMatrix=e.invert([],n),this.pixelMatrix3D=e.multiply(new Float64Array(16),this.labelPlaneMatrix,n);const m=this.width%2/2,y=this.height%2/2,g=Math.cos(this.angle),_=Math.sin(this.angle),b=r-Math.round(r)+g*m+_*y,v=i-Math.round(i)+g*y+_*m,x=new Float64Array(n);if(e.translate(x,x,[b>.5?b-1:b,v>.5?v-1:v,0]),this.alignedProjMatrix=x,n=e.invert(new Float64Array(16),this.pixelMatrix),!n)throw new Error("failed to invert matrix");this.pixelMatrixInverse=n,this._posMatrixCache={},this._alignedPosMatrixCache={}}maxPitchScaleFactor(){if(!this.pixelMatrixInverse)return 1;const t=this.pointCoordinate(new e.pointGeometry(0,0)),r=[t.x*this.worldSize,t.y*this.worldSize,0,1];return e.transformMat4(r,r,this.pixelMatrix)[3]/this.cameraToCenterDistance}getCameraPoint(){const t=Math.tan(this._pitch)*(this.cameraToCenterDistance||1);return this.centerPoint.add(new e.pointGeometry(0,t))}getCameraQueryGeometry(t){const r=this.getCameraPoint();if(1===t.length)return[t[0],r];{let i=r.x,n=r.y,o=r.x,a=r.y;for(const e of t)i=Math.min(i,e.x),n=Math.min(n,e.y),o=Math.max(o,e.x),a=Math.max(a,e.y);return[new e.pointGeometry(i,n),new e.pointGeometry(o,n),new e.pointGeometry(o,a),new e.pointGeometry(i,a),new e.pointGeometry(i,n)]}}}class ii{constructor(t){this._hashName=t&&encodeURIComponent(t),e.bindAll(["_getCurrentHash","_onHashChange","_updateHash"],this),this._updateHash=function(e,t){let r=!1,i=null;const n=()=>{i=null,r&&(e(),i=setTimeout(n,300),r=!1)};return()=>(r=!0,i||n(),i)}(this._updateHashUnthrottled.bind(this))}addTo(e){return this._map=e,addEventListener("hashchange",this._onHashChange,!1),this._map.on("moveend",this._updateHash),this}remove(){return removeEventListener("hashchange",this._onHashChange,!1),this._map.off("moveend",this._updateHash),clearTimeout(this._updateHash()),delete this._map,this}getHashString(e){const t=this._map.getCenter(),r=Math.round(100*this._map.getZoom())/100,i=Math.ceil((r*Math.LN2+Math.log(512/360/.5))/Math.LN10),n=Math.pow(10,i),o=Math.round(t.lng*n)/n,a=Math.round(t.lat*n)/n,s=this._map.getBearing(),l=this._map.getPitch();let c="";if(c+=e?`/${o}/${a}/${r}`:`${r}/${a}/${o}`,(s||l)&&(c+="/"+Math.round(10*s)/10),l&&(c+=`/${Math.round(l)}`),this._hashName){const e=this._hashName;let t=!1;const r=window.location.hash.slice(1).split("&").map((r=>{const i=r.split("=")[0];return i===e?(t=!0,`${i}=${c}`):r})).filter((e=>e));return t||r.push(`${e}=${c}`),`#${r.join("&")}`}return`#${c}`}_getCurrentHash(){const e=window.location.hash.replace("#","");if(this._hashName){let t;return e.split("&").map((e=>e.split("="))).forEach((e=>{e[0]===this._hashName&&(t=e)})),(t&&t[1]||"").split("/")}return e.split("/")}_onHashChange(){const e=this._getCurrentHash();if(e.length>=3&&!e.some((e=>isNaN(e)))){const t=this._map.dragRotate.isEnabled()&&this._map.touchZoomRotate.isEnabled()?+(e[3]||0):this._map.getBearing();return this._map.jumpTo({center:[+e[2],+e[1]],zoom:+e[0],bearing:t,pitch:+(e[4]||0)}),!0}return!1}_updateHashUnthrottled(){const e=window.location.href.replace(/(#.+)?$/,this.getHashString());try{window.history.replaceState(window.history.state,null,e)}catch(e){}}}const ni={linearity:.3,easing:e.bezier(0,0,.3,1)},oi=e.extend({deceleration:2500,maxSpeed:1400},ni),ai=e.extend({deceleration:20,maxSpeed:1400},ni),si=e.extend({deceleration:1e3,maxSpeed:360},ni),li=e.extend({deceleration:1e3,maxSpeed:90},ni);class ci{constructor(e){this._map=e,this.clear()}clear(){this._inertiaBuffer=[]}record(t){this._drainInertiaBuffer(),this._inertiaBuffer.push({time:e.exported.now(),settings:t})}_drainInertiaBuffer(){const t=this._inertiaBuffer,r=e.exported.now();for(;t.length>0&&r-t[0].time>160;)t.shift()}_onMoveEnd(t){if(this._drainInertiaBuffer(),this._inertiaBuffer.length<2)return;const r={zoom:0,bearing:0,pitch:0,pan:new e.pointGeometry(0,0),pinchAround:void 0,around:void 0};for(const{settings:e}of this._inertiaBuffer)r.zoom+=e.zoomDelta||0,r.bearing+=e.bearingDelta||0,r.pitch+=e.pitchDelta||0,e.panDelta&&r.pan._add(e.panDelta),e.around&&(r.around=e.around),e.pinchAround&&(r.pinchAround=e.pinchAround);const i=this._inertiaBuffer[this._inertiaBuffer.length-1].time-this._inertiaBuffer[0].time,n={};if(r.pan.mag()){const o=hi(r.pan.mag(),i,e.extend({},oi,t||{}));n.offset=r.pan.mult(o.amount/r.pan.mag()),n.center=this._map.transform.center,ui(n,o)}if(r.zoom){const e=hi(r.zoom,i,ai);n.zoom=this._map.transform.zoom+e.amount,ui(n,e)}if(r.bearing){const t=hi(r.bearing,i,si);n.bearing=this._map.transform.bearing+e.clamp(t.amount,-179,179),ui(n,t)}if(r.pitch){const e=hi(r.pitch,i,li);n.pitch=this._map.transform.pitch+e.amount,ui(n,e)}if(n.zoom||n.bearing){const e=void 0===r.pinchAround?r.around:r.pinchAround;n.around=e?this._map.unproject(e):this._map.getCenter()}return this.clear(),e.extend(n,{noMoveStart:!0})}}function ui(e,t){(!e.duration||e.duration<t.duration)&&(e.duration=t.duration,e.easing=t.easing)}function hi(t,r,i){const{maxSpeed:n,linearity:o,deceleration:a}=i,s=e.clamp(t*o/(r/1e3),-n,n),l=Math.abs(s)/(a*o);return{easing:i.easing,duration:1e3*l,amount:s*(l/2)}}class pi extends e.Event{constructor(t,r,i,n={}){const a=o.mousePos(r.getCanvasContainer(),i),s=r.unproject(a);super(t,e.extend({point:a,lngLat:s,originalEvent:i},n)),this._defaultPrevented=!1,this.target=r}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class di extends e.Event{constructor(t,r,i){const n="touchend"===t?i.changedTouches:i.touches,a=o.touchPos(r.getCanvasContainer(),n),s=a.map((e=>r.unproject(e))),l=a.reduce(((e,t,r,i)=>e.add(t.div(i.length))),new e.pointGeometry(0,0));super(t,{points:a,point:l,lngLats:s,lngLat:r.unproject(l),originalEvent:i}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class fi extends e.Event{constructor(e,t,r){super(e,{originalEvent:r}),this._defaultPrevented=!1}preventDefault(){this._defaultPrevented=!0}get defaultPrevented(){return this._defaultPrevented}}class mi{constructor(e,t){this._map=e,this._clickTolerance=t.clickTolerance}reset(){delete this._mousedownPos}wheel(e){return this._firePreventable(new fi(e.type,this._map,e))}mousedown(e,t){return this._mousedownPos=t,this._firePreventable(new pi(e.type,this._map,e))}mouseup(e){this._map.fire(new pi(e.type,this._map,e))}click(e,t){this._mousedownPos&&this._mousedownPos.dist(t)>=this._clickTolerance||this._map.fire(new pi(e.type,this._map,e))}dblclick(e){return this._firePreventable(new pi(e.type,this._map,e))}mouseover(e){this._map.fire(new pi(e.type,this._map,e))}mouseout(e){this._map.fire(new pi(e.type,this._map,e))}touchstart(e){return this._firePreventable(new di(e.type,this._map,e))}touchmove(e){this._map.fire(new di(e.type,this._map,e))}touchend(e){this._map.fire(new di(e.type,this._map,e))}touchcancel(e){this._map.fire(new di(e.type,this._map,e))}_firePreventable(e){if(this._map.fire(e),e.defaultPrevented)return{}}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class yi{constructor(e){this._map=e}reset(){this._delayContextMenu=!1,this._ignoreContextMenu=!0,delete this._contextMenuEvent}mousemove(e){this._map.fire(new pi(e.type,this._map,e))}mousedown(){this._delayContextMenu=!0,this._ignoreContextMenu=!1}mouseup(){this._delayContextMenu=!1,this._contextMenuEvent&&(this._map.fire(new pi("contextmenu",this._map,this._contextMenuEvent)),delete this._contextMenuEvent)}contextmenu(e){this._delayContextMenu?this._contextMenuEvent=e:this._ignoreContextMenu||this._map.fire(new pi(e.type,this._map,e)),this._map.listens("contextmenu")&&e.preventDefault()}isEnabled(){return!0}isActive(){return!1}enable(){}disable(){}}class gi{constructor(e,t){this._map=e,this._el=e.getCanvasContainer(),this._container=e.getContainer(),this._clickTolerance=t.clickTolerance||1}isEnabled(){return!!this._enabled}isActive(){return!!this._active}enable(){this.isEnabled()||(this._enabled=!0)}disable(){this.isEnabled()&&(this._enabled=!1)}mousedown(e,t){this.isEnabled()&&e.shiftKey&&0===e.button&&(o.disableDrag(),this._startPos=this._lastPos=t,this._active=!0)}mousemoveWindow(e,t){if(!this._active)return;const r=t;if(this._lastPos.equals(r)||!this._box&&r.dist(this._startPos)<this._clickTolerance)return;const i=this._startPos;this._lastPos=r,this._box||(this._box=o.create("div","maplibregl-boxzoom mapboxgl-boxzoom",this._container),this._container.classList.add("maplibregl-crosshair","mapboxgl-crosshair"),this._fireEvent("boxzoomstart",e));const n=Math.min(i.x,r.x),a=Math.max(i.x,r.x),s=Math.min(i.y,r.y),l=Math.max(i.y,r.y);o.setTransform(this._box,`translate(${n}px,${s}px)`),this._box.style.width=a-n+"px",this._box.style.height=l-s+"px"}mouseupWindow(t,r){if(!this._active)return;if(0!==t.button)return;const i=this._startPos,n=r;if(this.reset(),o.suppressClick(),i.x!==n.x||i.y!==n.y)return this._map.fire(new e.Event("boxzoomend",{originalEvent:t})),{cameraAnimation:e=>e.fitScreenCoordinates(i,n,this._map.getBearing(),{linear:!0})};this._fireEvent("boxzoomcancel",t)}keydown(e){this._active&&27===e.keyCode&&(this.reset(),this._fireEvent("boxzoomcancel",e))}reset(){this._active=!1,this._container.classList.remove("maplibregl-crosshair","mapboxgl-crosshair"),this._box&&(o.remove(this._box),this._box=null),o.enableDrag(),delete this._startPos,delete this._lastPos}_fireEvent(t,r){return this._map.fire(new e.Event(t,{originalEvent:r}))}}function _i(e,t){if(e.length!==t.length)throw new Error(`The number of touches and points are not equal - touches ${e.length}, points ${t.length}`);const r={};for(let i=0;i<e.length;i++)r[e[i].identifier]=t[i];return r}class bi{constructor(e){this.reset(),this.numTouches=e.numTouches}reset(){delete this.centroid,delete this.startTime,delete this.touches,this.aborted=!1}touchstart(t,r,i){(this.centroid||i.length>this.numTouches)&&(this.aborted=!0),this.aborted||(void 0===this.startTime&&(this.startTime=t.timeStamp),i.length===this.numTouches&&(this.centroid=function(t){const r=new e.pointGeometry(0,0);for(const e of t)r._add(e);return r.div(t.length)}(r),this.touches=_i(i,r)))}touchmove(e,t,r){if(this.aborted||!this.centroid)return;const i=_i(r,t);for(const e in this.touches){const t=this.touches[e],r=i[e];(!r||r.dist(t)>30)&&(this.aborted=!0)}}touchend(e,t,r){if((!this.centroid||e.timeStamp-this.startTime>500)&&(this.aborted=!0),0===r.length){const e=!this.aborted&&this.centroid;if(this.reset(),e)return e}}}class vi{constructor(e){this.singleTap=new bi(e),this.numTaps=e.numTaps,this.reset()}reset(){this.lastTime=1/0,delete this.lastTap,this.count=0,this.singleTap.reset()}touchstart(e,t,r){this.singleTap.touchstart(e,t,r)}touchmove(e,t,r){this.singleTap.touchmove(e,t,r)}touchend(e,t,r){const i=this.singleTap.touchend(e,t,r);if(i){const t=e.timeStamp-this.lastTime<500,r=!this.lastTap||this.lastTap.dist(i)<30;if(t&&r||this.reset(),this.count++,this.lastTime=e.timeStamp,this.lastTap=i,this.count===this.numTaps)return this.reset(),i}}}class xi{constructor(){this._zoomIn=new vi({numTouches:1,numTaps:2}),this._zoomOut=new vi({numTouches:2,numTaps:1}),this.reset()}reset(){this._active=!1,this._zoomIn.reset(),this._zoomOut.reset()}touchstart(e,t,r){this._zoomIn.touchstart(e,t,r),this._zoomOut.touchstart(e,t,r)}touchmove(e,t,r){this._zoomIn.touchmove(e,t,r),this._zoomOut.touchmove(e,t,r)}touchend(e,t,r){const i=this._zoomIn.touchend(e,t,r),n=this._zoomOut.touchend(e,t,r);return i?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:t.getZoom()+1,around:t.unproject(i)},{originalEvent:e})}):n?(this._active=!0,e.preventDefault(),setTimeout((()=>this.reset()),0),{cameraAnimation:t=>t.easeTo({duration:300,zoom:t.getZoom()-1,around:t.unproject(n)},{originalEvent:e})}):void 0}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}const wi={0:1,2:2};class Si{constructor(e){this.reset(),this._clickTolerance=e.clickTolerance||1}reset(){this._active=!1,this._moved=!1,delete this._lastPoint,delete this._eventButton}_correctButton(e,t){return!1}_move(e,t){return{}}mousedown(e,t){if(this._lastPoint)return;const r=o.mouseButton(e);this._correctButton(e,r)&&(this._lastPoint=t,this._eventButton=r)}mousemoveWindow(e,t){const r=this._lastPoint;if(r)if(e.preventDefault(),function(e,t){const r=wi[t];return void 0===e.buttons||(e.buttons&r)!==r}(e,this._eventButton))this.reset();else if(this._moved||!(t.dist(r)<this._clickTolerance))return this._moved=!0,this._lastPoint=t,this._move(r,t)}mouseupWindow(e){this._lastPoint&&o.mouseButton(e)===this._eventButton&&(this._moved&&o.suppressClick(),this.reset())}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ei extends Si{mousedown(e,t){super.mousedown(e,t),this._lastPoint&&(this._active=!0)}_correctButton(e,t){return 0===t&&!e.ctrlKey}_move(e,t){return{around:t,panDelta:t.sub(e)}}}class Ti extends Si{_correctButton(e,t){return 0===t&&e.ctrlKey||2===t}_move(e,t){const r=.8*(t.x-e.x);if(r)return this._active=!0,{bearingDelta:r}}contextmenu(e){e.preventDefault()}}class ki extends Si{_correctButton(e,t){return 0===t&&e.ctrlKey||2===t}_move(e,t){const r=-.5*(t.y-e.y);if(r)return this._active=!0,{pitchDelta:r}}contextmenu(e){e.preventDefault()}}class Ai{constructor(e,t){this._minTouches=e.cooperativeGestures?2:1,this._clickTolerance=e.clickTolerance||1,this._map=t,this.reset()}reset(){this._active=!1,this._touches={},this._sum=new e.pointGeometry(0,0),setTimeout((()=>{this._cancelCooperativeMessage=!1}),200)}touchstart(e,t,r){return this._calculateTransform(e,t,r)}touchmove(e,t,r){if(this._map._cooperativeGestures&&(2===this._minTouches&&r.length<2&&!this._cancelCooperativeMessage?this._map._onCooperativeGesture(e,!1,r.length):this._cancelCooperativeMessage||(this._cancelCooperativeMessage=!0)),this._active&&!(r.length<this._minTouches))return e.preventDefault(),this._calculateTransform(e,t,r)}touchend(e,t,r){this._calculateTransform(e,t,r),this._active&&r.length<this._minTouches&&this.reset()}touchcancel(){this.reset()}_calculateTransform(t,r,i){i.length>0&&(this._active=!0);const n=_i(i,r),o=new e.pointGeometry(0,0),a=new e.pointGeometry(0,0);let s=0;for(const e in n){const t=n[e],r=this._touches[e];r&&(o._add(t),a._add(t.sub(r)),s++,n[e]=t)}if(this._touches=n,s<this._minTouches||!a.mag())return;const l=a.div(s);return this._sum._add(l),this._sum.mag()<this._clickTolerance?void 0:{around:o.div(s),panDelta:l}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class Ii{constructor(){this.reset()}reset(){this._active=!1,delete this._firstTwoTouches}_start(e){}_move(e,t,r){return{}}touchstart(e,t,r){this._firstTwoTouches||r.length<2||(this._firstTwoTouches=[r[0].identifier,r[1].identifier],this._start([t[0],t[1]]))}touchmove(e,t,r){if(!this._firstTwoTouches)return;e.preventDefault();const[i,n]=this._firstTwoTouches,o=Pi(r,t,i),a=Pi(r,t,n);if(!o||!a)return;const s=this._aroundCenter?null:o.add(a).div(2);return this._move([o,a],s,e)}touchend(e,t,r){if(!this._firstTwoTouches)return;const[i,n]=this._firstTwoTouches,a=Pi(r,t,i),s=Pi(r,t,n);a&&s||(this._active&&o.suppressClick(),this.reset())}touchcancel(){this.reset()}enable(e){this._enabled=!0,this._aroundCenter=!!e&&"center"===e.around}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}function Pi(e,t,r){for(let i=0;i<e.length;i++)if(e[i].identifier===r)return t[i]}function Ci(e,t){return Math.log(e/t)/Math.LN2}class zi extends Ii{reset(){super.reset(),delete this._distance,delete this._startDistance}_start(e){this._startDistance=this._distance=e[0].dist(e[1])}_move(e,t){const r=this._distance;if(this._distance=e[0].dist(e[1]),this._active||!(Math.abs(Ci(this._distance,this._startDistance))<.1))return this._active=!0,{zoomDelta:Ci(this._distance,r),pinchAround:t}}}function Mi(e,t){return 180*e.angleWith(t)/Math.PI}class Oi extends Ii{reset(){super.reset(),delete this._minDiameter,delete this._startVector,delete this._vector}_start(e){this._startVector=this._vector=e[0].sub(e[1]),this._minDiameter=e[0].dist(e[1])}_move(e,t){const r=this._vector;if(this._vector=e[0].sub(e[1]),this._active||!this._isBelowThreshold(this._vector))return this._active=!0,{bearingDelta:Mi(this._vector,r),pinchAround:t}}_isBelowThreshold(e){this._minDiameter=Math.min(this._minDiameter,e.mag());const t=25/(Math.PI*this._minDiameter)*360,r=Mi(e,this._startVector);return Math.abs(r)<t}}function Di(e){return Math.abs(e.y)>Math.abs(e.x)}class Li extends Ii{constructor(e){super(),this._map=e}reset(){super.reset(),this._valid=void 0,delete this._firstMove,delete this._lastPoints}touchstart(e,t,r){super.touchstart(e,t,r),this._currentTouchCount=r.length}_start(e){this._lastPoints=e,Di(e[0].sub(e[1]))&&(this._valid=!1)}_move(e,t,r){if(this._map._cooperativeGestures&&this._currentTouchCount<3)return;const i=e[0].sub(this._lastPoints[0]),n=e[1].sub(this._lastPoints[1]);return this._valid=this.gestureBeginsVertically(i,n,r.timeStamp),this._valid?(this._lastPoints=e,this._active=!0,{pitchDelta:(i.y+n.y)/2*-.5}):void 0}gestureBeginsVertically(e,t,r){if(void 0!==this._valid)return this._valid;const i=e.mag()>=2,n=t.mag()>=2;if(!i&&!n)return;if(!i||!n)return void 0===this._firstMove&&(this._firstMove=r),r-this._firstMove<100&&void 0;const o=e.y>0==t.y>0;return Di(e)&&Di(t)&&o}}const ji={panStep:100,bearingStep:15,pitchStep:10};class Ri{constructor(){const e=ji;this._panStep=e.panStep,this._bearingStep=e.bearingStep,this._pitchStep=e.pitchStep,this._rotationDisabled=!1}reset(){this._active=!1}keydown(e){if(e.altKey||e.ctrlKey||e.metaKey)return;let t=0,r=0,i=0,n=0,o=0;switch(e.keyCode){case 61:case 107:case 171:case 187:t=1;break;case 189:case 109:case 173:t=-1;break;case 37:e.shiftKey?r=-1:(e.preventDefault(),n=-1);break;case 39:e.shiftKey?r=1:(e.preventDefault(),n=1);break;case 38:e.shiftKey?i=1:(e.preventDefault(),o=-1);break;case 40:e.shiftKey?i=-1:(e.preventDefault(),o=1);break;default:return}return this._rotationDisabled&&(r=0,i=0),{cameraAnimation:a=>{const s=a.getZoom();a.easeTo({duration:300,easeId:"keyboardHandler",easing:Bi,zoom:t?Math.round(s)+t*(e.shiftKey?2:1):s,bearing:a.getBearing()+r*this._bearingStep,pitch:a.getPitch()+i*this._pitchStep,offset:[-n*this._panStep,-o*this._panStep],center:a.getCenter()},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}disableRotation(){this._rotationDisabled=!0}enableRotation(){this._rotationDisabled=!1}}function Bi(e){return e*(2-e)}const Fi=4.000244140625;class Ni{constructor(t,r){this._map=t,this._el=t.getCanvasContainer(),this._handler=r,this._delta=0,this._defaultZoomRate=.01,this._wheelZoomRate=.0022222222222222222,e.bindAll(["_onTimeout"],this)}setZoomRate(e){this._defaultZoomRate=e}setWheelZoomRate(e){this._wheelZoomRate=e}isEnabled(){return!!this._enabled}isActive(){return!!this._active||void 0!==this._finishTimeout}isZooming(){return!!this._zooming}enable(e){this.isEnabled()||(this._enabled=!0,this._aroundCenter=e&&"center"===e.around)}disable(){this.isEnabled()&&(this._enabled=!1)}wheel(t){if(!this.isEnabled())return;if(this._map._cooperativeGestures){if(!this._map._metaPress)return;t.preventDefault()}let r=t.deltaMode===WheelEvent.DOM_DELTA_LINE?40*t.deltaY:t.deltaY;const i=e.exported.now(),n=i-(this._lastWheelEventTime||0);this._lastWheelEventTime=i,0!==r&&r%Fi==0?this._type="wheel":0!==r&&Math.abs(r)<4?this._type="trackpad":n>400?(this._type=null,this._lastValue=r,this._timeout=setTimeout(this._onTimeout,40,t)):this._type||(this._type=Math.abs(n*r)<200?"trackpad":"wheel",this._timeout&&(clearTimeout(this._timeout),this._timeout=null,r+=this._lastValue)),t.shiftKey&&r&&(r/=4),this._type&&(this._lastWheelEvent=t,this._delta-=r,this._active||this._start(t)),t.preventDefault()}_onTimeout(e){this._type="wheel",this._delta-=this._lastValue,this._active||this._start(e)}_start(t){if(!this._delta)return;this._frameId&&(this._frameId=null),this._active=!0,this.isZooming()||(this._zooming=!0),this._finishTimeout&&(clearTimeout(this._finishTimeout),delete this._finishTimeout);const r=o.mousePos(this._el,t);this._around=e.LngLat.convert(this._aroundCenter?this._map.getCenter():this._map.unproject(r)),this._aroundPoint=this._map.transform.locationPoint(this._around),this._frameId||(this._frameId=!0,this._handler._triggerRenderFrame())}renderFrame(){if(!this._frameId)return;if(this._frameId=null,!this.isActive())return;const t=this._map.transform;if(0!==this._delta){const e="wheel"===this._type&&Math.abs(this._delta)>Fi?this._wheelZoomRate:this._defaultZoomRate;let r=2/(1+Math.exp(-Math.abs(this._delta*e)));this._delta<0&&0!==r&&(r=1/r);const i="number"==typeof this._targetZoom?t.zoomScale(this._targetZoom):t.scale;this._targetZoom=Math.min(t.maxZoom,Math.max(t.minZoom,t.scaleZoom(i*r))),"wheel"===this._type&&(this._startZoom=t.zoom,this._easing=this._smoothOutEasing(200)),this._delta=0}const r="number"==typeof this._targetZoom?this._targetZoom:t.zoom,i=this._startZoom,n=this._easing;let o,a=!1;if("wheel"===this._type&&i&&n){const t=Math.min((e.exported.now()-this._lastWheelEventTime)/200,1),s=n(t);o=e.number(i,r,s),t<1?this._frameId||(this._frameId=!0):a=!0}else o=r,a=!0;return this._active=!0,a&&(this._active=!1,this._finishTimeout=setTimeout((()=>{this._zooming=!1,this._handler._triggerRenderFrame(),delete this._targetZoom,delete this._finishTimeout}),200)),{noInertia:!0,needsRenderFrame:!a,zoomDelta:o-t.zoom,around:this._aroundPoint,originalEvent:this._lastWheelEvent}}_smoothOutEasing(t){let r=e.ease;if(this._prevEase){const t=this._prevEase,i=(e.exported.now()-t.start)/t.duration,n=t.easing(i+.01)-t.easing(i),o=.27/Math.sqrt(n*n+1e-4)*.01,a=Math.sqrt(.0729-o*o);r=e.bezier(o,a,.25,1)}return this._prevEase={start:e.exported.now(),duration:t,easing:r},r}reset(){this._active=!1}}class Ui{constructor(e,t){this._clickZoom=e,this._tapZoom=t}enable(){this._clickZoom.enable(),this._tapZoom.enable()}disable(){this._clickZoom.disable(),this._tapZoom.disable()}isEnabled(){return this._clickZoom.isEnabled()&&this._tapZoom.isEnabled()}isActive(){return this._clickZoom.isActive()||this._tapZoom.isActive()}}class Vi{constructor(){this.reset()}reset(){this._active=!1}dblclick(e,t){return e.preventDefault(),{cameraAnimation:r=>{r.easeTo({duration:300,zoom:r.getZoom()+(e.shiftKey?-1:1),around:r.unproject(t)},{originalEvent:e})}}}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class qi{constructor(){this._tap=new vi({numTouches:1,numTaps:1}),this.reset()}reset(){this._active=!1,delete this._swipePoint,delete this._swipeTouch,delete this._tapTime,this._tap.reset()}touchstart(e,t,r){this._swipePoint||(this._tapTime&&e.timeStamp-this._tapTime>500&&this.reset(),this._tapTime?r.length>0&&(this._swipePoint=t[0],this._swipeTouch=r[0].identifier):this._tap.touchstart(e,t,r))}touchmove(e,t,r){if(this._tapTime){if(this._swipePoint){if(r[0].identifier!==this._swipeTouch)return;const i=t[0],n=i.y-this._swipePoint.y;return this._swipePoint=i,e.preventDefault(),this._active=!0,{zoomDelta:n/128}}}else this._tap.touchmove(e,t,r)}touchend(e,t,r){this._tapTime?this._swipePoint&&0===r.length&&this.reset():this._tap.touchend(e,t,r)&&(this._tapTime=e.timeStamp)}touchcancel(){this.reset()}enable(){this._enabled=!0}disable(){this._enabled=!1,this.reset()}isEnabled(){return this._enabled}isActive(){return this._active}}class $i{constructor(e,t,r){this._el=e,this._mousePan=t,this._touchPan=r}enable(e){this._inertiaOptions=e||{},this._mousePan.enable(),this._touchPan.enable(),this._el.classList.add("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}disable(){this._mousePan.disable(),this._touchPan.disable(),this._el.classList.remove("maplibregl-touch-drag-pan","mapboxgl-touch-drag-pan")}isEnabled(){return this._mousePan.isEnabled()&&this._touchPan.isEnabled()}isActive(){return this._mousePan.isActive()||this._touchPan.isActive()}}class Gi{constructor(e,t,r){this._pitchWithRotate=e.pitchWithRotate,this._mouseRotate=t,this._mousePitch=r}enable(){this._mouseRotate.enable(),this._pitchWithRotate&&this._mousePitch.enable()}disable(){this._mouseRotate.disable(),this._mousePitch.disable()}isEnabled(){return this._mouseRotate.isEnabled()&&(!this._pitchWithRotate||this._mousePitch.isEnabled())}isActive(){return this._mouseRotate.isActive()||this._mousePitch.isActive()}}class Zi{constructor(e,t,r,i){this._el=e,this._touchZoom=t,this._touchRotate=r,this._tapDragZoom=i,this._rotationDisabled=!1,this._enabled=!0}enable(e){this._touchZoom.enable(e),this._rotationDisabled||this._touchRotate.enable(e),this._tapDragZoom.enable(),this._el.classList.add("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")}disable(){this._touchZoom.disable(),this._touchRotate.disable(),this._tapDragZoom.disable(),this._el.classList.remove("maplibregl-touch-zoom-rotate","mapboxgl-touch-zoom-rotate")}isEnabled(){return this._touchZoom.isEnabled()&&(this._rotationDisabled||this._touchRotate.isEnabled())&&this._tapDragZoom.isEnabled()}isActive(){return this._touchZoom.isActive()||this._touchRotate.isActive()||this._tapDragZoom.isActive()}disableRotation(){this._rotationDisabled=!0,this._touchRotate.disable()}enableRotation(){this._rotationDisabled=!1,this._touchZoom.isEnabled()&&this._touchRotate.enable()}}const Wi=e=>e.zoom||e.drag||e.pitch||e.rotate;class Xi extends e.Event{}function Ki(e){return e.panDelta&&e.panDelta.mag()||e.zoomDelta||e.bearingDelta||e.pitchDelta}class Hi{constructor(t,r){this._map=t,this._el=this._map.getCanvasContainer(),this._handlers=[],this._handlersById={},this._changes=[],this._inertia=new ci(t),this._bearingSnap=r.bearingSnap,this._previousActiveHandlers={},this._eventsInProgress={},this._addDefaultHandlers(r),e.bindAll(["handleEvent","handleWindowEvent"],this);const 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],[document,"mousemove",{capture:!0}],[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],[window,"blur",void 0]];for(const[e,t,r]of this._listeners)o.addEventListener(e,t,e===document?this.handleWindowEvent:this.handleEvent,r)}destroy(){for(const[e,t,r]of this._listeners)o.removeEventListener(e,t,e===document?this.handleWindowEvent:this.handleEvent,r)}_addDefaultHandlers(e){const t=this._map,r=t.getCanvasContainer();this._add("mapEvent",new mi(t,e));const i=t.boxZoom=new gi(t,e);this._add("boxZoom",i);const n=new xi,o=new Vi;t.doubleClickZoom=new Ui(o,n),this._add("tapZoom",n),this._add("clickZoom",o);const a=new qi;this._add("tapDragZoom",a);const s=t.touchPitch=new Li(t);this._add("touchPitch",s);const l=new Ti(e),c=new ki(e);t.dragRotate=new Gi(e,l,c),this._add("mouseRotate",l,["mousePitch"]),this._add("mousePitch",c,["mouseRotate"]);const u=new Ei(e),h=new Ai(e,t);t.dragPan=new $i(r,u,h),this._add("mousePan",u),this._add("touchPan",h,["touchZoom","touchRotate"]);const p=new Oi,d=new zi;t.touchZoomRotate=new Zi(r,d,p,a),this._add("touchRotate",p,["touchPan","touchZoom"]),this._add("touchZoom",d,["touchPan","touchRotate"]);const f=t.scrollZoom=new Ni(t,this);this._add("scrollZoom",f,["mousePan"]);const m=t.keyboard=new Ri;this._add("keyboard",m),this._add("blockableMapEvent",new yi(t));for(const r of["boxZoom","doubleClickZoom","tapDragZoom","touchPitch","dragRotate","dragPan","touchZoomRotate","scrollZoom","keyboard"])e.interactive&&e[r]&&t[r].enable(e[r])}_add(e,t,r){this._handlers.push({handlerName:e,handler:t,allowed:r}),this._handlersById[e]=t}stop(e){if(!this._updatingCamera){for(const{handler:e}of this._handlers)e.reset();this._inertia.clear(),this._fireEvents({},{},e),this._changes=[]}}isActive(){for(const{handler:e}of this._handlers)if(e.isActive())return!0;return!1}isZooming(){return!!this._eventsInProgress.zoom||this._map.scrollZoom.isZooming()}isRotating(){return!!this._eventsInProgress.rotate}isMoving(){return Boolean(Wi(this._eventsInProgress))||this.isZooming()}_blockedByActive(e,t,r){for(const i in e)if(i!==r&&(!t||t.indexOf(i)<0))return!0;return!1}handleWindowEvent(e){this.handleEvent(e,`${e.type}Window`)}_getMapTouches(e){const t=[];for(const r of e)this._el.contains(r.target)&&t.push(r);return t}handleEvent(e,t){if("blur"===e.type)return void this.stop(!0);this._updatingCamera=!0;const r="renderFrame"===e.type?void 0:e,i={needsRenderFrame:!1},n={},a={},s=e.touches,l=s?this._getMapTouches(s):void 0,c=l?o.touchPos(this._el,l):o.mousePos(this._el,e);for(const{handlerName:o,handler:s,allowed:u}of this._handlers){if(!s.isEnabled())continue;let h;this._blockedByActive(a,u,o)?s.reset():s[t||e.type]&&(h=s[t||e.type](e,c,l),this.mergeHandlerResult(i,n,h,o,r),h&&h.needsRenderFrame&&this._triggerRenderFrame()),(h||s.isActive())&&(a[o]=s)}const u={};for(const e in this._previousActiveHandlers)a[e]||(u[e]=r);this._previousActiveHandlers=a,(Object.keys(u).length||Ki(i))&&(this._changes.push([i,n,u]),this._triggerRenderFrame()),(Object.keys(a).length||Ki(i))&&this._map._stop(!0),this._updatingCamera=!1;const{cameraAnimation:h}=i;h&&(this._inertia.clear(),this._fireEvents({},{},!0),this._changes=[],h(this._map))}mergeHandlerResult(t,r,i,n,o){if(!i)return;e.extend(t,i);const a={handlerName:n,originalEvent:i.originalEvent||o};void 0!==i.zoomDelta&&(r.zoom=a),void 0!==i.panDelta&&(r.drag=a),void 0!==i.pitchDelta&&(r.pitch=a),void 0!==i.bearingDelta&&(r.rotate=a)}_applyChanges(){const t={},r={},i={};for(const[n,o,a]of this._changes)n.panDelta&&(t.panDelta=(t.panDelta||new e.pointGeometry(0,0))._add(n.panDelta)),n.zoomDelta&&(t.zoomDelta=(t.zoomDelta||0)+n.zoomDelta),n.bearingDelta&&(t.bearingDelta=(t.bearingDelta||0)+n.bearingDelta),n.pitchDelta&&(t.pitchDelta=(t.pitchDelta||0)+n.pitchDelta),void 0!==n.around&&(t.around=n.around),void 0!==n.pinchAround&&(t.pinchAround=n.pinchAround),n.noInertia&&(t.noInertia=n.noInertia),e.extend(r,o),e.extend(i,a);this._updateMapTransform(t,r,i),this._changes=[]}_updateMapTransform(t,r,i){const n=this._map,o=n.transform,a=n.style&&n.style.terrain;if(!(Ki(t)||a&&this._drag))return this._fireEvents(r,i,!0);let{panDelta:s,zoomDelta:l,bearingDelta:c,pitchDelta:u,around:h,pinchAround:p}=t;void 0!==p&&(h=p),n._stop(!0),h=h||n.transform.centerPoint;const d=o.pointLocation(s?h.sub(s):h);c&&(o.bearing+=c),u&&(o.pitch+=u),l&&(o.zoom+=l),a?r.drag&&!this._drag?(this._drag={center:o.centerPoint,lngLat:o.pointLocation(h),point:h,handlerName:r.drag.handlerName},n.fire(new e.Event("freezeElevation",{freeze:!0}))):this._drag&&i[this._drag.handlerName]?(n.fire(new e.Event("freezeElevation",{freeze:!1})),this._drag=null):r.drag&&this._drag&&(o.center=o.pointLocation(o.centerPoint.sub(s))):o.setLocationAtPoint(d,h),this._map._update(),t.noInertia||this._inertia.record(t),this._fireEvents(r,i,!0)}_fireEvents(t,r,i){const n=Wi(this._eventsInProgress),o=Wi(t),a={};for(const e in t){const{originalEvent:r}=t[e];this._eventsInProgress[e]||(a[`${e}start`]=r),this._eventsInProgress[e]=t[e]}!n&&o&&this._fireEvent("movestart",o.originalEvent);for(const e in a)this._fireEvent(e,a[e]);o&&this._fireEvent("move",o.originalEvent);for(const e in t){const{originalEvent:r}=t[e];this._fireEvent(e,r)}const s={};let l;for(const e in this._eventsInProgress){const{handlerName:t,originalEvent:i}=this._eventsInProgress[e];this._handlersById[t].isActive()||(delete this._eventsInProgress[e],l=r[t]||i,s[`${e}end`]=l)}for(const e in s)this._fireEvent(e,s[e]);const c=Wi(this._eventsInProgress);if(i&&(n||o)&&!c){this._updatingCamera=!0;const t=this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions),r=e=>0!==e&&-this._bearingSnap<e&&e<this._bearingSnap;t?(r(t.bearing||this._map.getBearing())&&(t.bearing=0),this._map.easeTo(t,{originalEvent:l})):(this._map.fire(new e.Event("moveend",{originalEvent:l})),r(this._map.getBearing())&&this._map.resetNorth()),this._updatingCamera=!1}}_fireEvent(t,r){this._map.fire(new e.Event(t,r?{originalEvent:r}:{}))}_requestFrame(){return this._map.triggerRepaint(),this._map._renderTaskQueue.add((e=>{delete this._frameId,this.handleEvent(new Xi("renderFrame",{timeStamp:e})),this._applyChanges()}))}_triggerRenderFrame(){void 0===this._frameId&&(this._frameId=this._requestFrame())}}const Ji={extend:(t,...r)=>e.extend(t,...r),run(e){e()},logToElement(e,t=!1,r="log"){const i=window.document.getElementById(r);i&&(t&&(i.innerHTML=""),i.innerHTML+=`<br>${e}`)}};class Yi extends e.Evented{constructor(t,r){super(),this._moving=!1,this._zooming=!1,this.transform=t,this._bearingSnap=r.bearingSnap,e.bindAll(["_renderFrameCallback"],this)}getCenter(){return new e.LngLat(this.transform.center.lng,this.transform.center.lat)}setCenter(e,t){return this.jumpTo({center:e},t)}panBy(t,r,i){return t=e.pointGeometry.convert(t).mult(-1),this.panTo(this.transform.center,e.extend({offset:t},r),i)}panTo(t,r,i){return this.easeTo(e.extend({center:t},r),i)}getZoom(){return this.transform.zoom}setZoom(e,t){return this.jumpTo({zoom:e},t),this}zoomTo(t,r,i){return this.easeTo(e.extend({zoom:t},r),i)}zoomIn(e,t){return this.zoomTo(this.getZoom()+1,e,t),this}zoomOut(e,t){return this.zoomTo(this.getZoom()-1,e,t),this}getBearing(){return this.transform.bearing}setBearing(e,t){return this.jumpTo({bearing:e},t),this}getPadding(){return this.transform.padding}setPadding(e,t){return this.jumpTo({padding:e},t),this}rotateTo(t,r,i){return this.easeTo(e.extend({bearing:t},r),i)}resetNorth(t,r){return this.rotateTo(0,e.extend({duration:1e3},t),r),this}resetNorthPitch(t,r){return this.easeTo(e.extend({bearing:0,pitch:0,duration:1e3},t),r),this}snapToNorth(e,t){return Math.abs(this.getBearing())<this._bearingSnap?this.resetNorth(e,t):this}getPitch(){return this.transform.pitch}setPitch(e,t){return this.jumpTo({pitch:e},t),this}cameraForBounds(t,r){t=e.LngLatBounds.convert(t);const i=r&&r.bearing||0;return this._cameraForBoxAndBearing(t.getNorthWest(),t.getSouthEast(),i,r)}_cameraForBoxAndBearing(t,r,i,n){const o={top:0,bottom:0,right:0,left:0};if("number"==typeof(n=e.extend({padding:o,offset:[0,0],maxZoom:this.transform.maxZoom},n)).padding){const e=n.padding;n.padding={top:e,bottom:e,right:e,left:e}}n.padding=e.extend(o,n.padding);const a=this.transform,s=a.padding,l=a.project(e.LngLat.convert(t)),c=a.project(e.LngLat.convert(r)),u=l.rotate(-i*Math.PI/180),h=c.rotate(-i*Math.PI/180),p=new e.pointGeometry(Math.max(u.x,h.x),Math.max(u.y,h.y)),d=new e.pointGeometry(Math.min(u.x,h.x),Math.min(u.y,h.y)),f=p.sub(d),m=(a.width-(s.left+s.right+n.padding.left+n.padding.right))/f.x,y=(a.height-(s.top+s.bottom+n.padding.top+n.padding.bottom))/f.y;if(y<0||m<0)return void e.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.");const g=Math.min(a.scaleZoom(a.scale*Math.min(m,y)),n.maxZoom),_=e.pointGeometry.convert(n.offset),b=new e.pointGeometry((n.padding.left-n.padding.right)/2,(n.padding.top-n.padding.bottom)/2).rotate(i*Math.PI/180),v=_.add(b).mult(a.scale/a.zoomScale(g));return{center:a.unproject(l.add(c).div(2).sub(v)),zoom:g,bearing:i}}fitBounds(e,t,r){return this._fitInternal(this.cameraForBounds(e,t),t,r)}fitScreenCoordinates(t,r,i,n,o){return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(e.pointGeometry.convert(t)),this.transform.pointLocation(e.pointGeometry.convert(r)),i,n),n,o)}_fitInternal(t,r,i){return t?(delete(r=e.extend(t,r)).padding,r.linear?this.easeTo(r,i):this.flyTo(r,i)):this}jumpTo(t,r){this.stop();const i=this.transform;let n=!1,o=!1,a=!1;return"zoom"in t&&i.zoom!==+t.zoom&&(n=!0,i.zoom=+t.zoom),void 0!==t.center&&(i.center=e.LngLat.convert(t.center)),"bearing"in t&&i.bearing!==+t.bearing&&(o=!0,i.bearing=+t.bearing),"pitch"in t&&i.pitch!==+t.pitch&&(a=!0,i.pitch=+t.pitch),null==t.padding||i.isPaddingEqual(t.padding)||(i.padding=t.padding),this.fire(new e.Event("movestart",r)).fire(new e.Event("move",r)),n&&this.fire(new e.Event("zoomstart",r)).fire(new e.Event("zoom",r)).fire(new e.Event("zoomend",r)),o&&this.fire(new e.Event("rotatestart",r)).fire(new e.Event("rotate",r)).fire(new e.Event("rotateend",r)),a&&this.fire(new e.Event("pitchstart",r)).fire(new e.Event("pitch",r)).fire(new e.Event("pitchend",r)),this.fire(new e.Event("moveend",r))}calculateCameraOptionsFromTo(t,r,i,n=0){const o=e.MercatorCoordinate.fromLngLat(t,r),a=e.MercatorCoordinate.fromLngLat(i,n),s=a.x-o.x,l=a.y-o.y,c=a.z-o.z,u=Math.hypot(s,l,c);if(0===u)throw new Error("Can't calculate camera options with same From and To");const h=Math.hypot(s,l),p=this.transform.scaleZoom(this.transform.cameraToCenterDistance/u/this.transform.tileSize),d=180*Math.atan2(s,-l)/Math.PI;let f=180*Math.acos(h/u)/Math.PI;return f=c<0?90-f:90+f,{center:a.toLngLat(),zoom:p,pitch:f,bearing:d}}easeTo(t,r){this._stop(!1,t.easeId),(!1===(t=e.extend({offset:[0,0],duration:500,easing:e.ease},t)).animate||!t.essential&&e.exported.prefersReducedMotion)&&(t.duration=0);const i=this.transform,n=this.getZoom(),o=this.getBearing(),a=this.getPitch(),s=this.getPadding(),l="zoom"in t?+t.zoom:n,c="bearing"in t?this._normalizeBearing(t.bearing,o):o,u="pitch"in t?+t.pitch:a,h="padding"in t?t.padding:i.padding,p=e.pointGeometry.convert(t.offset);let d=i.centerPoint.add(p);const f=i.pointLocation(d),m=e.LngLat.convert(t.center||f);this._normalizeCenter(m);const y=i.project(f),g=i.project(m).sub(y),_=i.zoomScale(l-n);let b,v;t.around&&(b=e.LngLat.convert(t.around),v=i.locationPoint(b));const x={moving:this._moving,zooming:this._zooming,rotating:this._rotating,pitching:this._pitching};return this._zooming=this._zooming||l!==n,this._rotating=this._rotating||o!==c,this._pitching=this._pitching||u!==a,this._padding=!i.isPaddingEqual(h),this._easeId=t.easeId,this._prepareEase(r,t.noMoveStart,x),this._ease((t=>{if(this._zooming&&(i.zoom=e.number(n,l,t)),this._rotating&&(i.bearing=e.number(o,c,t)),this._pitching&&(i.pitch=e.number(a,u,t)),this._padding&&(i.interpolatePadding(s,h,t),d=i.centerPoint.add(p)),b)i.setLocationAtPoint(b,v);else{const e=i.zoomScale(i.zoom-n),r=l>n?Math.min(2,_):Math.max(.5,_),o=Math.pow(r,1-t),a=i.unproject(y.add(g.mult(t*o)).mult(e));i.setLocationAtPoint(i.renderWorldCopies?a.wrap():a,d)}this._fireMoveEvents(r)}),(e=>{this._afterEase(r,e)}),t),this}_prepareEase(t,r,i={}){this._moving=!0,this.fire(new e.Event("freezeElevation",{freeze:!0})),r||i.moving||this.fire(new e.Event("movestart",t)),this._zooming&&!i.zooming&&this.fire(new e.Event("zoomstart",t)),this._rotating&&!i.rotating&&this.fire(new e.Event("rotatestart",t)),this._pitching&&!i.pitching&&this.fire(new e.Event("pitchstart",t))}_fireMoveEvents(t){this.fire(new e.Event("move",t)),this._zooming&&this.fire(new e.Event("zoom",t)),this._rotating&&this.fire(new e.Event("rotate",t)),this._pitching&&this.fire(new e.Event("pitch",t))}_afterEase(t,r){if(this._easeId&&r&&this._easeId===r)return;delete this._easeId,this.fire(new e.Event("freezeElevation",{freeze:!1}));const i=this._zooming,n=this._rotating,o=this._pitching;this._moving=!1,this._zooming=!1,this._rotating=!1,this._pitching=!1,this._padding=!1,i&&this.fire(new e.Event("zoomend",t)),n&&this.fire(new e.Event("rotateend",t)),o&&this.fire(new e.Event("pitchend",t)),this.fire(new e.Event("moveend",t))}flyTo(t,r){if(!t.essential&&e.exported.prefersReducedMotion){const i=e.pick(t,["center","zoom","bearing","pitch","around"]);return this.jumpTo(i,r)}this.stop(),t=e.extend({offset:[0,0],speed:1.2,curve:1.42,easing:e.ease},t);const i=this.transform,n=this.getZoom(),o=this.getBearing(),a=this.getPitch(),s=this.getPadding(),l="zoom"in t?e.clamp(+t.zoom,i.minZoom,i.maxZoom):n,c="bearing"in t?this._normalizeBearing(t.bearing,o):o,u="pitch"in t?+t.pitch:a,h="padding"in t?t.padding:i.padding,p=i.zoomScale(l-n),d=e.pointGeometry.convert(t.offset);let f=i.centerPoint.add(d);const m=i.pointLocation(f),y=e.LngLat.convert(t.center||m);this._normalizeCenter(y);const g=i.project(m),_=i.project(y).sub(g);let b=t.curve;const v=Math.max(i.width,i.height),x=v/p,w=_.mag();if("minZoom"in t){const r=e.clamp(Math.min(t.minZoom,n,l),i.minZoom,i.maxZoom),o=v/i.zoomScale(r-n);b=Math.sqrt(o/w*2)}const S=b*b;function E(e){const t=(x*x-v*v+(e?-1:1)*S*S*w*w)/(2*(e?x:v)*S*w);return Math.log(Math.sqrt(t*t+1)-t)}function T(e){return(Math.exp(e)-Math.exp(-e))/2}function k(e){return(Math.exp(e)+Math.exp(-e))/2}const A=E(0);let I=function(e){return k(A)/k(A+b*e)},P=function(e){return v*((k(A)*(T(t=A+b*e)/k(t))-T(A))/S)/w;var t},C=(E(1)-A)/b;if(Math.abs(w)<1e-6||!isFinite(C)){if(Math.abs(v-x)<1e-6)return this.easeTo(t,r);const e=x<v?-1:1;C=Math.abs(Math.log(x/v))/b,P=function(){return 0},I=function(t){return Math.exp(e*b*t)}}return t.duration="duration"in t?+t.duration:1e3*C/("screenSpeed"in t?+t.screenSpeed/b:+t.speed),t.maxDuration&&t.duration>t.maxDuration&&(t.duration=0),this._zooming=!0,this._rotating=o!==c,this._pitching=u!==a,this._padding=!i.isPaddingEqual(h),this._prepareEase(r,!1),this._ease((t=>{const p=t*C,m=1/I(p);i.zoom=1===t?l:n+i.scaleZoom(m),this._rotating&&(i.bearing=e.number(o,c,t)),this._pitching&&(i.pitch=e.number(a,u,t)),this._padding&&(i.interpolatePadding(s,h,t),f=i.centerPoint.add(d));const b=1===t?y:i.unproject(g.add(_.mult(P(p))).mult(m));i.setLocationAtPoint(i.renderWorldCopies?b.wrap():b,f),this._fireMoveEvents(r)}),(()=>this._afterEase(r)),t),this}isEasing(){return!!this._easeFrameId}stop(){return this._stop()}_stop(e,t){if(this._easeFrameId&&(this._cancelRenderFrame(this._easeFrameId),delete this._easeFrameId,delete this._onEaseFrame),this._onEaseEnd){const e=this._onEaseEnd;delete this._onEaseEnd,e.call(this,t)}if(!e){const e=this.handlers;e&&e.stop(!1)}return this}_ease(t,r,i){!1===i.animate||0===i.duration?(t(1),r()):(this._easeStart=e.exported.now(),this._easeOptions=i,this._onEaseFrame=t,this._onEaseEnd=r,this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback))}_renderFrameCallback(){const t=Math.min((e.exported.now()-this._easeStart)/this._easeOptions.duration,1);this._onEaseFrame(this._easeOptions.easing(t)),t<1?this._easeFrameId=this._requestRenderFrame(this._renderFrameCallback):this.stop()}_normalizeBearing(t,r){t=e.wrap(t,-180,180);const i=Math.abs(t-r);return Math.abs(t-360-r)<i&&(t-=360),Math.abs(t+360-r)<i&&(t+=360),t}_normalizeCenter(e){const t=this.transform;if(!t.renderWorldCopies||t.lngRange)return;const r=e.lng-t.center.lng;e.lng+=r>180?-360:r<-180?360:0}}class Qi{constructor(t={}){this.options=t,e.bindAll(["_toggleAttribution","_updateData","_updateCompact","_updateCompactMinimize"],this)}getDefaultPosition(){return"bottom-right"}onAdd(e){return this._map=e,this._compact=this.options&&this.options.compact,this._container=o.create("details","maplibregl-ctrl maplibregl-ctrl-attrib mapboxgl-ctrl mapboxgl-ctrl-attrib"),this._compactButton=o.create("summary","maplibregl-ctrl-attrib-button mapboxgl-ctrl-attrib-button",this._container),this._compactButton.addEventListener("click",this._toggleAttribution),this._setElementTitle(this._compactButton,"ToggleAttribution"),this._innerContainer=o.create("div","maplibregl-ctrl-attrib-inner mapboxgl-ctrl-attrib-inner",this._container),this._updateAttributions(),this._updateCompact(),this._map.on("styledata",this._updateData),this._map.on("sourcedata",this._updateData),this._map.on("terrain",this._updateData),this._map.on("resize",this._updateCompact),this._map.on("drag",this._updateCompactMinimize),this._container}onRemove(){o.remove(this._container),this._map.off("styledata",this._updateData),this._map.off("sourcedata",this._updateData),this._map.off("terrain",this._updateData),this._map.off("resize",this._updateCompact),this._map.off("drag",this._updateCompactMinimize),this._map=void 0,this._compact=void 0,this._attribHTML=void 0}_setElementTitle(e,t){const r=this._map._getUIString(`AttributionControl.${t}`);e.title=r,e.setAttribute("aria-label",r)}_toggleAttribution(){this._container.classList.contains("maplibregl-compact")&&(this._container.classList.contains("maplibregl-compact-show")?(this._container.setAttribute("open",""),this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")):(this._container.classList.add("maplibregl-compact-show","mapboxgl-compact-show"),this._container.removeAttribute("open")))}_updateData(e){!e||"metadata"!==e.sourceDataType&&"visibility"!==e.sourceDataType&&"style"!==e.dataType&&"terrain"!==e.type||this._updateAttributions()}_updateAttributions(){if(!this._map.style)return;let e=[];if(this.options.customAttribution&&(Array.isArray(this.options.customAttribution)?e=e.concat(this.options.customAttribution.map((e=>"string"!=typeof e?"":e))):"string"==typeof this.options.customAttribution&&e.push(this.options.customAttribution)),this._map.style.stylesheet){const e=this._map.style.stylesheet;this.styleOwner=e.owner,this.styleId=e.id}const t=this._map.style.sourceCaches;for(const r in t){const i=t[r];if(i.used||i.usedForTerrain){const t=i.getSource();t.attribution&&e.indexOf(t.attribution)<0&&e.push(t.attribution)}}e=e.filter((e=>String(e).trim())),e.sort(((e,t)=>e.length-t.length)),e=e.filter(((t,r)=>{for(let i=r+1;i<e.length;i++)if(e[i].indexOf(t)>=0)return!1;return!0}));const r=e.join(" | ");r!==this._attribHTML&&(this._attribHTML=r,e.length?(this._innerContainer.innerHTML=r,this._container.classList.remove("maplibregl-attrib-empty","mapboxgl-attrib-empty")):this._container.classList.add("maplibregl-attrib-empty","mapboxgl-attrib-empty"),this._updateCompact(),this._editLink=null)}_updateCompact(){this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1===this._compact?this._container.setAttribute("open",""):this._container.classList.contains("maplibregl-compact")||this._container.classList.contains("maplibregl-attrib-empty")||(this._container.setAttribute("open",""),this._container.classList.add("maplibregl-compact","mapboxgl-compact","maplibregl-compact-show","mapboxgl-compact-show")):(this._container.setAttribute("open",""),this._container.classList.contains("maplibregl-compact")&&this._container.classList.remove("maplibregl-compact","maplibregl-compact-show","mapboxgl-compact","mapboxgl-compact-show"))}_updateCompactMinimize(){this._container.classList.contains("maplibregl-compact")&&this._container.classList.contains("maplibregl-compact-show")&&this._container.classList.remove("maplibregl-compact-show","mapboxgl-compact-show")}}class en{constructor(t={}){this.options=t,e.bindAll(["_updateCompact"],this)}getDefaultPosition(){return"bottom-left"}onAdd(e){this._map=e,this._compact=this.options&&this.options.compact,this._container=o.create("div","maplibregl-ctrl mapboxgl-ctrl");const t=o.create("a","maplibregl-ctrl-logo mapboxgl-ctrl-logo");return t.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="block",this._map.on("resize",this._updateCompact),this._updateCompact(),this._container}onRemove(){o.remove(this._container),this._map.off("resize",this._updateCompact),this._map=void 0,this._compact=void 0}_updateCompact(){const e=this._container.children;if(e.length){const t=e[0];this._map.getCanvasContainer().offsetWidth<=640||this._compact?!1!==this._compact&&t.classList.add("maplibregl-compact","mapboxgl-compact"):t.classList.remove("maplibregl-compact","mapboxgl-compact")}}}class tn{constructor(){this._queue=[],this._id=0,this._cleared=!1,this._currentlyRunning=!1}add(e){const t=++this._id;return this._queue.push({callback:e,id:t,cancelled:!1}),t}remove(e){const t=this._currentlyRunning,r=t?this._queue.concat(t):this._queue;for(const t of r)if(t.id===e)return void(t.cancelled=!0)}run(e=0){if(this._currentlyRunning)throw new Error("Attempting to run(), but is already running.");const t=this._currentlyRunning=this._queue;this._queue=[];for(const r of t)if(!r.cancelled&&(r.callback(e),this._cleared))break;this._cleared=!1,this._currentlyRunning=!1}clear(){this._currentlyRunning&&(this._cleared=!0),this._queue=[]}}const rn={"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","TerrainControl.enableTerrain":"Enable terrain","TerrainControl.disableTerrain":"Disable terrain"},nn={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,cooperativeGestures:void 0,bearingSnap:7,clickTolerance:3,pitchWithRotate:!0,hash:!1,attributionControl:!0,maplibreLogo:!1,failIfMajorPerformanceCaveat:!1,preserveDrawingBuffer:!1,trackResize:!0,renderWorldCopies:!0,refreshExpiredTiles:!0,maxTileCacheSize:null,localIdeographFontFamily:"sans-serif",transformRequest:null,fadeDuration:300,crossSourceCollisions:!0},on={showCompass:!0,showZoom:!0,visualizePitch:!1};class an{constructor(t,r,i=!1){this._clickTolerance=10,this.element=r,this.mouseRotate=new Ti({clickTolerance:t.dragRotate._mouseRotate._clickTolerance}),this.map=t,i&&(this.mousePitch=new ki({clickTolerance:t.dragRotate._mousePitch._clickTolerance})),e.bindAll(["mousedown","mousemove","mouseup","touchstart","touchmove","touchend","reset"],this),o.addEventListener(r,"mousedown",this.mousedown),o.addEventListener(r,"touchstart",this.touchstart,{passive:!1}),o.addEventListener(r,"touchmove",this.touchmove),o.addEventListener(r,"touchend",this.touchend),o.addEventListener(r,"touchcancel",this.reset)}down(e,t){this.mouseRotate.mousedown(e,t),this.mousePitch&&this.mousePitch.mousedown(e,t),o.disableDrag()}move(e,t){const r=this.map,i=this.mouseRotate.mousemoveWindow(e,t);if(i&&i.bearingDelta&&r.setBearing(r.getBearing()+i.bearingDelta),this.mousePitch){const i=this.mousePitch.mousemoveWindow(e,t);i&&i.pitchDelta&&r.setPitch(r.getPitch()+i.pitchDelta)}}off(){const e=this.element;o.removeEventListener(e,"mousedown",this.mousedown),o.removeEventListener(e,"touchstart",this.touchstart,{passive:!1}),o.removeEventListener(e,"touchmove",this.touchmove),o.removeEventListener(e,"touchend",this.touchend),o.removeEventListener(e,"touchcancel",this.reset),this.offTemp()}offTemp(){o.enableDrag(),o.removeEventListener(window,"mousemove",this.mousemove),o.removeEventListener(window,"mouseup",this.mouseup)}mousedown(t){this.down(e.extend({},t,{ctrlKey:!0,preventDefault:()=>t.preventDefault()}),o.mousePos(this.element,t)),o.addEventListener(window,"mousemove",this.mousemove),o.addEventListener(window,"mouseup",this.mouseup)}mousemove(e){this.move(e,o.mousePos(this.element,e))}mouseup(e){this.mouseRotate.mouseupWindow(e),this.mousePitch&&this.mousePitch.mouseupWindow(e),this.offTemp()}touchstart(e){1!==e.targetTouches.length?this.reset():(this._startPos=this._lastPos=o.touchPos(this.element,e.targetTouches)[0],this.down({type:"mousedown",button:0,ctrlKey:!0,preventDefault:()=>e.preventDefault()},this._startPos))}touchmove(e){1!==e.targetTouches.length?this.reset():(this._lastPos=o.touchPos(this.element,e.targetTouches)[0],this.move({preventDefault:()=>e.preventDefault()},this._lastPos))}touchend(e){0===e.targetTouches.length&&this._startPos&&this._lastPos&&this._startPos.dist(this._lastPos)<this._clickTolerance&&this.element.click(),this.reset()}reset(){this.mouseRotate.reset(),this.mousePitch&&this.mousePitch.reset(),delete this._startPos,delete this._lastPos,this.offTemp()}}function sn(t,r,i){if(t=new e.LngLat(t.lng,t.lat),r){const n=new e.LngLat(t.lng-360,t.lat),o=new e.LngLat(t.lng+360,t.lat),a=i.locationPoint(t).distSqr(r);i.locationPoint(n).distSqr(r)<a?t=n:i.locationPoint(o).distSqr(r)<a&&(t=o)}for(;Math.abs(t.lng-i.center.lng)>180;){const e=i.locationPoint(t);if(e.x>=0&&e.y>=0&&e.x<=i.width&&e.y<=i.height)break;t.lng>i.center.lng?t.lng-=360:t.lng+=360}return t}const ln={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 cn(e,t,r){const i=e.classList;for(const e in ln)i.remove(`maplibregl-${r}-anchor-${e}`,`mapboxgl-${r}-anchor-${e}`);i.add(`maplibregl-${r}-anchor-${t}`,`mapboxgl-${r}-anchor-${t}`)}class un extends e.Evented{constructor(t,r){if(super(),(t instanceof HTMLElement||r)&&(t=e.extend({element:t},r)),e.bindAll(["_update","_onMove","_onUp","_addDragHandler","_onMapClick","_onKeyPress"],this),this._anchor=t&&t.anchor||"center",this._color=t&&t.color||"#3FB1CE",this._scale=t&&t.scale||1,this._draggable=t&&t.draggable||!1,this._clickTolerance=t&&t.clickTolerance||0,this._isDragging=!1,this._state="inactive",this._rotation=t&&t.rotation||0,this._rotationAlignment=t&&t.rotationAlignment||"auto",this._pitchAlignment=t&&t.pitchAlignment&&"auto"!==t.pitchAlignment?t.pitchAlignment:this._rotationAlignment,t&&t.element)this._element=t.element,this._offset=e.pointGeometry.convert(t&&t.offset||[0,0]);else{this._defaultMarker=!0,this._element=o.create("div"),this._element.setAttribute("aria-label","Map marker");const r=o.createNS("http://www.w3.org/2000/svg","svg"),i=41,n=27;r.setAttributeNS(null,"display","block"),r.setAttributeNS(null,"height",`${i}px`),r.setAttributeNS(null,"width",`${n}px`),r.setAttributeNS(null,"viewBox",`0 0 ${n} ${i}`);const a=o.createNS("http://www.w3.org/2000/svg","g");a.setAttributeNS(null,"stroke","none"),a.setAttributeNS(null,"stroke-width","1"),a.setAttributeNS(null,"fill","none"),a.setAttributeNS(null,"fill-rule","evenodd");const s=o.createNS("http://www.w3.org/2000/svg","g");s.setAttributeNS(null,"fill-rule","nonzero");const l=o.createNS("http://www.w3.org/2000/svg","g");l.setAttributeNS(null,"transform","translate(3.0, 29.0)"),l.setAttributeNS(null,"fill","#000000");const c=[{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"}];for(const e of c){const t=o.createNS("http://www.w3.org/2000/svg","ellipse");t.setAttributeNS(null,"opacity","0.04"),t.setAttributeNS(null,"cx","10.5"),t.setAttributeNS(null,"cy","5.80029008"),t.setAttributeNS(null,"rx",e.rx),t.setAttributeNS(null,"ry",e.ry),l.appendChild(t)}const u=o.createNS("http://www.w3.org/2000/svg","g");u.setAttributeNS(null,"fill",this._color);const h=o.createNS("http://www.w3.org/2000/svg","path");h.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"),u.appendChild(h);const p=o.createNS("http://www.w3.org/2000/svg","g");p.setAttributeNS(null,"opacity","0.25"),p.setAttributeNS(null,"fill","#000000");const d=o.createNS("http://www.w3.org/2000/svg","path");d.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"),p.appendChild(d);const f=o.createNS("http://www.w3.org/2000/svg","g");f.setAttributeNS(null,"transform","translate(6.0, 7.0)"),f.setAttributeNS(null,"fill","#FFFFFF");const m=o.createNS("http://www.w3.org/2000/svg","g");m.setAttributeNS(null,"transform","translate(8.0, 8.0)");const y=o.createNS("http://www.w3.org/2000/svg","circle");y.setAttributeNS(null,"fill","#000000"),y.setAttributeNS(null,"opacity","0.25"),y.setAttributeNS(null,"cx","5.5"),y.setAttributeNS(null,"cy","5.5"),y.setAttributeNS(null,"r","5.4999962");const g=o.createNS("http://www.w3.org/2000/svg","circle");g.setAttributeNS(null,"fill","#FFFFFF"),g.setAttributeNS(null,"cx","5.5"),g.setAttributeNS(null,"cy","5.5"),g.setAttributeNS(null,"r","5.4999962"),m.appendChild(y),m.appendChild(g),s.appendChild(l),s.appendChild(u),s.appendChild(p),s.appendChild(f),s.appendChild(m),r.appendChild(s),r.setAttributeNS(null,"height",i*this._scale+"px"),r.setAttributeNS(null,"width",n*this._scale+"px"),this._element.appendChild(r),this._offset=e.pointGeometry.convert(t&&t.offset||[0,-14])}this._element.classList.add("maplibregl-marker","mapboxgl-marker"),this._element.addEventListener("dragstart",(e=>{e.preventDefault()})),this._element.addEventListener("mousedown",(e=>{e.preventDefault()})),cn(this._element,this._anchor,"marker"),this._popup=null}addTo(e){return this.remove(),this._map=e,e.getCanvasContainer().appendChild(this._element),e.on("move",this._update),e.on("moveend",this._update),this.setDraggable(this._draggable),this._update(),this._map.on("click",this._onMapClick),this}remove(){return this._opacityTimeout&&(clearTimeout(this._opacityTimeout),delete this._opacityTimeout),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),o.remove(this._element),this._popup&&this._popup.remove(),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.LngLat.convert(t),this._pos=null,this._popup&&this._popup.setLngLat(this._lngLat),this._update(),this}getElement(){return this._element}setPopup(e){if(this._popup&&(this._popup.remove(),this._popup=null,this._element.removeEventListener("keypress",this._onKeyPress),this._originalTabIndex||this._element.removeAttribute("tabindex")),e){if(!("offset"in e.options)){const t=38.1,r=13.5,i=Math.sqrt(Math.pow(r,2)/2);e.options.offset=this._defaultMarker?{top:[0,0],"top-left":[0,0],"top-right":[0,0],bottom:[0,-t],"bottom-left":[i,-1*(t-r+i)],"bottom-right":[-i,-1*(t-r+i)],left:[r,-1*(t-r)],right:[-r,-1*(t-r)]}:this._offset}this._popup=e,this._lngLat&&this._popup.setLngLat(this._lngLat),this._originalTabIndex=this._element.getAttribute("tabindex"),this._originalTabIndex||this._element.setAttribute("tabindex","0"),this._element.addEventListener("keypress",this._onKeyPress)}return this}_onKeyPress(e){const t=e.code,r=e.charCode||e.keyCode;"Space"!==t&&"Enter"!==t&&32!==r&&13!==r||this.togglePopup()}_onMapClick(e){const t=e.originalEvent.target,r=this._element;this._popup&&(t===r||r.contains(t))&&this.togglePopup()}getPopup(){return this._popup}togglePopup(){const e=this._popup;return e?(e.isOpen()?e.remove():e.addTo(this._map),this):this}_update(e){if(!this._map)return;this._map.transform.renderWorldCopies&&(this._lngLat=sn(this._lngLat,this._pos,this._map.transform)),this._pos=this._map.project(this._lngLat)._add(this._offset);let t="";"viewport"===this._rotationAlignment||"auto"===this._rotationAlignment?t=`rotateZ(${this._rotation}deg)`:"map"===this._rotationAlignment&&(t=`rotateZ(${this._rotation-this._map.getBearing()}deg)`);let r="";"viewport"===this._pitchAlignment||"auto"===this._pitchAlignment?r="rotateX(0deg)":"map"===this._pitchAlignment&&(r=`rotateX(${this._map.getPitch()}deg)`),e&&"moveend"!==e.type||(this._pos=this._pos.round()),o.setTransform(this._element,`${ln[this._anchor]} translate(${this._pos.x}px, ${this._pos.y}px) ${r} ${t}`),this._map.style&&this._map.style.terrain&&!this._opacityTimeout&&(this._opacityTimeout=setTimeout((()=>{const e=this._map.unproject(this._pos),t=40075016.686*Math.abs(Math.cos(this._lngLat.lat*Math.PI/180))/Math.pow(2,this._map.transform.tileZoom+8);this._element.style.opacity=e.distanceTo(this._lngLat)>20*t?"0.2":"1.0",this._opacityTimeout=null}),100))}getOffset(){return this._offset}setOffset(t){return this._offset=e.pointGeometry.convert(t),this._update(),this}_onMove(t){if(!this._isDragging){const e=this._clickTolerance||this._map._clickTolerance;this._isDragging=t.point.dist(this._pointerdownPos)>=e}this._isDragging&&(this._pos=t.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 e.Event("dragstart"))),this.fire(new e.Event("drag")))}_onUp(){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 e.Event("dragend")),this._state="inactive"}_addDragHandler(e){this._element.contains(e.originalEvent.target)&&(e.preventDefault(),this._positionDelta=e.point.sub(this._pos).add(this._offset),this._pointerdownPos=e.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))}setDraggable(e){return this._draggable=!!e,this._map&&(e?(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}isDraggable(){return this._draggable}setRotation(e){return this._rotation=e||0,this._update(),this}getRotation(){return this._rotation}setRotationAlignment(e){return this._rotationAlignment=e||"auto",this._update(),this}getRotationAlignment(){return this._rotationAlignment}setPitchAlignment(e){return this._pitchAlignment=e&&"auto"!==e?e:this._rotationAlignment,this._update(),this}getPitchAlignment(){return this._pitchAlignment}}const hn={positionOptions:{enableHighAccuracy:!1,maximumAge:0,timeout:6e3},fitBoundsOptions:{maxZoom:15},trackUserLocation:!1,showAccuracyCircle:!0,showUserLocation:!0};let pn,dn=0,fn=!1;const mn={maxWidth:100,unit:"metric"};function yn(e,t,r){const i=r&&r.maxWidth||100,n=e._container.clientHeight/2,o=e.unproject([0,n]),a=e.unproject([i,n]),s=o.distanceTo(a);if(r&&"imperial"===r.unit){const r=3.2808*s;r>5280?gn(t,i,r/5280,e._getUIString("ScaleControl.Miles")):gn(t,i,r,e._getUIString("ScaleControl.Feet"))}else r&&"nautical"===r.unit?gn(t,i,s/1852,e._getUIString("ScaleControl.NauticalMiles")):s>=1e3?gn(t,i,s/1e3,e._getUIString("ScaleControl.Kilometers")):gn(t,i,s,e._getUIString("ScaleControl.Meters"))}function gn(e,t,r,i){const n=function(e){const t=Math.pow(10,`${Math.floor(e)}`.length-1);let r=e/t;return r=r>=10?10:r>=5?5:r>=3?3:r>=2?2:r>=1?1:function(e){const t=Math.pow(10,Math.ceil(-Math.log(e)/Math.LN10));return Math.round(e*t)/t}(r),t*r}(r);e.style.width=t*(n/r)+"px",e.innerHTML=`${n}&nbsp;${i}`}const _n={closeButton:!0,closeOnClick:!0,focusAfterOpen:!0,className:"",maxWidth:"240px"},bn=["a[href]","[tabindex]:not([tabindex='-1'])","[contenteditable]:not([contenteditable='false'])","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].join(", ");function vn(t){if(t){if("number"==typeof t){const r=Math.round(Math.sqrt(.5*Math.pow(t,2)));return{center:new e.pointGeometry(0,0),top:new e.pointGeometry(0,t),"top-left":new e.pointGeometry(r,r),"top-right":new e.pointGeometry(-r,r),bottom:new e.pointGeometry(0,-t),"bottom-left":new e.pointGeometry(r,-r),"bottom-right":new e.pointGeometry(-r,-r),left:new e.pointGeometry(t,0),right:new e.pointGeometry(-t,0)}}if(t instanceof e.pointGeometry||Array.isArray(t)){const r=e.pointGeometry.convert(t);return{center:r,top:r,"top-left":r,"top-right":r,bottom:r,"bottom-left":r,"bottom-right":r,left:r,right:r}}return{center:e.pointGeometry.convert(t.center||[0,0]),top:e.pointGeometry.convert(t.top||[0,0]),"top-left":e.pointGeometry.convert(t["top-left"]||[0,0]),"top-right":e.pointGeometry.convert(t["top-right"]||[0,0]),bottom:e.pointGeometry.convert(t.bottom||[0,0]),"bottom-left":e.pointGeometry.convert(t["bottom-left"]||[0,0]),"bottom-right":e.pointGeometry.convert(t["bottom-right"]||[0,0]),left:e.pointGeometry.convert(t.left||[0,0]),right:e.pointGeometry.convert(t.right||[0,0])}}return vn(new e.pointGeometry(0,0))}const xn={supported:t,setRTLTextPlugin:e.setRTLTextPlugin,getRTLTextPluginStatus:e.getRTLTextPluginStatus,Map:class extends Yi{constructor(t){var r;if(e.PerformanceUtils.mark(e.PerformanceMarkers.create),null!=(t=e.extend({},nn,t)).minZoom&&null!=t.maxZoom&&t.minZoom>t.maxZoom)throw new Error("maxZoom must be greater than or equal to minZoom");if(null!=t.minPitch&&null!=t.maxPitch&&t.minPitch>t.maxPitch)throw new Error("maxPitch must be greater than or equal to minPitch");if(null!=t.minPitch&&t.minPitch<0)throw new Error("minPitch must be greater than or equal to 0");if(null!=t.maxPitch&&t.maxPitch>85)throw new Error("maxPitch must be less than or equal to 85");if(super(new ri(t.minZoom,t.maxZoom,t.minPitch,t.maxPitch,t.renderWorldCopies),{bearingSnap:t.bearingSnap}),this._interactive=t.interactive,this._cooperativeGestures=t.cooperativeGestures,this._maxTileCacheSize=t.maxTileCacheSize,this._failIfMajorPerformanceCaveat=t.failIfMajorPerformanceCaveat,this._preserveDrawingBuffer=t.preserveDrawingBuffer,this._antialias=t.antialias,this._trackResize=t.trackResize,this._bearingSnap=t.bearingSnap,this._refreshExpiredTiles=t.refreshExpiredTiles,this._fadeDuration=t.fadeDuration,this._crossSourceCollisions=t.crossSourceCollisions,this._crossFadingFactor=1,this._collectResourceTiming=t.collectResourceTiming,this._renderTaskQueue=new tn,this._controls=[],this._mapId=e.uniqueId(),this._locale=e.extend({},rn,t.locale),this._clickTolerance=t.clickTolerance,this._pixelRatio=null!==(r=t.pixelRatio)&&void 0!==r?r:devicePixelRatio,this._requestManager=new a(t.transformRequest),"string"==typeof t.container){if(this._container=document.getElementById(t.container),!this._container)throw new Error(`Container '${t.container}' not found.`)}else{if(!(t.container instanceof HTMLElement))throw new Error("Invalid type: 'container' must be a String or HTMLElement.");this._container=t.container}if(t.maxBounds&&this.setMaxBounds(t.maxBounds),e.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",(()=>this._update(!1))),this.on("moveend",(()=>this._update(!1))),this.on("zoom",(()=>this._update(!0))),this.on("terrain",(()=>{this.painter.terrainFacilitator.dirty=!0,this._update(!0)})),"undefined"!=typeof window&&(addEventListener("online",this._onWindowOnline,!1),addEventListener("resize",this._onWindowResize,!1),addEventListener("orientationchange",this._onWindowResize,!1)),this.handlers=new Hi(this,t),this._cooperativeGestures&&this._setupCooperativeGestures(),this._hash=t.hash&&new ii("string"==typeof t.hash&&t.hash||void 0).addTo(this),this._hash&&this._hash._onHashChange()||(this.jumpTo({center:t.center,zoom:t.zoom,bearing:t.bearing,pitch:t.pitch}),t.bounds&&(this.resize(),this.fitBounds(t.bounds,e.extend({},t.fitBoundsOptions,{duration:0})))),this.resize(),this._localIdeographFontFamily=t.localIdeographFontFamily,t.style&&this.setStyle(t.style,{localIdeographFontFamily:t.localIdeographFontFamily}),t.attributionControl&&this.addControl(new Qi({customAttribution:t.customAttribution})),t.maplibreLogo&&this.addControl(new en,t.logoPosition),this.on("style.load",(()=>{this.transform.unmodified&&this.jumpTo(this.style.stylesheet)})),this.on("data",(t=>{this._update("style"===t.dataType),this.fire(new e.Event(`${t.dataType}data`,t))})),this.on("dataloading",(t=>{this.fire(new e.Event(`${t.dataType}dataloading`,t))})),this.on("dataabort",(t=>{this.fire(new e.Event("sourcedataabort",t))}))}_getMapId(){return this._mapId}addControl(t,r){if(void 0===r&&(r=t.getDefaultPosition?t.getDefaultPosition():"top-right"),!t||!t.onAdd)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));const i=t.onAdd(this);this._controls.push(t);const n=this._controlPositions[r];return-1!==r.indexOf("bottom")?n.insertBefore(i,n.firstChild):n.appendChild(i),this}removeControl(t){if(!t||!t.onRemove)return this.fire(new e.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));const r=this._controls.indexOf(t);return r>-1&&this._controls.splice(r,1),t.onRemove(this),this}hasControl(e){return this._controls.indexOf(e)>-1}calculateCameraOptionsFromTo(e,t,r,i){return null==i&&this.style.terrain&&(i=this.transform.getElevation(r,this.style.terrain)),super.calculateCameraOptionsFromTo(e,t,r,i)}resize(t){const r=this._containerDimensions(),i=r[0],n=r[1];this._resizeCanvas(i,n,this.getPixelRatio()),this.transform.resize(i,n),this.painter.resize(i,n,this.getPixelRatio());const o=!this._moving;return o&&(this.stop(),this.fire(new e.Event("movestart",t)).fire(new e.Event("move",t))),this.fire(new e.Event("resize",t)),o&&this.fire(new e.Event("moveend",t)),this}getPixelRatio(){return this._pixelRatio}setPixelRatio(e){const[t,r]=this._containerDimensions();this._pixelRatio=e,this._resizeCanvas(t,r,e),this.painter.resize(t,r,e)}getBounds(){return this.transform.getBounds()}getMaxBounds(){return this.transform.getMaxBounds()}setMaxBounds(t){return this.transform.setMaxBounds(e.LngLatBounds.convert(t)),this._update()}setMinZoom(e){if((e=null==e?-2:e)>=-2&&e<=this.transform.maxZoom)return this.transform.minZoom=e,this._update(),this.getZoom()<e&&this.setZoom(e),this;throw new Error("minZoom must be between -2 and the current maxZoom, inclusive")}getMinZoom(){return this.transform.minZoom}setMaxZoom(e){if((e=null==e?22:e)>=this.transform.minZoom)return this.transform.maxZoom=e,this._update(),this.getZoom()>e&&this.setZoom(e),this;throw new Error("maxZoom must be greater than the current minZoom")}getMaxZoom(){return this.transform.maxZoom}setMinPitch(e){if((e=null==e?0:e)<0)throw new Error("minPitch must be greater than or equal to 0");if(e>=0&&e<=this.transform.maxPitch)return this.transform.minPitch=e,this._update(),this.getPitch()<e&&this.setPitch(e),this;throw new Error("minPitch must be between 0 and the current maxPitch, inclusive")}getMinPitch(){return this.transform.minPitch}setMaxPitch(e){if((e=null==e?60:e)>85)throw new Error("maxPitch must be less than or equal to 85");if(e>=this.transform.minPitch)return this.transform.maxPitch=e,this._update(),this.getPitch()>e&&this.setPitch(e),this;throw new Error("maxPitch must be greater than the current minPitch")}getMaxPitch(){return this.transform.maxPitch}getRenderWorldCopies(){return this.transform.renderWorldCopies}setRenderWorldCopies(e){return this.transform.renderWorldCopies=e,this._update()}project(t){return this.transform.locationPoint(e.LngLat.convert(t),this.style&&this.style.terrain)}unproject(t){return this.transform.pointLocation(e.pointGeometry.convert(t),this.style&&this.style.terrain)}isMoving(){return this._moving||this.handlers.isMoving()}isZooming(){return this._zooming||this.handlers.isZooming()}isRotating(){return this._rotating||this.handlers.isRotating()}_createDelegatedListener(e,t,r){if("mouseenter"===e||"mouseover"===e){let i=!1;const n=n=>{const o=this.getLayer(t)?this.queryRenderedFeatures(n.point,{layers:[t]}):[];o.length?i||(i=!0,r.call(this,new pi(e,this,n.originalEvent,{features:o}))):i=!1};return{layer:t,listener:r,delegates:{mousemove:n,mouseout:()=>{i=!1}}}}if("mouseleave"===e||"mouseout"===e){let i=!1;const n=n=>{(this.getLayer(t)?this.queryRenderedFeatures(n.point,{layers:[t]}):[]).length?i=!0:i&&(i=!1,r.call(this,new pi(e,this,n.originalEvent)))},o=t=>{i&&(i=!1,r.call(this,new pi(e,this,t.originalEvent)))};return{layer:t,listener:r,delegates:{mousemove:n,mouseout:o}}}{const i=e=>{const i=this.getLayer(t)?this.queryRenderedFeatures(e.point,{layers:[t]}):[];i.length&&(e.features=i,r.call(this,e),delete e.features)};return{layer:t,listener:r,delegates:{[e]:i}}}}on(e,t,r){if(void 0===r)return super.on(e,t);const i=this._createDelegatedListener(e,t,r);this._delegatedListeners=this._delegatedListeners||{},this._delegatedListeners[e]=this._delegatedListeners[e]||[],this._delegatedListeners[e].push(i);for(const e in i.delegates)this.on(e,i.delegates[e]);return this}once(e,t,r){if(void 0===r)return super.once(e,t);const i=this._createDelegatedListener(e,t,r);for(const e in i.delegates)this.once(e,i.delegates[e]);return this}off(e,t,r){return void 0===r?super.off(e,t):(this._delegatedListeners&&this._delegatedListeners[e]&&(i=>{const n=this._delegatedListeners[e];for(let e=0;e<n.length;e++){const i=n[e];if(i.layer===t&&i.listener===r){for(const e in i.delegates)this.off(e,i.delegates[e]);return n.splice(e,1),this}}})(),this)}queryRenderedFeatures(t,r){if(!this.style)return[];let i;if(void 0!==r||void 0===t||t instanceof e.pointGeometry||Array.isArray(t)||(r=t,t=void 0),r=r||{},(t=t||[[0,0],[this.transform.width,this.transform.height]])instanceof e.pointGeometry||"number"==typeof t[0])i=[e.pointGeometry.convert(t)];else{const r=e.pointGeometry.convert(t[0]),n=e.pointGeometry.convert(t[1]);i=[r,new e.pointGeometry(n.x,r.y),n,new e.pointGeometry(r.x,n.y),r]}return this.style.queryRenderedFeatures(i,r,this.transform)}querySourceFeatures(e,t){return this.style.querySourceFeatures(e,t)}setStyle(t,r){return!1!==(r=e.extend({},{localIdeographFontFamily:this._localIdeographFontFamily},r)).diff&&r.localIdeographFontFamily===this._localIdeographFontFamily&&this.style&&t?(this._diffStyle(t,r),this):(this._localIdeographFontFamily=r.localIdeographFontFamily,this._updateStyle(t,r))}setTransformRequest(e){return this._requestManager.setTransformRequest(e),this}_getUIString(e){const t=this._locale[e];if(null==t)throw new Error(`Missing UI string '${e}'`);return t}_updateStyle(e,t){return this.style&&(this.style.setEventedParent(null),this.style._remove()),e?(this.style=new tt(this,t||{}),this.style.setEventedParent(this,{style:this.style}),"string"==typeof e?this.style.loadURL(e):this.style.loadJSON(e),this):(delete this.style,this)}_lazyInitEmptyStyle(){this.style||(this.style=new tt(this,{}),this.style.setEventedParent(this,{style:this.style}),this.style.loadEmpty())}_diffStyle(t,r){if("string"==typeof t){const i=this._requestManager.transformRequest(t,e.ResourceType.Style);e.getJSON(i,((t,i)=>{t?this.fire(new e.ErrorEvent(t)):i&&this._updateDiff(i,r)}))}else"object"==typeof t&&this._updateDiff(t,r)}_updateDiff(t,r){try{this.style.setState(t)&&this._update(!0)}catch(i){e.warnOnce(`Unable to perform style diff: ${i.message||i.error||i}. Rebuilding the style from scratch.`),this._updateStyle(t,r)}}getStyle(){if(this.style)return this.style.serialize()}isStyleLoaded(){return this.style?this.style.loaded():e.warnOnce("There is no style added to the map.")}addSource(e,t){return this._lazyInitEmptyStyle(),this.style.addSource(e,t),this._update(!0)}isSourceLoaded(t){const r=this.style&&this.style.sourceCaches[t];if(void 0!==r)return r.loaded();this.fire(new e.ErrorEvent(new Error(`There is no source with ID '${t}'`)))}setTerrain(e){return this.style.setTerrain(e),this}getTerrain(){return this.style.terrain&&this.style.terrain.options}areTilesLoaded(){const e=this.style&&this.style.sourceCaches;for(const t in e){const r=e[t]._tiles;for(const e in r){const t=r[e];if("loaded"!==t.state&&"errored"!==t.state)return!1}}return!0}addSourceType(e,t,r){return this._lazyInitEmptyStyle(),this.style.addSourceType(e,t,r)}removeSource(e){return this.style.removeSource(e),this._update(!0)}getSource(e){return this.style.getSource(e)}addImage(t,r,{pixelRatio:i=1,sdf:n=!1,stretchX:o,stretchY:a,content:s}={}){if(this._lazyInitEmptyStyle(),r instanceof HTMLImageElement||e.isImageBitmap(r)){const{width:l,height:c,data:u}=e.exported.getImageData(r);this.style.addImage(t,{data:new e.RGBAImage({width:l,height:c},u),pixelRatio:i,stretchX:o,stretchY:a,content:s,sdf:n,version:0})}else{if(void 0===r.width||void 0===r.height)return this.fire(new e.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`")));{const{width:l,height:c,data:u}=r,h=r;this.style.addImage(t,{data:new e.RGBAImage({width:l,height:c},new Uint8Array(u)),pixelRatio:i,stretchX:o,stretchY:a,content:s,sdf:n,version:0,userImage:h}),h.onAdd&&h.onAdd(this,t)}}}updateImage(t,r){const i=this.style.getImage(t);if(!i)return this.fire(new e.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));const n=r instanceof HTMLImageElement||e.isImageBitmap(r)?e.exported.getImageData(r):r,{width:o,height:a,data:s}=n;if(void 0===o||void 0===a)return this.fire(new e.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`")));if(o!==i.data.width||a!==i.data.height)return this.fire(new e.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image")));const l=!(r instanceof HTMLImageElement||e.isImageBitmap(r));i.data.replace(s,l),this.style.updateImage(t,i)}hasImage(t){return t?!!this.style.getImage(t):(this.fire(new e.ErrorEvent(new Error("Missing required image id"))),!1)}removeImage(e){this.style.removeImage(e)}loadImage(t,r){e.getImage(this._requestManager.transformRequest(t,e.ResourceType.Image),r)}listImages(){return this.style.listImages()}addLayer(e,t){return this._lazyInitEmptyStyle(),this.style.addLayer(e,t),this._update(!0)}moveLayer(e,t){return this.style.moveLayer(e,t),this._update(!0)}removeLayer(e){return this.style.removeLayer(e),this._update(!0)}getLayer(e){return this.style.getLayer(e)}setLayerZoomRange(e,t,r){return this.style.setLayerZoomRange(e,t,r),this._update(!0)}setFilter(e,t,r={}){return this.style.setFilter(e,t,r),this._update(!0)}getFilter(e){return this.style.getFilter(e)}setPaintProperty(e,t,r,i={}){return this.style.setPaintProperty(e,t,r,i),this._update(!0)}getPaintProperty(e,t){return this.style.getPaintProperty(e,t)}setLayoutProperty(e,t,r,i={}){return this.style.setLayoutProperty(e,t,r,i),this._update(!0)}getLayoutProperty(e,t){return this.style.getLayoutProperty(e,t)}setLight(e,t={}){return this._lazyInitEmptyStyle(),this.style.setLight(e,t),this._update(!0)}getLight(){return this.style.getLight()}setFeatureState(e,t){return this.style.setFeatureState(e,t),this._update()}removeFeatureState(e,t){return this.style.removeFeatureState(e,t),this._update()}getFeatureState(e){return this.style.getFeatureState(e)}getContainer(){return this._container}getCanvasContainer(){return this._canvasContainer}getCanvas(){return this._canvas}_containerDimensions(){let e=0,t=0;return this._container&&(e=this._container.clientWidth||400,t=this._container.clientHeight||300),[e,t]}_setupContainer(){const e=this._container;e.classList.add("maplibregl-map","mapboxgl-map");const t=this._canvasContainer=o.create("div","maplibregl-canvas-container mapboxgl-canvas-container",e);this._interactive&&t.classList.add("maplibregl-interactive","mapboxgl-interactive"),this._canvas=o.create("canvas","maplibregl-canvas mapboxgl-canvas",t),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");const r=this._containerDimensions();this._resizeCanvas(r[0],r[1],this.getPixelRatio());const i=this._controlContainer=o.create("div","maplibregl-control-container mapboxgl-control-container",e),n=this._controlPositions={};["top-left","top-right","bottom-left","bottom-right"].forEach((e=>{n[e]=o.create("div",`maplibregl-ctrl-${e} mapboxgl-ctrl-${e}`,i)})),this._container.addEventListener("scroll",this._onMapScroll,!1)}_setupCooperativeGestures(){const e=this._container;this._metaPress=!1,this._cooperativeGesturesScreen=o.create("div","maplibregl-cooperative-gesture-screen",e);let t="Control",r="boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.windowsHelpText?this._cooperativeGestures.windowsHelpText:"Use Ctrl + scroll to zoom the map";0===navigator.platform.indexOf("Mac")&&(r="boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.macHelpText?this._cooperativeGestures.macHelpText:"Use ⌘ + scroll to zoom the map",t="Meta"),this._cooperativeGesturesScreen.innerHTML=`\n <div class="maplibregl-desktop-message">${r}</div>\n <div class="maplibregl-mobile-message">${"boolean"!=typeof this._cooperativeGestures&&this._cooperativeGestures.mobileHelpText?this._cooperativeGestures.mobileHelpText:"Use two fingers to move the map"}</div>\n `,document.addEventListener("keydown",(e=>{e.key===t&&(this._metaPress=!0)})),document.addEventListener("keyup",(e=>{e.key===t&&(this._metaPress=!1)})),this._canvasContainer.addEventListener("wheel",(e=>{this._onCooperativeGesture(e,this._metaPress,1)}),!1),this._canvasContainer.classList.remove("mapboxgl-touch-drag-pan","maplibregl-touch-drag-pan")}_resizeCanvas(e,t,r){this._canvas.width=r*e,this._canvas.height=r*t,this._canvas.style.width=`${e}px`,this._canvas.style.height=`${t}px`}_setupPainter(){const r=e.extend({},t.webGLContextAttributes,{failIfMajorPerformanceCaveat:this._failIfMajorPerformanceCaveat,preserveDrawingBuffer:this._preserveDrawingBuffer,antialias:this._antialias||!1}),i=this._canvas.getContext("webgl",r)||this._canvas.getContext("experimental-webgl",r);i?(this.painter=new Yr(i,this.transform),e.exported$1.testSupport(i)):this.fire(new e.ErrorEvent(new Error("Failed to initialize WebGL")))}_contextLost(t){t.preventDefault(),this._frame&&(this._frame.cancel(),this._frame=null),this.fire(new e.Event("webglcontextlost",{originalEvent:t}))}_contextRestored(t){this._setupPainter(),this.resize(),this._update(),this.fire(new e.Event("webglcontextrestored",{originalEvent:t}))}_onMapScroll(e){if(e.target===this._container)return this._container.scrollTop=0,this._container.scrollLeft=0,!1}_onCooperativeGesture(e,t,r){return!t&&r<2&&(this._cooperativeGesturesScreen.classList.add("maplibregl-show"),setTimeout((()=>{this._cooperativeGesturesScreen.classList.remove("maplibregl-show")}),100)),!1}loaded(){return!this._styleDirty&&!this._sourcesDirty&&!!this.style&&this.style.loaded()}_update(e){return this.style?(this._styleDirty=this._styleDirty||e,this._sourcesDirty=!0,this.triggerRepaint(),this):this}_requestRenderFrame(e){return this._update(),this._renderTaskQueue.add(e)}_cancelRenderFrame(e){this._renderTaskQueue.remove(e)}_render(t){let r,i=0;const n=this.painter.context.extTimerQuery;if(this.listens("gpu-timing-frame")&&(r=n.createQueryEXT(),n.beginQueryEXT(n.TIME_ELAPSED_EXT,r),i=e.exported.now()),this.painter.context.setDirty(),this.painter.setBaseState(),this._renderTaskQueue.run(t),this._removed)return;let o=!1;if(this.style&&this._styleDirty){this._styleDirty=!1;const t=this.transform.zoom,r=e.exported.now();this.style.zoomHistory.update(t,r);const i=new e.EvaluationParameters(t,{now:r,fadeDuration:this._fadeDuration,zoomHistory:this.style.zoomHistory,transition:this.style.getTransition()}),n=i.crossFadingFactor();1===n&&n===this._crossFadingFactor||(o=!0,this._crossFadingFactor=n),this.style.update(i)}if(this.style&&this._sourcesDirty&&(this._sourcesDirty=!1,this.style._updateSources(this.transform)),this.style.terrain&&this.style.terrain.sourceCache.update(this.transform,this.style.terrain),this.transform.updateElevation(this.style.terrain),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 e.Event("render")),this.loaded()&&!this._loaded&&(this._loaded=!0,e.PerformanceUtils.mark(e.PerformanceMarkers.load),this.fire(new e.Event("load"))),this.style&&(this.style.hasTransitions()||o)&&(this._styleDirty=!0),this.style&&!this._placementDirty&&this.style._releaseSymbolFadeTiles(),this.listens("gpu-timing-frame")){const t=e.exported.now()-i;n.endQueryEXT(n.TIME_ELAPSED_EXT,r),setTimeout((()=>{const i=n.getQueryObjectEXT(r,n.QUERY_RESULT_EXT)/1e6;n.deleteQueryEXT(r),this.fire(new e.Event("gpu-timing-frame",{cpuTime:t,gpuTime:i}))}),50)}if(this.listens("gpu-timing-layer")){const t=this.painter.collectGpuTimers();setTimeout((()=>{const r=this.painter.queryGpuTimers(t);this.fire(new e.Event("gpu-timing-layer",{layerTimes:r}))}),50)}const a=this._sourcesDirty||this._styleDirty||this._placementDirty;return a||this._repaint?this.triggerRepaint():!this.isMoving()&&this.loaded()&&this.fire(new e.Event("idle")),!this._loaded||this._fullyLoaded||a||(this._fullyLoaded=!0,e.PerformanceUtils.mark(e.PerformanceMarkers.fullLoad)),this}redraw(){return this.style&&(this._frame&&(this._frame.cancel(),this._frame=null),this._render(0)),this}remove(){this._hash&&this._hash.remove();for(const e of this._controls)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),"undefined"!=typeof window&&(removeEventListener("resize",this._onWindowResize,!1),removeEventListener("orientationchange",this._onWindowResize,!1),removeEventListener("online",this._onWindowOnline,!1));const t=this.painter.context.gl.getExtension("WEBGL_lose_context");t&&t.loseContext(),this._canvas.removeEventListener("webglcontextrestored",this._contextRestored,!1),this._canvas.removeEventListener("webglcontextlost",this._contextLost,!1),o.remove(this._canvasContainer),o.remove(this._controlContainer),this._cooperativeGestures&&o.remove(this._cooperativeGesturesScreen),this._container.classList.remove("maplibregl-map","mapboxgl-map"),e.PerformanceUtils.clearMetrics(),this._removed=!0,this.fire(new e.Event("remove"))}triggerRepaint(){this.style&&!this._frame&&(this._frame=e.exported.frame((t=>{e.PerformanceUtils.frame(t),this._frame=null,this._render(t)})))}_onWindowOnline(){this._update()}_onWindowResize(e){this._trackResize&&this.resize({originalEvent:e})._update()}get showTileBoundaries(){return!!this._showTileBoundaries}set showTileBoundaries(e){this._showTileBoundaries!==e&&(this._showTileBoundaries=e,this._update())}get showPadding(){return!!this._showPadding}set showPadding(e){this._showPadding!==e&&(this._showPadding=e,this._update())}get showCollisionBoxes(){return!!this._showCollisionBoxes}set showCollisionBoxes(e){this._showCollisionBoxes!==e&&(this._showCollisionBoxes=e,e?this.style._generateCollisionBoxes():this._update())}get showOverdrawInspector(){return!!this._showOverdrawInspector}set showOverdrawInspector(e){this._showOverdrawInspector!==e&&(this._showOverdrawInspector=e,this._update())}get repaint(){return!!this._repaint}set repaint(e){this._repaint!==e&&(this._repaint=e,this.triggerRepaint())}get vertices(){return!!this._vertices}set vertices(e){this._vertices=e,this._update()}_setCacheLimits(t,r){e.setCacheLimits(t,r)}get version(){return"2.4.0"}},NavigationControl:class{constructor(t){this.options=e.extend({},on,t),this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this.options.showZoom&&(e.bindAll(["_setButtonTitle","_updateZoomButtons"],this),this._zoomInButton=this._createButton("maplibregl-ctrl-zoom-in mapboxgl-ctrl-zoom-in",(e=>this._map.zoomIn({},{originalEvent:e}))),o.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomInButton).setAttribute("aria-hidden","true"),this._zoomOutButton=this._createButton("maplibregl-ctrl-zoom-out mapboxgl-ctrl-zoom-out",(e=>this._map.zoomOut({},{originalEvent:e}))),o.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._zoomOutButton).setAttribute("aria-hidden","true")),this.options.showCompass&&(e.bindAll(["_rotateCompassArrow"],this),this._compass=this._createButton("maplibregl-ctrl-compass mapboxgl-ctrl-compass",(e=>{this.options.visualizePitch?this._map.resetNorthPitch({},{originalEvent:e}):this._map.resetNorth({},{originalEvent:e})})),this._compassIcon=o.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._compass),this._compassIcon.setAttribute("aria-hidden","true"))}_updateZoomButtons(){const e=this._map.getZoom(),t=e===this._map.getMaxZoom(),r=e===this._map.getMinZoom();this._zoomInButton.disabled=t,this._zoomOutButton.disabled=r,this._zoomInButton.setAttribute("aria-disabled",t.toString()),this._zoomOutButton.setAttribute("aria-disabled",r.toString())}_rotateCompassArrow(){const e=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=e}onAdd(e){return this._map=e,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 an(this._map,this._compass,this.options.visualizePitch)),this._container}onRemove(){o.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}_createButton(e,t){const r=o.create("button",e,this._container);return r.type="button",r.addEventListener("click",t),r}_setButtonTitle(e,t){const r=this._map._getUIString(`NavigationControl.${t}`);e.title=r,e.setAttribute("aria-label",r)}},GeolocateControl:class extends e.Evented{constructor(t){super(),this.options=e.extend({},hn,t),e.bindAll(["_onSuccess","_onError","_onZoom","_finish","_setupUI","_updateCamera","_updateMarker"],this)}onAdd(e){var t;return this._map=e,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),t=this._setupUI,void 0!==pn?t(pn):void 0!==window.navigator.permissions?window.navigator.permissions.query({name:"geolocation"}).then((e=>{pn="denied"!==e.state,t(pn)})):(pn=!!window.navigator.geolocation,t(pn)),this._container}onRemove(){void 0!==this._geolocationWatchID&&(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(),o.remove(this._container),this._map.off("zoom",this._onZoom),this._map=void 0,dn=0,fn=!1}_isOutOfMapMaxBounds(e){const t=this._map.getMaxBounds(),r=e.coords;return t&&(r.longitude<t.getWest()||r.longitude>t.getEast()||r.latitude<t.getSouth()||r.latitude>t.getNorth())}_setErrorState(){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");break;case"ACTIVE_ERROR":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}}_onSuccess(t){if(this._map){if(this._isOutOfMapMaxBounds(t))return this._setErrorState(),this.fire(new e.Event("outofmaxbounds",t)),this._updateMarker(),void this._finish();if(this.options.trackUserLocation)switch(this._lastKnownPosition=t,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");break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}this.options.showUserLocation&&"OFF"!==this._watchState&&this._updateMarker(t),this.options.trackUserLocation&&"ACTIVE_LOCK"!==this._watchState||this._updateCamera(t),this.options.showUserLocation&&this._dotElement.classList.remove("maplibregl-user-location-dot-stale","mapboxgl-user-location-dot-stale"),this.fire(new e.Event("geolocate",t)),this._finish()}}_updateCamera(t){const r=new e.LngLat(t.coords.longitude,t.coords.latitude),i=t.coords.accuracy,n=this._map.getBearing(),o=e.extend({bearing:n},this.options.fitBoundsOptions);this._map.fitBounds(r.toBounds(i),o,{geolocateSource:!0})}_updateMarker(t){if(t){const r=new e.LngLat(t.coords.longitude,t.coords.latitude);this._accuracyCircleMarker.setLngLat(r).addTo(this._map),this._userLocationDotMarker.setLngLat(r).addTo(this._map),this._accuracy=t.coords.accuracy,this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}else this._userLocationDotMarker.remove(),this._accuracyCircleMarker.remove()}_updateCircleRadius(){const e=this._map._container.clientHeight/2,t=this._map.unproject([0,e]),r=this._map.unproject([1,e]),i=t.distanceTo(r),n=Math.ceil(2*this._accuracy/i);this._circleElement.style.width=`${n}px`,this._circleElement.style.height=`${n}px`}_onZoom(){this.options.showUserLocation&&this.options.showAccuracyCircle&&this._updateCircleRadius()}_onError(t){if(this._map){if(this.options.trackUserLocation)if(1===t.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;const e=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e),void 0!==this._geolocationWatchID&&this._clearWatch()}else{if(3===t.code&&fn)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 e.Event("error",t)),this._finish()}}_finish(){this._timeoutId&&clearTimeout(this._timeoutId),this._timeoutId=void 0}_setupUI(t){if(this._container.addEventListener("contextmenu",(e=>e.preventDefault())),this._geolocateButton=o.create("button","maplibregl-ctrl-geolocate mapboxgl-ctrl-geolocate",this._container),o.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._geolocateButton).setAttribute("aria-hidden","true"),this._geolocateButton.type="button",!1===t){e.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");const t=this._map._getUIString("GeolocateControl.LocationNotAvailable");this._geolocateButton.disabled=!0,this._geolocateButton.title=t,this._geolocateButton.setAttribute("aria-label",t)}else{const e=this._map._getUIString("GeolocateControl.FindMyLocation");this._geolocateButton.title=e,this._geolocateButton.setAttribute("aria-label",e)}this.options.trackUserLocation&&(this._geolocateButton.setAttribute("aria-pressed","false"),this._watchState="OFF"),this.options.showUserLocation&&(this._dotElement=o.create("div","maplibregl-user-location-dot mapboxgl-user-location-dot"),this._userLocationDotMarker=new un(this._dotElement),this._circleElement=o.create("div","maplibregl-user-location-accuracy-circle mapboxgl-user-location-accuracy-circle"),this._accuracyCircleMarker=new un({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",(t=>{t.geolocateSource||"ACTIVE_LOCK"!==this._watchState||t.originalEvent&&"resize"===t.originalEvent.type||(this._watchState="BACKGROUND",this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-background","mapboxgl-ctrl-geolocate-background"),this._geolocateButton.classList.remove("maplibregl-ctrl-geolocate-active","mapboxgl-ctrl-geolocate-active"),this.fire(new e.Event("trackuserlocationend")))}))}trigger(){if(!this._setup)return e.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 e.Event("trackuserlocationstart"));break;case"WAITING_ACTIVE":case"ACTIVE_LOCK":case"ACTIVE_ERROR":case"BACKGROUND_ERROR":dn--,fn=!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 e.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 e.Event("trackuserlocationstart"));break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}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"OFF":break;default:throw new Error(`Unexpected watchState ${this._watchState}`)}if("OFF"===this._watchState&&void 0!==this._geolocationWatchID)this._clearWatch();else if(void 0===this._geolocationWatchID){let e;this._geolocateButton.classList.add("maplibregl-ctrl-geolocate-waiting","mapboxgl-ctrl-geolocate-waiting"),this._geolocateButton.setAttribute("aria-pressed","true"),dn++,dn>1?(e={maximumAge:6e5,timeout:0},fn=!0):(e=this.options.positionOptions,fn=!1),this._geolocationWatchID=window.navigator.geolocation.watchPosition(this._onSuccess,this._onError,e)}}else window.navigator.geolocation.getCurrentPosition(this._onSuccess,this._onError,this.options.positionOptions),this._timeoutId=setTimeout(this._finish,1e4);return!0}_clearWatch(){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)}},AttributionControl:Qi,LogoControl:en,ScaleControl:class{constructor(t){this.options=e.extend({},mn,t),e.bindAll(["_onMove","setUnit"],this)}getDefaultPosition(){return"bottom-left"}_onMove(){yn(this._map,this._container,this.options)}onAdd(e){return this._map=e,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-scale mapboxgl-ctrl mapboxgl-ctrl-scale",e.getContainer()),this._map.on("move",this._onMove),this._onMove(),this._container}onRemove(){o.remove(this._container),this._map.off("move",this._onMove),this._map=void 0}setUnit(e){this.options.unit=e,yn(this._map,this._container,this.options)}},FullscreenControl:class{constructor(t){this._fullscreen=!1,t&&t.container&&(t.container instanceof HTMLElement?this._container=t.container:e.warnOnce("Full screen control 'container' must be a DOM element.")),e.bindAll(["_onClickFullscreen","_changeIcon"],this),"onfullscreenchange"in document?this._fullscreenchange="fullscreenchange":"onmozfullscreenchange"in document?this._fullscreenchange="mozfullscreenchange":"onwebkitfullscreenchange"in document?this._fullscreenchange="webkitfullscreenchange":"onmsfullscreenchange"in document&&(this._fullscreenchange="MSFullscreenChange")}onAdd(t){return this._map=t,this._container||(this._container=this._map.getContainer()),this._controlContainer=o.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._checkFullscreenSupport()?this._setupUI():(this._controlContainer.style.display="none",e.warnOnce("This device does not support fullscreen mode.")),this._controlContainer}onRemove(){o.remove(this._controlContainer),this._map=null,window.document.removeEventListener(this._fullscreenchange,this._changeIcon)}_checkFullscreenSupport(){return!!(document.fullscreenEnabled||document.mozFullScreenEnabled||document.msFullscreenEnabled||document.webkitFullscreenEnabled)}_setupUI(){const e=this._fullscreenButton=o.create("button","maplibregl-ctrl-fullscreen mapboxgl-ctrl-fullscreen",this._controlContainer);o.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",e).setAttribute("aria-hidden","true"),e.type="button",this._updateTitle(),this._fullscreenButton.addEventListener("click",this._onClickFullscreen),window.document.addEventListener(this._fullscreenchange,this._changeIcon)}_updateTitle(){const e=this._getTitle();this._fullscreenButton.setAttribute("aria-label",e),this._fullscreenButton.title=e}_getTitle(){return this._map._getUIString(this._isFullscreen()?"FullscreenControl.Exit":"FullscreenControl.Enter")}_isFullscreen(){return this._fullscreen}_changeIcon(){(window.document.fullscreenElement||window.document.mozFullScreenElement||window.document.webkitFullscreenElement||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())}_onClickFullscreen(){this._isFullscreen()?window.document.exitFullscreen?window.document.exitFullscreen():window.document.mozCancelFullScreen?window.document.mozCancelFullScreen():window.document.msExitFullscreen?window.document.msExitFullscreen():window.document.webkitCancelFullScreen&&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()}},TerrainControl:class{constructor(t){this.options=t,e.bindAll(["_toggleTerrain","_updateTerrainIcon"],this)}onAdd(e){return this._map=e,this._container=o.create("div","maplibregl-ctrl maplibregl-ctrl-group mapboxgl-ctrl mapboxgl-ctrl-group"),this._terrainButton=o.create("button","maplibregl-ctrl-terrain mapboxgl-ctrl-terrain",this._container),o.create("span","maplibregl-ctrl-icon mapboxgl-ctrl-icon",this._terrainButton).setAttribute("aria-hidden","true"),this._terrainButton.type="button",this._terrainButton.addEventListener("click",this._toggleTerrain),this._updateTerrainIcon(),this._map.on("terrain",this._updateTerrainIcon),this._container}onRemove(){o.remove(this._container),this._map.off("terrain",this._updateTerrainIcon),this._map=void 0}_toggleTerrain(){this._map.getTerrain()?this._map.setTerrain(null):this._map.setTerrain(this.options),this._updateTerrainIcon()}_updateTerrainIcon(){this._terrainButton.classList.remove("maplibregl-ctrl-terrain","mapboxgl-ctrl-terrain"),this._terrainButton.classList.remove("maplibregl-ctrl-terrain-enabled","mapboxgl-ctrl-terrain-enabled"),this._map.style.terrain?(this._terrainButton.classList.add("maplibregl-ctrl-terrain-enabled","mapboxgl-ctrl-terrain-enabled"),this._terrainButton.title=this._map._getUIString("TerrainControl.disableTerrain")):(this._terrainButton.classList.add("maplibregl-ctrl-terrain","mapboxgl-ctrl-terrain"),this._terrainButton.title=this._map._getUIString("TerrainControl.enableTerrain"))}},Popup:class extends e.Evented{constructor(t){super(),this.options=e.extend(Object.create(_n),t),e.bindAll(["_update","_onClose","remove","_onMouseMove","_onMouseUp","_onDrag"],this)}addTo(t){return this._map&&this.remove(),this._map=t,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 e.Event("open")),this}isOpen(){return!!this._map}remove(){return this._content&&o.remove(this._content),this._container&&(o.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 e.Event("close")),this}getLngLat(){return this._lngLat}setLngLat(t){return this._lngLat=e.LngLat.convert(t),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}trackPointer(){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}getElement(){return this._container}setText(e){return this.setDOMContent(document.createTextNode(e))}setHTML(e){const t=document.createDocumentFragment(),r=document.createElement("body");let i;for(r.innerHTML=e;i=r.firstChild,i;)t.appendChild(i);return this.setDOMContent(t)}getMaxWidth(){return this._container&&this._container.style.maxWidth}setMaxWidth(e){return this.options.maxWidth=e,this._update(),this}setDOMContent(e){if(this._content)for(;this._content.hasChildNodes();)this._content.firstChild&&this._content.removeChild(this._content.firstChild);else this._content=o.create("div","maplibregl-popup-content mapboxgl-popup-content",this._container);return this._content.appendChild(e),this._createCloseButton(),this._update(),this._focusFirstElement(),this}addClassName(e){this._container&&this._container.classList.add(e)}removeClassName(e){this._container&&this._container.classList.remove(e)}setOffset(e){return this.options.offset=e,this._update(),this}toggleClassName(e){if(this._container)return this._container.classList.toggle(e)}_createCloseButton(){this.options.closeButton&&(this._closeButton=o.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))}_onMouseUp(e){this._update(e.point)}_onMouseMove(e){this._update(e.point)}_onDrag(e){this._update(e.point)}_update(e){if(!this._map||!this._lngLat&&!this._trackPointer||!this._content)return;if(this._container||(this._container=o.create("div","maplibregl-popup mapboxgl-popup",this._map.getContainer()),this._tip=o.create("div","maplibregl-popup-tip mapboxgl-popup-tip",this._container),this._container.appendChild(this._content),this.options.className&&this.options.className.split(" ").forEach((e=>this._container.classList.add(e))),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=sn(this._lngLat,this._pos,this._map.transform)),this._trackPointer&&!e)return;const t=this._pos=this._trackPointer&&e?e:this._map.project(this._lngLat);let r=this.options.anchor;const i=vn(this.options.offset);if(!r){const e=this._container.offsetWidth,n=this._container.offsetHeight;let o;o=t.y+i.bottom.y<n?["top"]:t.y>this._map.transform.height-n?["bottom"]:[],t.x<e/2?o.push("left"):t.x>this._map.transform.width-e/2&&o.push("right"),r=0===o.length?"bottom":o.join("-")}const n=t.add(i[r]).round();o.setTransform(this._container,`${ln[r]} translate(${n.x}px,${n.y}px)`),cn(this._container,r,"popup")}_focusFirstElement(){if(!this.options.focusAfterOpen||!this._container)return;const e=this._container.querySelector(bn);e&&e.focus()}_onClose(){this.remove()}},Marker:un,Style:tt,LngLat:e.LngLat,LngLatBounds:e.LngLatBounds,Point:e.pointGeometry,MercatorCoordinate:e.MercatorCoordinate,Evented:e.Evented,AJAXError:e.AJAXError,config:e.config,CanvasSource:C,GeoJSONSource:k,ImageSource:I,RasterDEMTileSource:T,RasterTileSource:S,VectorTileSource:w,VideoSource:P,prewarm:function(){G().acquire(U)},clearPrewarmedResources:function(){const e=$;e&&(e.isPreloaded()&&1===e.numActive()?(e.release(U),$=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 version(){return"2.4.0"},get workerCount(){return V.workerCount},set workerCount(e){V.workerCount=e},get maxParallelImageRequests(){return e.config.MAX_PARALLEL_IMAGE_REQUESTS},set maxParallelImageRequests(t){e.config.MAX_PARALLEL_IMAGE_REQUESTS=t},clearStorage(t){e.clearTileCache(t)},workerUrl:"",addProtocol(t,r){e.config.REGISTERED_PROTOCOLS[t]=r},removeProtocol(t){delete e.config.REGISTERED_PROTOCOLS[t]}};return Ji.extend(xn,{isSafari:e.isSafari,getPerformanceMetrics:e.PerformanceUtils.getPerformanceMetrics}),xn})),r}()}(tl);var rl=function(e){function t(t,r){return e.call(this,t,r)||this}return r(t,e),t}(Fs),il=function(){function e(t){Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"baseStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sources",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"layers",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"layerOrder",{enumerable:!0,configurable:!0,writable:!0,value:[]}),this.options=i(i({},e.defaultOptions),t),this.baseStyle=e.defaultBaseStyle,Pa(this,{options:Gn,sources:Gn,layers:Gn,layerOrder:Gn,baseStyle:Gn.ref,styleSpecification:Kn,bindState:Wo,setBaseStyle:Wo,addSource:Wo,removeSource:Wo,addLayer:Wo,removeLayer:Wo},{name:this.formattedName(this.id)})}return Object.defineProperty(e.prototype,"styleSpecification",{get:function(){var e=this,t=i(i({},this.baseStyle),{sources:i({},this.baseStyle.sources),layers:l([],s(this.baseStyle.layers),!1)});return Object.values(this.sources).forEach((function(e){t.sources[e.id]=e.dataSourceSpecification})),this.layerOrder.forEach((function(r){var n=e.layers[r],o=n.layerSpecification,a=t.layers.findIndex((function(e){return e.id===r}));if(a>=0){var s=t.layers[a],l=i(i({},s),{paint:i(i({},s.paint),o.paint),layout:i(i({},s.layout),o.layout)});t.layers.splice(a,1,l)}else{"vector"===t.sources[n.source].type&&Yr(o["source-layer"])&&(o["source-layer"]="geometry");var c=e.layerInsertionPoint(n,t);t.layers.splice(c,0,n.layerSpecification)}})),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.baseStyle.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bindState",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return this.state=e,e.transaction((function(){Object.values(t.sources).forEach((function(t){return t.bindState(e)})),Object.values(t.layers).forEach((function(t){return t.bindState(e)}))})),this}}),Object.defineProperty(e.prototype,"setBaseStyle",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return this.baseStyle=t?Object.freeze(i({},t)):e.defaultBaseStyle,this}}),Object.defineProperty(e.prototype,"addSource",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.sources[e.id]=e,e.bindState(this.state),this}}),Object.defineProperty(e.prototype,"removeSource",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;if(void 0===t&&(t=!1),!this.sources[e])throw new Fs("".concat(this.formattedName(),": no source with id '").concat(e,"'"));var i=Object.values(this.layers).filter((function(t){return t.source===e})).map((function(e){return e.id}));if(t)i.forEach((function(e){return r.removeLayer(e)}));else if(i.length)throw new Fs("".concat(this.formattedName(),": cannot remove source with id '").concat(e,"' when in use by layers ").concat(i.join(", ")));return delete this.sources[e],this}}),Object.defineProperty(e.prototype,"getSource",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.sources[e];if(!t)throw new Fs("".concat(this.formattedName(),": no source with id '").concat(e,"'"));return t}}),Object.defineProperty(e.prototype,"getSources",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return Object.values(this.sources).filter((function(t){return!e||e(t)}))}}),Object.defineProperty(e.prototype,"addLayer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!this.sources[e.source]&&!this.baseStyle.sources[e.source])throw new Fs("".concat(this.formattedName(),": no source with id '").concat(e.source,"'"));return this.layers[e.id]=e,this.layerOrder.push(e.id),e.bindState(this.state),this}}),Object.defineProperty(e.prototype,"removeLayer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!this.layers[e])throw new Fs("".concat(this.formattedName(),": no layer with id '").concat(e,"'"));delete this.layers[e];var t=this.layerOrder.indexOf(e);return this.layerOrder.splice(t,1),this}}),Object.defineProperty(e.prototype,"getLayer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.layers[e];if(!t)throw new Fs("".concat(this.formattedName(),": no layer with id '").concat(e,"'"));return t}}),Object.defineProperty(e.prototype,"getLayers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return this.layerOrder.map((function(e){return t.layers[e]})).filter((function(t){return!e||e(t)}))}}),Object.defineProperty(e.prototype,"formattedName",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"FlowCoreMapStyle<".concat(e||this.id,">")}}),Object.defineProperty(e.prototype,"layerInsertionPoint",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,i,n=-1;if(e.above)(n=t.layers.findIndex((function(t){return t.id===e.above})))>=0&&n++;else if(e.below)n=t.layers.findIndex((function(t){return t.id===e.below}));else{var o=null===(i=null===(r=t.metadata)||void 0===r?void 0:r.insertionPoints)||void 0===i?void 0:i[e.type];n=t.layers.findIndex((function(e){return e.id===o}))}return-1===n&&(n=t.layers.length),n}}),Object.defineProperty(e,"defaultOptions",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(e,"defaultBaseStyle",{enumerable:!0,configurable:!0,writable:!0,value:Object.freeze({version:8,id:"default",name:"Default base style",sources:{},layers:[]})}),e}(),nl=function(){function e(t,r){Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"filter",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"paintProps",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"layoutProps",{enumerable:!0,configurable:!0,writable:!0,value:{}}),this.options=i(i({},e.defaultOptions),t),this.getPropertyMetadata("visibility",t.type),Pa(this,{paintProps:Gn,layoutProps:Gn,filter:Gn,options:Gn,layerSpecification:Kn,bindState:Wo,setMinZoom:Wo,setMaxZoom:Wo,setInteractive:Wo,setAbove:Wo,setBelow:Wo,setStyle:Wo,setStyleProperty:Wo,setFilter:Wo},{name:this.formattedName(t.id)}),t.filter&&this.setFilter(t.filter),r&&this.setStyle(r)}return Object.defineProperty(e.prototype,"layerSpecification",{get:function(){var e=this;this.options.above,this.options.below;var t={id:this.options.id,type:this.options.type,source:this.options.source};return Qr(this.options.minZoom)&&(t.minzoom=this.options.minZoom),Qr(this.options.maxZoom)&&(t.maxzoom=this.options.maxZoom),Qr(this.options.sourceLayer)&&(t["source-layer"]=this.options.sourceLayer),Qr(this.filter)&&(t.filter=this.filter.maplibreExpression),si(this.paintProps)&&(t.paint=Object.keys(this.paintProps).reduce((function(t,r){return t[r]=e.paintProps[r].maplibreExpression,t}),{})),si(this.layoutProps)&&(t.layout=Object.keys(this.layoutProps).reduce((function(t,r){var i=e.layoutProps[r].maplibreExpression;return"visibility"===r&&(i=e.layoutProps[r].value?"visible":"none"),t[r]=i,t}),{})),t},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"id",{get:function(){return this.options.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this.options.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"source",{get:function(){return this.options.source},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"interactive",{get:function(){return!!this.options.interactive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"above",{get:function(){return this.options.above},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"below",{get:function(){return this.options.below},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bindState",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.state=e,this.filter&&this.filter.bindState(e),Object.values(this.paintProps).forEach((function(t){return t.bindState(e)})),Object.values(this.layoutProps).forEach((function(t){return t.bindState(e)})),this}}),Object.defineProperty(e.prototype,"setMinZoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.options.minZoom=e,this}}),Object.defineProperty(e.prototype,"setMaxZoom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.options.maxZoom=e,this}}),Object.defineProperty(e.prototype,"setInteractive",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.options.interactive=e,this}}),Object.defineProperty(e.prototype,"setAbove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.options.above=e,this}}),Object.defineProperty(e.prototype,"setBelow",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.options.below=e,this}}),Object.defineProperty(e.prototype,"setStyle",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=Zs.parseProgram(e);Object.keys(r).forEach((function(e){("paint"===t.getPropertyMetadata(e,t.options.type).type?t.paintProps:t.layoutProps)[e]=r[e].bindState(t.state)}))}}),Object.defineProperty(e.prototype,"setStyleProperty",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r="paint"===this.getPropertyMetadata(e,this.options.type).type?this.paintProps:this.layoutProps;if(Yr(t))delete r[e];else{var i=new Zs(t).bindState(this.state);if(i.parseError)throw i.parseError;r[e]=i}}}),Object.defineProperty(e.prototype,"setFilter",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this.filter=null,Qr(e)){var t=new Zs(e).bindState(this.state);if(t.parseError)throw t.parseError;Ur.isExpressionFilter(t.maplibreExpression)||(t=new Zs(t.expression,["to-boolean",t.maplibreExpression])),this.filter=t}}}),Object.defineProperty(e.prototype,"formattedName",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"FlowCoreMapLayer<".concat(e||this.options.id,">")}}),Object.defineProperty(e.prototype,"getPropertyMetadata",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){e.propertyMetadataIndex||e.initializePropertyMetadataIndex();var i=e.propertyMetadataIndex[r];if(!i)throw new Fs("".concat(this.formattedName(),": unknown layer type '").concat(r,"'"));var n=i[t];if(!n)throw new Fs("".concat(this.formattedName(),": unknown layer property '").concat(t,"'"));return n}}),Object.defineProperty(e,"initializePropertyMetadataIndex",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=Object.keys(c.layer.type.values);this.propertyMetadataIndex=e.reduce((function(e,t){return e[t]={},["layout","paint"].forEach((function(r){Object.keys(c["".concat(r,"_").concat(t)]).forEach((function(i){e[t][i]={property:i,type:r,definition:c["".concat(r,"_").concat(t)][i]}}))})),e}),{})}}),Object.defineProperty(e,"defaultOptions",{enumerable:!0,configurable:!0,writable:!0,value:{interactive:!0,minZoom:0,maxZoom:18}}),e}(),ol=Symbol("FlowCoreStateStoreMarker"),al=Symbol("FlowCoreStateStorCache"),sl=function(){function e(){Object.defineProperty(this,"nextIds",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"formattedName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_initialized",{enumerable:!0,configurable:!0,writable:!0,value:!1});var e=Reflect.getPrototypeOf(this).constructor.name;this.formattedName="FlowCoreStateStore<".concat(e,"#").concat(this.getNextId(e),">")}return Object.defineProperty(e.prototype,"getNextId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.nextIds[e]=this.nextIds[e]?this.nextIds[e]+1:1}}),Object.defineProperty(e.prototype,"initialize",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(void 0===e&&(e={}),this._initialized)throw new Fs("".concat(this.formattedName,": initialize() called multiple times"));Reflect.getPrototypeOf(this).constructor.name,this.makeSimpleAutoObservable(this,e,{name:this.formattedName}),this._initialized=!0}}),Object.defineProperty(e.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.checkInitialized();for(var t,r=this,i=e.split(".");t=i.shift();)r=r[t];return r}}),Object.defineProperty(e.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this.checkInitialized();for(var r=e.split("."),i=this;r.length>1;)i=i[r.shift()];i[r.shift()]=t}}),Object.defineProperty(e.prototype,"transaction",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this.checkInitialized(),Ko((function(){return e(t)}))}}),Object.defineProperty(e.prototype,"toggle",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.checkInitialized();var t=!this.get(e);return this.set(e,t),t}}),Object.defineProperty(e.prototype,"increment",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.checkInitialized();var t=+this.get(e)+1;return this.set(e,t),t}}),Object.defineProperty(e.prototype,"decrement",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.checkInitialized();var t=+this.get(e)-1;return this.set(e,t),t}}),Object.defineProperty(e.prototype,"toStream",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return void 0===t&&(t=!0),this.checkInitialized(),Ds((function(){return r.get(e)}),t)}}),Object.defineProperty(e.prototype,"autorun",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return this.checkInitialized(),Jo((function(){return e(r)}),{name:t})}}),Object.defineProperty(e.prototype,"makeSimpleAutoObservable",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){void 0===t&&(t={}),t=i(i({},t),{_initialized:!1,$mobx:!1,constructor:!1});var n=e[al];if(!n){n={};for(var o=e;o&&!Object.hasOwn(o,ol);)Reflect.ownKeys(o).forEach((function(e){n[e]=!t||(!(e in t)||t[e])})),o=Object.getPrototypeOf(o);var a=Object.getPrototypeOf(e);a&&Object.defineProperty(a,al,{value:n})}return Pa(e,n=i(i({},n),{set:Wo,toggle:Wo,increment:Wo,decrement:Wo}),r)}}),Object.defineProperty(e.prototype,"checkInitialized",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._initialized)throw new Fs("".concat(this.formattedName," not initialized. 'this.initialize()' must be called in constructor"))}}),e}();sl.prototype[ol]=!0;var ll=function(){function e(t){if(Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"srcExpression",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"parameters",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"state",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.options=i(i({},e.defaultOptions),t),!hi(t.type,["vector","geojson","raster"]))throw new Fs("".concat(this.formattedName(),": unrecognized type '").concat(t.type,"'"));this.setSrcExpression(t.src),Pa(this,{options:Gn,srcExpression:Gn,parameters:Gn,dataSourceSpecification:Kn,bindState:Wo,setSrc:Wo,setParameter:Wo},{name:this.formattedName(t.id)})}return Object.defineProperty(e.prototype,"id",{get:function(){return this.options.id},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"type",{get:function(){return this.options.type},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"featureId",{get:function(){return this.options.featureId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"dataSourceSpecification",{get:function(){var e,t=this.srcExpression?ga(this.srcExpression.value,new Map):this.options.src;switch(ei(t)&&(t=this.expandSrc(t,this.options.type)),this.options.type){case"vector":return e=ri(t)?{type:"vector",url:t}:{type:"geojson",data:{type:"FeatureCollection",features:[]}},this.options.featureId&&(e.promoteId=this.options.featureId),e;case"raster":return e=ri(t)?{type:"raster",url:t}:{type:"geojson",data:{type:"FeatureCollection",features:[]}};case"geojson":return e={type:"geojson",data:t||{type:"FeatureCollection",features:[]}},this.options.cluster&&(e.cluster=!0,e.clusterMaxZoom=this.options.clusterMaxZoom,e.clusterMinPoints=this.options.clusterMinPoints,e.clusterRadius=this.options.clusterRadius),this.options.featureId&&(e.promoteId=this.options.featureId),e;default:throw new Fs("".concat(this.formattedName(),": unrecognized type '").concat(this.options.type,"'"))}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bindState",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return this.state=e,this.srcExpression&&(null===(t=this.srcExpression)||void 0===t||t.bindState(e)),Object.values(this.parameters).forEach((function(t){return t.bindState(e)})),this}}),Object.defineProperty(e.prototype,"setSrc",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.options.src=e,this.setSrcExpression(e)}}),Object.defineProperty(e.prototype,"setParameter",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(Yr(t))delete this.parameters[e];else{var r=new Zs(t);this.parameters[e]=r.bindState(this.state)}}}),Object.defineProperty(e.prototype,"setFlowEndpoint",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.options.flowHost=e.host,this.options.flowApiKey=e.apiKey}}),Object.defineProperty(e.prototype,"formattedName",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return"FlowCoreMapDataSource<".concat(e||this.options.id,">")}}),Object.defineProperty(e.prototype,"setSrcExpression",{enumerable:!1,configurable:!0,writable:!0,value:function(e){ei(e)?(vi(e)&&(e="'".concat(e,"'")),this.srcExpression=new Zs(e),this.srcExpression.bindState(this.state)):this.srcExpression=null}}),Object.defineProperty(e.prototype,"expandSrc",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.options.flowHost,i=!1;if(!vi(e))switch(t){case"vector":case"raster":e="".concat(r,"/tiles/").concat(e,"/index.json");break;case"geojson":e="".concat(r,"/api/v1/datasets/").concat(e,"/query"),i=!0;break;default:throw new Fs("".concat(this.formattedName(),": unrecognized type '").concat(this.options.type,"'"))}var n=new URL(e),o=new URLSearchParams(n.searchParams);return Object.entries(this.parameters).filter((function(e){var t=s(e,2);t[0];var r=t[1];return!Yr(r.value)})).forEach((function(e){var t=s(e,2),r=t[0],i=t[1];return o.append(r,i.value)})),!o.has("apikey")&&this.options.flowApiKey&&o.append("apikey",this.options.flowApiKey),this.options.limit&&o.append("limit",this.options.limit.toString(10)),i&&o.append("format","geojson"),n.search=o.toString(),n.toString()}}),Object.defineProperty(e,"defaultOptions",{enumerable:!0,configurable:!0,writable:!0,value:{type:"vector",cluster:!1,clusterRadius:50,clusterMaxZoom:20,clusterMinPoints:2,flowHost:"https://flow.emu-analytics.net"}}),e}();function cl(e,t){if(!e)throw new Fs(null!=t?t:"Assertion failed")}var ul=Symbol("Do not memoize");function hl(e,t){var r,i=t.delay,n=t.noTrailing,o=void 0!==n&&n,a=t.noLeading,s=void 0!==a&&a,l=t.debounceMode,c=void 0===l?void 0:l,u=!1,h=0;function p(){r&&clearTimeout(r)}function d(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];var l=t.context,d=Date.now()-h;function f(){h=Date.now(),e.apply(l,n)}function m(){r=void 0}u||(s||!c||r||f(),p(),void 0===c&&d>i?s?(h=Date.now(),o||(r=setTimeout(c?m:f,i))):f():!0!==o&&(r=setTimeout(c?m:f,void 0===c?i-d:i)))}return d.cancel=function(e){var t=(e||{}).upcomingOnly,r=void 0!==t&&t;p(),u=!r},d}function pl(e,t){var r=function(e,t){var r=new Map,i=t.hash?t.hash:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e[0]},n=t.context;return function(){for(var t=[],o=0;o<arguments.length;o++)t[o]=arguments[o];var a,s=i.apply(n,t);return s===ul?e.apply(n,t):(r.has(s)?a=r.get(s):(a=e.apply(n,t),r.set(s,a)),a)}}((function(){return function(e,t){var r=t.delay,i=t.context,n=t.atBegin;return hl(e,{delay:r,debounceMode:!1!==(void 0!==n&&n),context:i})}(e,t)}),t);return function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];r.apply(void 0,l([],s(e),!1)).apply(void 0,l([],s(e),!1))}}var dl=function(e,t){return void 0===e&&(e=""),void 0===t&&(t=!1),e.slice(0,1).toUpperCase()+(t?e.slice(1).toLowerCase():e.slice(1))},fl=function(){function e(){var e=this;Object.defineProperty(this,"listeners",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"handleKeyboardEvent",{enumerable:!0,configurable:!0,writable:!0,value:function(t){var r,i;if(!e.isInputEvent(t)){var n=e.keyDefinitionFromEvent(t);try{for(var o=a(e.listeners),s=o.next();!s.done;s=o.next()){var l=s.value.bindings[n];if(l){if(!0===l(t))continue;return void t.stopPropagation()}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}}}}),this.listeners=[],document.addEventListener("keydown",this.handleKeyboardEvent)}return Object.defineProperty(e.prototype,"addListener",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;e=this.splitEventBindings(e);var i=this.addToListeners({bindings:e,priority:null!=t?t:0});return function(){r.removeFromListeners(i)}}}),Object.defineProperty(e.prototype,"splitEventBindings",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r={},i=function(i){i.split(",").forEach((function(n){r[t.normalizeKeyDefinition(n)]=e[i]}))};for(var n in e)i(n);return r}}),Object.defineProperty(e.prototype,"isInputEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.target instanceof Node)switch(e.target.nodeName){case"INPUT":case"SELECT":case"TEXTAREA":return!0;default:return!1}return!1}}),Object.defineProperty(e.prototype,"addToListeners",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.listeners.push(e),this.listeners.sort((function(e,t){return t.priority-e.priority})),e}}),Object.defineProperty(e.prototype,"removeFromListeners",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.listeners=this.listeners.filter((function(t){return t!==e}))}}),Object.defineProperty(e.prototype,"normalizeKeyDefinition",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e.split("+"),r={ctrlKey:t.includes("Ctrl"),shiftKey:t.includes("Shift"),altKey:t.includes("Alt"),metaKey:t.includes("Meta"),code:t[t.length-1]};return this.keyDefinitionFromEvent(r)}}),Object.defineProperty(e.prototype,"keyDefinitionFromEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t="";return e.ctrlKey&&(t+="Ctrl+"),e.shiftKey&&(t+="Shift+"),e.altKey&&(t+="Alt+"),e.metaKey&&(t+="Meta+"),t+=e.code}}),e}(),ml=Ys("flow:map-plugin-manager"),yl=function(){function e(e){var t=this;Object.defineProperty(this,"_map",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_keyboardShortcutManager",{enumerable:!0,configurable:!0,writable:!0,value:new fl}),Object.defineProperty(this,"_plugins",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"_initialized",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_exclusivePlugins",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),this._map=e,this.map.initialized.then((function(){var e,r;t._initialized=!0;try{for(var i=a(t._plugins.values()),n=i.next();!n.done;n=i.next()){var o=n.value;o.initialize&&o.initialize()}}catch(t){e={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}}))}return Object.defineProperty(e.prototype,"map",{get:function(){return this._map},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"usePlugin",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=new e(this,t);return this._plugins.set(e,r),ml("".concat(this.map.formattedName(),": Using plugin '").concat(r.name,"'")),this._initialized&&r.initialize&&r.initialize(),this}}),Object.defineProperty(e.prototype,"getPlugin",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t,r;if(ei(e)?(r=Array.from(this._plugins.values()).find((function(t){return t.name===e})),t=e):(r=this._plugins.get(e),t=e.name),!r)throw new Fs("<".concat(t,">: plugin not registered"));return r}}),Object.defineProperty(e.prototype,"removePlugin",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this._plugins.get(e);return t&&t.destroy&&t.destroy(),this._plugins.delete(e),this}}),Object.defineProperty(e.prototype,"removeAllPlugins",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._plugins.forEach((function(e){e.destroy&&e.destroy()})),this._plugins.clear(),this}}),Object.defineProperty(e.prototype,"setExclusivePlugin",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._exclusivePlugins.add(e),this.forwardSetExclusivePlugin(),this}}),Object.defineProperty(e.prototype,"removeExclusivePlugin",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._exclusivePlugins.delete(e),this.forwardSetExclusivePlugin(),this}}),Object.defineProperty(e.prototype,"addKeyboardShortcuts",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=0),this._keyboardShortcutManager.addListener(e,t)}}),Object.defineProperty(e.prototype,"forwardEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=this,r=[],i=1;i<arguments.length;i++)r[i-1]=arguments[i];var n="handle".concat(dl(e));this._plugins.forEach((function(e){if(!t._exclusivePlugins.size||t._exclusivePlugins.has(e)){var i=e[n];i&&i.apply(e,r)}}))}}),Object.defineProperty(e.prototype,"forwardStyleChangeEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return this._plugins.forEach((function(r){if((!t._exclusivePlugins.size||t._exclusivePlugins.has(r))&&r.handleBeforeStyleChanged){var i=r.handleBeforeStyleChanged(e);i&&(e.newStyle=i)}})),e.newStyle}}),Object.defineProperty(e.prototype,"bindState",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._plugins.forEach((function(t){t.bindState&&t.bindState(e)})),this}}),Object.defineProperty(e.prototype,"forwardSetExclusivePlugin",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;this._plugins.forEach((function(t){t.handleSetExclusivePlugin&&t.handleSetExclusivePlugin(Array.from(e._exclusivePlugins))}))}}),e}(),gl=function(){function e(e,t,r){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"map",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"originalEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.type=e,this.map=t,this.originalEvent=r}return Object.defineProperty(e,"fromMaplibreEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,i){return new e(t,r,i.originalEvent)}}),e}(),_l=function(e){function t(t,r,i,n,o,a){var s=e.call(this,t,r,a)||this;return Object.defineProperty(s,"point",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"lngLat",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(s,"features",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),s.point=i,s.lngLat=n,s.features=o,s}return r(t,e),Object.defineProperty(t,"fromMaplibreMouseEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,r,i,n){return new t(e,i,[r.point.x,r.point.y],[r.lngLat.lng,r.lngLat.lat],n,r.originalEvent)}}),t}(gl),bl=function(e){function t(t,r,i){var n=e.call(this,t,r)||this;return Object.defineProperty(n,"source",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n.source=i,n}return r(t,e),t}(gl),vl=function(e){function t(t,r){var i=e.call(this,"loading",t)||this;return Object.defineProperty(i,"loading",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),i.loading=r,i}return r(t,e),t}(gl),xl=function(e){function t(t,r,i,n){var o=e.call(this,t,r)||this;return Object.defineProperty(o,"oldStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"newStyle",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),o.oldStyle=i,o.newStyle=n,o}return r(t,e),t}(gl);Ys("emu:feature-stream");var wl=function(){function e(e){var t,r;Object.defineProperty(this,"_boundHandleLoading",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_boundHandleSourceFeatureState",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_sourceLoadCount",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"_sourceLoaded",{enumerable:!0,configurable:!0,writable:!0,value:!0}),this._options=i({fireImmediately:!0},e),"vector"===e.map.getSource(e.source).type&&(null!==(t=(r=this._options).sourceLayer)&&void 0!==t||(r.sourceLayer="geometry")),Pa(this,{_options:Gn,_sourceLoadCount:Gn,featureData:Kn.struct}),this._boundHandleLoading=this.handleLoading.bind(this),this._boundHandleSourceFeatureState=this.handleSourceFeatureState.bind(this),ta(this,"featureData",this.resume.bind(this)),ra(this,"featureData",this.suspend.bind(this))}return Object.defineProperty(e.prototype,"featureData",{get:function(){return this._sourceLoadCount,this.queryFeatureData(this._options.featureIds)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"featureIds",{get:function(){return this._options.featureIds},set:function(e){var t=this;Ko((function(){t._options.featureIds=e}))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subscribe",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=Ds((function(){return t.featureData}),this._options.fireImmediately).subscribe(e);return{unsubscribe:function(){r.unsubscribe()}}}}),Object.defineProperty(e.prototype,"featureFromMaplibreFeature",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return{id:e.id,geometry:e.geometry,source:this._options.source,sourceLayer:this._options.sourceLayer,properties:e.properties,state:this._options.map.maplibreMap.getFeatureState({id:e.id,source:this._options.source,sourceLayer:this._options.sourceLayer})}}}),Object.defineProperty(e.prototype,"handleLoading",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=!1;"sourcedata"===e.type&&e.sourceId===this._options.source?r=e.isSourceLoaded:"idle"===e.type&&(r=!0),this._sourceLoaded!==r&&(this._sourceLoaded=r,r&&Ko((function(){t._sourceLoadCount++})))}}),Object.defineProperty(e.prototype,"handleSourceFeatureState",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;"sourceFeatureState"===e.type&&e.source===this._options.source&&Ko((function(){t._sourceLoadCount++}))}}),Object.defineProperty(e.prototype,"queryFeatureData",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;if(0===e.length)return{};var r=this._options.map.getSource(this._options.source),i=this._options.map.maplibreMap.querySourceFeatures(this._options.source,{sourceLayer:this._options.sourceLayer,filter:["in",["get",r.featureId],["literal",e]]}),n=new Set;return(i=i.filter((function(e){return!n.has(e.id)&&(n.add(e.id)&&!0)}))).reduce((function(e,r){return e[r.id]=t.featureFromMaplibreFeature(r),e}),{})}}),Object.defineProperty(e.prototype,"resume",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._options.map.maplibreMap.on("sourcedata",this._boundHandleLoading),this._options.map.maplibreMap.on("idle",this._boundHandleLoading),this._options.map.on("sourceFeatureState",this._boundHandleSourceFeatureState)}}),Object.defineProperty(e.prototype,"suspend",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._options.map.maplibreMap.off("sourcedata",this._boundHandleLoading),this._options.map.maplibreMap.off("idle",this._boundHandleLoading),this._options.map.off("sourceFeatureState",this._boundHandleSourceFeatureState)}}),e}();Ys("flow:image-registry");var Sl="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512' class='flowicon'%3E%3C!--! Font Awesome Free 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2022 Fonticons, Inc.--%3E%3Cpath d='M256 0C114.6 0 0 114.6 0 256s114.6 256 256 256 256-114.6 256-256S397.4 0 256 0zm0 400c-18 0-32-14-32-32s13.1-32 32-32c17.1 0 32 14 32 32s-14.9 32-32 32zm69.1-142L280 286v2c0 13-11 24-24 24s-24-11-24-24v-16c0-8 4-16 12-21l57-34c7-4 11-11 11-19 0-12-10.9-22-22.9-22H238c-12.9 0-22 10-22 22 0 13-11 24-24 24s-24-11-24-24c0-39 31-70 69.1-70h51.1c40.8 0 71.8 31 71.8 70 0 24-13 47-34.9 60z'/%3E%3C/svg%3E",El=function(){function e(){Object.defineProperty(this,"registry",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"_unknownImage",{enumerable:!0,configurable:!0,writable:!0,value:null})}return Object.defineProperty(e.prototype,"unknownImage",{get:function(){if(!this._unknownImage){var e=new Image(40,40);e.src=Sl,this._unknownImage={id:"unknown-image",src:Sl,pixelDensity:2,image:e}}return this._unknownImage},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"registerImage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,n,o){void 0===n&&(n=2),void 0===o&&(o=!1);var a={id:e,src:t,width:r,height:i,pixelDensity:n,recolor:o};return this.registry.set(e,a),a}}),Object.defineProperty(e.prototype,"getImage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.registry.get(e);return t?(t.image||(t.image=this.loadImage(t.src,t.width,t.height,t.pixelDensity)),t):this.unknownImage}}),Object.defineProperty(e.prototype,"loadImage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i){void 0===i&&(i=2);var n=new Image;return n.crossOrigin="Anonymous",n.width=t?t*i:n.width,n.height=r?r*i:n.height,n.src=e,n}}),e}(),Tl=Ys("flow:flow-core-map"),kl=function(e){function t(r){var n=e.call(this)||this;return Object.defineProperty(n,"_initialized",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"_loading",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(n,"_state",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(n,"debouncedEmitSourceEvent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"imageRegistry",{enumerable:!0,configurable:!0,writable:!0,value:new El}),Object.defineProperty(n,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"pluginManager",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"resolveInitialized",{enumerable:!0,configurable:!0,writable:!0,value:function(){}}),Object.defineProperty(n,"style",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(n,"styleUpdateSubscription",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(n,"throttledMouseMove",{enumerable:!0,configurable:!0,writable:!0,value:hl(n.handleMouseMove,{delay:200,noLeading:!0,context:n})}),Object.defineProperty(n,"updateMapStyle",{enumerable:!0,configurable:!0,writable:!0,value:function(e){var t=n.maplibreMap.getStyle(),r=new xl("beforeStyleChanged",n,t,e);e=n.pluginManager.forwardStyleChangeEvent(new xl("beforeStyleChanged",n,t,e)),n.emit(r.type,r),Tl("".concat(n.formattedName(),": Updating style"),e),n.maplibreMap.setStyle(e),n.emitEvent(new xl("styleChanged",n,t,e))}}),Object.defineProperty(n,"maplibreMap",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n.options=i(i({},t.defaultOptions),r),n.style=new il({id:"style"}),n.debouncedEmitSourceEvent=pl(n.emitEvent,{delay:20,hash:function(e){return e.source},context:n}),n._initialized=new Promise((function(e){n.resolveInitialized=e})),n.pluginManager=new yl(n),n.initialize(),n}return r(t,e),Object.defineProperty(t.prototype,"client",{get:function(){return this.options.flowClient},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"container",{get:function(){return this.maplibreMap.getContainer()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"id",{get:function(){return this.options.id},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"initialized",{get:function(){return this._initialized},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"styleSpecification",{get:function(){return this.style.styleSpecification},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"addLayer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.style.addLayer(e),this}}),Object.defineProperty(t.prototype,"addSource",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.emitEvent(new bl("beforeSourceAdded",this,e.id)),e.setFlowEndpoint({host:this.options.flowClient.baseUrl,apiKey:this.options.flowClient.apiKey||void 0}),this.style.addSource(e),this.emitEvent(new bl("sourceAdded",this,e.id)),this}}),Object.defineProperty(t.prototype,"bindState",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._state=e,this.style.bindState(e),this.pluginManager.bindState(e),this}}),Object.defineProperty(t.prototype,"destroy",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e,t;this.pluginManager.removeAllPlugins(),null===(e=this.styleUpdateSubscription)||void 0===e||e.unsubscribe(),null===(t=this.maplibreMap)||void 0===t||t.remove(),this.emit("destroyed",new gl("destroyed",this))}}),Object.defineProperty(t.prototype,"emitError",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=new rl("".concat(this.formattedName(),": ").concat(e),t);this.pluginManager.forwardEvent("error",r),this.listenerCount("error")?this.emit("error",r):console.error(r)}}),Object.defineProperty(t.prototype,"emitEvent",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.pluginManager.forwardEvent(e.type,e),this.emit(e.type,e)}}),Object.defineProperty(t.prototype,"featureStream",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return new wl(i({map:this},e))}}),Object.defineProperty(t.prototype,"formattedName",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"FlowCoreMap<".concat(this.options.id,">")}}),Object.defineProperty(t.prototype,"getFeatureState",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.maplibreMap.getFeatureState(e)}}),Object.defineProperty(t.prototype,"getLayer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.style.getLayer(e)}}),Object.defineProperty(t.prototype,"getLayers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.style.getLayers(e)}}),Object.defineProperty(t.prototype,"getPlugin",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.pluginManager.getPlugin(e)}}),Object.defineProperty(t.prototype,"getSource",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.style.getSource(e)}}),Object.defineProperty(t.prototype,"getSources",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.style.getSources(e)}}),Object.defineProperty(t.prototype,"registerImage",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,i,n,o){void 0===n&&(n=2),void 0===o&&(o=!1),Tl("".concat(this.formattedName(),": Registering image '").concat(e,"'")),this.imageRegistry.registerImage(e,t,r,i,n,o)}}),Object.defineProperty(t.prototype,"removeFeatureState",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var i;if(void 0===r&&(r=!0),Yr(e.id)&&Qr(t)){var n=this.maplibreMap.style;n._checkLoaded();var o=e.source,a=n.sourceCaches[o];if(void 0===a)throw new Fs("The source '".concat(o,"' does not exist in the map's style."));var s=a._state,l="vector"===a.getSource().type?null!==(i=e.sourceLayer)&&void 0!==i?i:"geometry":"_geojsonTileLayer";if(s.deletedStates[l]=s.deletedStates[l]||{},null===s.deletedStates[l])return;s.state[l]&&Object.keys(s.state[l]).forEach((function(e){null!==s.deletedStates[l][e]&&(s.deletedStates[l][e]=s.deletedStates[l][e]||{},s.deletedStates[l][e][t]=null)})),this.maplibreMap._update()}else this.maplibreMap.removeFeatureState(e,t);if(r){var c=new bl("sourceFeatureState",this,e.source);this.debouncedEmitSourceEvent(c)}}}),Object.defineProperty(t.prototype,"removeLayer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.style.removeLayer(e),this}}),Object.defineProperty(t.prototype,"removeSource",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return void 0===t&&(t=!1),this.emitEvent(new bl("beforeSourceRemoved",this,e)),this.style.removeSource(e,t),this.emitEvent(new bl("sourceRemoved",this,e)),this}}),Object.defineProperty(t.prototype,"setBaseStyle",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return n(this,void 0,void 0,(function(){var t;return o(this,(function(r){switch(r.label){case 0:return[4,this.loadBaseStyle(e)];case 1:return t=r.sent(),this.style.setBaseStyle(t),[2]}}))}))}}),Object.defineProperty(t.prototype,"getCenter",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.maplibreMap.getCenter(),t=this.maplibreMap.getZoom(),r=this.maplibreMap.getBearing(),i=this.maplibreMap.getPitch();return{lng:e.lng,lat:e.lat,zoom:t,bearing:r,pitch:i}}}),Object.defineProperty(t.prototype,"setCenter",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Qr(e.lng)&&Qr(e.lat)?new tl.exports.LngLat(e.lng,e.lat):void 0,n=this.maplibreMap.jumpTo;if(t)switch(t.mode){case"ease":n=this.maplibreMap.easeTo;break;case"fly":n=this.maplibreMap.flyTo;break;default:n=this.maplibreMap.jumpTo}var o=i(i({center:r},e),t);return n.call(this.maplibreMap,o),this}}),Object.defineProperty(t.prototype,"getBounds",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.maplibreMap.getBounds();return[e.getWest(),e.getSouth(),e.getEast(),e.getNorth()]}}),Object.defineProperty(t.prototype,"setBounds",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=i({linear:!t||"ease"===t.mode||"jump"===t.mode,animate:!!t&&"jump"!==t.mode},t);this.maplibreMap.fitBounds(e,r)}}),Object.defineProperty(t.prototype,"setFeatureState",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){void 0===r&&(r=!0);var i=this.getSource(e.source);if(cl(ri(i.featureId)),"vector"===(null==i?void 0:i.type)&&(e.sourceLayer=e.sourceLayer||"geometry"),this.maplibreMap.setFeatureState(e,t),r){var n=new bl("sourceFeatureState",this,e.source);this.debouncedEmitSourceEvent(n)}}}),Object.defineProperty(t.prototype,"setFeatureStateBulk",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r,i=this.getSource(e.source);cl(ri(i.featureId)),this.maplibreMap.style._checkLoaded();var n=this.maplibreMap.style.sourceCaches[e.source];if(Hr(n))throw new Fs("".concat(this.formattedName(),": the source '").concat(e.source,"' does not exist in the map's style."));var o="vector"===n.getSource().type?null!==(r=e.sourceLayer)&&void 0!==r?r:"geometry":"";Object.keys(t).forEach((function(e){n.setFeatureState(o,e,t[e])})),this.maplibreMap._update();var a=new bl("sourceFeatureState",this,e.source);this.debouncedEmitSourceEvent(a)}}),Object.defineProperty(t.prototype,"transaction",{enumerable:!1,configurable:!0,writable:!0,value:function(e){Ko((function(){return e()}))}}),Object.defineProperty(t.prototype,"usePlugin",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this.pluginManager.usePlugin(e,t),this}}),Object.defineProperty(t.prototype,"usePlugins",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return e.forEach((function(e){return t.usePlugin(e)})),this}}),Object.defineProperty(t.prototype,"bindMapEvents",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;this.maplibreMap.on("error",(function(t){return e.emitError(t.error.message,t.error)})),this.maplibreMap.on("mousemove",this.throttledMouseMove),this.maplibreMap.on("mouseout",this.throttledMouseMove),this.maplibreMap.on("click",this.handleMouseClick("click").bind(this)),this.maplibreMap.on("dblclick",this.handleMouseClick("dblClick").bind(this)),this.maplibreMap.on("styleimagemissing",this.handleMissingImage.bind(this)),this.maplibreMap.on("sourcedata",this.handleLoading.bind(this)),this.maplibreMap.on("idle",this.handleLoading.bind(this));["moveEnd"].forEach((function(t){e.maplibreMap.on(t.toLowerCase(),(function(r){var i=gl.fromMaplibreEvent(t,e,r);e.emitEvent(i)}))}))}}),Object.defineProperty(t.prototype,"featureFromMaplibreFeature",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return{id:e.id,geometry:e.geometry,source:e.source,sourceLayer:e.sourceLayer,layer:e.layer.id,properties:e.properties,state:e.state}}}),Object.defineProperty(t.prototype,"featureQueryBox",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.options.featureClickTolerance?[[e.point.x-this.options.featureClickTolerance,e.point.y-this.options.featureClickTolerance],[e.point.x+this.options.featureClickTolerance,e.point.y+this.options.featureClickTolerance]]:e.point}}),Object.defineProperty(t.prototype,"handleLoading",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return n(this,void 0,void 0,(function(){var t,r;return o(this,(function(i){return t=!1,t="sourcedata"===e.type&&!1===e.isSourceLoaded||"idle"!==e.type&&!!Object.values(this.maplibreMap.style.sourceCaches).find((function(e){return!e.loaded()})),this._loading!==t&&(r=new vl(this,t),this.emitEvent(r),this._loading=t),[2]}))}))}}),Object.defineProperty(t.prototype,"handleMissingImage",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return n(this,void 0,void 0,(function(){var t,r=this;return o(this,(function(i){return(t=this.imageRegistry.getImage(e.id))===this.imageRegistry.unknownImage&&console.error("".concat(this.formattedName(),": Image '").concat(e.id,"' not registered")),t.image.complete||(t.image.onload=function(){r.maplibreMap.updateImage(e.id,t.image),r.maplibreMap.redraw()}),this.maplibreMap.addImage(e.id,t.image,{pixelRatio:t.pixelDensity,sdf:t.recolor}),[2]}))}))}}),Object.defineProperty(t.prototype,"handleMouseClick",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return function(r){var i=t.style.getLayers((function(e){return e.interactive})).map((function(e){return e.id})),n=t.maplibreMap.queryRenderedFeatures(t.featureQueryBox(r),{layers:i}).map(t.featureFromMaplibreFeature.bind(t));n.length&&Tl("".concat(t.formattedName()," Feature ").concat(e,"ed"),n[0]);var o=_l.fromMaplibreMouseEvent(e,r,t,n);t.emitEvent(o)}}}),Object.defineProperty(t.prototype,"handleMouseMove",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if("mousemove"===e.type){var t=this.style.getLayers((function(e){return e.interactive})).map((function(e){return e.id})),r=this.maplibreMap.queryRenderedFeatures(this.featureQueryBox(e),{layers:t}).map(this.featureFromMaplibreFeature.bind(this)),i=_l.fromMaplibreMouseEvent("mouseMove",e,this,r);this.emitEvent(i)}else if("mouseout"===e.type){i=_l.fromMaplibreMouseEvent("mouseOut",e,this,[]);this.emitEvent(i)}}}),Object.defineProperty(t.prototype,"initialize",{enumerable:!1,configurable:!0,writable:!0,value:function(){return n(this,void 0,void 0,(function(){var e,t=this;return o(this,(function(r){switch(r.label){case 0:return[4,this.loadBaseStyle(this.options.baseStyle)];case 1:return e=r.sent(),this.style.setBaseStyle(e),this.maplibreMap=new tl.exports.Map(i(i({},this.options),{transformRequest:this.transformMapRequest.bind(this),style:e})),this.maplibreMap.once("load",(function(){t.styleUpdateSubscription=Ds((function(){return t.style.styleSpecification}),!1).subscribe(t.updateMapStyle),t.bindMapEvents(),t.resolveInitialized(),Tl("".concat(t.formattedName(),": initialized with options"),t.options)})),[2]}}))}))}}),Object.defineProperty(t.prototype,"loadBaseStyle",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return vi(e)?[2,fetch(e).then((function(e){return e.json()}))]:ei(e)?[2,this.options.flowClient.maps.get(e)]:[2,e]}))}))}}),Object.defineProperty(t.prototype,"transformMapRequest",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r={url:e};return this.client.accessToken&&e.startsWith(this.client.baseUrl)&&(r.headers={Authorization:"Bearer ".concat(this.client.accessToken)}),r}}),Object.defineProperty(t,"defaultOptions",{enumerable:!0,configurable:!0,writable:!0,value:{boxZoom:!1,doubleClickZoom:!1,featureClickTolerance:0}}),t}(el),Al=function(){function e(){Object.defineProperty(this,"requestId",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"commitId",{enumerable:!0,configurable:!0,writable:!0,value:0})}return Object.defineProperty(e.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return n(this,void 0,void 0,(function(){var t,r;return o(this,(function(i){switch(i.label){case 0:return this.requestId+=1,t=this.requestId,[4,e];case 1:return r=i.sent(),t<=this.commitId?[2,{succeeded:!1}]:(this.commitId=t,[2,{succeeded:!0,value:r}])}}))}))}}),Object.defineProperty(e.prototype,"run",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return[2,this.resolve(e())]}))}))}}),e}(),Il=Ys("flow:flow-core-query"),Pl=function(){function e(t,r,n){var o;Object.defineProperty(this,"queryFn",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"committer",{enumerable:!0,configurable:!0,writable:!0,value:new Al}),Object.defineProperty(this,"disposer",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"store",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"transformFn",{enumerable:!0,configurable:!0,writable:!0,value:function(e){return e}}),Object.defineProperty(this,"_flowClient",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"results",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"busy",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:null}),this.options=i(i({},e.defaultOptions),n),this.options.name=null!==(o=this.options.name)&&void 0!==o?o:"FlowCoreQuery#".concat(e.queryNum++),this._flowClient=this.options.flowClient,Pa(this,{results:Gn.ref,busy:Gn,error:Gn.ref,store:Gn.ref,bindState:Wo},{name:"flowQuery"}),ta(this,"results",this.wake.bind(this)),ra(this,"results",this.sleep.bind(this)),r&&(this.transformFn=r),e.queries.set(this.options.name,new WeakRef(this))}return Object.defineProperty(e,"setDefaultOptions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.defaultOptions=i(i({},this.defaultOptions),e)}}),Object.defineProperty(e,"getQueries",{enumerable:!1,configurable:!0,writable:!0,value:function(){return Array.from(this.queries.values()).map((function(e){return e.deref()})).filter((function(e){return!!e}))}}),Object.defineProperty(e,"getQuery",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t;return null===(t=this.queries.get(e))||void 0===t?void 0:t.deref()}}),Object.defineProperty(e.prototype,"flowClient",{get:function(){return this._flowClient},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"name",{get:function(){return this.options.name},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"bindState",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.store=e,this}}),Object.defineProperty(e.prototype,"runImmediately",{enumerable:!1,configurable:!0,writable:!0,value:function(){return n(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:return e=this.queryFn.call(this.store,this.store),[4,this.runQuery(e)];case 1:if(t.sent(),this.error)throw this.error;return[2,this.results]}}))}))}}),Object.defineProperty(e.prototype,"wake",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;this.sleep(),this.disposer=ea((function(t){return e.queryFn.call(e.store,e.store)}),(function(t,r,i){e.runQuery(t)}),{name:this.formattedName(),fireImmediately:this.options.fireImmediately,delay:this.options.delay})}}),Object.defineProperty(e.prototype,"sleep",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(this.disposer){Ko((function(){e.results=null,e.error=null,e.busy=!1,e.committer.commitId=e.committer.requestId}));var t=this.disposer;this.disposer=null,t()}}}),Object.defineProperty(e.prototype,"runQuery",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return n(this,void 0,void 0,(function(){var t,r,i=this;return o(this,(function(n){switch(n.label){case 0:Il("".concat(this.formattedName(),": running query"),e),n.label=1;case 1:return n.trys.push([1,5,,6]),null!==e?[3,2]:(Ko((function(){i.results=null,i.error=null,i.busy=!1})),[3,4]);case 2:if(Ko((function(){i.busy=!0,i.error=null})),!this.flowClient)throw new Error("No Flo.w client to execute query");return[4,this.committer.run((function(){return i.flowClient.datasets.query(e)}))];case 3:(t=n.sent()).succeeded&&Ko((function(){i.results=i.transformFn(t.value),i.busy=!1})),n.label=4;case 4:return[3,6];case 5:return r=n.sent(),console.error("".concat(this.formattedName(),": ").concat(r.message)),Ko((function(){i.results=null,i.error=r,i.busy=!1})),[3,6];case 6:return[2]}}))}))}}),Object.defineProperty(e.prototype,"formattedName",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"FlowCoreQuery<".concat(this.options.name,">")}}),Object.defineProperty(e,"defaultOptions",{enumerable:!0,configurable:!0,writable:!0,value:{fireImmediately:!0,delay:100}}),Object.defineProperty(e,"queryNum",{enumerable:!0,configurable:!0,writable:!0,value:1}),Object.defineProperty(e,"queries",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),e}();function Cl(e,t,r){return"object"==typeof t&&(r=t,t=void 0),new Pl(e,t,r)}var zl={exports:{}},Ml={exports:{}},Ol=function(e,t){return function(){for(var r=new Array(arguments.length),i=0;i<r.length;i++)r[i]=arguments[i];return e.apply(t,r)}},Dl=Ol,Ll=Object.prototype.toString,jl=function(e){return function(t){var r=Ll.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())}}(Object.create(null));function Rl(e){return e=e.toLowerCase(),function(t){return jl(t)===e}}function Bl(e){return Array.isArray(e)}function Fl(e){return void 0===e}var Nl=Rl("ArrayBuffer");function Ul(e){return null!==e&&"object"==typeof e}function Vl(e){if("object"!==jl(e))return!1;var t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}var ql=Rl("Date"),$l=Rl("File"),Gl=Rl("Blob"),Zl=Rl("FileList");function Wl(e){return"[object Function]"===Ll.call(e)}var Xl=Rl("URLSearchParams");function Kl(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),Bl(e))for(var r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.call(null,e[n],n,e)}var Hl,Jl=(Hl="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array),function(e){return Hl&&e instanceof Hl}),Yl={isArray:Bl,isArrayBuffer:Nl,isBuffer:function(e){return null!==e&&!Fl(e)&&null!==e.constructor&&!Fl(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){var t="[object FormData]";return e&&("function"==typeof FormData&&e instanceof FormData||Ll.call(e)===t||Wl(e.toString)&&e.toString()===t)},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&Nl(e.buffer)},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:Ul,isPlainObject:Vl,isUndefined:Fl,isDate:ql,isFile:$l,isBlob:Gl,isFunction:Wl,isStream:function(e){return Ul(e)&&Wl(e.pipe)},isURLSearchParams:Xl,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:Kl,merge:function e(){var t={};function r(r,i){Vl(t[i])&&Vl(r)?t[i]=e(t[i],r):Vl(r)?t[i]=e({},r):Bl(r)?t[i]=r.slice():t[i]=r}for(var i=0,n=arguments.length;i<n;i++)Kl(arguments[i],r);return t},extend:function(e,t,r){return Kl(t,(function(t,i){e[i]=r&&"function"==typeof t?Dl(t,r):t})),e},trim:function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},stripBOM:function(e){return 65279===e.charCodeAt(0)&&(e=e.slice(1)),e},inherits:function(e,t,r,i){e.prototype=Object.create(t.prototype,i),e.prototype.constructor=e,r&&Object.assign(e.prototype,r)},toFlatObject:function(e,t,r){var i,n,o,a={};t=t||{};do{for(n=(i=Object.getOwnPropertyNames(e)).length;n-- >0;)a[o=i[n]]||(t[o]=e[o],a[o]=!0);e=Object.getPrototypeOf(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:jl,kindOfTest:Rl,endsWith:function(e,t,r){e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;var i=e.indexOf(t,r);return-1!==i&&i===r},toArray:function(e){if(!e)return null;var t=e.length;if(Fl(t))return null;for(var r=new Array(t);t-- >0;)r[t]=e[t];return r},isTypedArray:Jl,isFileList:Zl},Ql=Yl;function ec(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var tc=function(e,t,r){if(!t)return e;var i;if(r)i=r(t);else if(Ql.isURLSearchParams(t))i=t.toString();else{var n=[];Ql.forEach(t,(function(e,t){null!=e&&(Ql.isArray(e)?t+="[]":e=[e],Ql.forEach(e,(function(e){Ql.isDate(e)?e=e.toISOString():Ql.isObject(e)&&(e=JSON.stringify(e)),n.push(ec(t)+"="+ec(e))})))})),i=n.join("&")}if(i){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e},rc=Yl;function ic(){this.handlers=[]}ic.prototype.use=function(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},ic.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},ic.prototype.forEach=function(e){rc.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var nc,oc,ac=ic,sc=Yl;function lc(){if(oc)return nc;oc=1;var e=Yl;function t(e,t,r,i,n){Error.call(this),this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),i&&(this.request=i),n&&(this.response=n)}e.inherits(t,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var r=t.prototype,i={};return["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach((function(e){i[e]={value:e}})),Object.defineProperties(t,i),Object.defineProperty(r,"isAxiosError",{value:!0}),t.from=function(i,n,o,a,s,l){var c=Object.create(r);return e.toFlatObject(i,c,(function(e){return e!==Error.prototype})),t.call(c,i.message,n,o,a,s),c.name=i.name,l&&Object.assign(c,l),c},nc=t}var cc,uc,hc,pc,dc,fc,mc={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};function yc(){if(uc)return cc;uc=1;var e=Yl;return cc=function(t,r){r=r||new FormData;var i=[];function n(t){return null===t?"":e.isDate(t)?t.toISOString():e.isArrayBuffer(t)||e.isTypedArray(t)?"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}return function t(o,a){if(e.isPlainObject(o)||e.isArray(o)){if(-1!==i.indexOf(o))throw Error("Circular reference detected in "+a);i.push(o),e.forEach(o,(function(i,o){if(!e.isUndefined(i)){var s,l=a?a+"."+o:o;if(i&&!a&&"object"==typeof i)if(e.endsWith(o,"{}"))i=JSON.stringify(i);else if(e.endsWith(o,"[]")&&(s=e.toArray(i)))return void s.forEach((function(t){!e.isUndefined(t)&&r.append(l,n(t))}));t(i,l)}})),i.pop()}else r.append(a,n(o))}(t),r},cc}function gc(){if(pc)return hc;pc=1;var e=lc();return hc=function(t,r,i){var n=i.config.validateStatus;i.status&&n&&!n(i.status)?r(new e("Request failed with status code "+i.status,[e.ERR_BAD_REQUEST,e.ERR_BAD_RESPONSE][Math.floor(i.status/100)-4],i.config,i.request,i)):t(i)}}function _c(){if(fc)return dc;fc=1;var e=Yl;return dc=e.isStandardBrowserEnv()?{write:function(t,r,i,n,o,a){var s=[];s.push(t+"="+encodeURIComponent(r)),e.isNumber(i)&&s.push("expires="+new Date(i).toGMTString()),e.isString(n)&&s.push("path="+n),e.isString(o)&&s.push("domain="+o),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}}var bc,vc,xc,wc,Sc,Ec,Tc,kc,Ac,Ic,Pc,Cc,zc=function(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)},Mc=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e},Oc=function(e,t){return e&&!zc(t)?Mc(e,t):t};function Dc(){if(vc)return bc;vc=1;var e=Yl,t=["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"];return bc=function(r){var i,n,o,a={};return r?(e.forEach(r.split("\n"),(function(r){if(o=r.indexOf(":"),i=e.trim(r.substr(0,o)).toLowerCase(),n=e.trim(r.substr(o+1)),i){if(a[i]&&t.indexOf(i)>=0)return;a[i]="set-cookie"===i?(a[i]?a[i]:[]).concat([n]):a[i]?a[i]+", "+n:n}})),a):a}}function Lc(){if(wc)return xc;wc=1;var e=Yl;return xc=e.isStandardBrowserEnv()?function(){var t,r=/(msie|trident)/i.test(navigator.userAgent),i=document.createElement("a");function n(e){var t=e;return r&&(i.setAttribute("href",t),t=i.href),i.setAttribute("href",t),{href:i.href,protocol:i.protocol?i.protocol.replace(/:$/,""):"",host:i.host,search:i.search?i.search.replace(/^\?/,""):"",hash:i.hash?i.hash.replace(/^#/,""):"",hostname:i.hostname,port:i.port,pathname:"/"===i.pathname.charAt(0)?i.pathname:"/"+i.pathname}}return t=n(window.location.href),function(r){var i=e.isString(r)?n(r):r;return i.protocol===t.protocol&&i.host===t.host}}():function(){return!0}}function jc(){if(Ec)return Sc;Ec=1;var e=lc();function t(t){e.call(this,null==t?"canceled":t,e.ERR_CANCELED),this.name="CanceledError"}return Yl.inherits(t,e,{__CANCEL__:!0}),Sc=t}function Rc(){return kc?Tc:(kc=1,Tc=function(e){var t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""})}function Bc(){if(Ic)return Ac;Ic=1;var e=Yl,t=gc(),r=_c(),i=tc,n=Oc,o=Dc(),a=Lc(),s=mc,l=lc(),c=jc(),u=Rc();return Ac=function(h){return new Promise((function(p,d){var f,m=h.data,y=h.headers,g=h.responseType;function _(){h.cancelToken&&h.cancelToken.unsubscribe(f),h.signal&&h.signal.removeEventListener("abort",f)}e.isFormData(m)&&e.isStandardBrowserEnv()&&delete y["Content-Type"];var b=new XMLHttpRequest;if(h.auth){var v=h.auth.username||"",x=h.auth.password?unescape(encodeURIComponent(h.auth.password)):"";y.Authorization="Basic "+btoa(v+":"+x)}var w=n(h.baseURL,h.url);function S(){if(b){var e="getAllResponseHeaders"in b?o(b.getAllResponseHeaders()):null,r={data:g&&"text"!==g&&"json"!==g?b.response:b.responseText,status:b.status,statusText:b.statusText,headers:e,config:h,request:b};t((function(e){p(e),_()}),(function(e){d(e),_()}),r),b=null}}if(b.open(h.method.toUpperCase(),i(w,h.params,h.paramsSerializer),!0),b.timeout=h.timeout,"onloadend"in b?b.onloadend=S:b.onreadystatechange=function(){b&&4===b.readyState&&(0!==b.status||b.responseURL&&0===b.responseURL.indexOf("file:"))&&setTimeout(S)},b.onabort=function(){b&&(d(new l("Request aborted",l.ECONNABORTED,h,b)),b=null)},b.onerror=function(){d(new l("Network Error",l.ERR_NETWORK,h,b,b)),b=null},b.ontimeout=function(){var e=h.timeout?"timeout of "+h.timeout+"ms exceeded":"timeout exceeded",t=h.transitional||s;h.timeoutErrorMessage&&(e=h.timeoutErrorMessage),d(new l(e,t.clarifyTimeoutError?l.ETIMEDOUT:l.ECONNABORTED,h,b)),b=null},e.isStandardBrowserEnv()){var E=(h.withCredentials||a(w))&&h.xsrfCookieName?r.read(h.xsrfCookieName):void 0;E&&(y[h.xsrfHeaderName]=E)}"setRequestHeader"in b&&e.forEach(y,(function(e,t){void 0===m&&"content-type"===t.toLowerCase()?delete y[t]:b.setRequestHeader(t,e)})),e.isUndefined(h.withCredentials)||(b.withCredentials=!!h.withCredentials),g&&"json"!==g&&(b.responseType=h.responseType),"function"==typeof h.onDownloadProgress&&b.addEventListener("progress",h.onDownloadProgress),"function"==typeof h.onUploadProgress&&b.upload&&b.upload.addEventListener("progress",h.onUploadProgress),(h.cancelToken||h.signal)&&(f=function(e){b&&(d(!e||e&&e.type?new c:e),b.abort(),b=null)},h.cancelToken&&h.cancelToken.subscribe(f),h.signal&&(h.signal.aborted?f():h.signal.addEventListener("abort",f))),m||(m=null);var T=u(w);T&&-1===["http","https","file"].indexOf(T)?d(new l("Unsupported protocol "+T+":",l.ERR_BAD_REQUEST,h)):b.send(m)}))},Ac}var Fc=Yl,Nc=function(e,t){sc.forEach(e,(function(r,i){i!==t&&i.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[i])}))},Uc=lc(),Vc=mc,qc=yc(),$c={"Content-Type":"application/x-www-form-urlencoded"};function Gc(e,t){!Fc.isUndefined(e)&&Fc.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var Zc,Wc={transitional:Vc,adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(Zc=Bc()),Zc),transformRequest:[function(e,t){if(Nc(t,"Accept"),Nc(t,"Content-Type"),Fc.isFormData(e)||Fc.isArrayBuffer(e)||Fc.isBuffer(e)||Fc.isStream(e)||Fc.isFile(e)||Fc.isBlob(e))return e;if(Fc.isArrayBufferView(e))return e.buffer;if(Fc.isURLSearchParams(e))return Gc(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString();var r,i=Fc.isObject(e),n=t&&t["Content-Type"];if((r=Fc.isFileList(e))||i&&"multipart/form-data"===n){var o=this.env&&this.env.FormData;return qc(r?{"files[]":e}:e,o&&new o)}return i||"application/json"===n?(Gc(t,"application/json"),function(e,t,r){if(Fc.isString(e))try{return(t||JSON.parse)(e),Fc.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){var t=this.transitional||Wc.transitional,r=t&&t.silentJSONParsing,i=t&&t.forcedJSONParsing,n=!r&&"json"===this.responseType;if(n||i&&Fc.isString(e)&&e.length)try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw Uc.from(e,Uc.ERR_BAD_RESPONSE,this,null,this.response);throw e}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Cc?Pc:(Cc=1,Pc=null)},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Fc.forEach(["delete","get","head"],(function(e){Wc.headers[e]={}})),Fc.forEach(["post","put","patch"],(function(e){Wc.headers[e]=Fc.merge($c)}));var Xc,Kc,Hc=Wc,Jc=Yl,Yc=Hc;function Qc(){return Kc?Xc:(Kc=1,Xc=function(e){return!(!e||!e.__CANCEL__)})}var eu=Yl,tu=function(e,t,r){var i=this||Yc;return Jc.forEach(r,(function(r){e=r.call(i,e,t)})),e},ru=Qc(),iu=Hc,nu=jc();function ou(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new nu}var au,su,lu=Yl,cu=function(e,t){t=t||{};var r={};function i(e,t){return lu.isPlainObject(e)&&lu.isPlainObject(t)?lu.merge(e,t):lu.isPlainObject(t)?lu.merge({},t):lu.isArray(t)?t.slice():t}function n(r){return lu.isUndefined(t[r])?lu.isUndefined(e[r])?void 0:i(void 0,e[r]):i(e[r],t[r])}function o(e){if(!lu.isUndefined(t[e]))return i(void 0,t[e])}function a(r){return lu.isUndefined(t[r])?lu.isUndefined(e[r])?void 0:i(void 0,e[r]):i(void 0,t[r])}function s(r){return r in t?i(e[r],t[r]):r in e?i(void 0,e[r]):void 0}var l={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s};return lu.forEach(Object.keys(e).concat(Object.keys(t)),(function(e){var t=l[e]||n,i=t(e);lu.isUndefined(i)&&t!==s||(r[e]=i)})),r};function uu(){return su?au:(su=1,au={version:"0.27.2"})}var hu=uu().version,pu=lc(),du={};["object","boolean","number","function","string","symbol"].forEach((function(e,t){du[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));var fu={};du.transitional=function(e,t,r){function i(e,t){return"[Axios v"+hu+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return function(r,n,o){if(!1===e)throw new pu(i(n," has been removed"+(t?" in "+t:"")),pu.ERR_DEPRECATED);return t&&!fu[n]&&(fu[n]=!0,console.warn(i(n," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,n,o)}};var mu,yu,gu,_u,bu,vu,xu={assertOptions:function(e,t,r){if("object"!=typeof e)throw new pu("options must be an object",pu.ERR_BAD_OPTION_VALUE);for(var i=Object.keys(e),n=i.length;n-- >0;){var o=i[n],a=t[o];if(a){var s=e[o],l=void 0===s||a(s,o,e);if(!0!==l)throw new pu("option "+o+" must be "+l,pu.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new pu("Unknown option "+o,pu.ERR_BAD_OPTION)}},validators:du},wu=Yl,Su=tc,Eu=ac,Tu=function(e){return ou(e),e.headers=e.headers||{},e.data=tu.call(e,e.data,e.headers,e.transformRequest),e.headers=eu.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),eu.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||iu.adapter)(e).then((function(t){return ou(e),t.data=tu.call(e,t.data,t.headers,e.transformResponse),t}),(function(t){return ru(t)||(ou(e),t&&t.response&&(t.response.data=tu.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},ku=cu,Au=Oc,Iu=xu,Pu=Iu.validators;function Cu(e){this.defaults=e,this.interceptors={request:new Eu,response:new Eu}}Cu.prototype.request=function(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},(t=ku(this.defaults,t)).method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var r=t.transitional;void 0!==r&&Iu.assertOptions(r,{silentJSONParsing:Pu.transitional(Pu.boolean),forcedJSONParsing:Pu.transitional(Pu.boolean),clarifyTimeoutError:Pu.transitional(Pu.boolean)},!1);var i=[],n=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(n=n&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));var o,a=[];if(this.interceptors.response.forEach((function(e){a.push(e.fulfilled,e.rejected)})),!n){var s=[Tu,void 0];for(Array.prototype.unshift.apply(s,i),s=s.concat(a),o=Promise.resolve(t);s.length;)o=o.then(s.shift(),s.shift());return o}for(var l=t;i.length;){var c=i.shift(),u=i.shift();try{l=c(l)}catch(e){u(e);break}}try{o=Tu(l)}catch(e){return Promise.reject(e)}for(;a.length;)o=o.then(a.shift(),a.shift());return o},Cu.prototype.getUri=function(e){e=ku(this.defaults,e);var t=Au(e.baseURL,e.url);return Su(t,e.params,e.paramsSerializer)},wu.forEach(["delete","get","head","options"],(function(e){Cu.prototype[e]=function(t,r){return this.request(ku(r||{},{method:e,url:t,data:(r||{}).data}))}})),wu.forEach(["post","put","patch"],(function(e){function t(t){return function(r,i,n){return this.request(ku(n||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:i}))}}Cu.prototype[e]=t(),Cu.prototype[e+"Form"]=t(!0)}));var zu=Yl,Mu=Ol,Ou=Cu,Du=cu;var Lu=function e(t){var r=new Ou(t),i=Mu(Ou.prototype.request,r);return zu.extend(i,Ou.prototype,r),zu.extend(i,r),i.create=function(r){return e(Du(t,r))},i}(Hc);Lu.Axios=Ou,Lu.CanceledError=jc(),Lu.CancelToken=function(){if(yu)return mu;yu=1;var e=jc();function t(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");var r;this.promise=new Promise((function(e){r=e}));var i=this;this.promise.then((function(e){if(i._listeners){var t,r=i._listeners.length;for(t=0;t<r;t++)i._listeners[t](e);i._listeners=null}})),this.promise.then=function(e){var t,r=new Promise((function(e){i.subscribe(e),t=e})).then(e);return r.cancel=function(){i.unsubscribe(t)},r},t((function(t){i.reason||(i.reason=new e(t),r(i.reason))}))}return t.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},t.prototype.subscribe=function(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]},t.prototype.unsubscribe=function(e){if(this._listeners){var t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}},t.source=function(){var e;return{token:new t((function(t){e=t})),cancel:e}},mu=t}(),Lu.isCancel=Qc(),Lu.VERSION=uu().version,Lu.toFormData=yc(),Lu.AxiosError=lc(),Lu.Cancel=Lu.CanceledError,Lu.all=function(e){return Promise.all(e)},Lu.spread=_u?gu:(_u=1,gu=function(e){return function(t){return e.apply(null,t)}}),Lu.isAxiosError=function(){if(vu)return bu;vu=1;var e=Yl;return bu=function(t){return e.isObject(t)&&!0===t.isAxiosError}}(),Ml.exports=Lu,Ml.exports.default=Lu,function(e){e.exports=Ml.exports}(zl);var ju=Vr(zl.exports),Ru=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Bu=function(e){function t(r,i,n){void 0===i&&(i=null),void 0===n&&(n=500);var o=e.call(this,r||"Unknown Error")||this;return Object.setPrototypeOf(o,t.prototype),o.statusCode=n,o.error=i,o}return Ru(t,e),t}(Error),Fu=function(){function e(e,t){this.client=e,this.resourcePath=t}return Object.defineProperty(e.prototype,"resourceEndpoint",{get:function(){return"/api/v1/".concat(this.resourcePath)},enumerable:!1,configurable:!0}),e.prototype.list=function(e){if(null==e?void 0:e.filter){var t=e.filter;Object.keys(t).forEach((function(r){e["filter[".concat(r,"]")]=t[r]})),delete e.filter}return this.client._get(this.resourceEndpoint,{params:e})},e.prototype.get=function(e,t){return void 0===t&&(t={}),this.client._get("".concat(this.resourceEndpoint,"/").concat(e),{params:t})},e.prototype.create=function(e,t){return void 0===t&&(t={}),this.client._post("".concat(this.resourceEndpoint),e,{params:t})},e.prototype.update=function(e,t,r){return void 0===r&&(r={}),this.client._put("".concat(this.resourceEndpoint,"/").concat(e),t,{params:r})},e.prototype.delete=function(e,t){return void 0===t&&(t={}),this.client._delete("".concat(this.resourceEndpoint,"/").concat(e),{params:t})},e.prototype.getMetadata=function(e,t,r){void 0===r&&(r={});var i=t?"".concat(this.resourceEndpoint,"/").concat(e,"/metadata/").concat(t):"".concat(this.resourceEndpoint,"/").concat(e,"/metadata");return this.client._get(i,{params:r})},e.prototype.setMetadata=function(e,t,r,i){return void 0===i&&(i={}),this.client._put("".concat(this.resourceEndpoint,"/").concat(e,"/metadata/").concat(t),r,{headers:{"Content-Type":"application/json"},params:i})},e.prototype.deleteMetadata=function(e,t,r){return void 0===r&&(r={}),this.client._delete("".concat(this.resourceEndpoint,"/").concat(e,"/metadata/").concat(t),{headers:{"Content-Type":"application/json"},params:r})},e}(),Nu=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Uu=function(e){function t(t){return e.call(this,t,"auth/users")||this}return Nu(t,e),t.prototype.me=function(e){return this.client._get("".concat(this.resourceEndpoint,"/me"),{headers:{Authorization:"Bearer ".concat(e)}})},t}(Fu),Vu=function(){function e(e){this.client=e,this.users=new Uu(this.client)}return e.prototype.login=function(e,t,r){return this.client._post("/api/v1/auth/login",{email:e,password:t,applicationId:r})},e.prototype.logout=function(e,t){return this.client._post("/api/v1/auth/logout",{refreshToken:t},{headers:{Authorization:"Bearer ".concat(e)}})},e.prototype.refresh=function(e,t){return this.client._post("/api/v1/auth/refresh",{refreshToken:e,applicationId:t})},e.prototype.changePassword=function(e,t,r){return this.client._post("/api/v1/auth/changepassword",{password:e,newPassword:t},{headers:{Authorization:"Bearer ".concat(r)}})},e.prototype.signUp=function(e,t,r,i,n,o){return this.client._post("/api/v1/auth/signup",{firstName:e,lastName:t,email:r,password:i,applicationId:n,confirmUrl:"".concat(this.client.baseUrl,"/api/v1/auth/confirmsignup"),redirectUrl:o})},e.prototype.requestPasswordReset=function(e,t,r){return this.client._post("/api/v1/auth/requestpasswordreset",{email:e,applicationId:t,redirectUrl:r})},e.prototype.resetPassword=function(e,t,r,i){return this.client._post("/api/v1/auth/resetpassword",{email:e,password:t,applicationId:r,token:i})},e}(),qu=function(){function e(e){this.client=e}return e.prototype.getTileSpec=function(e,t){return void 0===t&&(t={}),this.client._get("/tiles/".concat(e,"/index.json"),{params:t})},e.prototype.getPreviewStyle=function(e,t){return void 0===t&&(t={}),this.client._get("/tiles/".concat(e,"/style.json"),{params:t})},e}(),$u=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Gu=function(e){function t(t){return e.call(this,t,"styles")||this}return $u(t,e),t}(Fu),Zu=function(){function e(e){this.client=e}return e.prototype.get=function(e,t){return void 0===t&&(t={}),this.client._get("/maps/".concat(e,".json"),{params:t})},e}(),Wu=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Xu=function(e){function t(t){return e.call(this,t,"apikeys")||this}return Wu(t,e),t}(Fu),Ku=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Hu=function(e){function t(t){return e.call(this,t,"applications")||this}return Ku(t,e),t}(Fu),Ju=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),Yu=function(e){function t(t){return e.call(this,t,"databases")||this}return Ju(t,e),t.prototype.drivers=function(){return this.client._get("/api/v1/databases/drivers").catch((function(e){if(404===e.status)return["postgis","postgis-mapnik"]}))},t}(Fu),Qu=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),eh=function(){return eh=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},eh.apply(this,arguments)},th=function(e){function t(t){return e.call(this,t,"datasets")||this}return Qu(t,e),t.prototype.query=function(e,t,r){return void 0===t&&(t={}),void 0===r&&(r={}),"object"==typeof e&&(r=eh(eh({},e.params),{format:e.format||"json"}),e=(t=e).datasetId,delete t.datasetId,delete t.format),"string"==typeof r&&(r={format:r}),this.client._post("/api/v1/datasets/".concat(e,"/query"),t,{params:eh(eh({},r),{format:r.format||"json",explain:r.explain||!1})}).catch((function(e){throw"Network Error"===e.message?new Error("Query timed out"):e}))},t.prototype.getExportUrl=function(e,t){var r=this.client.accessToken?"accesstoken=".concat(this.client.accessToken):"apikey=".concat(this.client.apiKey);return"".concat(this.client.baseUrl,"/api/v1/datasets/").concat(e,"/export?format=").concat(t,"&").concat(r)},t}(Fu),rh=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ih=function(e){function t(t){return e.call(this,t,"tilesources")||this}return rh(t,e),t.prototype.drivers=function(){return this.client._get("/api/v1/tilesources/drivers").catch((function(e){if(404===e.statusCode)return["tilelive","dataset"]}))},t}(Fu),nh="object"==typeof self?self.FormData:window.FormData,oh=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ah=function(e,t,r,i){return new(r||(r=Promise))((function(n,o){function a(e){try{l(i.next(e))}catch(e){o(e)}}function s(e){try{l(i.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}l((i=i.apply(e,t||[])).next())}))},sh=function(e,t){var r,i,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,i&&(n=2&o[0]?i.return:o[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,o[1])).done)return n;switch(i=0,n&&(o=[2&o[0],n.value]),o[0]){case 0:case 1:n=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,i=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!n||o[1]>n[0]&&o[1]<n[3])){a.label=o[1];break}if(6===o[0]&&a.label<n[1]){a.label=n[1],n=o;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(o);break}n[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],i=0}finally{r=n=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}},lh=function(e){function t(t){return e.call(this,t,"uploads")||this}return oh(t,e),t.prototype.upload=function(e,t){return void 0===t&&(t={}),ah(this,void 0,void 0,(function(){var r;return sh(this,(function(i){switch(i.label){case 0:return r=new nh,e.datasetName&&r.append("name",e.datasetName),e.datasetDescription&&r.append("description",e.datasetDescription),e.attribution&&r.append("attribution",e.attribution),e.datasetId&&r.append("datasetId",e.datasetId),e.sourceSrid&&r.append("sourceSrid",e.sourceSrid),e.targetSrid&&r.append("targetSrid",e.targetSrid),e.schema&&r.append("schema",e.schema),r.append("file",e.data,e.filename),[4,this.client._post(this.resourceEndpoint,r,{headers:r.getHeaders(),params:t,onUploadProgress:e.progress})];case 1:return[2,i.sent()]}}))}))},t}(Fu),ch=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),uh=function(e){function t(t){return e.call(this,t,"appconfig")||this}return ch(t,e),t}(Fu),hh=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},e(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function i(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(i.prototype=r.prototype,new i)}}(),ph=function(e){function t(t){return e.call(this,t,"jobs")||this}return hh(t,e),t.prototype.submit=function(e){return this.client._post("/api/v1/jobs/submit",e)},t.prototype.getStatus=function(e){return this.client._get("/api/v1/jobs/".concat(e,"/status"))},t.prototype.setStatus=function(e,t){return this.client._post("/api/v1/jobs/".concat(e,"/status"),t)},t.prototype.cancel=function(e){return this.client._post("/api/v1/jobs/".concat(e,"/cancel"),{})},t.prototype.request=function(e){return this.client._post("/api/v1/jobs/request",{type:e})},t}(Fu),dh=function(){return dh=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},dh.apply(this,arguments)},fh=function(){function e(e,t){void 0===t&&(t=null),this.baseUrl=e,this.apiKey=t,this.accessToken=null,this.auth=new Vu(this),this.tiles=new qu(this),this.maps=new Zu(this),this.apiKeys=new Xu(this),this.applications=new Hu(this),this.appconfig=new uh(this),this.databases=new Yu(this),this.datasets=new th(this),this.styles=new Gu(this),this.tileSources=new ih(this),this.uploads=new lh(this),this.jobs=new ph(this),this.axios=ju.create({baseURL:e,maxContentLength:524288e3})}return e.prototype.config=function(){return this._get("/api/v1/config")},e.prototype._get=function(e,t){var r;return void 0===t&&(t={}),(null===(r=t.params)||void 0===r?void 0:r.apiKey)&&(t.apiKey=t.params.apiKey,delete t.params.apiKey),this.axios(dh(dh({method:"get",url:e},t),this.headers(t))).then((function(e){return e.data})).catch(this.handleError)},e.prototype._post=function(e,t,r){var i;return void 0===r&&(r={}),(null===(i=r.params)||void 0===i?void 0:i.apiKey)&&(r.apiKey=r.params.apiKey,delete r.params.apiKey),this.axios(dh(dh({method:"post",url:e,data:t,maxContentLength:1/0,maxBodyLength:1/0},r),this.headers(r))).then((function(e){return e.data})).catch(this.handleError)},e.prototype._put=function(e,t,r){var i;return void 0===r&&(r={}),(null===(i=r.params)||void 0===i?void 0:i.apiKey)&&(r.apiKey=r.params.apiKey,delete r.params.apiKey),this.axios(dh(dh({method:"put",url:e,data:t},r),this.headers(r))).then((function(e){return e.data})).catch(this.handleError)},e.prototype._delete=function(e,t){var r;return void 0===t&&(t={}),(null===(r=t.params)||void 0===r?void 0:r.apiKey)&&(t.apiKey=t.params.apiKey,delete t.params.apiKey),this.axios(dh(dh({method:"delete",url:e},t),this.headers(t))).then((function(e){return e.data})).catch(this.handleError)},e.prototype.handleError=function(e){if(e.response&&e.response.data){if("object"==typeof e.response.data){var t=e.response.data;throw new Bu(t.message||t.error,t.error,e.response.status)}if("string"==typeof e.response.data)throw new Bu(e.response.data,null,e.response.status)}var r=e;throw delete r.config,delete r.request,delete r.response,new Bu(r.message,r)},e.prototype.headers=function(e){var t=e.headers||{};return(e.apiKey||this.apiKey)&&(t["X-Api-Key"]=e.apiKey||this.apiKey),this.accessToken&&(t.Authorization=t.Authorization||"Bearer ".concat(this.accessToken)),{headers:t}},e}(),mh=qs;e.BaseEndpoints=Fu,e.Client=fh,e.FlowCoreExpression=Zs,e.FlowCoreMap=kl,e.FlowCoreMapDataSource=ll,e.FlowCoreMapLayer=nl,e.FlowCoreMapStyle=il,e.FlowCoreQuery=Pl,e.FlowCoreStateStore=sl,e.FlowEngineError=Bu,e.action=Wo,e.computed=Kn,e.flowQuery=Cl,e.flowQueryMany=function(e,t,r){return"object"==typeof t&&(r=t,t=void 0),Cl(e,t,r)},e.flowQueryOne=function(e,t,r){return"object"==typeof t&&(r=t,t=void 0),Cl(e,(function(e){var r=null;return(null==e?void 0:e.length)&&(r=e[0]),t&&"function"==typeof t&&(r=t(r)),r}),r)},e.hasLength=ti,e.hasValue=yi,e.isArray=ii,e.isArrayFull=ni,e.isArrayStrings=oi,e.isBoolean=pi,e.isDate=fi,e.isDefined=Qr,e.isFalse=ci,e.isFunction=gi,e.isIn=hi,e.isNil=Yr,e.isNull=Jr,e.isNumber=li,e.isNumeric=di,e.isObject=ai,e.isObjectFull=si,e.isPlainObject=_i,e.isString=ei,e.isStringFull=ri,e.isTrue=ui,e.isURL=vi,e.isUndefined=Hr,e.isValue=mi,e.observable=Gn,e.traceReaction=function(){_a()},e.utils=mh}));
15
+ //# sourceMappingURL=flow-rdf-core.umd.js.map