@defra/interactive-map 0.0.54-alpha → 0.0.55-alpha

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 (139) hide show
  1. package/assets/templates/add-polygons.njk +1 -1
  2. package/assets/templates/add-symbols.njk +4 -4
  3. package/assets/templates/draw-tools.njk +7 -7
  4. package/assets/templates/marker-panel.njk +5 -5
  5. package/assets/templates/place-marker.njk +8 -8
  6. package/assets/templates/search-control.njk +1 -1
  7. package/assets/templates/select-feature.njk +7 -7
  8. package/assets/templates/style-switcher.njk +4 -4
  9. package/assets/templates/toggle-marker-label.njk +3 -3
  10. package/dist/esm/im-core.js +1 -1
  11. package/dist/esm/im-shell.js +1 -1
  12. package/dist/esm/index.js +1 -1
  13. package/dist/umd/im-core.js +1 -1
  14. package/dist/umd/im-core.js.LICENSE.txt +0 -30
  15. package/dist/umd/index.js +1 -1
  16. package/dist/umd/index.js.LICENSE.txt +0 -20
  17. package/docs/api.md +3 -13
  18. package/docs/building-a-plugin.md +2 -2
  19. package/docs/examples/add-marker-with-panel.mdx +46 -44
  20. package/docs/examples/add-polygons.mdx +100 -98
  21. package/docs/examples/add-symbols.mdx +75 -73
  22. package/docs/examples/basic-map.mdx +16 -14
  23. package/docs/examples/button-map.mdx +16 -14
  24. package/docs/examples/draw-tools.mdx +119 -117
  25. package/docs/examples/place-marker.mdx +51 -49
  26. package/docs/examples/search-control.mdx +22 -20
  27. package/docs/examples/select-feature.mdx +107 -105
  28. package/docs/examples/style-switcher.mdx +47 -45
  29. package/docs/examples/toggle-marker-label.mdx +30 -28
  30. package/docs/getting-started.md +26 -24
  31. package/docs/plugins/draw.md +10 -10
  32. package/docs/plugins/interact.md +9 -9
  33. package/docs/plugins/plugin-descriptor.md +1 -1
  34. package/docs/plugins/search.md +3 -3
  35. package/docusaurus.config.cjs +23 -0
  36. package/package.json +3 -7
  37. package/plugins/beta/draw-es/dist/esm/im-draw-es-plugin.js +1 -1
  38. package/plugins/beta/draw-es/dist/esm/index.js +1 -1
  39. package/plugins/beta/draw-ml/dist/esm/im-draw-ml-plugin.js +1 -1
  40. package/plugins/beta/draw-ml/dist/esm/index.js +1 -1
  41. package/plugins/beta/draw-ml/dist/umd/im-draw-ml-plugin.js +1 -1
  42. package/plugins/beta/draw-ml/dist/umd/index.js +1 -1
  43. package/plugins/beta/draw-ol/dist/esm/DrawMode.js +1 -1
  44. package/plugins/beta/draw-ol/dist/esm/EditMode.js +1 -1
  45. package/plugins/beta/draw-ol/dist/esm/geometryHelpers.js +1 -1
  46. package/plugins/beta/draw-ol/dist/esm/im-draw-ol-plugin.js +1 -1
  47. package/plugins/beta/draw-ol/dist/esm/index.js +1 -1
  48. package/plugins/beta/frame/dist/esm/im-frame-plugin.js +1 -1
  49. package/plugins/beta/frame/dist/esm/index.js +1 -1
  50. package/plugins/beta/frame/dist/umd/im-frame-plugin.js +1 -1
  51. package/plugins/beta/frame/dist/umd/index.js +1 -1
  52. package/plugins/beta/map-styles/dist/esm/im-map-styles-plugin.js +1 -1
  53. package/plugins/beta/map-styles/dist/esm/index.js +1 -1
  54. package/plugins/beta/map-styles/dist/umd/im-map-styles-plugin.js +1 -1
  55. package/plugins/beta/map-styles/dist/umd/index.js +1 -1
  56. package/plugins/beta/scale-bar/dist/esm/im-scale-bar-plugin.js +1 -1
  57. package/plugins/beta/scale-bar/dist/esm/index.js +1 -1
  58. package/plugins/beta/scale-bar/dist/umd/im-scale-bar-plugin.js +1 -1
  59. package/plugins/beta/scale-bar/dist/umd/index.js +1 -1
  60. package/plugins/beta/use-location/dist/esm/im-use-location-plugin.js +1 -1
  61. package/plugins/beta/use-location/dist/esm/index.js +1 -1
  62. package/plugins/beta/use-location/dist/umd/im-use-location-plugin.js +1 -1
  63. package/plugins/beta/use-location/dist/umd/index.js +1 -1
  64. package/plugins/datasets/dist/esm/im-datasets-esri-adapter.js +1 -1
  65. package/plugins/datasets/dist/esm/im-datasets-ml-adapter.js +1 -1
  66. package/plugins/datasets/dist/esm/im-datasets-ol-adapter.js +1 -1
  67. package/plugins/datasets/dist/esm/im-datasets-plugin.js +1 -1
  68. package/plugins/datasets/dist/esm/index.js +1 -1
  69. package/plugins/datasets/dist/esm/layerAdapter.js +1 -1
  70. package/plugins/datasets/dist/esm/mapboxStyleLayerAdapter.js +1 -1
  71. package/plugins/datasets/dist/umd/im-datasets-ml-adapter.js +1 -1
  72. package/plugins/datasets/dist/umd/im-datasets-ol-adapter.js +1 -1
  73. package/plugins/datasets/dist/umd/im-datasets-plugin.js +1 -1
  74. package/plugins/datasets/dist/umd/index.js +1 -1
  75. package/plugins/draw/dist/esm/im-draw-ml-adapter.js +1 -1
  76. package/plugins/draw/dist/esm/im-draw-ol-adapter.js +1 -1
  77. package/plugins/draw/dist/esm/im-draw-plugin.js +1 -1
  78. package/plugins/draw/dist/esm/index.js +1 -1
  79. package/plugins/draw/dist/esm/liveDrawChecks.js +1 -1
  80. package/plugins/draw/dist/umd/im-draw-ml-adapter.js +1 -1
  81. package/plugins/draw/dist/umd/im-draw-ol-adapter.js +1 -1
  82. package/plugins/draw/dist/umd/im-draw-plugin.js +1 -1
  83. package/plugins/draw/dist/umd/index.js +1 -1
  84. package/plugins/draw/src/adapters/maplibre/styles.js +3 -2
  85. package/plugins/draw/src/adapters/maplibre/styles.test.js +3 -3
  86. package/plugins/interact/dist/esm/im-interact-plugin.js +1 -1
  87. package/plugins/interact/dist/esm/index.js +1 -1
  88. package/plugins/interact/dist/umd/im-interact-plugin.js +1 -1
  89. package/plugins/interact/dist/umd/index.js +1 -1
  90. package/plugins/map-key/dist/esm/im-map-key-plugin.js +1 -1
  91. package/plugins/map-key/dist/esm/index.js +1 -1
  92. package/plugins/map-key/dist/umd/im-map-key-plugin.js +1 -1
  93. package/plugins/map-key/dist/umd/index.js +1 -1
  94. package/plugins/menu/dist/esm/im-menu-plugin.js +1 -1
  95. package/plugins/menu/dist/esm/index.js +1 -1
  96. package/plugins/menu/dist/umd/im-menu-plugin.js +1 -1
  97. package/plugins/menu/dist/umd/index.js +1 -1
  98. package/plugins/search/dist/esm/im-search-plugin.js +1 -1
  99. package/plugins/search/dist/esm/index.js +1 -1
  100. package/plugins/search/dist/umd/im-search-plugin.js +1 -1
  101. package/plugins/search/dist/umd/index.js +1 -1
  102. package/providers/beta/esri/dist/esm/im-esri-provider.js +1 -1
  103. package/providers/beta/esri/dist/esm/index.js +1 -1
  104. package/providers/beta/open-names/dist/esm/im-reverse-geocode.js +1 -1
  105. package/providers/beta/open-names/dist/esm/index.js +1 -1
  106. package/providers/beta/open-names/dist/umd/im-reverse-geocode.js +1 -1
  107. package/providers/beta/open-names/dist/umd/index.js +1 -1
  108. package/providers/beta/openlayers/dist/esm/im-openlayers-provider.js +1 -1
  109. package/providers/beta/openlayers/dist/esm/index.js +1 -1
  110. package/providers/beta/openlayers/dist/umd/im-openlayers-provider.js +1 -1
  111. package/providers/beta/openlayers/dist/umd/index.js +1 -1
  112. package/providers/beta/openlayers/src/index.js +27 -4
  113. package/providers/beta/openlayers/src/index.test.js +47 -0
  114. package/providers/maplibre/dist/esm/im-maplibre-provider.js +1 -1
  115. package/providers/maplibre/dist/esm/index.js +1 -1
  116. package/providers/maplibre/dist/umd/im-maplibre-framework.js +1 -1
  117. package/providers/maplibre/dist/umd/im-maplibre-framework.js.LICENSE.txt +3 -3
  118. package/providers/maplibre/dist/umd/im-maplibre-provider.js +1 -1
  119. package/providers/maplibre/dist/umd/im-maplibre-worker.js +2 -0
  120. package/providers/maplibre/dist/umd/im-maplibre-worker.js.LICENSE.txt +4 -0
  121. package/providers/maplibre/dist/umd/index.js +1 -1
  122. package/providers/maplibre/src/index.js +41 -12
  123. package/providers/maplibre/src/index.test.js +43 -12
  124. package/providers/maplibre/src/utils/detectModuleWorker.js +25 -0
  125. package/providers/maplibre/src/utils/detectModuleWorker.test.js +40 -0
  126. package/providers/maplibre/src/utils/spatial.js +22 -12
  127. package/providers/maplibre/src/utils/spatial.test.js +6 -6
  128. package/providers/maplibre/src/utils/workerUrl.js +15 -0
  129. package/providers/maplibre/src/utils/workerUrl.test.js +14 -0
  130. package/rollup.esm.mjs +38 -1
  131. package/src/InteractiveMap/InteractiveMap.js +2 -1
  132. package/src/InteractiveMap/InteractiveMap.test.js +9 -2
  133. package/src/InteractiveMap/domStateManager.js +21 -1
  134. package/src/InteractiveMap/domStateManager.test.js +48 -1
  135. package/src/InteractiveMap/polyfills.js +4 -3
  136. package/src/InteractiveMap/polyfills.test.js +12 -0
  137. package/src/types.js +3 -5
  138. package/webpack.dev.mjs +2 -0
  139. package/webpack.umd.mjs +28 -7
@@ -1 +1 @@
1
- import e from"ol/Map.js";import t from"ol/View.js";import{getCenter as r}from"ol/extent.js";import n from"ol/format/GeoJSON.js";import o from"ol/format/MVT.js";import"ol/has.js";import"ol/layer/Group.js";import"ol/layer/Layer.js";import a from"ol/layer/Tile.js";import i from"ol/layer/Vector.js";import s from"ol/layer/VectorTile.js";import"ol/loadingstrategy.js";import"ol/proj.js";import"ol/proj/Units.js";import"ol/source/Source.js";import"ol/source/TileJSON.js";import l from"ol/source/Vector.js";import u from"ol/source/VectorTile.js";import"ol/tilegrid.js";import p from"ol/tilegrid/TileGrid.js";import{distance as c}from"ol/coordinate.js";import{toPromise as f}from"ol/functions.js";import d from"ol/render/Feature.js";import m from"ol/style/Circle.js";import y from"ol/style/Fill.js";import h from"ol/style/Icon.js";import g from"ol/style/Stroke.js";import v from"ol/style/Style.js";import b from"ol/style/Text.js";import"ol/events/Event.js";import"ol/events/EventType.js";import x from"@babel/runtime/helpers/asyncToGenerator";import{defaults as w}from"ol/interaction/defaults.js";import k from"proj4";import{register as S}from"ol/proj/proj4.js";import M from"@babel/runtime/helpers/defineProperty";import z from"ol/source/XYZ.js";import I from"ol/source/TileWMS.js";import j from"ol/source/OGCVectorTile.js";import A from"ol/TileState.js";import{fromString as E}from"ol/color.js";import"ol/layer/Image.js";import"ol/source/Raster.js";import{checkedFonts as _}from"ol/render/canvas.js";import{getUid as P}from"ol/util.js";import O from"ol/Feature.js";import C from"ol/style/IconImage.js";import{shared as T}from"ol/style/IconImageCache.js";import $ from"ol/ImageState.js";import{buildExpression as q,newEvaluationContext as D}from"ol/expr/cpu.js";import{BooleanType as F,newParsingContext as N}from"ol/expr/expression.js";class L{_notImplemented(e){throw new Error("".concat(this.name," must implement ").concat(e,"()"))}isBaseMapReady(){this._notImplemented("isBaseMapReady")}addSymbolsToMap(){this._notImplemented("addSymbolsToMap")}addPatternsToMap(){this._notImplemented("addPatternsToMap")}getActiveSymbolImageId(){this._notImplemented("getActiveSymbolImageId")}getSelectedSymbolImageId(){this._notImplemented("getSelectedSymbolImageId")}}var R="EPSG:27700";k.defs(R,"+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs"),S(k);var G=[896,448,224,112,56,28,14,7,3.5,1.75,.875,.4375,.21875,.109375],U=[156543.03392800014,78271.51696400007,39135.758482000034,19567.879241000017,9783.939620500008,4891.969810250004,2445.984905125002,1222.992452562501,611.4962262812505,305.74811314062526,152.87405657031263,76.43702828515632,38.21851414257816,19.10925707128908,9.55462853564454,4.77731426782227,2.388657133911135,1.1943285669555674,.5971642834777837,.29858214173889186,.14929107086944593,.07464553543472296,.03732276771736148,.01866138385868074],B=[-238375,1376256],H=300,Z=2,V=["showKeyboardHelp","selectControl","moveLarge","nudgeMap","zoomLarge","nudgeZoom"],W="uk",J="world";var X=(e,t)=>{var r=null,n=function(){for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];clearTimeout(r),r=setTimeout(()=>{e(...o)},t)};return n.cancel=()=>{r&&(clearTimeout(r),r=null)},n};function Y(e){var{map:t,view:r,emit:n,eventBus:o,events:a,on:i,debouncers:s}=e,l=!1,u=X(()=>{l=!1,n(a.MAP_MOVE_END)},500);s.push(u);var p,c,f,d=(p=()=>n(a.MAP_MOVE),c=10,f=0,function(){var e=Date.now();e-f>=c&&(f=e,p(...arguments))});i(r,"change",()=>{l||(l=!0,o.emit(a.MAP_MOVE_START)),u()}),i(t,"postrender",()=>{l&&d()})}function K(e){var{map:t,source:r,events:n,eventBus:o,getZoom:a,getCenter:i,getBounds:s,getResolution:l}=e,u=!1,p=[],c=[],f=[],d=t.getView(),m=e=>{var t=(()=>{if(u)return null;var e=a();return{center:i(),bounds:s(),resolution:l(),zoom:e,isAtMaxZoom:e+.01>=d.getMaxZoom(),isAtMinZoom:e-.01<=d.getMinZoom()}})();t&&o.emit(e,t)},y=(e,t,r)=>{e.on(t,r),p.push([e,t,r])},h=(e,t,r)=>{e.on(t,r),c.push([e,t,r])},g=!1,v=()=>{g||(g=!0,o.emit(n.MAP_LOADED))},b=X(()=>m(n.MAP_DATA_CHANGE),500);f.push(b);var x=e=>{u||(c.forEach(e=>{var[t,r,n]=e;return t.un(r,n)}),c=[],h(e,"tileloadend",v),h(e,"tileloadend",b))};return Y({map:t,view:t.getView(),emit:m,eventBus:o,events:n,on:y,debouncers:f}),x(r),t.once("rendercomplete",()=>m(n.MAP_FIRST_IDLE)),function(e){var{map:t,eventBus:r,events:n,on:o}=e,a=null;o(t,"pointerdown",e=>{a=e.pixel}),o(t,"click",e=>{if(a){var t=e.pixel[0]-a[0],o=e.pixel[1]-a[1];if(Math.hypot(t,o)>6)return}r.emit(n.MAP_CLICK,{point:{x:e.pixel[0],y:e.pixel[1]},coords:e.coordinate})})}({map:t,eventBus:o,events:n,on:y}),y(t,"postrender",()=>o.emit(n.MAP_RENDER)),{setSource:x,remove(){u=!0,f.forEach(e=>e.cancel()),p.forEach(e=>{var[t,r,n]=e;return t.un(r,n)}),c.forEach(e=>{var[t,r,n]=e;return t.un(r,n)})}}}var Q={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},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},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{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:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},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:{},"color-relief":{},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_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-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",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-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",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"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","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-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-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},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:"expression_name",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}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","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","feature"]},"property-type":"cross-faded-data-driven"},"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"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,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:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,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:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",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"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,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"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}};const ee=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function te(e,t){const r={};for(const t in e)"ref"!==t&&(r[t]=e[t]);return ee.forEach(e=>{e in t&&(r[e]=t[e])}),r}class re extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class ne{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,r]of t)this.bindings[e]=r}concat(e){return new ne(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 oe={kind:"null"},ae={kind:"number"},ie={kind:"string"},se={kind:"boolean"},le={kind:"color"},ue={kind:"projectionDefinition"},pe={kind:"object"},ce={kind:"value"},fe={kind:"collator"},de={kind:"formatted"},me={kind:"padding"},ye={kind:"colorArray"},he={kind:"numberArray"},ge={kind:"resolvedImage"},ve={kind:"variableAnchorOffsetCollection"};function be(e,t){return{kind:"array",itemType:e,N:t}}function xe(e){if("array"===e.kind){const t=xe(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const we=[oe,ae,ie,se,le,ue,de,pe,be(ce),me,he,ye,ge,ve];function ke(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!ke(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 we)if(!ke(e,t))return null}return`Expected ${xe(e)} but found ${xe(t)} instead.`}function Se(e,t){return t.some(t=>t.kind===e.kind)}function Me(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)}function ze(e,t){return"array"===e.kind&&"array"===t.kind?e.itemType.kind===t.itemType.kind&&"number"==typeof e.N:e.kind===t.kind}const Ie=.96422,je=.82521,Ae=4/29,Ee=6/29,_e=3*Ee*Ee,Pe=Ee*Ee*Ee,Oe=Math.PI/180,Ce=180/Math.PI;function Te(e){return(e%=360)<0&&(e+=360),e}function $e([e,t,r,n]){let o,a;const i=De((.2225045*(e=qe(e))+.7168786*(t=qe(t))+.0606169*(r=qe(r)))/1);e===t&&t===r?o=a=i:(o=De((.4360747*e+.3850649*t+.1430804*r)/Ie),a=De((.0139322*e+.0971045*t+.7141733*r)/je));const s=116*i-16;return[s<0?0:s,500*(o-i),200*(i-a),n]}function qe(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function De(e){return e>Pe?Math.pow(e,1/3):e/_e+Ae}function Fe([e,t,r,n]){let o=(e+16)/116,a=isNaN(t)?o:o+t/500,i=isNaN(r)?o:o-r/200;return o=1*Le(o),a=Ie*Le(a),i=je*Le(i),[Ne(3.1338561*a-1.6168667*o-.4906146*i),Ne(-.9787684*a+1.9161415*o+.033454*i),Ne(.0719453*a-.2289914*o+1.4052427*i),n]}function Ne(e){return(e=e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055)<0?0:e>1?1:e}function Le(e){return e>Ee?e*e*e:_e*(e-Ae)}const Re=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function Ge(e,t){return Re(e,t)?e[t]:void 0}function Ue(e){if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];const t=Ge(We,e);if(t){const[e,r,n]=t;return[e/255,r/255,n/255,1]}if(e.startsWith("#")){if(/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){const t=e.length<6?1:2;let r=1;return[Be(e.slice(r,r+=t)),Be(e.slice(r,r+=t)),Be(e.slice(r,r+=t)),Be(e.slice(r,r+t)||"ff")]}}if(e.startsWith("rgb")){const t=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,r=e.match(t);if(r){const[e,t,n,o,a,i,s,l,u,p,c,f]=r,d=[o||" ",s||" ",p].join("");if(" "===d||" /"===d||",,"===d||",,,"===d){const e=[n,i,u].join(""),r="%%%"===e?100:""===e?255:0;if(r){const e=[Ze(+t/r,0,1),Ze(+a/r,0,1),Ze(+l/r,0,1),c?He(+c,f):1];if(Ve(e))return e}}return}}const r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){const[e,t,n,o,a,i,s,l,u]=r,p=[n||" ",a||" ",s].join("");if(" "===p||" /"===p||",,"===p||",,,"===p){const e=[+t,Ze(+o,0,100),Ze(+i,0,100),l?He(+l,u):1];if(Ve(e))return function([e,t,r,n]){function o(n){const o=(n+e/30)%12,a=t*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(o-3,9-o,1))}return e=Te(e),t/=100,r/=100,[o(0),o(8),o(4),n]}(e)}}}function Be(e){return parseInt(e.padEnd(2,e),16)/255}function He(e,t){return Ze(t?e/100:e,0,1)}function Ze(e,t,r){return Math.min(Math.max(t,e),r)}function Ve(e){return!e.some(Number.isNaN)}const We={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Je(e,t,r){return e+r*(t-e)}function Xe(e,t,r){return e.map((e,n)=>Je(e,t[n],r))}class Ye{constructor(e,t,r,n=1,o=!0){this.r=e,this.g=t,this.b=r,this.a=n,o||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[e,t,r,n]))}static parse(e){if(e instanceof Ye)return e;if("string"!=typeof e)return;const t=Ue(e);return t?new Ye(...t,!1):void 0}get rgb(){const{r:e,g:t,b:r,a:n}=this,o=n||1/0;return this.overwriteGetter("rgb",[e/o,t/o,r/o,n])}get hcl(){return this.overwriteGetter("hcl",function(e){const[t,r,n,o]=$e(e),a=Math.sqrt(r*r+n*n);return[Math.round(1e4*a)?Te(Math.atan2(n,r)*Ce):NaN,a,t,o]}(this.rgb))}get lab(){return this.overwriteGetter("lab",$e(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){const[e,t,r,n]=this.rgb;return`rgba(${[e,t,r].map(e=>Math.round(255*e)).join(",")},${n})`}static interpolate(e,t,r,n="rgb"){switch(n){case"rgb":{const[n,o,a,i]=Xe(e.rgb,t.rgb,r);return new Ye(n,o,a,i,!1)}case"hcl":{const[n,o,a,i]=e.hcl,[s,l,u,p]=t.hcl;let c,f;if(isNaN(n)||isNaN(s))isNaN(n)?isNaN(s)?c=NaN:(c=s,1!==a&&0!==a||(f=l)):(c=n,1!==u&&0!==u||(f=o));else{let e=s-n;s>n&&e>180?e-=360:s<n&&n-s>180&&(e+=360),c=n+r*e}const[d,m,y,h]=function([e,t,r,n]){return e=isNaN(e)?0:e*Oe,Fe([r,Math.cos(e)*t,Math.sin(e)*t,n])}([c,null!=f?f:Je(o,l,r),Je(a,u,r),Je(i,p,r)]);return new Ye(d,m,y,h,!1)}case"lab":{const[n,o,a,i]=Fe(Xe(e.lab,t.lab,r));return new Ye(n,o,a,i,!1)}}}}Ye.black=new Ye(0,0,0,1),Ye.white=new Ye(1,1,1,1),Ye.transparent=new Ye(0,0,0,0),Ye.red=new Ye(1,0,0,1);class Ke{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}}const Qe=["bottom","center","top"];class et{constructor(e,t,r,n,o,a){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=o,this.verticalAlign=a}}class tt{constructor(e){this.sections=e}static fromString(e){return new tt([new et(e,null,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 tt?e:tt.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map(e=>e.text).join("")}}class rt{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof rt)return e;if("number"==typeof e)return new rt([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 rt(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){return new rt(Xe(e.values,t.values,r))}}class nt{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof nt)return e;if("number"==typeof e)return new nt([e]);if(Array.isArray(e)){for(const t of e)if("number"!=typeof t)return;return new nt(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){return new nt(Xe(e.values,t.values,r))}}class ot{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof ot)return e;if("string"==typeof e){const t=Ye.parse(e);if(!t)return;return new ot([t])}if(!Array.isArray(e))return;const t=[];for(const r of e){if("string"!=typeof r)return;const e=Ye.parse(r);if(!e)return;t.push(e)}return new ot(t)}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r,n="rgb"){const o=[];if(e.values.length!=t.values.length)throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${t.values.length}), cannot interpolate.`);for(let a=0;a<e.values.length;a++)o.push(Ye.interpolate(e.values[a],t.values[a],r,n));return new ot(o)}}class at extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}}const it=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class st{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof st)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let t=0;t<e.length;t+=2){const r=e[t],n=e[t+1];if("string"!=typeof r||!it.has(r))return;if(!Array.isArray(n)||2!==n.length||"number"!=typeof n[0]||"number"!=typeof n[1])return}return new st(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){const n=e.values,o=t.values;if(n.length!==o.length)throw new at(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${t.toString()}`);const a=[];for(let e=0;e<n.length;e+=2){if(n[e]!==o[e])throw new at(`Cannot interpolate values containing mismatched anchors. from[${e}]: ${n[e]}, to[${e}]: ${o[e]}`);a.push(n[e]);const[t,i]=n[e+1],[s,l]=o[e+1];a.push([Je(t,s,r),Je(i,l,r)])}return new st(a)}}class lt{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new lt({name:e,available:!1}):null}}class ut{constructor(e,t,r){this.from=e,this.to=t,this.transition=r}static interpolate(e,t,r){return new ut(e,t,r)}static parse(e){return e instanceof ut?e:Array.isArray(e)&&3===e.length&&"string"==typeof e[0]&&"string"==typeof e[1]&&"number"==typeof e[2]?new ut(e[0],e[1],e[2]):"object"==typeof e&&"string"==typeof e.from&&"string"==typeof e.to&&"number"==typeof e.transition?new ut(e.from,e.to,e.transition):"string"==typeof e?new ut(e,e,1):void 0}}function pt(e,t,r,n){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 n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}return void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`}function ct(e){if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||e instanceof ut||e instanceof Ye||e instanceof Ke||e instanceof tt||e instanceof rt||e instanceof nt||e instanceof ot||e instanceof st||e instanceof lt)return!0;if(Array.isArray(e)){for(const t of e)if(!ct(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!ct(e[t]))return!1;return!0}return!1}function ft(e){if(null===e)return oe;if("string"==typeof e)return ie;if("boolean"==typeof e)return se;if("number"==typeof e)return ae;if(e instanceof Ye)return le;if(e instanceof ut)return ue;if(e instanceof Ke)return fe;if(e instanceof tt)return de;if(e instanceof rt)return me;if(e instanceof nt)return he;if(e instanceof ot)return ye;if(e instanceof st)return ve;if(e instanceof lt)return ge;if(Array.isArray(e)){const t=e.length;let r;for(const t of e){const e=ft(t);if(r){if(r===e)continue;r=ce;break}r=e}return be(r||ce,t)}return pe}function dt(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Ye||e instanceof ut||e instanceof tt||e instanceof rt||e instanceof nt||e instanceof ot||e instanceof st||e instanceof lt?e.toString():JSON.stringify(e)}class mt{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(!ct(e[1]))return t.error("invalid value");const r=e[1];let n=ft(r);const o=t.expectedType;return"array"!==n.kind||0!==n.N||!o||"array"!==o.kind||"number"==typeof o.N&&0!==o.N||(n=o),new mt(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const yt={string:ie,number:ae,boolean:se,object:pe};class ht{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,n=1;const o=e[0];if("array"===o){let o,a;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in yt)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);o=yt[r],n++}else o=ce;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);a=e[2],n++}r=be(o,a)}else{if(!yt[o])throw new Error(`Types doesn't contain name = ${o}`);r=yt[o]}const a=[];for(;n<e.length;n++){const r=t.parse(e[n],n,ce);if(!r)return null;a.push(r)}return new ht(r,a)}evaluate(e){for(let t=0;t<this.args.length;t++){const r=this.args[t].evaluate(e);if(!ke(this.type,ft(r)))return r;if(t===this.args.length-1)throw new at(`Expected value to be of type ${xe(this.type)}, but found ${xe(ft(r))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const gt={"to-boolean":se,"to-color":le,"to-number":ae,"to-string":ie};class vt{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(!gt[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 n=gt[r],o=[];for(let r=1;r<e.length;r++){const n=t.parse(e[r],r,ce);if(!n)return null;o.push(n)}return new vt(n,o)}evaluate(e){switch(this.type.kind){case"boolean":return Boolean(this.args[0].evaluate(e));case"color":{let t,r;for(const n of this.args){if(t=n.evaluate(e),r=null,t instanceof Ye)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 rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:pt(t[0],t[1],t[2],t[3]),!r))return new Ye(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new at(r||`Could not parse color from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"padding":{let t;for(const r of this.args){t=r.evaluate(e);const n=rt.parse(t);if(n)return n}throw new at(`Could not parse padding from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"numberArray":{let t;for(const r of this.args){t=r.evaluate(e);const n=nt.parse(t);if(n)return n}throw new at(`Could not parse numberArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"colorArray":{let t;for(const r of this.args){t=r.evaluate(e);const n=ot.parse(t);if(n)return n}throw new at(`Could not parse colorArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"variableAnchorOffsetCollection":{let t;for(const r of this.args){t=r.evaluate(e);const n=st.parse(t);if(n)return n}throw new at(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"number":{let t=null;for(const r of this.args){if(t=r.evaluate(e),null===t)return 0;const n=Number(t);if(!isNaN(n))return n}throw new at(`Could not convert ${JSON.stringify(t)} to number.`)}case"formatted":return tt.fromString(dt(this.args[0].evaluate(e)));case"resolvedImage":return lt.fromString(dt(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return dt(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const bt=["Unknown","Point","LineString","Polygon"];class xt{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,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?bt[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.get(e);return t||(t=Ye.parse(e),this._parseColorCache.set(e,t)),t}}class wt{constructor(e,t,r=[],n,o=new ne,a=[]){this.registry=e,this.path=r,this.key=r.map(e=>`[${e}]`).join(""),this.scope=o,this.errors=a,this.expectedType=n,this._isConstant=t}parse(e,t,r,n,o={}){return t?this.concat(t,r,n)._parse(e,o):this._parse(e,o)}_parse(e,t){function r(e,t,r){return"assert"===r?new ht(t,[e]):"coerce"===r?new vt(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 n=e[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const o=this.registry[n];if(o){let n=o.parse(e,this);if(!n)return null;if(this.expectedType){const e=this.expectedType,o=n.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==o.kind){if("projectionDefinition"===e.kind&&["string","array"].includes(o.kind)||["color","formatted","resolvedImage"].includes(e.kind)&&["value","string"].includes(o.kind)||["padding","numberArray"].includes(e.kind)&&["value","number","array"].includes(o.kind)||"colorArray"===e.kind&&["value","string","array"].includes(o.kind)||"variableAnchorOffsetCollection"===e.kind&&["value","array"].includes(o.kind))n=r(n,e,t.typeAnnotation||"coerce");else if(this.checkSubtype(e,o))return null}else n=r(n,e,t.typeAnnotation||"assert")}if(!(n instanceof mt)&&"resolvedImage"!==n.type.kind&&this._isConstant(n)){const e=new xt;try{n=new mt(n.type,n.evaluate(e))}catch(e){return this.error(e.message),null}}return n}return this.error(`Unknown expression "${n}". 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 n="number"==typeof e?this.path.concat(e):this.path,o=r?this.scope.concat(r):this.scope;return new wt(this.registry,this._isConstant,n,t||null,o,this.errors)}error(e,...t){const r=`${this.key}${t.map(e=>`[${e}]`).join("")}`;this.errors.push(new re(r,e))}checkSubtype(e,t){const r=ke(e,t);return r&&this.error(r),r}}class kt{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 n=1;n<e.length-1;n+=2){const o=e[n];if("string"!=typeof o)return t.error(`Expected string, but found ${typeof o} instead.`,n);if(/[^a-zA-Z0-9_]/.test(o))return t.error("Variable names must contain only alphanumeric characters or '_'.",n);const a=t.parse(e[n+1],n+1);if(!a)return null;r.push([o,a])}const n=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return n?new kt(r,n):null}outputDefined(){return this.result.outputDefined()}}class St{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 St(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 Mt{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,ae),n=t.parse(e[2],2,be(t.expectedType||ce));if(!r||!n)return null;const o=n.type;return new Mt(o.itemType,r,n)}evaluate(e){const t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new at(`Array index out of bounds: ${t} < 0.`);if(t>=r.length)throw new at(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new at(`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 zt{constructor(e,t){this.type=se,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,ce),n=t.parse(e[2],2,ce);return r&&n?Se(r.type,[se,ie,ae,oe,ce])?new zt(r,n):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${xe(r.type)} instead`):null}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!r)return!1;if(!Me(t,["boolean","string","number","null"]))throw new at(`Expected first argument to be of type boolean, string, number or null, but found ${xe(ft(t))} instead.`);if(!Me(r,["string","array"]))throw new at(`Expected second argument to be of type array or string, but found ${xe(ft(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class It{constructor(e,t,r){this.type=ae,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ce),n=t.parse(e[2],2,ce);if(!r||!n)return null;if(!Se(r.type,[se,ie,ae,oe,ce]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${xe(r.type)} instead`);if(4===e.length){const o=t.parse(e[3],3,ae);return o?new It(r,n,o):null}return new It(r,n)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!Me(t,["boolean","string","number","null"]))throw new at(`Expected first argument to be of type boolean, string, number or null, but found ${xe(ft(t))} instead.`);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),Me(r,["string"])){const e=r.indexOf(t,n);return-1===e?-1:[...r.slice(0,e)].length}if(Me(r,["array"]))return r.indexOf(t,n);throw new at(`Expected second argument to be of type array or string, but found ${xe(ft(r))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class jt{constructor(e,t,r,n,o,a){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=o,this.otherwise=a}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,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const o={},a=[];for(let i=2;i<e.length-1;i+=2){let s=e[i];const l=e[i+1];Array.isArray(s)||(s=[s]);const u=t.concat(i);if(0===s.length)return u.error("Expected at least one branch label.");for(const e of s){if("number"!=typeof e&&"string"!=typeof e)return u.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,ft(e)))return null}else r=ft(e);if(void 0!==o[String(e)])return u.error("Branch labels must be unique.");o[String(e)]=a.length}const p=t.parse(l,i,n);if(!p)return null;n=n||p.type,a.push(p)}const i=t.parse(e[1],1,ce);if(!i)return null;const s=t.parse(e[e.length-1],e.length-1,n);return s?"value"!==i.type.kind&&t.concat(1).checkSubtype(r,i.type)?null:new jt(r,n,i,o,a,s):null}evaluate(e){const t=this.input.evaluate(e);return(ft(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 At{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 n=[];for(let o=1;o<e.length-1;o+=2){const a=t.parse(e[o],o,se);if(!a)return null;const i=t.parse(e[o+1],o+1,r);if(!i)return null;n.push([a,i]),r=r||i.type}const o=t.parse(e[e.length-1],e.length-1,r);if(!o)return null;if(!r)throw new Error("Can't infer output type");return new At(r,n,o)}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 Et{constructor(e,t,r,n){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ce),n=t.parse(e[2],2,ae);if(!r||!n)return null;if(!Se(r.type,[be(ce),ie,ce]))return t.error(`Expected first argument to be of type array or string, but found ${xe(r.type)} instead`);if(4===e.length){const o=t.parse(e[3],3,ae);return o?new Et(r.type,r,n,o):null}return new Et(r.type,r,n)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);let n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),Me(t,["string"]))return[...t].slice(r,n).join("");if(Me(t,["array"]))return t.slice(r,n);throw new at(`Expected first argument to be of type array or string, but found ${xe(ft(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function _t(e,t){const r=e.length-1;let n,o,a=0,i=r,s=0;for(;a<=i;)if(s=Math.floor((a+i)/2),n=e[s],o=e[s+1],n<=t){if(s===r||t<o)return s;a=s+1}else{if(!(n>t))throw new at("Input is not a number.");i=s-1}return 0}class Pt{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,ae);if(!r)return null;const n=[];let o=null;t.expectedType&&"value"!==t.expectedType.kind&&(o=t.expectedType);for(let r=1;r<e.length;r+=2){const a=1===r?-1/0:e[r],i=e[r+1],s=r,l=r+1;if("number"!=typeof a)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(n.length&&n[n.length-1][0]>=a)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const u=t.parse(i,l,o);if(!u)return null;o=o||u.type,n.push([a,u])}return new Pt(o,r,n)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const o=t.length;if(n>=t[o-1])return r[o-1].evaluate(e);return r[_t(t,n)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Ot(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ct,Tt;var $t=function(){if(Tt)return Ct;function e(e,t,r,n){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*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=n}return Tt=1,Ct=e,e.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,n=0;n<8;n++){var o=this.sampleCurveX(r)-e;if(Math.abs(o)<t)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=o/a}var i=0,s=1;for(r=e,n=0;n<20&&(o=this.sampleCurveX(r),!(Math.abs(o-e)<t));n++)e>o?i=r:s=r,r=.5*(s-i)+i;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},Ct}(),qt=Ot($t);class Dt{constructor(e,t,r,n,o){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(const[e,t]of o)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,r,n){let o=0;if("exponential"===e.name)o=Ft(t,e.base,r,n);else if("linear"===e.name)o=Ft(t,1,r,n);else if("cubic-bezier"===e.name){const a=e.controlPoints;o=new qt(a[0],a[1],a[2],a[3]).solve(Ft(t,1,r,n))}return o}static parse(e,t){let[r,n,o,...a]=e;if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const e=n[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return t.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const e=n.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);n={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(o=t.parse(o,2,ae),!o)return null;const i=[];let s=null;"interpolate-hcl"!==r&&"interpolate-lab"!==r||t.expectedType==ye?t.expectedType&&"value"!==t.expectedType.kind&&(s=t.expectedType):s=le;for(let e=0;e<a.length;e+=2){const r=a[e],n=a[e+1],o=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.',o);if(i.length&&i[i.length-1][0]>=r)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',o);const u=t.parse(n,l,s);if(!u)return null;s=s||u.type,i.push([r,u])}return ze(s,ae)||ze(s,ue)||ze(s,le)||ze(s,me)||ze(s,he)||ze(s,ye)||ze(s,ve)||ze(s,be(ae))?new Dt(s,r,n,o,i):t.error(`Type ${xe(s)} is not interpolatable.`)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const o=t.length;if(n>=t[o-1])return r[o-1].evaluate(e);const a=_t(t,n),i=t[a],s=t[a+1],l=Dt.interpolationFactor(this.interpolation,n,i,s),u=r[a].evaluate(e),p=r[a+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Je(u,p,l);case"color":return Ye.interpolate(u,p,l);case"padding":return rt.interpolate(u,p,l);case"colorArray":return ot.interpolate(u,p,l);case"numberArray":return nt.interpolate(u,p,l);case"variableAnchorOffsetCollection":return st.interpolate(u,p,l);case"array":return Xe(u,p,l);case"projectionDefinition":return ut.interpolate(u,p,l)}case"interpolate-hcl":switch(this.type.kind){case"color":return Ye.interpolate(u,p,l,"hcl");case"colorArray":return ot.interpolate(u,p,l,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return Ye.interpolate(u,p,l,"lab");case"colorArray":return ot.interpolate(u,p,l,"lab")}}}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Ft(e,t,r,n){const o=n-r,a=e-r;return 0===o?0:1===t?a/o:(Math.pow(t,a)-1)/(Math.pow(t,o)-1)}class Nt{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=null;const n=t.expectedType;n&&"value"!==n.kind&&(r=n);const o=[];for(const n of e.slice(1)){const e=t.parse(n,1+o.length,r,void 0,{typeAnnotation:"omit"});if(!e)return null;r=r||e.type,o.push(e)}if(!r)throw new Error("No output type");const a=n&&o.some(e=>ke(n,e.type));return new Nt(a?ce:r,o)}evaluate(e){let t,r=null,n=0;for(const o of this.args)if(n++,r=o.evaluate(e),r&&r instanceof lt&&!r.available&&(t||(t=r.name),r=null,n===this.args.length&&(r=t)),null!==r)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}function Lt(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 Rt(e,t,r,n){return 0===n.compare(t,r)}function Gt(e,t,r){const n="=="!==e&&"!="!==e;return class o{constructor(e,t,r){this.type=se,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 a=t.parse(e[1],1,ce);if(!a)return null;if(!Lt(r,a.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${xe(a.type)}'.`);let i=t.parse(e[2],2,ce);if(!i)return null;if(!Lt(r,i.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${xe(i.type)}'.`);if(a.type.kind!==i.type.kind&&"value"!==a.type.kind&&"value"!==i.type.kind)return t.error(`Cannot compare types '${xe(a.type)}' and '${xe(i.type)}'.`);n&&("value"===a.type.kind&&"value"!==i.type.kind?a=new ht(i.type,[a]):"value"!==a.type.kind&&"value"===i.type.kind&&(i=new ht(a.type,[i])));let s=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==i.type.kind&&"value"!==a.type.kind&&"value"!==i.type.kind)return t.error("Cannot use collator to compare non-string types.");if(s=t.parse(e[3],3,fe),!s)return null}return new o(a,i,s)}evaluate(o){const a=this.lhs.evaluate(o),i=this.rhs.evaluate(o);if(n&&this.hasUntypedArgument){const t=ft(a),r=ft(i);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new at(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const e=ft(a),r=ft(i);if("string"!==e.kind||"string"!==r.kind)return t(o,a,i)}return this.collator?r(o,a,i,this.collator.evaluate(o)):t(o,a,i)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}const Ut=Gt("==",function(e,t,r){return t===r},Rt),Bt=Gt("!=",function(e,t,r){return t!==r},function(e,t,r,n){return!Rt(0,t,r,n)}),Ht=Gt("<",function(e,t,r){return t<r},function(e,t,r,n){return n.compare(t,r)<0}),Zt=Gt(">",function(e,t,r){return t>r},function(e,t,r,n){return n.compare(t,r)>0}),Vt=Gt("<=",function(e,t,r){return t<=r},function(e,t,r,n){return n.compare(t,r)<=0}),Wt=Gt(">=",function(e,t,r){return t>=r},function(e,t,r,n){return n.compare(t,r)>=0});class Jt{constructor(e,t,r){this.type=fe,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 n=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,se);if(!n)return null;const o=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,se);if(!o)return null;let a=null;return r.locale&&(a=t.parse(r.locale,1,ie),!a)?null:new Jt(n,o,a)}evaluate(e){return new Ke(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}}class Xt{constructor(e,t,r,n,o,a){this.type=ie,this.number=e,this.locale=t,this.currency=r,this.unit=n,this.minFractionDigits=o,this.maxFractionDigits=a}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,ae);if(!r)return null;const n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");let o=null;if(n.locale&&(o=t.parse(n.locale,1,ie),!o))return null;let a=null;if(n.currency&&(a=t.parse(n.currency,1,ie),!a))return null;let i=null;if(n.unit&&(i=t.parse(n.unit,1,ie),!i))return null;if(a&&i)return t.error("NumberFormat options `currency` and `unit` are mutually exclusive");let s=null;if(n["min-fraction-digits"]&&(s=t.parse(n["min-fraction-digits"],1,ae),!s))return null;let l=null;return n["max-fraction-digits"]&&(l=t.parse(n["max-fraction-digits"],1,ae),!l)?null:new Xt(r,o,a,i,s,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.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.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Yt{constructor(e){this.type=de,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 n=[];let o=!1;for(let r=1;r<=e.length-1;++r){const a=e[r];if(o&&"object"==typeof a&&!Array.isArray(a)){o=!1;let e=null;if(a["font-scale"]&&(e=t.parse(a["font-scale"],1,ae),!e))return null;let r=null;if(a["text-font"]&&(r=t.parse(a["text-font"],1,be(ie)),!r))return null;let i=null;if(a["text-color"]&&(i=t.parse(a["text-color"],1,le),!i))return null;let s=null;if(a["vertical-align"]){if("string"==typeof a["vertical-align"]&&!Qe.includes(a["vertical-align"]))return t.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${a["vertical-align"]}' instead.`);if(s=t.parse(a["vertical-align"],1,ie),!s)return null}const l=n[n.length-1];l.scale=e,l.font=r,l.textColor=i,l.verticalAlign=s}else{const a=t.parse(e[r],1,ce);if(!a)return null;const i=a.type.kind;if("string"!==i&&"value"!==i&&"null"!==i&&"resolvedImage"!==i)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,n.push({content:a,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Yt(n)}evaluate(e){return new tt(this.sections.map(t=>{const r=t.content.evaluate(e);return ft(r)===ge?new et("",r,null,null,null,t.verticalAlign?t.verticalAlign.evaluate(e):null):new et(dt(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null,t.verticalAlign?t.verticalAlign.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),t.verticalAlign&&e(t.verticalAlign)}outputDefined(){return!1}}class Kt{constructor(e){this.type=ge,this.input=e}static parse(e,t){if(2!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,ie);return r?new Kt(r):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),r=lt.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}}class Qt{constructor(e){this.type=ae,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 ${xe(r.type)} instead.`):new Qt(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 at(`Expected value to be of type string or array, but found ${xe(ft(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const er=8192;function tr(e,t){const r=(180+e[0])/360;const n=(o=e[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o*Math.PI/360)))/360);var o;const a=Math.pow(2,t.z);return[Math.round(r*a*er),Math.round(n*a*er)]}function rr(e,t){const r=Math.pow(2,t.z),n=(e[0]/er+t.x)/r,o=(e[1]/er+t.y)/r;return[(i=n,360*i-180),(a=o,360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180))-90)];var a,i}function nr(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 or(e,t){return!(e[0]<=t[0])&&(!(e[2]>=t[2])&&(!(e[1]<=t[1])&&!(e[3]>=t[3])))}function ar(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function ir(e,t,r){const n=e[0]-t[0],o=e[1]-t[1],a=e[0]-r[0],i=e[1]-r[1];return n*i-a*o===0&&n*a<=0&&o*i<=0}function sr(e,t,r,n){const o=[t[0]-e[0],t[1]-e[1]],a=[n[0]-r[0],n[1]-r[1]];return 0!==(i=a)[0]*(s=o)[1]-i[1]*s[0]&&!(!dr(e,t,r,n)||!dr(r,n,e,t));var i,s}function lr(e,t,r){for(const n of r)for(let r=0;r<n.length-1;++r)if(sr(e,t,n[r],n[r+1]))return!0;return!1}function ur(e,t,r=!1){let n=!1;for(const o of t)for(let t=0;t<o.length-1;t++){if(ir(e,o[t],o[t+1]))return r;ar(e,o[t],o[t+1])&&(n=!n)}return n}function pr(e,t){for(const r of t)if(ur(e,r))return!0;return!1}function cr(e,t){for(const r of e)if(!ur(r,t))return!1;for(let r=0;r<e.length-1;++r)if(lr(e[r],e[r+1],t))return!1;return!0}function fr(e,t){for(const r of t)if(cr(e,r))return!0;return!1}function dr(e,t,r,n){const o=e[0]-r[0],a=e[1]-r[1],i=t[0]-r[0],s=t[1]-r[1],l=n[0]-r[0],u=n[1]-r[1],p=o*u-l*a,c=i*u-l*s;return p>0&&c<0||p<0&&c>0}function mr(e,t,r){const n=[];for(let o=0;o<e.length;o++){const a=[];for(let n=0;n<e[o].length;n++){const i=tr(e[o][n],r);nr(t,i),a.push(i)}n.push(a)}return n}function yr(e,t,r){const n=[];for(let o=0;o<e.length;o++){const a=mr(e[o],t,r);n.push(a)}return n}function hr(e,t,r,n){if(e[0]<r[0]||e[0]>r[2]){const t=.5*n;let o=e[0]-r[0]>t?-n:r[0]-e[0]>t?n:0;0===o&&(o=e[0]-r[2]>t?-n:r[2]-e[0]>t?n:0),e[0]+=o}nr(t,e)}function gr(e,t,r,n){const o=Math.pow(2,n.z)*er,a=[n.x*er,n.y*er],i=[];for(const n of e)for(const e of n){const n=[e.x+a[0],e.y+a[1]];hr(n,t,r,o),i.push(n)}return i}function vr(e,t,r,n){const o=Math.pow(2,n.z)*er,a=[n.x*er,n.y*er],i=[];for(const r of e){const e=[];for(const n of r){const r=[n.x+a[0],n.y+a[1]];nr(t,r),e.push(r)}i.push(e)}if(t[2]-t[0]<=o/2){!function(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}(t);for(const e of i)for(const n of e)hr(n,t,r,o)}return i}class br{constructor(e,t){this.type=se,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(ct(e[1])){const t=e[1];if("FeatureCollection"===t.type){const e=[];for(const r of t.features){const{type:t,coordinates:n}=r.geometry;"Polygon"===t&&e.push(n),"MultiPolygon"===t&&e.push(...n)}if(e.length){return new br(t,{type:"MultiPolygon",coordinates:e})}}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new br(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new br(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],n=[1/0,1/0,-1/0,-1/0],o=e.canonicalID();if("Polygon"===t.type){const a=mr(t.coordinates,n,o),i=gr(e.geometry(),r,n,o);if(!or(r,n))return!1;for(const e of i)if(!ur(e,a))return!1}if("MultiPolygon"===t.type){const a=yr(t.coordinates,n,o),i=gr(e.geometry(),r,n,o);if(!or(r,n))return!1;for(const e of i)if(!pr(e,a))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],n=[1/0,1/0,-1/0,-1/0],o=e.canonicalID();if("Polygon"===t.type){const a=mr(t.coordinates,n,o),i=vr(e.geometry(),r,n,o);if(!or(r,n))return!1;for(const e of i)if(!cr(e,a))return!1}if("MultiPolygon"===t.type){const a=yr(t.coordinates,n,o),i=vr(e.geometry(),r,n,o);if(!or(r,n))return!1;for(const e of i)if(!fr(e,a))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class xr{constructor(e=[],t=(e,t)=>e<t?-1:e>t?1:0){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._up(this.length++)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:r}=this,n=t[e];for(;e>0;){const o=e-1>>1,a=t[o];if(r(n,a)>=0)break;t[e]=a,e=o}t[e]=n}_down(e){const{data:t,compare:r}=this,n=this.length>>1,o=t[e];for(;e<n;){let n=1+(e<<1);const a=n+1;if(a<this.length&&r(t[a],t[n])<0&&(n=a),r(t[n],o)>=0)break;t[e]=t[n],e=n}t[e]=o}}function wr(e){let t=0;for(let r,n,o=0,a=e.length,i=a-1;o<a;i=o++)r=e[o],n=e[i],t+=(n.x-r.x)*(r.y+n.y);return t}const kr=1/298.257223563,Sr=kr*(2-kr),Mr=Math.PI/180;class zr{constructor(e){const t=6378.137*Mr*1e3,r=Math.cos(e*Mr),n=1/(1-Sr*(1-r*r)),o=Math.sqrt(n);this.kx=t*o*r,this.ky=t*o*n*(1-Sr)}distance(e,t){const r=this.wrap(e[0]-t[0])*this.kx,n=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+n*n)}pointOnLine(e,t){let r,n,o,a,i=1/0;for(let s=0;s<e.length-1;s++){let l=e[s][0],u=e[s][1],p=this.wrap(e[s+1][0]-l)*this.kx,c=(e[s+1][1]-u)*this.ky,f=0;0===p&&0===c||(f=(this.wrap(t[0]-l)*this.kx*p+(t[1]-u)*this.ky*c)/(p*p+c*c),f>1?(l=e[s+1][0],u=e[s+1][1]):f>0&&(l+=p/this.kx*f,u+=c/this.ky*f)),p=this.wrap(t[0]-l)*this.kx,c=(t[1]-u)*this.ky;const d=p*p+c*c;d<i&&(i=d,r=l,n=u,o=s,a=f)}return{point:[r,n],index:o,t:Math.max(0,Math.min(1,a))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}function Ir(e,t){return t[0]-e[0]}function jr(e){return e[1]-e[0]+1}function Ar(e,t){return e[1]>=e[0]&&e[1]<t}function Er(e,t){if(e[0]>e[1])return[null,null];const r=jr(e);if(t){if(2===r)return[e,null];const t=Math.floor(r/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(1===r)return[e,null];const n=Math.floor(r/2)-1;return[[e[0],e[0]+n],[e[0]+n+1,e[1]]]}function _r(e,t){if(!Ar(t,e.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let n=t[0];n<=t[1];++n)nr(r,e[n]);return r}function Pr(e){const t=[1/0,1/0,-1/0,-1/0];for(const r of e)for(const e of r)nr(t,e);return t}function Or(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function Cr(e,t,r){if(!Or(e)||!Or(t))return NaN;let n=0,o=0;return e[2]<t[0]&&(n=t[0]-e[2]),e[0]>t[2]&&(n=e[0]-t[2]),e[1]>t[3]&&(o=e[1]-t[3]),e[3]<t[1]&&(o=t[1]-e[3]),r.distance([0,0],[n,o])}function Tr(e,t,r){const n=r.pointOnLine(t,e);return r.distance(e,n.point)}function $r(e,t,r,n,o){const a=Math.min(Tr(e,[r,n],o),Tr(t,[r,n],o)),i=Math.min(Tr(r,[e,t],o),Tr(n,[e,t],o));return Math.min(a,i)}function qr(e,t,r,n,o){if(!(Ar(t,e.length)&&Ar(n,r.length)))return 1/0;let a=1/0;for(let i=t[0];i<t[1];++i){const t=e[i],s=e[i+1];for(let e=n[0];e<n[1];++e){const n=r[e],i=r[e+1];if(sr(t,s,n,i))return 0;a=Math.min(a,$r(t,s,n,i,o))}}return a}function Dr(e,t,r,n,o){if(!(Ar(t,e.length)&&Ar(n,r.length)))return NaN;let a=1/0;for(let i=t[0];i<=t[1];++i)for(let t=n[0];t<=n[1];++t)if(a=Math.min(a,o.distance(e[i],r[t])),0===a)return a;return a}function Fr(e,t,r){if(ur(e,t,!0))return 0;let n=1/0;for(const o of t){const t=o[0],a=o[o.length-1];if(t!==a&&(n=Math.min(n,Tr(e,[a,t],r)),0===n))return n;const i=r.pointOnLine(o,e);if(n=Math.min(n,r.distance(e,i.point)),0===n)return n}return n}function Nr(e,t,r,n){if(!Ar(t,e.length))return NaN;for(let n=t[0];n<=t[1];++n)if(ur(e[n],r,!0))return 0;let o=1/0;for(let a=t[0];a<t[1];++a){const t=e[a],i=e[a+1];for(const e of r)for(let r=0,a=e.length,s=a-1;r<a;s=r++){const a=e[s],l=e[r];if(sr(t,i,a,l))return 0;o=Math.min(o,$r(t,i,a,l,n))}}return o}function Lr(e,t){for(const r of e)for(const e of r)if(ur(e,t,!0))return!0;return!1}function Rr(e,t,r,n=1/0){const o=Pr(e),a=Pr(t);if(n!==1/0&&Cr(o,a,r)>=n)return n;if(or(o,a)){if(Lr(e,t))return 0}else if(Lr(t,e))return 0;let i=1/0;for(const n of e)for(let e=0,o=n.length,a=o-1;e<o;a=e++){const o=n[a],s=n[e];for(const e of t)for(let t=0,n=e.length,a=n-1;t<n;a=t++){const n=e[a],l=e[t];if(sr(o,s,n,l))return 0;i=Math.min(i,$r(o,s,n,l,r))}}return i}function Gr(e,t,r,n,o,a){if(!a)return;const i=Cr(_r(n,a),o,r);i<t&&e.push([i,a,[0,0]])}function Ur(e,t,r,n,o,a,i){if(!a||!i)return;const s=Cr(_r(n,a),_r(o,i),r);s<t&&e.push([s,a,i])}function Br(e,t,r,n,o=1/0){let a=Math.min(n.distance(e[0],r[0][0]),o);if(0===a)return a;const i=new xr([[0,[0,e.length-1],[0,0]]],Ir),s=Pr(r);for(;i.length>0;){const o=i.pop();if(o[0]>=a)continue;const l=o[1],u=t?50:100;if(jr(l)<=u){if(!Ar(l,e.length))return NaN;if(t){const t=Nr(e,l,r,n);if(isNaN(t)||0===t)return t;a=Math.min(a,t)}else for(let t=l[0];t<=l[1];++t){const o=Fr(e[t],r,n);if(a=Math.min(a,o),0===a)return 0}}else{const r=Er(l,t);Gr(i,a,n,e,s,r[0]),Gr(i,a,n,e,s,r[1])}}return a}function Hr(e,t,r,n,o,a=1/0){let i=Math.min(a,o.distance(e[0],r[0]));if(0===i)return i;const s=new xr([[0,[0,e.length-1],[0,r.length-1]]],Ir);for(;s.length>0;){const a=s.pop();if(a[0]>=i)continue;const l=a[1],u=a[2],p=t?50:100,c=n?50:100;if(jr(l)<=p&&jr(u)<=c){if(!Ar(l,e.length)&&Ar(u,r.length))return NaN;let a;if(t&&n)a=qr(e,l,r,u,o),i=Math.min(i,a);else if(t&&!n){const t=e.slice(l[0],l[1]+1);for(let e=u[0];e<=u[1];++e)if(a=Tr(r[e],t,o),i=Math.min(i,a),0===i)return i}else if(!t&&n){const t=r.slice(u[0],u[1]+1);for(let r=l[0];r<=l[1];++r)if(a=Tr(e[r],t,o),i=Math.min(i,a),0===i)return i}else a=Dr(e,l,r,u,o),i=Math.min(i,a)}else{const a=Er(l,t),p=Er(u,n);Ur(s,i,o,e,r,a[0],p[0]),Ur(s,i,o,e,r,a[0],p[1]),Ur(s,i,o,e,r,a[1],p[0]),Ur(s,i,o,e,r,a[1],p[1])}}return i}function Zr(e,t){const r=e.geometry();if(0===r.length||0===r[0].length)return NaN;const n=function(e){if(e.length<=1)return[e];const t=[];let r,n;for(const o of e){const e=wr(o);0!==e&&(o.area=Math.abs(e),void 0===n&&(n=e<0),n===e<0?(r&&t.push(r),r=[o]):r.push(o))}return r&&t.push(r),t}(r).map(t=>t.map(t=>t.map(t=>rr([t.x,t.y],e.canonical)))),o=new zr(n[0][0][0][1]);let a=1/0;for(const e of t)for(const t of n){switch(e.type){case"Point":a=Math.min(a,Br([e.coordinates],!1,t,o,a));break;case"LineString":a=Math.min(a,Br(e.coordinates,!0,t,o,a));break;case"Polygon":a=Math.min(a,Rr(t,e.coordinates,o,a))}if(0===a)return a}return a}function Vr(e){return"MultiPolygon"===e.type?e.coordinates.map(e=>({type:"Polygon",coordinates:e})):"MultiLineString"===e.type?e.coordinates.map(e=>({type:"LineString",coordinates:e})):"MultiPoint"===e.type?e.coordinates.map(e=>({type:"Point",coordinates:e})):[e]}class Wr{constructor(e,t){this.type=ae,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ct(e[1])){const t=e[1];if("FeatureCollection"===t.type)return new Wr(t,t.features.map(e=>Vr(e.geometry)).flat());if("Feature"===t.type)return new Wr(t,Vr(t.geometry));if("type"in t&&"coordinates"in t)return new Wr(t,Vr(t))}return t.error("'distance' 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=e.geometry(),n=r.flat().map(t=>rr([t.x,t.y],e.canonical));if(0===r.length)return NaN;const o=new zr(n[0][1]);let a=1/0;for(const e of t){switch(e.type){case"Point":a=Math.min(a,Hr(n,!1,[e.coordinates],!1,o,a));break;case"LineString":a=Math.min(a,Hr(n,!1,e.coordinates,!0,o,a));break;case"Polygon":a=Math.min(a,Br(n,!1,e.coordinates,o,a))}if(0===a)return a}return a}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=e.geometry(),n=r.flat().map(t=>rr([t.x,t.y],e.canonical));if(0===r.length)return NaN;const o=new zr(n[0][1]);let a=1/0;for(const e of t){switch(e.type){case"Point":a=Math.min(a,Hr(n,!0,[e.coordinates],!1,o,a));break;case"LineString":a=Math.min(a,Hr(n,!0,e.coordinates,!0,o,a));break;case"Polygon":a=Math.min(a,Br(n,!0,e.coordinates,o,a))}if(0===a)return a}return a}(e,this.geometries);if("Polygon"===e.geometryType())return Zr(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Jr{constructor(e){this.type=ce,this.key=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=e[1];return null==r?t.error("Global state property must be defined."):"string"!=typeof r?t.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new Jr(r)}evaluate(e){var t;const r=null===(t=e.globals)||void 0===t?void 0:t.globalState;return r&&0!==Object.keys(r).length?Ge(r,this.key):null}eachChild(){}outputDefined(){return!1}}const Xr={"==":Ut,"!=":Bt,">":Zt,"<":Ht,">=":Wt,"<=":Vt,array:ht,at:Mt,boolean:ht,case:At,coalesce:Nt,collator:Jt,format:Yt,image:Kt,in:zt,"index-of":It,interpolate:Dt,"interpolate-hcl":Dt,"interpolate-lab":Dt,length:Qt,let:kt,literal:mt,match:jt,number:ht,"number-format":Xt,object:ht,slice:Et,step:Pt,string:ht,"to-boolean":vt,"to-color":vt,"to-number":vt,"to-string":vt,var:St,within:br,distance:Wr,"global-state":Jr};class Yr{constructor(e,t,r,n){this.name=e,this.type=t,this._evaluate=r,this.args=n}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],n=Yr.definitions[r];if(!n)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const o=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,i=a.filter(([t])=>!Array.isArray(t)||t.length===e.length-1);let s=null;for(const[n,a]of i){s=new wt(t.registry,rn,t.path,null,t.scope);const i=[];let l=!1;for(let t=1;t<e.length;t++){const r=e[t],o=Array.isArray(n)?n[t-1]:n.type,a=s.parse(r,1+i.length,o);if(!a){l=!0;break}i.push(a)}if(!l)if(Array.isArray(n)&&n.length!==i.length)s.error(`Expected ${n.length} arguments, but found ${i.length} instead.`);else{for(let e=0;e<i.length;e++){const t=Array.isArray(n)?n[e]:n.type,r=i[e];s.concat(e+1).checkSubtype(t,r.type)}if(0===s.errors.length)return new Yr(r,o,a,i)}}if(1===i.length)t.errors.push(...s.errors);else{const r=(i.length?i:a).map(([e])=>{return t=e,Array.isArray(t)?`(${t.map(xe).join(", ")})`:`(${xe(t.type)}...)`;var t}).join(" | "),n=[];for(let r=1;r<e.length;r++){const o=t.parse(e[r],1+n.length);if(!o)return null;n.push(xe(o.type))}t.error(`Expected arguments of type ${r}, but found (${n.join(", ")}) instead.`)}return null}static register(e,t){Yr.definitions=t;for(const r in t)e[r]=Yr}}function Kr(e,[t,r,n,o]){t=t.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);const a=o?o.evaluate(e):1,i=pt(t,r,n,a);if(i)throw new at(i);return new Ye(t/255,r/255,n/255,a,!1)}function Qr(e,t){return e in t}function en(e,t){const r=t[e];return void 0===r?null:r}function tn(e){return{type:e}}function rn(e){if(e instanceof St)return rn(e.boundExpression);if(e instanceof Yr&&"error"===e.name)return!1;if(e instanceof Jt)return!1;if(e instanceof br)return!1;if(e instanceof Wr)return!1;if(e instanceof Jr)return!1;const t=e instanceof vt||e instanceof ht;let r=!0;return e.eachChild(e=>{r=t?r&&rn(e):r&&e instanceof mt}),!!r&&(nn(e)&&an(e,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]))}function nn(e){if(e instanceof Yr){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 br)return!1;if(e instanceof Wr)return!1;let t=!0;return e.eachChild(e=>{t&&!nn(e)&&(t=!1)}),t}function on(e){if(e instanceof Yr&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild(e=>{t&&!on(e)&&(t=!1)}),t}function an(e,t){if(e instanceof Yr&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild(e=>{r&&!an(e,t)&&(r=!1)}),r}function sn(e){return{result:"success",value:e}}function ln(e){return{result:"error",value:e}}function un(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&ft(e)===pe}Yr.register(Xr,{error:[{kind:"error"},[ie],(e,[t])=>{throw new at(t.evaluate(e))}],typeof:[ie,[ce],(e,[t])=>xe(ft(t.evaluate(e)))],"to-rgba":[be(ae,4),[le],(e,[t])=>{const[r,n,o,a]=t.evaluate(e).rgb;return[255*r,255*n,255*o,a]}],rgb:[le,[ae,ae,ae],Kr],rgba:[le,[ae,ae,ae,ae],Kr],has:{type:se,overloads:[[[ie],(e,[t])=>Qr(t.evaluate(e),e.properties())],[[ie,pe],(e,[t,r])=>Qr(t.evaluate(e),r.evaluate(e))]]},get:{type:ce,overloads:[[[ie],(e,[t])=>en(t.evaluate(e),e.properties())],[[ie,pe],(e,[t,r])=>en(t.evaluate(e),r.evaluate(e))]]},"feature-state":[ce,[ie],(e,[t])=>en(t.evaluate(e),e.featureState||{})],properties:[pe,[],e=>e.properties()],"geometry-type":[ie,[],e=>e.geometryType()],id:[ce,[],e=>e.id()],zoom:[ae,[],e=>e.globals.zoom],"heatmap-density":[ae,[],e=>e.globals.heatmapDensity||0],elevation:[ae,[],e=>e.globals.elevation||0],"line-progress":[ae,[],e=>e.globals.lineProgress||0],accumulated:[ce,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[ae,tn(ae),(e,t)=>{let r=0;for(const n of t)r+=n.evaluate(e);return r}],"*":[ae,tn(ae),(e,t)=>{let r=1;for(const n of t)r*=n.evaluate(e);return r}],"-":{type:ae,overloads:[[[ae,ae],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[ae],(e,[t])=>-t.evaluate(e)]]},"/":[ae,[ae,ae],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[ae,[ae,ae],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[ae,[],()=>Math.LN2],pi:[ae,[],()=>Math.PI],e:[ae,[],()=>Math.E],"^":[ae,[ae,ae],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[ae,[ae],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[ae,[ae],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[ae,[ae],(e,[t])=>Math.log(t.evaluate(e))],log2:[ae,[ae],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[ae,[ae],(e,[t])=>Math.sin(t.evaluate(e))],cos:[ae,[ae],(e,[t])=>Math.cos(t.evaluate(e))],tan:[ae,[ae],(e,[t])=>Math.tan(t.evaluate(e))],asin:[ae,[ae],(e,[t])=>Math.asin(t.evaluate(e))],acos:[ae,[ae],(e,[t])=>Math.acos(t.evaluate(e))],atan:[ae,[ae],(e,[t])=>Math.atan(t.evaluate(e))],min:[ae,tn(ae),(e,t)=>Math.min(...t.map(t=>t.evaluate(e)))],max:[ae,tn(ae),(e,t)=>Math.max(...t.map(t=>t.evaluate(e)))],abs:[ae,[ae],(e,[t])=>Math.abs(t.evaluate(e))],round:[ae,[ae],(e,[t])=>{const r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[ae,[ae],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[ae,[ae],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[se,[ie,ce],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[se,[ce],(e,[t])=>e.id()===t.value],"filter-type-==":[se,[ie],(e,[t])=>e.geometryType()===t.value],"filter-<":[se,[ie,ce],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n<o}],"filter-id-<":[se,[ce],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<n}],"filter->":[se,[ie,ce],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n>o}],"filter-id->":[se,[ce],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>n}],"filter-<=":[se,[ie,ce],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n<=o}],"filter-id-<=":[se,[ce],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<=n}],"filter->=":[se,[ie,ce],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n>=o}],"filter-id->=":[se,[ce],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>=n}],"filter-has":[se,[ce],(e,[t])=>t.value in e.properties()],"filter-has-id":[se,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[se,[be(ie)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[se,[be(ce)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[se,[ie,be(ce)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[se,[ie,be(ce)],(e,[t,r])=>function(e,t,r,n){for(;r<=n;){const o=r+n>>1;if(t[o]===e)return!0;t[o]>e?n=o-1:r=o+1}return!1}(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:se,overloads:[[[se,se],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[tn(se),(e,t)=>{for(const r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:se,overloads:[[[se,se],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[tn(se),(e,t)=>{for(const r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[se,[se],(e,[t])=>!t.evaluate(e)],"is-supported-script":[se,[ie],(e,[t])=>{const r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[ie,[ie],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[ie,[ie],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[ie,tn(ce),(e,t)=>t.map(t=>dt(t.evaluate(e))).join("")],split:[be(ie),[ie,ie],(e,[t,r])=>t.evaluate(e).split(r.evaluate(e))],join:[ie,[be(ie),ie],(e,[t,r])=>t.evaluate(e).join(r.evaluate(e))],"resolved-locale":[ie,[fe],(e,[t])=>t.evaluate(e).resolvedLocale()]});class pn{constructor(e,t,r){this.expression=e,this._warningHistory={},this._evaluator=new xt,this._defaultValue=t?function(e){if("color"===e.type&&un(e.default))return new Ye(0,0,0,0);switch(e.type){case"color":return Ye.parse(e.default)||null;case"padding":return rt.parse(e.default)||null;case"numberArray":return nt.parse(e.default)||null;case"colorArray":return ot.parse(e.default)||null;case"variableAnchorOffsetCollection":return st.parse(e.default)||null;case"projectionDefinition":return ut.parse(e.default)||null;default:return void 0===e.default?null:e.default}}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null,this._globalState=r}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=vn(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,n,o,a){this._globalState&&(e=vn(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a||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 at(`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 cn(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in Xr}function fn(e,t,r){const n=new wt(Xr,rn,[],t?function(e){const t={color:le,string:ie,number:ae,enum:ie,boolean:se,formatted:de,padding:me,numberArray:he,colorArray:ye,projectionDefinition:ue,resolvedImage:ge,variableAnchorOffsetCollection:ve};if("array"===e.type)return be(t[e.value]||ce,e.length);return t[e.type]}(t):void 0),o=n.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return o?sn(new pn(o,t,r)):ln(n.errors)}class dn{constructor(e,t,r){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!on(t.expression),this.globalStateRefs=gn(t.expression),this._globalState=r}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=vn(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,o,a)}evaluate(e,t,r,n,o,a){return this._globalState&&(e=vn(e,this._globalState)),this._styleExpression.evaluate(e,t,r,n,o,a)}}class mn{constructor(e,t,r,n,o){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!on(t.expression),this.globalStateRefs=gn(t.expression),this.interpolationType=n,this._globalState=o}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=vn(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,o,a)}evaluate(e,t,r,n,o,a){return this._globalState&&(e=vn(e,this._globalState)),this._styleExpression.evaluate(e,t,r,n,o,a)}interpolationFactor(e,t,r){return this.interpolationType?Dt.interpolationFactor(this.interpolationType,e,t,r):0}}function yn(e,t,r){const n=fn(e,t,r);if("error"===n.result)return n;const o=n.value.expression,a=nn(o);if(!a&&("data-driven"!==(i=t)["property-type"]&&"cross-faded-data-driven"!==i["property-type"]))return ln([new re("","data expressions not supported")]);var i;const s=an(o,["zoom"]);if(!s&&!function(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}(t))return ln([new re("","zoom expressions not supported")]);const l=hn(o);if(!l&&!s)return ln([new re("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(l instanceof re)return ln([l]);if(l instanceof Dt&&!function(e){return!!e.expression&&e.expression.interpolated}(t))return ln([new re("",'"interpolate" expressions cannot be used with this property')]);if(!l)return sn(new dn(a?"constant":"source",n.value,r));const u=l instanceof Dt?l.interpolation:void 0;return sn(new mn(a?"camera":"composite",n.value,l.labels,u,r))}function hn(e){let t=null;if(e instanceof kt)t=hn(e.result);else if(e instanceof Nt){for(const r of e.args)if(t=hn(r),t)break}else(e instanceof Pt||e instanceof Dt)&&e.input instanceof Yr&&"zoom"===e.input.name&&(t=e);return t instanceof re||e.eachChild(e=>{const r=hn(e);r instanceof re?t=r:!t&&r?t=new re("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new re("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function gn(e,t=new Set){return e instanceof Jr&&t.add(e.key),e.eachChild(e=>{gn(e,t)}),t}function vn(e,t){const{zoom:r,heatmapDensity:n,elevation:o,lineProgress:a,isSupportedScript:i,accumulated:s}=null!=e?e:{};return{zoom:r,heatmapDensity:n,elevation:o,lineProgress:a,isSupportedScript:i,accumulated:s,globalState:t}}function bn(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(!bn(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}const xn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function wn(e,t){if(null==e)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};bn(e)||(e=Mn(e));const r=fn(e,xn,t);if("error"===r.result)throw new Error(r.value.map(e=>`${e.key}: ${e.message}`).join(", "));return{filter:(e,t,n)=>r.value.evaluate(e,t,{},n),needGeometry:Sn(e),getGlobalStateRefs:()=>gn(r.value.expression)}}function kn(e,t){return e<t?-1:e>t?1:0}function Sn(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t<e.length;t++)if(Sn(e[t]))return!0;return!1}function Mn(e){if(!e)return!0;const t=e[0];if(e.length<=1)return"any"!==t;var r;return"=="===t?zn(e[1],e[2],"=="):"!="===t?An(zn(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?zn(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(Mn))):"all"===t?["all"].concat(e.slice(1).map(Mn)):"none"===t?["all"].concat(e.slice(1).map(Mn).map(An)):"in"===t?In(e[1],e.slice(2)):"!in"===t?An(In(e[1],e.slice(2))):"has"===t?jn(e[1]):"!has"!==t||An(jn(e[1]))}function zn(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 In(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(kn)]]:["filter-in-small",e,["literal",t]]}}function jn(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function An(e){return["!",e]}function En(e){return"object"==typeof e?["literal",e]:e}function _n(e,t){let r=e.stops;if(!r)return function(e,t){const r=["get",e.property];if(void 0===e.default)return"string"===t.type?["string",r]:r;if("enum"===t.type)return["match",r,Object.keys(t.values),r,e.default];{const n=["color"===t.type?"to-color":t.type,r,En(e.default)];return"array"===t.type&&n.splice(1,0,t.value,t.length||null),n}}(e,t);const n=r&&"object"==typeof r[0][0],o=n||void 0!==e.property,a=n||!o;return r=r.map(e=>!o&&t.tokens&&"string"==typeof e[1]?[e[0],Dn(e[1])]:[e[0],En(e[1])]),n?function(e,t,r){const n={},o={},a=[];for(let t=0;t<r.length;t++){const i=r[t],s=i[0].zoom;void 0===n[s]&&(n[s]={zoom:s,type:e.type,property:e.property,default:e.default},o[s]=[],a.push(s)),o[s].push([i[0].value,i[1]])}const i=qn({},t);if("exponential"===i){const r=[Pn(e),["linear"],["zoom"]];for(const e of a){$n(r,e,Cn(n[e],t,o[e]),!1)}return r}{const e=["step",["zoom"]];for(const r of a){$n(e,r,Cn(n[r],t,o[r]),!0)}return Tn(e),e}}(e,t,r):a?function(e,t,r,n=["zoom"]){const o=qn(e,t);let a,i=!1;if("interval"===o)a=["step",n],i=!0;else{if("exponential"!==o)throw new Error(`Unknown zoom function type "${o}"`);{const t=void 0!==e.base?e.base:1;a=[Pn(e),1===t?["linear"]:["exponential",t],n]}}for(const e of r)$n(a,e[0],e[1],i);return Tn(a),a}(e,t,r):Cn(e,t,r)}function Pn(e){switch(e.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function On(e,t){const r=En((n=e.default,o=t.default,void 0!==n?n:void 0!==o?o:void 0));var n,o;return void 0===r&&"resolvedImage"===t.type?"":r}function Cn(e,t,r){const n=qn(e,t),o=["get",e.property];if("categorical"===n&&"boolean"==typeof r[0][0]){const n=["case"];for(const e of r)n.push(["==",o,e[0]],e[1]);return n.push(On(e,t)),n}if("categorical"===n){const n=["match",o];for(const e of r)$n(n,e[0],e[1],!1);return n.push(On(e,t)),n}if("interval"===n){const t=["step",["number",o]];for(const e of r)$n(t,e[0],e[1],!0);return Tn(t),void 0===e.default?t:["case",["==",["typeof",o],"number"],t,En(e.default)]}if("exponential"===n){const t=void 0!==e.base?e.base:1,n=[Pn(e),1===t?["linear"]:["exponential",t],["number",o]];for(const e of r)$n(n,e[0],e[1],!1);return void 0===e.default?n:["case",["==",["typeof",o],"number"],n,En(e.default)]}throw new Error(`Unknown property function type ${n}`)}function Tn(e){"step"===e[0]&&3===e.length&&(e.push(0),e.push(e[3]))}function $n(e,t,r,n){e.length>3&&t===e[e.length-2]||(n&&2===e.length||e.push(t),e.push(r))}function qn(e,t){return e.type?e.type:t.expression.interpolated?"exponential":"interval"}function Dn(e){const t=["concat"],r=/{([^{}]+)}/g;let n=0;for(let o=r.exec(e);null!==o;o=r.exec(e)){const a=e.slice(n,r.lastIndex-o[0].length);n=r.lastIndex,a.length>0&&t.push(a),t.push(["get",o[1]])}if(1===t.length)return e;if(n<e.length)t.push(e.slice(n));else if(2===t.length)return["to-string",t[1]];return t}const Fn=Q;function Nn(e,t){const r=t[0].evaluate(e),n=t[1].evaluate(e),o=t[2].evaluate(e),a=t[3]?t[3].evaluate(e):1;return Ye.parse(`hsla(${r}, ${n}%, ${o}%, ${a})`)}function Ln(e){if(Array.isArray(e)){if(0===e.length)return e;const t=e[0];if("literal"===t)return e;if("image"===t&&3===e.length&&"object"==typeof e[2]&&null!==e[2]&&!Array.isArray(e[2])){return["image-config",Ln(e[1]),["literal",e[2]]]}const r=e.length;for(let n=1;n<r;++n){const o=e[n],a=Ln(o);if(a!==o){const o=[t];for(let t=1;t<n;++t)o.push(e[t]);o.push(a);for(let t=n+1;t<r;++t)o.push(Ln(e[t]));return o}}}return e}const Rn={},Gn={zoom:0,distanceFromCenter:0};Yr.register(Xr,{...Yr.definitions,pitch:[{kind:"number"},[],e=>Gn.pitch||0],"distance-from-center":[{kind:"number"},[],e=>Gn.distanceFromCenter||0],"to-hsla":[{kind:"array",itemType:{kind:"number"},N:4},[{kind:"string"}],(e,[t])=>function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,o=e[3],a=Math.max(t,r,n),i=Math.min(t,r,n),s=(a+i)/2;let l,u;if(a===i)l=0,u=0;else{const e=a-i;switch(u=s>.5?e/(2-a-i):e/(a+i),a){case t:l=(r-n)/e+(r<n?6:0);break;case r:l=(n-t)/e+2;break;case n:l=(t-r)/e+4;break;default:l=0}l/=6}return[360*l,100*u,100*s,o]}(E(t.evaluate(e)))],hsl:[{kind:"color"},[{kind:"number"},{kind:"number"},{kind:"number"}],Nn],hsla:[{kind:"color"},[{kind:"number"},{kind:"number"},{kind:"number"},{kind:"number"}],Nn],"image-config":[{kind:"value"},[{kind:"string"},{kind:"value"}],(e,[t,r])=>t.evaluate(e)],"measure-light":[{kind:"number"},[{kind:"value"}],()=>1],config:[{kind:"value"},[{kind:"string"}],(e,[t])=>{const r=Rn[t.evaluate(e)];return void 0===r?{}:r}]});var Un={thin:100,hairline:100,"ultra-light":200,"extra-light":200,light:300,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,"extra-bold":800,"ultra-bold":800,heavy:900,black:900,"heavy-black":900,fat:900,poster:900,"ultra-black":950,"extra-black":950},Bn=" ",Hn=/(italic|oblique)$/i,Zn={};function Vn(e,t,r){var n=Zn[e];if(!n){Array.isArray(e)||(e=[e]);for(var o,a,i=400,s="normal",l=[],u=0,p=e.length;u<p;++u){var c=e[u].split(" "),f=c[c.length-1].toLowerCase();for(var d in"normal"==f||"italic"==f||"oblique"==f?(s=a?s:f,a=!0,c.pop(),f=c[c.length-1].toLowerCase()):Hn.test(f)&&(f=f.replace(Hn,""),s=a?s:c[c.length-1].replace(f,""),a=!0),Un){var m=c.length>1?c[c.length-2].toLowerCase():"";if(f==d||f==d.replace("-","")||m+"-"+f==d){i=o?i:Un[d],c.pop(),m&&d.startsWith(m)&&c.pop();break}}o||"number"!=typeof f||(i=f,o=!0);var y=c.join(Bn).replace("Klokantech Noto Sans","Noto Sans").replace("DIN Pro","Barlow").replace("Arial Unicode MS","Arial");-1!==y.indexOf(Bn)&&(y='"'+y+'"'),l.push(y)}n=Zn[e]=[s,i,l]}return n[0]+Bn+n[1]+Bn+t+"px"+(r?"/"+r:"")+Bn+n[2]}const Wn=Object.freeze({}),Jn={},Xn={};let Yn=0;function Kn(e){return e.id||(e.id=Yn++),e.id}function Qn(e){return e*Math.PI/180}const eo=function(){const e=[];for(let t=78271.51696402048;e.length<=24;t/=2)e.push(t);return e}();function to(e,t){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(e,t);const r=document.createElement("canvas");return r.width=e,r.height=t,r}function ro(e,t,r,n){const o=[2*r*t.pixelRatio+t.width,2*r*t.pixelRatio+t.height],a=to(o[0],o[1]),i=a.getContext("2d");i.drawImage(e,t.x,t.y,t.width,t.height,r*t.pixelRatio,r*t.pixelRatio,t.width,t.height);const s=i.getImageData(0,0,o[0],o[1]);i.globalCompositeOperation="destination-over",i.fillStyle=`rgba(${255*n.r},${255*n.g},${255*n.b},${n.a})`;const l=s.data;for(let e=0,n=s.width;e<n;++e)for(let o=0,a=s.height;o<a;++o){l[4*(o*n+e)+3]>0&&i.arc(e,o,r*t.pixelRatio,0,2*Math.PI)}return i.fill(),a}function no(e,t,r){const n=Math.max(0,Math.min(1,(r-e)/(t-e)));return n*n*(3-2*n)}function oo(e,t,r){const n=to(t.width,t.height),o=n.getContext("2d");o.drawImage(e,t.x,t.y,t.width,t.height,0,0,t.width,t.height);const a=o.getImageData(0,0,t.width,t.height),i=a.data;for(let e=0,t=a.width;e<t;++e)for(let n=0,o=a.height;n<o;++n){const o=4*(n*t+e),a=.75,s=.1,l=no(a-s,a+s,i[o+3]/255);l>0?(i[o+0]=Math.round(255*r.r*l),i[o+1]=Math.round(255*r.g*l),i[o+2]=Math.round(255*r.b*l),i[o+3]=Math.round(255*l)):i[o+3]=0}return o.putImageData(a,0,0),n}const ao=Array(256).join(" ");function io(e,t){if(t>=.05){let r="";const n=e.split("\n"),o=ao.slice(0,Math.round(t/.1));for(let e=0,t=n.length;e<t;++e)e>0&&(r+="\n"),r+=n[e].split("").join(o);return r}return e}let so;function lo(){return so||(so=to(1,1).getContext("2d")),so}function uo(e,t){return lo().measureText(e).width+(e.length-1)*t}const po={};function co(e,t,r,n){if(-1!==e.indexOf("\n")){const o=e.split("\n"),a=[];for(let e=0,i=o.length;e<i;++e)a.push(co(o[e],t,r,n));return a.join("\n")}const o=r+","+t+","+e+","+n;let a=po[o];if(!a){const i=e.split(" ");if(i.length>1){const e=lo();e.font=t;const o=e.measureText("M").width*r;let s="";const l=[];for(let e=0,t=i.length;e<t;++e){const t=i[e],r=s+(s?" ":"")+t;uo(r,n)<=o?s=r:(s&&l.push(s),s=t)}s&&l.push(s);for(let e=0,t=l.length;e<t&&t>1;++e){const r=l[e];if(uo(r,n)<.35*o){const o=e>0?uo(l[e-1],n):1/0,a=e<t-1?uo(l[e+1],n):1/0;l.splice(e,1),t-=1,o<a?(l[e-1]+=" "+r,e-=1):l[e]=r+" "+l[e]}}for(let e=0,t=l.length-1;e<t;++e){const r=l[e],a=l[e+1];if(uo(r,n)>.7*o&&uo(a,n)<.6*o){const i=r.split(" "),s=i.pop();uo(s,n)<.2*o&&(l[e]=i.join(" "),l[e+1]=s+" "+a),t-=1}}a=l.join("\n")}else a=e;a=io(a,n),po[o]=a}return a}_.on("propertychange",()=>{for(const e in po)delete po[e]});const fo={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},mo={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},yo=function(e,t){let r=yn(e,t);if("error"===r.result){const n=Ln(e);n!==e&&(r=yn(n,t))}if("error"===r.result){const n=r.value[0];return console.error("Error parsing expression:",e,n.key,n.message),{evaluate:()=>t.default}}return r.value};let ho,go;function vo(e,t,r,n,o,a){const i=e.id;o||(o={},console.warn("No functionCache provided to getValue()")),o[i]||(o[i]={});const s=o[i];if(!s[r]){let n=(e[t]||Wn)[r];const o=Fn[`${t}_${e.type}`]&&Fn[`${t}_${e.type}`][r];void 0===n&&o&&(n=o.default);let a=cn(n);if(!a&&un(n)&&(n=_n(n,o),a=!0),a){const e=yo(n,o);s[r]=e.evaluate.bind(e)}else{const e=o?o.type:typeof n;"color"!==e&&"colorArray"!==e||(n=Ye.parse(n));let t=!1;if("array"===e)for(let e=0;e<n.length;++e){const r=n[e];if(cn(r)||un(r)){t=!0;break}}if(t){const e=Object.assign({},o,{type:o.value}),t=[];for(let r=0;r<n.length;++r){let o=n[r];if(!cn(o)&&un(o)&&(o=_n(o,e)),cn(o)){const r=yo(o,e);t.push(r.evaluate.bind(r))}else t.push(function(){return o})}s[r]=function(e,r,n){const o=[];for(let a=0;a<t.length;++a)o[a]=t[a](e,r,n);return o}}else s[r]=function(){return n}}}return s[r](Gn,n,a)}function bo(e,t,r,n){if(!vo(e,"layout",`${r}-allow-overlap`,t,n))return"declutter";return vo(e,"layout",`${r}-ignore-placement`,t,n)?"none":"obstacle"}function xo(e,t,r,n){if(n||console.warn("No filterCache provided to evaluateFilter()"),!(e in n))try{n[e]=wn(t).filter}catch(t){console.warn("Filter will evaluate to false: "+t.message),n[e]=function(){return!1}}return n[e](Gn,r)}function wo(e,t){if(e){if(0===e.a||0===t)return;const r=e.a;return t=void 0===t?1:t,0===r?"transparent":"rgba("+Math.round(255*e.r/r)+","+Math.round(255*e.g/r)+","+Math.round(255*e.b/r)+","+r*t+")"}return e}const ko=/\{[^{}}]*\}/g;function So(e,t){return e.replace(ko,function(e){return t[e.slice(1,-1)]||""})}function Mo(e,t){let r=e.split(":")[0];return r===e&&(r="default"),t[r]}let zo=!1;const Io={};function jo(t,n,o,a=eo,i=void 0,s=void 0,l=void 0,u=void 0){if("string"==typeof n&&(n=JSON.parse(n)),n.schema)for(const e in n.schema){const t=n.schema[e];"default"in t&&(Rn[e]=t.default)}if(8!=n.version)throw new Error("glStyle version 8 required.");Io[function(e,t){return Kn(e)+"."+P(t)}(n,t)]=Array.from(arguments);const p={};("string"==typeof s||s instanceof Request||s instanceof Response||s instanceof Promise)&&(s={default:s});for(const e in s){const r=s[e];f(()=>r).then(async r=>{let n;if("undefined"!=typeof Image){const o=new Image;if("string"==typeof r)o.crossOrigin="anonymous",o.src=r;else{let e;r instanceof Request?e=await fetch(r):r instanceof Response&&(e=r);const t=await e.blob();n=URL.createObjectURL(t),o.src=n}o.addEventListener("load",function r(){o.removeEventListener("load",r),p[e]={image:o,size:[o.width,o.height]},t.changed(),n&&URL.revokeObjectURL(n)}),o.addEventListener("error",function e(){URL.revokeObjectURL(n),o.removeEventListener("error",e)})}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){const t=self;t.postMessage({action:"loadImage",src:r}),t.addEventListener("message",function(t){"imageLoaded"===t.data.action&&t.data.src===r&&(p[e]={image:t.data.image,size:[t.data.image.width,t.data.image.height]})})}})}const x=function(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]=te(e[r],t[e[r].ref]));return e}(n.layers),w={},k=[],S={},M={},z=function(e){let t=Jn[e.id];return t||(t={},Jn[Kn(e)]=t),t}(n),I=function(e){let t=Xn[e.id];return t||(t={},Xn[Kn(e)]=t),t}(n);let j;for(let e=0,t=x.length;e<t;++e){const t=x[e],r=t.id;if("string"==typeof o&&t.source==o||Array.isArray(o)&&-1!==o.indexOf(r)){const o=t["source-layer"];if(j){if(t.source!==j)throw new Error(`Layer "${r}" does not use source "${j}`)}else{j=t.source;const e=n.sources[j];if(!e)throw new Error(`Source "${j}" is not defined`);const r=e.type;if("vector"!==r&&"geojson"!==r)throw new Error(`Source "${j}" is not of type "vector" or "geojson", but "${r}"`)}let a=w[o];a||(a=[],w[o]=a),a.push({layer:t,index:e}),k.push(r)}}const A=[],E=function(o,s,f){const x=t.getSource?.()?.format_?.layerName_??"mvt:layer",k=o.getProperties(),j=w[k[x]];if(!j)return;let E=a.indexOf(s);-1==E&&(E=function(e,t){let r=0;const n=t.length;for(;r<n;++r)if(t[r]<e&&r+1<n){const n=t[r]/t[r+1];return r+Math.log(t[r]/e)/Math.log(n)}return n-1}(s,a)),Gn.zoom=E,Gn.distanceFromCenter=0;const _=o.getGeometry(),P=fo[_.getType()],O=t.get("map");if(O&&O instanceof e&&1===P){const e=O.getSize();if(e){const t=O.getView().getCenter(),n=r(_.getExtent());Gn.distanceFromCenter=c(t,n)/s/e[1]}}const C={id:o.getId(),properties:k,type:P},T=t.get("mapbox-featurestate")[o.getId()];let $,q=-1;for(let e=0,r=j.length;e<r;++e){const r=j[e],a=r.layer,c=a.id;if(void 0!==f&&f!==c)continue;const x=a.layout||Wn,w=a.paint||Wn;if("none"===vo(a,"layout","visibility",C,z,T)||"minzoom"in a&&E<a.minzoom||"maxzoom"in a&&E>=a.maxzoom)continue;const _=a.filter;if(!_||xo(c,_,C,I)){let e,c,f,I,j,E;$=a;const _=r.index;if(3==P&&("fill"==a.type||"fill-extrusion"==a.type))if(c=vo(a,"paint",a.type+"-opacity",C,z,T),a.type+"-pattern"in w){const e=vo(a,"paint",a.type+"-pattern",C,z,T);if(e){const t="string"==typeof e?So(e,k):e.toString(),r=Mo(t,p);if(i&&i[t]&&r){++q,E=A[q],E&&E.getFill()&&!E.getStroke()&&!E.getText()||(E=new v({fill:new y}),A[q]=E),f=E.getFill(),E.setZIndex(_);const e=t+"."+c;let n=M[e];if(!n){const o=i[t],a=to(o.width,o.height),s=a.getContext("2d");s.globalAlpha=c,s.drawImage(r.image,o.x,o.y,o.width,o.height,0,0,o.width,o.height),n=s.createPattern(a,"repeat"),M[e]=n}f.setColor(n)}}}else if(e=wo(vo(a,"paint",a.type+"-color",C,z,T),c),a.type+"-outline-color"in w&&(j=wo(vo(a,"paint",a.type+"-outline-color",C,z,T),c)),j||(j=e),e||j){if(++q,E=A[q],(!E||e&&!E.getFill()||!e&&E.getFill()||j&&!E.getStroke()||!j&&E.getStroke()||E.getText())&&(E=new v({fill:e?new y:void 0,stroke:j?new g:void 0}),A[q]=E),e&&(f=E.getFill(),f.setColor(e)),"fill-extrusion"===a.type){const e=vo(a,"paint","fill-extrusion-height",C,z,T);if(e>0){const t=Math.max(.1,.9-Math.min(e,225)/280);if(j&&"transparent"!==j){const e=Ye.parse(j);j=`rgba(${Math.round(255*e.r*t)},${Math.round(255*e.g*t)},${Math.round(255*e.b*t)},${e.a})`}}}j&&(I=E.getStroke(),I.setColor(j),I.setWidth(.5)),E.setZIndex(_)}if(1!=P&&"line"==a.type){e="line-pattern"in w?void 0:wo(vo(a,"paint","line-color",C,z,T),vo(a,"paint","line-opacity",C,z,T));const t=vo(a,"paint","line-width",C,z,T);e&&t>0&&(++q,E=A[q],E&&E.getStroke()&&!E.getFill()&&!E.getText()||(E=new v({stroke:new g}),A[q]=E),I=E.getStroke(),I.setLineCap(vo(a,"layout","line-cap",C,z,T)),I.setLineJoin(vo(a,"layout","line-join",C,z,T)),I.setMiterLimit(vo(a,"layout","line-miter-limit",C,z,T)),I.setColor(e),I.setWidth(t),I.setLineDash(w["line-dasharray"]?vo(a,"paint","line-dasharray",C,z,T).map(function(e){return e*t}):null),"function"==typeof I.setOffset&&I.setOffset(vo(a,"paint","line-offset",C,z,T)),E.setZIndex(_))}let O,D,F,N,L,R,G,U,B,H=!1,Z=null,V=0;if((1==P||2==P)&&"icon-image"in x){const e=vo(a,"layout","icon-image",C,z,T);if(e){let r;O="string"==typeof e?So(e,k):e.toString();const n=u?u(t,O):void 0,l=Mo(O,p);if(i&&i[O]&&l||n){const e=vo(a,"layout","icon-rotation-alignment",C,z,T);if(2==P){const t=o.getGeometry();if(t.getFlatMidpoint||t.getFlatMidpoints){const n=t.getExtent();if(Math.sqrt(Math.max(Math.pow((n[2]-n[0])/s,2),Math.pow((n[3]-n[1])/s,2)))>150){const n="MultiLineString"===t.getType()?t.getFlatMidpoints():t.getFlatMidpoint();go||(ho=[NaN,NaN],go=new d("Point",ho,[],2,{},void 0)),r=go,ho[0]=n[0],ho[1]=n[1];if("line"===vo(a,"layout","symbol-placement",C,z,T)&&"map"===e){const e=t.getStride(),r=t.getFlatCoordinates();for(let t=0,o=r.length-e;t<o;t+=e){const o=r[t],a=r[t+1],i=r[t+e],s=r[t+e+1],l=Math.min(o,i),u=Math.max(o,i),p=n[0],c=(s-a)*(p-o)-(i-o)*(n[1]-a);if(Math.abs(c)<.001&&p<=u&&p>=l){V=Math.atan2(a-s,i-o);break}}}}}}if(2!==P||r){const t=vo(a,"layout","icon-size",C,z,T),o=void 0!==w["icon-color"]?vo(a,"paint","icon-color",C,z,T):null;if(!o||0!==o.a){const r=vo(a,"paint","icon-halo-color",C,z,T),s=vo(a,"paint","icon-halo-width",C,z,T);let u=`${O}.${t}.${s}.${r}`;if(null!==o&&(u+=`.${o}`),D=S[u],!D){const p=bo(a,C,"icon",z);let c;"icon-offset"in x&&(c=vo(a,"layout","icon-offset",C,z,T).slice(0),c[0]*=t,c[1]*=-t);let f=o?[255*o.r,255*o.g,255*o.b,o.a]:void 0;if(n){const r={color:f,rotateWithView:"map"===e,displacement:c,declutterMode:p,scale:t};"string"==typeof n?r.src=n:(r.img=n,r.imgSize=[n.width,n.height]),D=new h(r)}else{const n=i[O];let a,u,d;if(s)n.sdf?(a=ro(oo(l.image,n,o||[0,0,0,1]),{x:0,y:0,width:n.width,height:n.height,pixelRatio:n.pixelRatio},s,r),f=void 0):a=ro(l.image,n,s,r);else{if(n.sdf&&!l.unSDFed){const e=oo(l.image,{x:0,y:0,width:l.size[0],height:l.size[1]},{r:1,g:1,b:1});l.image=e,l.unSDFed=!0}a=l.image,u=[n.width,n.height],d=[n.x,n.y]}D=new h({color:f,img:a,imgSize:l.size,size:u,offset:d,rotateWithView:"map"===e,scale:t/n.pixelRatio,displacement:c,declutterMode:p})}S[u]=D}}D&&(++q,E=A[q],E&&E.getImage()&&!E.getFill()&&!E.getStroke()||(E=new v,A[q]=E),E.setGeometry(r),D.setRotation(V+Qn(vo(a,"layout","icon-rotate",C,z,T))),D.setOpacity(vo(a,"paint","icon-opacity",C,z,T)),D.setAnchor(mo[vo(a,"layout","icon-anchor",C,z,T)]),E.setImage(D),Z=E.getText(),E.setText(void 0),E.setZIndex(_),H=!0,F=!1)}else F=!0}}}if(1==P&&"circle"===a.type){++q,E=A[q],E&&E.getImage()&&!E.getFill()&&!E.getStroke()||(E=new v,A[q]=E);const e="circle-radius"in w?vo(a,"paint","circle-radius",C,z,T):5,t=wo(vo(a,"paint","circle-stroke-color",C,z,T),vo(a,"paint","circle-stroke-opacity",C,z,T)),r=vo(a,"paint","circle-translate",C,z,T),n=wo(vo(a,"paint","circle-color",C,z,T),vo(a,"paint","circle-opacity",C,z,T)),o=vo(a,"paint","circle-stroke-width",C,z,T),i=e+"."+t+"."+n+"."+o+"."+r[0]+"."+r[1];D=S[i],D||(D=new m({radius:e,displacement:[r[0],-r[1]],stroke:t&&o>0?new g({width:o,color:t}):void 0,fill:n?new y({color:n}):void 0,declutterMode:"none"}),S[i]=D),E.setImage(D),Z=E.getText(),E.setText(void 0),E.setGeometry(void 0),E.setZIndex(_),H=!0}if("text-field"in x){G=Math.round(vo(a,"layout","text-size",C,z,T));const e=vo(a,"layout","text-font",C,z,T);R=vo(a,"layout","text-line-height",C,z,T),L=Vn(l?l(e,n.metadata?n.metadata["ol:webfonts"]:void 0):e,G,R),L.includes("sans-serif")||(L+=",sans-serif"),U=vo(a,"layout","text-letter-spacing",C,z,T),B=vo(a,"layout","text-max-width",C,z,T);const t=vo(a,"layout","text-field",C,z,T);N="object"==typeof t&&t.sections?1===t.sections.length?t.toString():t.sections.reduce((t,r,n)=>{const o=r.fontStack?r.fontStack.split(","):e,a=Vn(l?l(o):o,G*(r.scale||1),R);let i=r.text;if("\n"===i)return t.push("\n",""),t;if(2==P)return t.push(io(i,U),a),t;i=co(i,a,B,U).split("\n");for(let e=0,r=i.length;e<r;++e)e>0&&t.push("\n",""),t.push(i[e],a);return t},[]):So(t,k).trim(),c=vo(a,"paint","text-opacity",C,z,T)}if(N&&c&&!F){H||(++q,E=A[q],E&&E.getText()&&!E.getFill()&&!E.getStroke()||(E=new v,A[q]=E),E.setImage(void 0),E.setGeometry(void 0));const e=bo(a,C,"text",z);E.getText()||E.setText(Z),Z=E.getText(),(!Z||"getDeclutterMode"in Z&&Z.getDeclutterMode()!==e)&&(Z=new b({padding:[2,2,2,2],declutterMode:e}),E.setText(Z));const t=vo(a,"layout","text-transform",C,z,T);"uppercase"==t?N=Array.isArray(N)?N.map((e,t)=>t%2?e:e.toUpperCase()):N.toUpperCase():"lowercase"==t&&(N=Array.isArray(N)?N.map((e,t)=>t%2?e:e.toLowerCase()):N.toLowerCase());const r=Array.isArray(N)?N:2==P?io(N,U):co(N,L,B,U);if(Z.setText(r),Z.setFont(L),Z.setRotation(Qn(vo(a,"layout","text-rotate",C,z,T))),"function"==typeof Z.setKeepUpright){const e=vo(a,"layout","text-keep-upright",C,z,T);Z.setKeepUpright(e)}const n=vo(a,"layout","text-anchor",C,z,T),o=H||1==P?"point":vo(a,"layout","symbol-placement",C,z,T);let i;if("line-center"===o?(Z.setPlacement("line"),i="center"):Z.setPlacement(o),"line"===o&&"function"==typeof Z.setRepeat){const e=vo(a,"layout","symbol-spacing",C,z,T);Z.setRepeat(2*e)}Z.setOverflow("point"===o);let s=vo(a,"paint","text-halo-width",C,z,T);const l=vo(a,"layout","text-offset",C,z,T),u=vo(a,"paint","text-translate",C,z,T);let p=0,f=0;if("point"==o){i="center",-1!==n.indexOf("left")?(i="left",f=s):-1!==n.indexOf("right")&&(i="right",f=-s);const e=vo(a,"layout","text-rotation-alignment",C,z,T);Z.setRotateWithView("map"==e)}else Z.setMaxAngle(Qn(vo(a,"layout","text-max-angle",C,z,T))*N.length/r.length),Z.setRotateWithView(!1);Z.setTextAlign(i);let d="middle";0==n.indexOf("bottom")?(d="bottom",p=-s-.5*(R-1)*G):0==n.indexOf("top")&&(d="top",p=s+.5*(R-1)*G),Z.setTextBaseline(d);const m=vo(a,"layout","text-justify",C,z,T);Z.setJustify("auto"===m?void 0:m),Z.setOffsetX(l[0]*G+f+u[0]),Z.setOffsetY(l[1]*G+p+u[1]);const h=Z.getFill()||new y;h.setColor(wo(vo(a,"paint","text-color",C,z,T),c)),Z.setFill(h);const x=wo(vo(a,"paint","text-halo-color",C,z,T),c);if(x&&s>0){const e=Z.getStroke()||new g;e.setColor(x),s*=2;const t=.5*G;e.setWidth(s<=t?s:t),Z.setStroke(e)}else Z.setStroke(void 0);const w=vo(a,"layout","text-padding",C,z,T),k=Z.getPadding();w!==k[0]&&(k[0]=w,k[1]=w,k[2]=w,k[3]=w),E.setZIndex(_)}}}return q>-1?(A.length=q+1,zo&&("set"in o?o.set("mapbox-layer",$):o.getProperties()["mapbox-layer"]=$),A):void 0};return t.setStyle(E),t.set("mapbox-layers",k),t.set("mapbox-source",j),t.set("mapbox-featurestate",t.get("mapbox-featurestate")||{}),E}function Ao(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Eo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ao(Object(r),!0).forEach(function(t){M(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ao(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}Ye.parse("#000000"),Ye.parse("#FFFFFF"),Ye.parse("#000000"),function(e=!1){zo=e}(!0);var _o="EPSG:27700",Po=new Set(["vector","raster","wms","ogc-vt"]);function Oo(e,t,r){var n=r&&r(e,t)||{};return fetch(n.url||e,{headers:n.headers||{}})}var Co=e=>(t,r)=>{var n=e(r,"Tile")||{},o=n.url||r,a=n.headers||{};fetch(o,{headers:a}).then(e=>e.blob()).then(e=>{t.getImage().src=URL.createObjectURL(e)}).catch(()=>t.setState(A.ERROR))};function To(e){return new p(Eo({resolutions:G,origin:B,tileSize:256},e&&{extent:e}))}function $o(e,t){return qo.apply(this,arguments)}function qo(){return qo=x(function*(e,t){if(e.type&&!Po.has(e.type))throw new Error("Unsupported map style type: '".concat(e.type,"'"));if("wms"===e.type){var r=function(e,t,r){var n=To();return new I({url:e,params:t,projection:_o,tileGrid:n,tileLoadFunction:r?Co(r):void 0})}(e.url,e.params||{},t);return{layer:new a({source:r}),source:r}}if("raster"===e.type){var n=function(e,t,r){var n=To(r);return new z({projection:_o,tileGrid:n,tileUrlFunction:t=>{var[r,n,o]=t;return e.replace("{z}",r).replace("{x}",n).replace("{y}",o)},tileLoadFunction:t?Co(t):void 0})}(e.url,t,e.extent);return{layer:new a({source:n}),source:n}}return"ogc-vt"===e.type?function(e,t){return No.apply(this,arguments)}(e.url,t,e):function(e,t){return Fo.apply(this,arguments)}(e.url,t,e)}),qo.apply(this,arguments)}function Do(e,t){var r=e.indexOf("?"),[n,o]=r>=0?[e.slice(0,r),e.slice(r)]:[e,""],a="".concat(n,".json").concat(o),i="".concat(n,".png").concat(o);return{jsonUrl:a,pngUrl:i,fetch:()=>Oo(a,"SpriteJSON",t).then(e=>e.json())}}function Fo(){return Fo=x(function*(e,t){var{renderMode:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=yield Oo(e,"Style",t).then(e=>e.json()),a=Object.keys(n.sources)[0],i=n.sources[a].url,l=yield Oo(i,"Source",t).then(e=>e.json()),c=[l.fullExtent.xmin,l.fullExtent.ymin,l.fullExtent.xmax,l.fullExtent.ymax],f=[l.tileInfo.origin.x,l.tileInfo.origin.y],d=l.tileInfo.lods.map(e=>e.resolution).slice(0,16),m=l.tileInfo.rows,y=l.tiles[0],h=Do(n.sprite,t),g=yield h.fetch();!function(e){e.layers.forEach(e=>{var t;null!==(t=e.paint)&&void 0!==t&&t["icon-color"]&&(e.paint["icon-color"]=e.paint["icon-color"].replace(",0)",",1)"))})}(n);var v=new p({extent:c,origin:f,resolutions:d,tileSize:m}),b=new u({format:new o,url:y,projection:_o,tileGrid:v}),x=new s(Eo({source:b,declutter:!0},r&&{renderMode:r}));return x.set("layerType","vectorTile"),jo(x,n,a,d,g,h.pngUrl),{layer:x,source:b}}),Fo.apply(this,arguments)}function No(){return No=x(function*(e,t){var r,{renderMode:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=yield Oo(e,"Style",t).then(e=>e.json()),i=Object.keys(a.sources)[0],l=a.sources[i].url,u=Do(a.sprite,t),c=null===(r=(yield Oo(l,"Source",t).then(e=>e.json())).links)||void 0===r?void 0:r.find(e=>"http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme"===e.rel),[f,d]=yield Promise.all([Oo(c.href,"Source",t).then(e=>e.json()),u.fetch()]),m=f.tileMatrices.map(e=>e.cellSize),y=f.tileMatrices[0].pointOfOrigin,h=[f.tileMatrices[0].tileHeight,f.tileMatrices[0].tileWidth],g=new o;g.supportedMediaTypes.push("application/octet-stream");var v=new p({resolutions:m,origin:y,tileSize:h}),b=new j({url:l,format:g,tileGrid:v,projection:_o}),x=new s(Eo({source:b,declutter:!0},n&&{renderMode:n}));return x.set("layerType","vectorTile"),jo(x,a,i,m,d,u.pngUrl),{layer:x,source:b}}),No.apply(this,arguments)}function Lo(e,t,r){if(null!==e)for(var n,o,a,i,s,l,u,p,c=0,f=0,d=e.type,m="FeatureCollection"===d,y="Feature"===d,h=m?e.features.length:1,g=0;g<h;g++){s=(p=!!(u=m?e.features[g].geometry:y?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var v=0;v<s;v++){var b=0,x=0;if(null!==(i=p?u.geometries[v]:u)){l=i.coordinates;var w=i.type;switch(c=0,w){case null:break;case"Point":if(!1===t(l,f,g,b,x))return!1;f++,b++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(!1===t(l[n],f,g,b,x))return!1;f++,"MultiPoint"===w&&b++}"LineString"===w&&b++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(o=0;o<l[n].length-c;o++){if(!1===t(l[n][o],f,g,b,x))return!1;f++}"MultiLineString"===w&&b++,"Polygon"===w&&x++}"Polygon"===w&&b++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(x=0,o=0;o<l[n].length;o++){for(a=0;a<l[n][o].length-c;a++){if(!1===t(l[n][o][a],f,g,b,x))return!1;f++}x++}b++}break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===Lo(i.geometries[n],t))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var Ro=function(e,t={}){if(null!=e.bbox&&!0!==t.recompute)return e.bbox;const r=[1/0,1/0,-1/0,-1/0];return Lo(e,e=>{r[0]>e[0]&&(r[0]=e[0]),r[1]>e[1]&&(r[1]=e[1]),r[2]<e[0]&&(r[2]=e[0]),r[3]<e[1]&&(r[3]=e[1])}),r},Go=e=>{var t=e/1609.344;if(t<.5){var r=Math.round(e),n=1===r?"metre":"metres";return"".concat(r," ").concat(n)}if(t<10){var o=Number.parseFloat(t.toFixed(1)),a=1===o?"mile":"miles";return"".concat(o," ").concat(a)}var i=Math.round(t);return"".concat(i," miles")},Uo=e=>Ro(e),Bo="EPSG:27700",Ho=new n({dataProjection:Bo,featureProjection:Bo}),Zo=(e,t,r)=>{for(var n=[],o=t;o<r;o+=2)n.push([e[o],e[o+1]]);return n},Vo=e=>{var t=e.getType(),r=e.getFlatCoordinates();if("Point"===t)return{type:"Point",coordinates:[r[0],r[1]]};if("LineString"===t)return{type:"LineString",coordinates:Zo(r,0,r.length)};if("Polygon"===t){var n=e.getEnds(),o=0;return{type:"Polygon",coordinates:n.map(e=>{var t=Zo(r,o,e);return o=e,t})}}if("MultiPolygon"===t){var a=e.getEndss(),i=0,s=a.map(e=>{var t=i,n=e.map(e=>{var n=Zo(r,t,e);return t=e,n});return i=e[e.length-1],n});return{type:"MultiPolygon",coordinates:s}}return{type:t,coordinates:Zo(r,0,r.length)}},Wo=(e,t,r,n)=>{var o=[];return e.getLayers().forEach(e=>{if("vectorTile"===e.get("layerType")){var a=e.getSource(),i=null==a?void 0:a.sourceTiles_;i&&Object.values(i).forEach(a=>{a.getState()===A.LOADED&&a.getFeatures().forEach(a=>{var i,s;if((null!==(i=null===(s=a.get("mapbox-layer"))||void 0===s?void 0:s.id)&&void 0!==i?i:e.get("layerId"))===t){var l=n?a.get(n):a.getId();String(l)===String(r)&&o.push((e=>e.getGeometry?Ho.writeGeometryObject(e.getGeometry()):Vo(e))(a))}})})}}),o};function Jo(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Xo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Jo(Object(r),!0).forEach(function(t){M(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Jo(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var Yo="EPSG:27700",Ko=new n({dataProjection:Yo,featureProjection:Yo}),Qo="_highlight",ea=999,ta=(e,t)=>{if(!e)return[];var{stroke:r,selectionStroke:n,fill:o,strokeWidth:a,activeStrokeWidth:i}=e;if(t)return[new v({stroke:new g({color:r,width:i}),zIndex:ea}),new v({stroke:new g({color:n,width:a}),zIndex:1e3})];var s=[new v({stroke:new g({color:n,width:a}),zIndex:ea})];return o&&"transparent"!==o&&s.push(new v({fill:new y({color:o}),zIndex:ea})),s},ra=(e,t,r)=>{if(!(null!=(n=e)&&n.symbol||null!=n&&n.symbolSvgContent))return null;var n,o=t?e.symbolActiveImageId:e.symbolSelectedImageId,a=o&&(null==r?void 0:r.getImage(o));if(!a||!e.symbolImageAnchor)return null;var i=1/(e.symbolPixelRatio||1);return[new v({image:new h({img:a,anchor:e.symbolImageAnchor,scale:i}),zIndex:ea})]},na=e=>{var t=new Set,r={};for(var{layerId:n,featureId:o,idProperty:a}of null!=e?e:[])t.add("".concat(n,":").concat(o)),a&&(r[n]=a);return{keys:t,idProps:r}},oa=(e,t)=>e.getLayers().getArray().find(e=>"vector"===e.get("layerType")&&!e.get(Qo)&&e.get("layerId")===t),aa=(e,t,r)=>{var n;if(null!=r){var o=null===(n=oa(e,t))||void 0===n||null===(n=n.getSource())||void 0===n?void 0:n.getFeatureById(String(r));return null==o?void 0:o.getProperties()}},ia=(e,t,r,n)=>{var o,a=null===(o=oa(e,t))||void 0===o?void 0:o.get("symbolMeta");if(!a||!n)return null;var i=r?n.getActiveImageId(a.imageId):n.getSelectedImageId(a.imageId),s=i&&n.getImage(i);return s?[new v({image:new h({img:s,anchor:a.anchor,scale:1/a.pixelRatio}),zIndex:ea})]:null},sa=(e,t,r,n,o,a)=>{for(var{layerId:i,featureId:s,geometry:l}of null!=r?r:[]){var u,p;if(l){var c=aa(e,i,s),f=null!==(u=null!==(p=ra(c,n,a))&&void 0!==p?p:ia(e,i,n,a))&&void 0!==u?u:ta(null==o?void 0:o[i],n);if(f.length){var d=new O({geometry:Ko.readGeometry(l)});d.setStyle(f),t.addFeature(d)}}}},la=(e,t)=>{var{type:r,coordinates:n}=e,o=e=>{var[r,n]=e;return t(r,n)},a=e=>e.forEach(o);"Point"===r?o(n):"MultiPoint"===r||"LineString"===r?n.forEach(o):"MultiLineString"===r||"Polygon"===r?n.forEach(a):"MultiPolygon"===r&&n.forEach(e=>e.forEach(a))},ua=(e,t,r,n,o)=>{if(!e)return null;var a=new Set;e.getLayers().forEach(e=>{if("vector"===e.get("layerType")&&!e.get(Qo)){var t=e.get("layerId");t&&a.add(t)}});var{keys:s,idProps:u}=na(t),{keys:p,idProps:c}=na(r),f=Xo(Xo({},u),c);((e,t,r,n,o)=>{e.getLayers().forEach(e=>{if("vectorTile"===e.get("layerType"))if(t.size>0||r.size>0){e._highlightOriginalStyle&&e.getStyleFunction()===e._highlightWrappedStyle||(e._highlightOriginalStyle=e.getStyleFunction());var a=e._highlightOriginalStyle,i=(i,s)=>{var l,u,p=a(i,s),c=null!==(l=null===(u=i.get("mapbox-layer"))||void 0===u?void 0:u.id)&&void 0!==l?l:e.get("layerId");if(!c)return p;var f=n[c],d=f?i.get(f):i.getId(),m="".concat(c,":").concat(d),y=r.has(m),h=!y&&t.has(m);if(!y&&!h)return p;var g,v=ta(null==o?void 0:o[c],y);return v.length?[...(g=p,g?Array.isArray(g)?g:[g]:[]),...v]:p};e._highlightWrappedStyle=i,e.setStyle(i)}else e._highlightOriginalStyle&&(e.setStyle(e._highlightOriginalStyle),delete e._highlightOriginalStyle)})})(e,s,p,f,n);var d=(e=>{var t=e.getLayers().getArray().find(e=>e.get(Qo));return t||((t=new i({source:new l,zIndex:1001})).set(Qo,!0),t.set("layerType","vector"),e.addLayer(t)),t})(e),m=d.getSource();m.clear();var y=(null!=t?t:[]).filter(e=>a.has(e.layerId)),h=(null!=r?r:[]).filter(e=>a.has(e.layerId));sa(e,m,h,!0,n,o),sa(e,m,y,!1,n,o);var g=(null!=t?t:[]).flatMap(t=>((e,t)=>{var{layerId:r,featureId:n,idProperty:o,geometry:a}=t;if(null!=n){var i=Wo(e,r,n,o);if(i.length>0)return i}return a?[a]:[]})(e,t));return(e=>{if(!e.length)return null;var t=1/0,r=1/0,n=-1/0,o=-1/0;for(var a of e)la(a,(e,a)=>{e<t&&(t=e),a<r&&(r=a),e>n&&(n=e),a>o&&(o=a)});return t===1/0?null:[t,r,n,o]})(g)};class pa{constructor(){M(this,"sets",new Map)}add(e,t){var r,n=null!==(r=this.sets.get(e))&&void 0!==r?r:new Set;this.sets.delete(e),this.sets.set(e,n),t.forEach(e=>n.add(e));for(var o=new Set;this.sets.size>2;){var[a,i]=this.sets.entries().next().value;this.sets.delete(a),i.forEach(e=>o.add(e))}return this.sets.forEach(e=>e.forEach(e=>o.delete(e))),Array.from(o)}}class ca{constructor(){M(this,"images",new Map),M(this,"dataUris",new Map),M(this,"activeImageIds",new Map),M(this,"selectedImageIds",new Map),M(this,"recentImageSets",new pa)}getImage(e){return this.images.get(e)}getDataUri(e){return this.dataUris.get(e)}getActiveImageId(e){var t;return null!==(t=this.activeImageIds.get(e))&&void 0!==t?t:null}getSelectedImageId(e){var t;return null!==(t=this.selectedImageIds.get(e))&&void 0!==t?t:null}addImage(e,t,r){var n=document.createElement("canvas");if(n.width=t.width,n.height=t.height,n.getContext("2d").putImageData(t,0,0),this.images.set(e,n),r){var o=n.toDataURL();this.dataUris.set(e,o),T.set(o,null,new C(n,o,void 0,$.LOADED,null))}}removeImage(e){var t=this.dataUris.get(e);this.dataUris.delete(e),t&&!Array.from(this.dataUris.values()).includes(t)&&T.set(t,null,new C(void 0,t,void 0,$.IDLE,null)),this.images.delete(e),this.activeImageIds.delete(e),this.selectedImageIds.delete(e)}registerSymbol(e,t,r,n){var o=this;return x(function*(){var a=r.getSymbolImageIds(e,t,n);return a?(o.activeImageIds.set(a.normal,a.active),o.selectedImageIds.set(a.normal,a.selected),yield Promise.all(Object.entries(a).map(function(){var a=x(function*(a){var[i,s]=a;if(!o.images.has(s)){var l=yield r.rasteriseSymbolImage(e,t,i,n);l&&!o.images.has(l.imageId)&&o.addImage(l.imageId,l.imageData,"normal"===i)}});return function(e){return a.apply(this,arguments)}}())),Object.values(a)):[]})()}registerSymbols(e,t,r,n){var o=this;return x(function*(){var a=yield Promise.all(e.map(e=>o.registerSymbol(e,t,r,n)));o.recentImageSets.add("".concat(null==t?void 0:t.id,"|").concat(n),a.flat()).forEach(e=>o.removeImage(e))})()}}class fa{constructor(){M(this,"fills",new Map),M(this,"recentImageSets",new pa)}getFill(e){return this.fills.get(e)}addFill(e,t){var r=document.createElement("canvas");r.width=t.width,r.height=t.height,r.getContext("2d").putImageData(t,0,0);var n=document.createElement("canvas").getContext("2d").createPattern(r,"repeat");this.fills.set(e,new y({color:n}))}registerPatterns(e,t,r,n){var o=this;return x(function*(){var a=new Map;e.forEach(e=>{var o=r.getPatternImageId(e,t,n);o&&!a.has(o)&&a.set(o,e)}),yield Promise.all(Array.from(a,function(){var e=x(function*(e){var[a,i]=e;if(!o.fills.has(a)){var s=yield r.rasterisePatternImage(i,t,n);s&&!o.fills.has(s.imageId)&&o.addFill(s.imageId,s.imageData)}});return function(t){return e.apply(this,arguments)}}())),o.recentImageSets.add("".concat(t,"|").concat(n),Array.from(a.keys())).forEach(e=>o.fills.delete(e))})()}}var da=e=>{if(!e)return null;var t=q(e,F,N()),r=D();return e=>{var n,o,a;return r.properties=e.getProperties(),r.featureId=null!==(n=e.getId())&&void 0!==n?n:null,r.geometryType=null!==(o=null===(a=e.getGeometry())||void 0===a?void 0:a.getType())&&void 0!==o?o:"",Boolean(t(r))}};function ma(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}var ya="EPSG:27700",ha=new n({dataProjection:ya,featureProjection:ya}),ga=e=>{var t=e.getId();if(null!=t)return t;var r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ma(Object(r),!0).forEach(function(t){M(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ma(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({},e.getProperties());return delete r["mapbox-layer"],JSON.stringify(r)},va=(e,t,r,n)=>{if(r){var o="".concat(r,":").concat(ga(n));t.has(o)||(t.add(o),e.push({id:n.getId(),layer:{id:r},geometry:ha.writeGeometryObject(n.getGeometry()),properties:n.getProperties()}))}},ba=(e,t,r,n)=>{var o=null==r?void 0:r.id;if(o&&"background"!==(null==r?void 0:r.type)){var a="".concat(o,":").concat(ga(n));t.has(a)||(t.add(a),e.push({id:n.getId(),layer:{id:o},geometry:Vo(n),properties:n.getProperties()}))}},xa=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!t)return[];var{radius:n=10}=r,o=[t.x,t.y],a=[],i=new Set;return e.forEachFeatureAtPixel(o,(e,t)=>{"vectorTile"===t.get("layerType")?((e,t,r,n)=>{var o=n.get("mapbox-layer");o?ba(e,t,o,n):va(e,t,r.get("layerId"),n)})(a,i,t,e):"vector"!==t.get("layerType")||t.get("_highlight")||va(a,i,t.get("layerId"),e)},{hitTolerance:n}),a},wa=(e,t,r)=>{var n=e.getViewport();if(r&&e.un("pointermove",r),null==t||!t.length)return n.style.cursor="",null;var o=new Set(t),a=null,i=t=>{var r;if("mouse"===(null===(r=t.originalEvent)||void 0===r?void 0:r.pointerType)){var i=t.pixel;null!==a&&cancelAnimationFrame(a),a=requestAnimationFrame(()=>{a=null;var t=e.forEachFeatureAtPixel(i,(e,t)=>((e,t,r)=>{if("vectorTile"===t.get("layerType")){var n,o,a=null!==(n=null===(o=e.get("mapbox-layer"))||void 0===o?void 0:o.id)&&void 0!==n?n:t.get("layerId");return Boolean(a&&r.has(a))}if("vector"===t.get("layerType")&&!t.get("_highlight")){var i=t.get("layerId");return Boolean(i&&r.has(i))}return!1})(e,t,o),{hitTolerance:8});n.style.cursor=t?"pointer":""})}};return e.on("pointermove",i),i};function ka(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Sa(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ka(Object(r),!0).forEach(function(t){M(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ka(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}(()=>{if("undefined"!=typeof HTMLCanvasElement){var e=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(t,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),a=2;a<n;a++)o[a-2]=arguments[a];return e.call(this,t,"2d"===t?Sa(Sa({},r),{},{willReadFrequently:!0}):r,...o)}}})();var Ma=R,za=e=>{if(e){var{top:t=0,right:r=0,bottom:n=0,left:o=0}=e;return[t,r,n,o]}};class Ia extends L{constructor(e){var{mapProviderConfig:t={},events:r,eventBus:n}=e;super(),this.events=r,this.eventBus=n,this.capabilities={supportedShortcuts:V,supportsMapSizes:!0},this.symbolImages=new ca,this.patternImages=new fa,Object.assign(this,t)}get name(){return"OpenLayersProvider"}isBaseMapReady(){return Boolean(this.map)}initMap(n){var o=this;return x(function*(){var a,{container:i,padding:s,mapStyle:l,mapSize:u,center:p,zoom:c,bounds:f,minZoom:d,maxZoom:m,transformRequest:y,pixelRatio:h}=n;o.mapStyleId=null==l?void 0:l.id,o.mapSize=u;var{events:g,eventBus:v}=o,{layer:b,source:k}=yield $o(l,y),S=(null!==(a=o.zoomAlignment)&&void 0!==a?a:W)===J?{resolutions:U,defaultMinZoom:6,maxZoom:20}:{resolutions:G,defaultMinZoom:0,maxZoom:G.length-1},M=new t({projection:Ma,center:null!=p?p:f?r(f):void 0,zoom:null!=c?c:S.defaultMinZoom,minZoom:null!=d?d:S.defaultMinZoom,maxZoom:null!=m?m:S.maxZoom,resolutions:S.resolutions,constrainResolution:!1,padding:za(s)}),z=new e({target:i,layers:[b],view:M,controls:[],interactions:w({doubleClickZoom:!1}),pixelRatio:h});f&&z.once("rendercomplete",()=>{M.fit(f,{size:z.getSize(),duration:0})}),o.mapEventHandles=K({map:z,source:k,events:g,eventBus:v,getZoom:o.getZoom.bind(o),getCenter:o.getCenter.bind(o),getBounds:o.getBounds.bind(o),getResolution:o.getResolution.bind(o)}),o.appEventHandles=function(e){var{mapProvider:t,transformRequest:r,events:n,eventBus:o,map:a,onBaseSourceChange:i}=e,s=function(){var e=x(function*(e){var{layer:s,source:l}=yield $o(e,r);a.getLayers().setAt(0,s),i(l),o.emit(n.MAP_STYLE_CHANGE,{mapStyleId:e.id}),t.reapplyHighlights()});return function(t){return e.apply(this,arguments)}}(),l=e=>{a.setPixelRatio(e)},u=e=>{var{mapSize:r}=e;t.mapSize=r};return o.on(n.MAP_SET_STYLE,s),o.on(n.MAP_SET_PIXEL_RATIO,l),o.on(n.MAP_SIZE_CHANGE,u),{remove(){o.off(n.MAP_SET_STYLE,s),o.off(n.MAP_SET_PIXEL_RATIO,l),o.off(n.MAP_SIZE_CHANGE,u)}}}({mapProvider:o,transformRequest:y,events:g,eventBus:v,map:z,onBaseSourceChange:o.mapEventHandles.setSource})||[],o.map=z,o.view=M,v.emit(g.MAP_READY,{map:o.map,mapStyleId:o.mapStyleId,mapSize:o.mapSize,crs:o.crs})})()}destroyMap(){var e,t;null===(e=this.mapEventHandles)||void 0===e||e.remove(),null===(t=this.appEventHandles)||void 0===t||t.remove(),this.mapEventHandles=null,this.appEventHandles=null,this.map&&(this._onHoverMove&&(this.map.un("pointermove",this._onHoverMove),this._onHoverMove=null),this.map.setTarget(null),this.map=null),this.view=null}setView(e){var{center:t,zoom:r}=e;this.view.animate({center:null!=t?t:this.view.getCenter(),zoom:null!=r?r:this.view.getZoom(),duration:H})}zoomIn(e){this.view.animate({zoom:this.view.getZoom()+e,duration:H})}zoomOut(e){this.view.animate({zoom:this.view.getZoom()-e,duration:H})}panBy(e){var t=this.view.getCenter(),r=this.view.getResolution();this.view.animate({center:[t[0]+e[0]*r,t[1]-e[1]*r],duration:H})}fitToBounds(e){var t=Array.isArray(e)?e:Uo(e);this.view.fit(t,{duration:H})}setPadding(e){this.view.padding=za(e)}getCenter(){var e=this.view.getCenter(),t=Z;return[Math.round(e[0]*Math.pow(10,t))/Math.pow(10,t),Math.round(e[1]*Math.pow(10,t))/Math.pow(10,t)]}getZoom(){return this.view.getZoom()}getBounds(){return this.view.calculateExtent(this.map.getSize()).map(e=>Math.round(100*e)/100)}getFeaturesAtPoint(e,t){return xa(this.map,e,t)}getFeatureGeometry(e,t,r){var n=Wo(this.map,e,t,r);return 0===n.length?null:1===n.length?n[0]:{type:"MultiPolygon",coordinates:n.flatMap(e=>"MultiPolygon"===e.type?e.coordinates:[e.coordinates])}}setHoverCursor(e){this.map&&(this._onHoverMove=wa(this.map,e,this._onHoverMove))}getVisibleFeatures(e){return((e,t)=>{var r=new Set(t),n=[],o=new Set,a=e.getView().calculateExtent(e.getSize());return e.getLayers().forEach(e=>{if("vectorTile"===e.get("layerType")){var t,i=null===(t=e.getSource())||void 0===t?void 0:t.sourceTiles_;if(!i)return;var s=e.get("layerId"),l=da(e.get("filter"));Object.values(i).forEach(e=>{e.getState()===A.LOADED&&e.getFeatures().forEach(e=>{var t=e.get("mapbox-layer");t?r.has(t.id)&&ba(n,o,t,e):!r.has(s)||l&&!l(e)||va(n,o,s,e)})})}else if("vector"===e.get("layerType")){var u,p=e.get("layerId");if(!p||!r.has(p)||e.get("_highlight"))return;var c=da(e.get("filter"));null===(u=e.getSource())||void 0===u||u.getFeaturesInExtent(a).forEach(e=>{c&&!c(e)||va(n,o,p,e)})}}),n})(this.map,e)}updateHighlightedFeatures(e,t,r){return this._lastHighlightArgs={selectedFeatures:e,activeFeatures:t,stylesMap:r},ua(this.map,e,t,r,this.symbolImages)}reapplyHighlights(){if(this._lastHighlightArgs){var{selectedFeatures:e,activeFeatures:t,stylesMap:r}=this._lastHighlightArgs;ua(this.map,e,t,r,this.symbolImages)}}addSymbolsToMap(e,t,r){var n=arguments,o=this;return x(function*(){var a=n.length>3&&void 0!==n[3]?n[3]:o.map.getPixelRatio()||1;return o.symbolImages.registerSymbols(e,t,r,a)})()}getSymbolImage(e){return this.symbolImages.getImage(e)}getSymbolDataUri(e){return this.symbolImages.getDataUri(e)}addPatternsToMap(e,t,r){var n=arguments,o=this;return x(function*(){var a=n.length>3&&void 0!==n[3]?n[3]:o.map.getPixelRatio()||1;return o.patternImages.registerPatterns(e,t,r,a)})()}getPatternFill(e){return this.patternImages.getFill(e)}buildFilterEvaluator(e){return da(e)}getActiveSymbolImageId(e){return this.symbolImages.getActiveImageId(e)}getSelectedSymbolImageId(e){return this.symbolImages.getSelectedImageId(e)}getAreaDimensions(){return(e=>{if(!e)return"";var[t,r,n,o]=e,a=n-t;return"".concat(Go(o-r)," by ").concat(Go(a))})((e=>{var t=e.getSize(),r=e.getView().padding||[0,0,0,0],[n,o,a,i]=r,s=[i,t[1]-a],l=[t[0]-o,n],u=e.getCoordinateFromPixel(s),p=e.getCoordinateFromPixel(l);return u&&p?[u[0],u[1],p[0],p[1]]:null})(this.map))}getCardinalMove(e,t){return((e,t)=>{var r=t[0]-e[0],n=t[1]-e[1],o=[];return Math.abs(n)>1&&o.push("".concat(n>0?"north":"south"," ").concat(Go(Math.abs(n)))),Math.abs(r)>1&&o.push("".concat(r>0?"east":"west"," ").concat(Go(Math.abs(r)))),o.join(", ")})(e,t)}getResolution(){return this.view.getResolution()}mapToScreen(e){if(!this.map)return{x:0,y:0};var t=this.map.getPixelFromCoordinate(e);return t?{x:t[0],y:t[1]}:{x:0,y:0}}screenToMap(e){return this.map.getCoordinateFromPixel([e.x,e.y])}isGeometryObscured(e,t){return((e,t,r)=>{var n=r.getTargetElement().getBoundingClientRect();if(!n.width||!n.height)return!1;var o=r.getViewport().getBoundingClientRect(),a=o.width/n.width,i=o.height/n.height,[s,l,u,p]=Uo(e),c=[[s,l],[s,p],[u,l],[u,p]].map(e=>r.getPixelFromCoordinate(e)).filter(Boolean);if(!c.length)return!1;var f=n.left+Math.min(...c.map(e=>e[0]))*a,d=n.left+Math.max(...c.map(e=>e[0]))*a,m=n.top+Math.min(...c.map(e=>e[1]))*i,y=n.top+Math.max(...c.map(e=>e[1]))*i;return f<t.right&&d>t.left&&m<t.bottom&&y>t.top})(e,t,this.map)}}export{Ia as default};
1
+ import e from"ol/Map.js";import t from"ol/View.js";import{getCenter as r}from"ol/extent.js";import n from"ol/format/GeoJSON.js";import o from"ol/format/MVT.js";import"ol/has.js";import"ol/layer/Group.js";import"ol/layer/Layer.js";import a from"ol/layer/Tile.js";import i from"ol/layer/Vector.js";import s from"ol/layer/VectorTile.js";import"ol/loadingstrategy.js";import"ol/proj.js";import"ol/proj/Units.js";import"ol/source/Source.js";import"ol/source/TileJSON.js";import l from"ol/source/Vector.js";import u from"ol/source/VectorTile.js";import"ol/tilegrid.js";import p from"ol/tilegrid/TileGrid.js";import{distance as c}from"ol/coordinate.js";import{toPromise as f}from"ol/functions.js";import d from"ol/render/Feature.js";import m from"ol/style/Circle.js";import y from"ol/style/Fill.js";import h from"ol/style/Icon.js";import g from"ol/style/Stroke.js";import v from"ol/style/Style.js";import b from"ol/style/Text.js";import"ol/events/Event.js";import"ol/events/EventType.js";import{defaults as x}from"ol/interaction/defaults.js";import w from"proj4";import{register as k}from"ol/proj/proj4.js";import M from"ol/source/XYZ.js";import S from"ol/source/TileWMS.js";import z from"ol/source/OGCVectorTile.js";import I from"ol/TileState.js";import{fromString as A}from"ol/color.js";import"ol/layer/Image.js";import"ol/source/Raster.js";import{checkedFonts as _}from"ol/render/canvas.js";import{getUid as E}from"ol/util.js";import j from"ol/Feature.js";import $ from"ol/style/IconImage.js";import{shared as C}from"ol/style/IconImageCache.js";import P from"ol/ImageState.js";import{buildExpression as T,newEvaluationContext as q}from"ol/expr/cpu.js";import{BooleanType as F,newParsingContext as O}from"ol/expr/expression.js";class N{_notImplemented(e){throw new Error(`${this.name} must implement ${e}()`)}isBaseMapReady(){this._notImplemented("isBaseMapReady")}addSymbolsToMap(){this._notImplemented("addSymbolsToMap")}addPatternsToMap(){this._notImplemented("addPatternsToMap")}getActiveSymbolImageId(){this._notImplemented("getActiveSymbolImageId")}getSelectedSymbolImageId(){this._notImplemented("getSelectedSymbolImageId")}}const D="EPSG:27700";w.defs(D,"+proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +towgs84=446.448,-125.157,542.06,0.15,0.247,0.842,-20.489 +units=m +no_defs"),k(w);const L=[896,448,224,112,56,28,14,7,3.5,1.75,.875,.4375,.21875,.109375],R=[156543.03392800014,78271.51696400007,39135.758482000034,19567.879241000017,9783.939620500008,4891.969810250004,2445.984905125002,1222.992452562501,611.4962262812505,305.74811314062526,152.87405657031263,76.43702828515632,38.21851414257816,19.10925707128908,9.55462853564454,4.77731426782227,2.388657133911135,1.1943285669555674,.5971642834777837,.29858214173889186,.14929107086944593,.07464553543472296,.03732276771736148,.01866138385868074],G=[-238375,1376256],U=300,B=2,H=["showKeyboardHelp","selectControl","moveLarge","nudgeMap","zoomLarge","nudgeZoom"],Z="uk",V="world";const W=(e,t)=>{let r=null;const n=(...n)=>{clearTimeout(r),r=setTimeout(()=>{e(...n)},t)};return n.cancel=()=>{r&&(clearTimeout(r),r=null)},n};function J({map:e,view:t,emit:r,eventBus:n,events:o,on:a,debouncers:i}){let s=!1;const l=W(()=>{s=!1,r(o.MAP_MOVE_END)},500);i.push(l);const u=((e,t)=>{let r=0;return(...n)=>{const o=Date.now();o-r>=t&&(r=o,e(...n))}})(()=>r(o.MAP_MOVE),10);a(t,"change",()=>{s||(s=!0,n.emit(o.MAP_MOVE_START)),l()}),a(e,"postrender",()=>{s&&u()})}function X({map:e,source:t,events:r,eventBus:n,getZoom:o,getCenter:a,getBounds:i,getResolution:s}){let l=!1;const u=[];let p=[];const c=[],f=e.getView(),d=e=>{const t=(()=>{if(l)return null;const e=o();return{center:a(),bounds:i(),resolution:s(),zoom:e,isAtMaxZoom:e+.01>=f.getMaxZoom(),isAtMinZoom:e-.01<=f.getMinZoom()}})();t&&n.emit(e,t)},m=(e,t,r)=>{e.on(t,r),u.push([e,t,r])},y=(e,t,r)=>{e.on(t,r),p.push([e,t,r])};let h=!1;const g=()=>{h||(h=!0,n.emit(r.MAP_LOADED))},v=W(()=>d(r.MAP_DATA_CHANGE),500);c.push(v);const b=e=>{l||(p.forEach(([e,t,r])=>e.un(t,r)),p=[],y(e,"tileloadend",g),y(e,"tileloadend",v))};return J({map:e,view:e.getView(),emit:d,eventBus:n,events:r,on:m,debouncers:c}),b(t),e.once("rendercomplete",()=>d(r.MAP_FIRST_IDLE)),function({map:e,eventBus:t,events:r,on:n}){let o=null;n(e,"pointerdown",e=>{o=e.pixel}),n(e,"click",e=>{if(o){const t=e.pixel[0]-o[0],r=e.pixel[1]-o[1];if(Math.hypot(t,r)>6)return}t.emit(r.MAP_CLICK,{point:{x:e.pixel[0],y:e.pixel[1]},coords:e.coordinate})})}({map:e,eventBus:n,events:r,on:m}),m(e,"postrender",()=>n.emit(r.MAP_RENDER)),{setSource:b,remove(){l=!0,c.forEach(e=>e.cancel()),u.forEach(([e,t,r])=>e.un(t,r)),p.forEach(([e,t,r])=>e.un(t,r))}}}var Y={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number",length:2},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},"font-faces":{type:"fontFaces"},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},encoding:{type:"enum",values:{mvt:{},mlt:{}},default:"mvt"},"*":{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:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"filter"},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:{},"color-relief":{},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_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-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",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-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",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"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","feature"]},"property-type":"data-driven"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-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-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"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",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible",expression:{interpolated:!1,parameters:["global-state"]},"property-type":"data-constant"}},filter:{type:"boolean",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},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:"expression_name",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}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","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","feature"]},"property-type":"cross-faded-data-driven"},"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"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,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:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,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:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",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"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"},resampling:{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,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"}},interpolation:{type:"array",value:"interpolation_name",minimum:1},interpolation_name:{type:"enum",values:{linear:{syntax:{overloads:[{parameters:[],"output-type":"interpolation"}],parameters:[]}},exponential:{syntax:{overloads:[{parameters:["base"],"output-type":"interpolation"}],parameters:[{name:"base",type:"number literal"}]}},"cubic-bezier":{syntax:{overloads:[{parameters:["x1","y1","x2","y2"],"output-type":"interpolation"}],parameters:[{name:"x1",type:"number literal"},{name:"y1",type:"number literal"},{name:"x2",type:"number literal"},{name:"y2",type:"number literal"}]}}}}};const K=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function Q(e,t){const r={};for(const t in e)"ref"!==t&&(r[t]=e[t]);return K.forEach(e=>{e in t&&(r[e]=t[e])}),r}class ee extends Error{constructor(e,t){super(t),this.message=t,this.key=e}}class te{constructor(e,t=[]){this.parent=e,this.bindings={};for(const[e,r]of t)this.bindings[e]=r}concat(e){return new te(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 re={kind:"null"},ne={kind:"number"},oe={kind:"string"},ae={kind:"boolean"},ie={kind:"color"},se={kind:"projectionDefinition"},le={kind:"object"},ue={kind:"value"},pe={kind:"collator"},ce={kind:"formatted"},fe={kind:"padding"},de={kind:"colorArray"},me={kind:"numberArray"},ye={kind:"resolvedImage"},he={kind:"variableAnchorOffsetCollection"};function ge(e,t){return{kind:"array",itemType:e,N:t}}function ve(e){if("array"===e.kind){const t=ve(e.itemType);return"number"==typeof e.N?`array<${t}, ${e.N}>`:"value"===e.itemType.kind?"array":`array<${t}>`}return e.kind}const be=[re,ne,oe,ae,ie,se,ce,le,ge(ue),fe,me,de,ye,he];function xe(e,t){if("error"===t.kind)return null;if("array"===e.kind){if("array"===t.kind&&(0===t.N&&"value"===t.itemType.kind||!xe(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 be)if(!xe(e,t))return null}return`Expected ${ve(e)} but found ${ve(t)} instead.`}function we(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)}function Me(e,t){return"array"===e.kind&&"array"===t.kind?e.itemType.kind===t.itemType.kind&&"number"==typeof e.N:e.kind===t.kind}const Se=.96422,ze=.82521,Ie=4/29,Ae=6/29,_e=3*Ae*Ae,Ee=Ae*Ae*Ae,je=Math.PI/180,$e=180/Math.PI;function Ce(e){return(e%=360)<0&&(e+=360),e}function Pe([e,t,r,n]){let o,a;const i=qe((.2225045*(e=Te(e))+.7168786*(t=Te(t))+.0606169*(r=Te(r)))/1);e===t&&t===r?o=a=i:(o=qe((.4360747*e+.3850649*t+.1430804*r)/Se),a=qe((.0139322*e+.0971045*t+.7141733*r)/ze));const s=116*i-16;return[s<0?0:s,500*(o-i),200*(i-a),n]}function Te(e){return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)}function qe(e){return e>Ee?Math.pow(e,1/3):e/_e+Ie}function Fe([e,t,r,n]){let o=(e+16)/116,a=isNaN(t)?o:o+t/500,i=isNaN(r)?o:o-r/200;return o=1*Ne(o),a=Se*Ne(a),i=ze*Ne(i),[Oe(3.1338561*a-1.6168667*o-.4906146*i),Oe(-.9787684*a+1.9161415*o+.033454*i),Oe(.0719453*a-.2289914*o+1.4052427*i),n]}function Oe(e){return(e=e<=.00304?12.92*e:1.055*Math.pow(e,1/2.4)-.055)<0?0:e>1?1:e}function Ne(e){return e>Ae?e*e*e:_e*(e-Ie)}const De=Object.hasOwn||function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};function Le(e,t){return De(e,t)?e[t]:void 0}function Re(e){if("transparent"===(e=e.toLowerCase().trim()))return[0,0,0,0];const t=Le(Ze,e);if(t){const[e,r,n]=t;return[e/255,r/255,n/255,1]}if(e.startsWith("#")){if(/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(e)){const t=e.length<6?1:2;let r=1;return[Ge(e.slice(r,r+=t)),Ge(e.slice(r,r+=t)),Ge(e.slice(r,r+=t)),Ge(e.slice(r,r+t)||"ff")]}}if(e.startsWith("rgb")){const t=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,r=e.match(t);if(r){const[e,t,n,o,a,i,s,l,u,p,c,f]=r,d=[o||" ",s||" ",p].join("");if(" "===d||" /"===d||",,"===d||",,,"===d){const e=[n,i,u].join(""),r="%%%"===e?100:""===e?255:0;if(r){const e=[Be(+t/r,0,1),Be(+a/r,0,1),Be(+l/r,0,1),c?Ue(+c,f):1];if(He(e))return e}}return}}const r=e.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(r){const[e,t,n,o,a,i,s,l,u]=r,p=[n||" ",a||" ",s].join("");if(" "===p||" /"===p||",,"===p||",,,"===p){const e=[+t,Be(+o,0,100),Be(+i,0,100),l?Ue(+l,u):1];if(He(e))return function([e,t,r,n]){function o(n){const o=(n+e/30)%12,a=t*Math.min(r,1-r);return r-a*Math.max(-1,Math.min(o-3,9-o,1))}return e=Ce(e),t/=100,r/=100,[o(0),o(8),o(4),n]}(e)}}}function Ge(e){return parseInt(e.padEnd(2,e),16)/255}function Ue(e,t){return Be(t?e/100:e,0,1)}function Be(e,t,r){return Math.min(Math.max(t,e),r)}function He(e){return!e.some(Number.isNaN)}const Ze={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function Ve(e,t,r){return e+r*(t-e)}function We(e,t,r){return e.map((e,n)=>Ve(e,t[n],r))}class Je{constructor(e,t,r,n=1,o=!0){this.r=e,this.g=t,this.b=r,this.a=n,o||(this.r*=n,this.g*=n,this.b*=n,n||this.overwriteGetter("rgb",[e,t,r,n]))}static parse(e){if(e instanceof Je)return e;if("string"!=typeof e)return;const t=Re(e);return t?new Je(...t,!1):void 0}get rgb(){const{r:e,g:t,b:r,a:n}=this,o=n||1/0;return this.overwriteGetter("rgb",[e/o,t/o,r/o,n])}get hcl(){return this.overwriteGetter("hcl",function(e){const[t,r,n,o]=Pe(e),a=Math.sqrt(r*r+n*n);return[Math.round(1e4*a)?Ce(Math.atan2(n,r)*$e):NaN,a,t,o]}(this.rgb))}get lab(){return this.overwriteGetter("lab",Pe(this.rgb))}overwriteGetter(e,t){return Object.defineProperty(this,e,{value:t}),t}toString(){const[e,t,r,n]=this.rgb;return`rgba(${[e,t,r].map(e=>Math.round(255*e)).join(",")},${n})`}static interpolate(e,t,r,n="rgb"){switch(n){case"rgb":{const[n,o,a,i]=We(e.rgb,t.rgb,r);return new Je(n,o,a,i,!1)}case"hcl":{const[n,o,a,i]=e.hcl,[s,l,u,p]=t.hcl;let c,f;if(isNaN(n)||isNaN(s))isNaN(n)?isNaN(s)?c=NaN:(c=s,1!==a&&0!==a||(f=l)):(c=n,1!==u&&0!==u||(f=o));else{let e=s-n;s>n&&e>180?e-=360:s<n&&n-s>180&&(e+=360),c=n+r*e}const[d,m,y,h]=function([e,t,r,n]){return e=isNaN(e)?0:e*je,Fe([r,Math.cos(e)*t,Math.sin(e)*t,n])}([c,null!=f?f:Ve(o,l,r),Ve(a,u,r),Ve(i,p,r)]);return new Je(d,m,y,h,!1)}case"lab":{const[n,o,a,i]=Fe(We(e.lab,t.lab,r));return new Je(n,o,a,i,!1)}}}}Je.black=new Je(0,0,0,1),Je.white=new Je(1,1,1,1),Je.transparent=new Je(0,0,0,0),Je.red=new Je(1,0,0,1);class Xe{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}}const Ye=["bottom","center","top"];class Ke{constructor(e,t,r,n,o,a){this.text=e,this.image=t,this.scale=r,this.fontStack=n,this.textColor=o,this.verticalAlign=a}}class Qe{constructor(e){this.sections=e}static fromString(e){return new Qe([new Ke(e,null,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 Qe?e:Qe.fromString(e)}toString(){return 0===this.sections.length?"":this.sections.map(e=>e.text).join("")}}class et{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof et)return e;if("number"==typeof e)return new et([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 et(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){return new et(We(e.values,t.values,r))}}class tt{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof tt)return e;if("number"==typeof e)return new tt([e]);if(Array.isArray(e)){for(const t of e)if("number"!=typeof t)return;return new tt(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){return new tt(We(e.values,t.values,r))}}class rt{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof rt)return e;if("string"==typeof e){const t=Je.parse(e);if(!t)return;return new rt([t])}if(!Array.isArray(e))return;const t=[];for(const r of e){if("string"!=typeof r)return;const e=Je.parse(r);if(!e)return;t.push(e)}return new rt(t)}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r,n="rgb"){const o=[];if(e.values.length!=t.values.length)throw new Error(`colorArray: Arrays have mismatched length (${e.values.length} vs. ${t.values.length}), cannot interpolate.`);for(let a=0;a<e.values.length;a++)o.push(Je.interpolate(e.values[a],t.values[a],r,n));return new rt(o)}}class nt extends Error{constructor(e){super(e),this.name="RuntimeError"}toJSON(){return this.message}}const ot=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class at{constructor(e){this.values=e.slice()}static parse(e){if(e instanceof at)return e;if(Array.isArray(e)&&!(e.length<1)&&e.length%2==0){for(let t=0;t<e.length;t+=2){const r=e[t],n=e[t+1];if("string"!=typeof r||!ot.has(r))return;if(!Array.isArray(n)||2!==n.length||"number"!=typeof n[0]||"number"!=typeof n[1])return}return new at(e)}}toString(){return JSON.stringify(this.values)}static interpolate(e,t,r){const n=e.values,o=t.values;if(n.length!==o.length)throw new nt(`Cannot interpolate values of different length. from: ${e.toString()}, to: ${t.toString()}`);const a=[];for(let e=0;e<n.length;e+=2){if(n[e]!==o[e])throw new nt(`Cannot interpolate values containing mismatched anchors. from[${e}]: ${n[e]}, to[${e}]: ${o[e]}`);a.push(n[e]);const[t,i]=n[e+1],[s,l]=o[e+1];a.push([Ve(t,s,r),Ve(i,l,r)])}return new at(a)}}class it{constructor(e){this.name=e.name,this.available=e.available}toString(){return this.name}static fromString(e){return e?new it({name:e,available:!1}):null}}class st{constructor(e,t,r){this.from=e,this.to=t,this.transition=r}static interpolate(e,t,r){return new st(e,t,r)}static parse(e){return e instanceof st?e:Array.isArray(e)&&3===e.length&&"string"==typeof e[0]&&"string"==typeof e[1]&&"number"==typeof e[2]?new st(e[0],e[1],e[2]):"object"==typeof e&&"string"==typeof e.from&&"string"==typeof e.to&&"number"==typeof e.transition?new st(e.from,e.to,e.transition):"string"==typeof e?new st(e,e,1):void 0}}function lt(e,t,r,n){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 n?[e,t,r,n]:[e,t,r]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}return void 0===n||"number"==typeof n&&n>=0&&n<=1?null:`Invalid rgba value [${[e,t,r,n].join(", ")}]: 'a' must be between 0 and 1.`}function ut(e){if(null===e||"string"==typeof e||"boolean"==typeof e||"number"==typeof e||e instanceof st||e instanceof Je||e instanceof Xe||e instanceof Qe||e instanceof et||e instanceof tt||e instanceof rt||e instanceof at||e instanceof it)return!0;if(Array.isArray(e)){for(const t of e)if(!ut(t))return!1;return!0}if("object"==typeof e){for(const t in e)if(!ut(e[t]))return!1;return!0}return!1}function pt(e){if(null===e)return re;if("string"==typeof e)return oe;if("boolean"==typeof e)return ae;if("number"==typeof e)return ne;if(e instanceof Je)return ie;if(e instanceof st)return se;if(e instanceof Xe)return pe;if(e instanceof Qe)return ce;if(e instanceof et)return fe;if(e instanceof tt)return me;if(e instanceof rt)return de;if(e instanceof at)return he;if(e instanceof it)return ye;if(Array.isArray(e)){const t=e.length;let r;for(const t of e){const e=pt(t);if(r){if(r===e)continue;r=ue;break}r=e}return ge(r||ue,t)}return le}function ct(e){const t=typeof e;return null===e?"":"string"===t||"number"===t||"boolean"===t?String(e):e instanceof Je||e instanceof st||e instanceof Qe||e instanceof et||e instanceof tt||e instanceof rt||e instanceof at||e instanceof it?e.toString():JSON.stringify(e)}class ft{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(!ut(e[1]))return t.error("invalid value");const r=e[1];let n=pt(r);const o=t.expectedType;return"array"!==n.kind||0!==n.N||!o||"array"!==o.kind||"number"==typeof o.N&&0!==o.N||(n=o),new ft(n,r)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const dt={string:oe,number:ne,boolean:ae,object:le};class mt{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,n=1;const o=e[0];if("array"===o){let o,a;if(e.length>2){const r=e[1];if("string"!=typeof r||!(r in dt)||"object"===r)return t.error('The item type argument of "array" must be one of string, number, boolean',1);o=dt[r],n++}else o=ue;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);a=e[2],n++}r=ge(o,a)}else{if(!dt[o])throw new Error(`Types doesn't contain name = ${o}`);r=dt[o]}const a=[];for(;n<e.length;n++){const r=t.parse(e[n],n,ue);if(!r)return null;a.push(r)}return new mt(r,a)}evaluate(e){for(let t=0;t<this.args.length;t++){const r=this.args[t].evaluate(e);if(!xe(this.type,pt(r)))return r;if(t===this.args.length-1)throw new nt(`Expected value to be of type ${ve(this.type)}, but found ${ve(pt(r))} instead.`)}throw new Error}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const yt={"to-boolean":ae,"to-color":ie,"to-number":ne,"to-string":oe};class ht{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(!yt[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 n=yt[r],o=[];for(let r=1;r<e.length;r++){const n=t.parse(e[r],r,ue);if(!n)return null;o.push(n)}return new ht(n,o)}evaluate(e){switch(this.type.kind){case"boolean":return Boolean(this.args[0].evaluate(e));case"color":{let t,r;for(const n of this.args){if(t=n.evaluate(e),r=null,t instanceof Je)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 rgba value ${JSON.stringify(t)}: expected an array containing either three or four numeric values.`:lt(t[0],t[1],t[2],t[3]),!r))return new Je(t[0]/255,t[1]/255,t[2]/255,t[3])}throw new nt(r||`Could not parse color from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"padding":{let t;for(const r of this.args){t=r.evaluate(e);const n=et.parse(t);if(n)return n}throw new nt(`Could not parse padding from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"numberArray":{let t;for(const r of this.args){t=r.evaluate(e);const n=tt.parse(t);if(n)return n}throw new nt(`Could not parse numberArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"colorArray":{let t;for(const r of this.args){t=r.evaluate(e);const n=rt.parse(t);if(n)return n}throw new nt(`Could not parse colorArray from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"variableAnchorOffsetCollection":{let t;for(const r of this.args){t=r.evaluate(e);const n=at.parse(t);if(n)return n}throw new nt(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof t?t:JSON.stringify(t)}'`)}case"number":{let t=null;for(const r of this.args){if(t=r.evaluate(e),null===t)return 0;const n=Number(t);if(!isNaN(n))return n}throw new nt(`Could not convert ${JSON.stringify(t)} to number.`)}case"formatted":return Qe.fromString(ct(this.args[0].evaluate(e)));case"resolvedImage":return it.fromString(ct(this.args[0].evaluate(e)));case"projectionDefinition":return this.args[0].evaluate(e);default:return ct(this.args[0].evaluate(e))}}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}const gt=["Unknown","Point","LineString","Polygon"];class vt{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,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?gt[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.get(e);return t||(t=Je.parse(e),this._parseColorCache.set(e,t)),t}}class bt{constructor(e,t,r=[],n,o=new te,a=[]){this.registry=e,this.path=r,this.key=r.map(e=>`[${e}]`).join(""),this.scope=o,this.errors=a,this.expectedType=n,this._isConstant=t}parse(e,t,r,n,o={}){return t?this.concat(t,r,n)._parse(e,o):this._parse(e,o)}_parse(e,t){function r(e,t,r){return"assert"===r?new mt(t,[e]):"coerce"===r?new ht(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 n=e[0];if("string"!=typeof n)return this.error(`Expression name must be a string, but found ${typeof n} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const o=this.registry[n];if(o){let n=o.parse(e,this);if(!n)return null;if(this.expectedType){const e=this.expectedType,o=n.type;if("string"!==e.kind&&"number"!==e.kind&&"boolean"!==e.kind&&"object"!==e.kind&&"array"!==e.kind||"value"!==o.kind){if("projectionDefinition"===e.kind&&["string","array"].includes(o.kind)||["color","formatted","resolvedImage"].includes(e.kind)&&["value","string"].includes(o.kind)||["padding","numberArray"].includes(e.kind)&&["value","number","array"].includes(o.kind)||"colorArray"===e.kind&&["value","string","array"].includes(o.kind)||"variableAnchorOffsetCollection"===e.kind&&["value","array"].includes(o.kind))n=r(n,e,t.typeAnnotation||"coerce");else if(this.checkSubtype(e,o))return null}else n=r(n,e,t.typeAnnotation||"assert")}if(!(n instanceof ft)&&"resolvedImage"!==n.type.kind&&this._isConstant(n)){const e=new vt;try{n=new ft(n.type,n.evaluate(e))}catch(e){return this.error(e.message),null}}return n}return this.error(`Unknown expression "${n}". 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 n="number"==typeof e?this.path.concat(e):this.path,o=r?this.scope.concat(r):this.scope;return new bt(this.registry,this._isConstant,n,t||null,o,this.errors)}error(e,...t){const r=`${this.key}${t.map(e=>`[${e}]`).join("")}`;this.errors.push(new ee(r,e))}checkSubtype(e,t){const r=xe(e,t);return r&&this.error(r),r}}class xt{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 n=1;n<e.length-1;n+=2){const o=e[n];if("string"!=typeof o)return t.error(`Expected string, but found ${typeof o} instead.`,n);if(/[^a-zA-Z0-9_]/.test(o))return t.error("Variable names must contain only alphanumeric characters or '_'.",n);const a=t.parse(e[n+1],n+1);if(!a)return null;r.push([o,a])}const n=t.parse(e[e.length-1],e.length-1,t.expectedType,r);return n?new xt(r,n):null}outputDefined(){return this.result.outputDefined()}}class wt{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 wt(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 kt{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,ne),n=t.parse(e[2],2,ge(t.expectedType||ue));if(!r||!n)return null;const o=n.type;return new kt(o.itemType,r,n)}evaluate(e){const t=this.index.evaluate(e),r=this.input.evaluate(e);if(t<0)throw new nt(`Array index out of bounds: ${t} < 0.`);if(t>=r.length)throw new nt(`Array index out of bounds: ${t} > ${r.length-1}.`);if(t!==Math.floor(t))throw new nt(`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 Mt{constructor(e,t){this.type=ae,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,ue),n=t.parse(e[2],2,ue);return r&&n?we(r.type,[ae,oe,ne,re,ue])?new Mt(r,n):t.error(`Expected first argument to be of type boolean, string, number or null, but found ${ve(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 nt(`Expected first argument to be of type boolean, string, number or null, but found ${ve(pt(t))} instead.`);if(!ke(r,["string","array"]))throw new nt(`Expected second argument to be of type array or string, but found ${ve(pt(r))} instead.`);return r.indexOf(t)>=0}eachChild(e){e(this.needle),e(this.haystack)}outputDefined(){return!0}}class St{constructor(e,t,r){this.type=ne,this.needle=e,this.haystack=t,this.fromIndex=r}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ue),n=t.parse(e[2],2,ue);if(!r||!n)return null;if(!we(r.type,[ae,oe,ne,re,ue]))return t.error(`Expected first argument to be of type boolean, string, number or null, but found ${ve(r.type)} instead`);if(4===e.length){const o=t.parse(e[3],3,ne);return o?new St(r,n,o):null}return new St(r,n)}evaluate(e){const t=this.needle.evaluate(e),r=this.haystack.evaluate(e);if(!ke(t,["boolean","string","number","null"]))throw new nt(`Expected first argument to be of type boolean, string, number or null, but found ${ve(pt(t))} instead.`);let n;if(this.fromIndex&&(n=this.fromIndex.evaluate(e)),ke(r,["string"])){const e=r.indexOf(t,n);return-1===e?-1:[...r.slice(0,e)].length}if(ke(r,["array"]))return r.indexOf(t,n);throw new nt(`Expected second argument to be of type array or string, but found ${ve(pt(r))} instead.`)}eachChild(e){e(this.needle),e(this.haystack),this.fromIndex&&e(this.fromIndex)}outputDefined(){return!1}}class zt{constructor(e,t,r,n,o,a){this.inputType=e,this.type=t,this.input=r,this.cases=n,this.outputs=o,this.otherwise=a}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,n;t.expectedType&&"value"!==t.expectedType.kind&&(n=t.expectedType);const o={},a=[];for(let i=2;i<e.length-1;i+=2){let s=e[i];const l=e[i+1];Array.isArray(s)||(s=[s]);const u=t.concat(i);if(0===s.length)return u.error("Expected at least one branch label.");for(const e of s){if("number"!=typeof e&&"string"!=typeof e)return u.error("Branch labels must be numbers or strings.");if("number"==typeof e&&Math.abs(e)>Number.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof e&&Math.floor(e)!==e)return u.error("Numeric branch labels must be integer values.");if(r){if(u.checkSubtype(r,pt(e)))return null}else r=pt(e);if(void 0!==o[String(e)])return u.error("Branch labels must be unique.");o[String(e)]=a.length}const p=t.parse(l,i,n);if(!p)return null;n=n||p.type,a.push(p)}const i=t.parse(e[1],1,ue);if(!i)return null;const s=t.parse(e[e.length-1],e.length-1,n);return s?"value"!==i.type.kind&&t.concat(1).checkSubtype(r,i.type)?null:new zt(r,n,i,o,a,s):null}evaluate(e){const t=this.input.evaluate(e);return(pt(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 It{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 n=[];for(let o=1;o<e.length-1;o+=2){const a=t.parse(e[o],o,ae);if(!a)return null;const i=t.parse(e[o+1],o+1,r);if(!i)return null;n.push([a,i]),r=r||i.type}const o=t.parse(e[e.length-1],e.length-1,r);if(!o)return null;if(!r)throw new Error("Can't infer output type");return new It(r,n,o)}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 At{constructor(e,t,r,n){this.type=e,this.input=t,this.beginIndex=r,this.endIndex=n}static parse(e,t){if(e.length<=2||e.length>=5)return t.error(`Expected 2 or 3 arguments, but found ${e.length-1} instead.`);const r=t.parse(e[1],1,ue),n=t.parse(e[2],2,ne);if(!r||!n)return null;if(!we(r.type,[ge(ue),oe,ue]))return t.error(`Expected first argument to be of type array or string, but found ${ve(r.type)} instead`);if(4===e.length){const o=t.parse(e[3],3,ne);return o?new At(r.type,r,n,o):null}return new At(r.type,r,n)}evaluate(e){const t=this.input.evaluate(e),r=this.beginIndex.evaluate(e);let n;if(this.endIndex&&(n=this.endIndex.evaluate(e)),ke(t,["string"]))return[...t].slice(r,n).join("");if(ke(t,["array"]))return t.slice(r,n);throw new nt(`Expected first argument to be of type array or string, but found ${ve(pt(t))} instead.`)}eachChild(e){e(this.input),e(this.beginIndex),this.endIndex&&e(this.endIndex)}outputDefined(){return!1}}function _t(e,t){const r=e.length-1;let n,o,a=0,i=r,s=0;for(;a<=i;)if(s=Math.floor((a+i)/2),n=e[s],o=e[s+1],n<=t){if(s===r||t<o)return s;a=s+1}else{if(!(n>t))throw new nt("Input is not a number.");i=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,ne);if(!r)return null;const n=[];let o=null;t.expectedType&&"value"!==t.expectedType.kind&&(o=t.expectedType);for(let r=1;r<e.length;r+=2){const a=1===r?-1/0:e[r],i=e[r+1],s=r,l=r+1;if("number"!=typeof a)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(n.length&&n[n.length-1][0]>=a)return t.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',s);const u=t.parse(i,l,o);if(!u)return null;o=o||u.type,n.push([a,u])}return new Et(o,r,n)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const o=t.length;if(n>=t[o-1])return r[o-1].evaluate(e);return r[_t(t,n)].evaluate(e)}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function jt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $t,Ct;var Pt=function(){if(Ct)return $t;function e(e,t,r,n){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*(n-t)-this.cy,this.ay=1-this.cy-this.by,this.p1x=e,this.p1y=t,this.p2x=r,this.p2y=n}return Ct=1,$t=e,e.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,n=0;n<8;n++){var o=this.sampleCurveX(r)-e;if(Math.abs(o)<t)return r;var a=this.sampleCurveDerivativeX(r);if(Math.abs(a)<1e-6)break;r-=o/a}var i=0,s=1;for(r=e,n=0;n<20&&(o=this.sampleCurveX(r),!(Math.abs(o-e)<t));n++)e>o?i=r:s=r,r=.5*(s-i)+i;return r},solve:function(e,t){return this.sampleCurveY(this.solveCurveX(e,t))}},$t}(),Tt=jt(Pt);class qt{constructor(e,t,r,n,o){this.type=e,this.operator=t,this.interpolation=r,this.input=n,this.labels=[],this.outputs=[];for(const[e,t]of o)this.labels.push(e),this.outputs.push(t)}static interpolationFactor(e,t,r,n){let o=0;if("exponential"===e.name)o=Ft(t,e.base,r,n);else if("linear"===e.name)o=Ft(t,1,r,n);else if("cubic-bezier"===e.name){const a=e.controlPoints;o=new Tt(a[0],a[1],a[2],a[3]).solve(Ft(t,1,r,n))}return o}static parse(e,t){let[r,n,o,...a]=e;if(!Array.isArray(n)||0===n.length)return t.error("Expected an interpolation type expression.",1);if("linear"===n[0])n={name:"linear"};else if("exponential"===n[0]){const e=n[1];if("number"!=typeof e)return t.error("Exponential interpolation requires a numeric base.",1,1);n={name:"exponential",base:e}}else{if("cubic-bezier"!==n[0])return t.error(`Unknown interpolation type ${String(n[0])}`,1,0);{const e=n.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);n={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(o=t.parse(o,2,ne),!o)return null;const i=[];let s=null;"interpolate-hcl"!==r&&"interpolate-lab"!==r||t.expectedType==de?t.expectedType&&"value"!==t.expectedType.kind&&(s=t.expectedType):s=ie;for(let e=0;e<a.length;e+=2){const r=a[e],n=a[e+1],o=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.',o);if(i.length&&i[i.length-1][0]>=r)return t.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',o);const u=t.parse(n,l,s);if(!u)return null;s=s||u.type,i.push([r,u])}return Me(s,ne)||Me(s,se)||Me(s,ie)||Me(s,fe)||Me(s,me)||Me(s,de)||Me(s,he)||Me(s,ge(ne))?new qt(s,r,n,o,i):t.error(`Type ${ve(s)} is not interpolatable.`)}evaluate(e){const t=this.labels,r=this.outputs;if(1===t.length)return r[0].evaluate(e);const n=this.input.evaluate(e);if(n<=t[0])return r[0].evaluate(e);const o=t.length;if(n>=t[o-1])return r[o-1].evaluate(e);const a=_t(t,n),i=t[a],s=t[a+1],l=qt.interpolationFactor(this.interpolation,n,i,s),u=r[a].evaluate(e),p=r[a+1].evaluate(e);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return Ve(u,p,l);case"color":return Je.interpolate(u,p,l);case"padding":return et.interpolate(u,p,l);case"colorArray":return rt.interpolate(u,p,l);case"numberArray":return tt.interpolate(u,p,l);case"variableAnchorOffsetCollection":return at.interpolate(u,p,l);case"array":return We(u,p,l);case"projectionDefinition":return st.interpolate(u,p,l)}case"interpolate-hcl":switch(this.type.kind){case"color":return Je.interpolate(u,p,l,"hcl");case"colorArray":return rt.interpolate(u,p,l,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return Je.interpolate(u,p,l,"lab");case"colorArray":return rt.interpolate(u,p,l,"lab")}}}eachChild(e){e(this.input);for(const t of this.outputs)e(t)}outputDefined(){return this.outputs.every(e=>e.outputDefined())}}function Ft(e,t,r,n){const o=n-r,a=e-r;return 0===o?0:1===t?a/o:(Math.pow(t,a)-1)/(Math.pow(t,o)-1)}class Ot{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=null;const n=t.expectedType;n&&"value"!==n.kind&&(r=n);const o=[];for(const n of e.slice(1)){const e=t.parse(n,1+o.length,r,void 0,{typeAnnotation:"omit"});if(!e)return null;r=r||e.type,o.push(e)}if(!r)throw new Error("No output type");const a=n&&o.some(e=>xe(n,e.type));return new Ot(a?ue:r,o)}evaluate(e){let t,r=null,n=0;for(const o of this.args)if(n++,r=o.evaluate(e),r&&r instanceof it&&!r.available&&(t||(t=r.name),r=null,n===this.args.length&&(r=t)),null!==r)break;return r}eachChild(e){this.args.forEach(e)}outputDefined(){return this.args.every(e=>e.outputDefined())}}function Nt(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 Dt(e,t,r,n){return 0===n.compare(t,r)}function Lt(e,t,r){const n="=="!==e&&"!="!==e;return class o{constructor(e,t,r){this.type=ae,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 a=t.parse(e[1],1,ue);if(!a)return null;if(!Nt(r,a.type))return t.concat(1).error(`"${r}" comparisons are not supported for type '${ve(a.type)}'.`);let i=t.parse(e[2],2,ue);if(!i)return null;if(!Nt(r,i.type))return t.concat(2).error(`"${r}" comparisons are not supported for type '${ve(i.type)}'.`);if(a.type.kind!==i.type.kind&&"value"!==a.type.kind&&"value"!==i.type.kind)return t.error(`Cannot compare types '${ve(a.type)}' and '${ve(i.type)}'.`);n&&("value"===a.type.kind&&"value"!==i.type.kind?a=new mt(i.type,[a]):"value"!==a.type.kind&&"value"===i.type.kind&&(i=new mt(a.type,[i])));let s=null;if(4===e.length){if("string"!==a.type.kind&&"string"!==i.type.kind&&"value"!==a.type.kind&&"value"!==i.type.kind)return t.error("Cannot use collator to compare non-string types.");if(s=t.parse(e[3],3,pe),!s)return null}return new o(a,i,s)}evaluate(o){const a=this.lhs.evaluate(o),i=this.rhs.evaluate(o);if(n&&this.hasUntypedArgument){const t=pt(a),r=pt(i);if(t.kind!==r.kind||"string"!==t.kind&&"number"!==t.kind)throw new nt(`Expected arguments for "${e}" to be (string, string) or (number, number), but found (${t.kind}, ${r.kind}) instead.`)}if(this.collator&&!n&&this.hasUntypedArgument){const e=pt(a),r=pt(i);if("string"!==e.kind||"string"!==r.kind)return t(o,a,i)}return this.collator?r(o,a,i,this.collator.evaluate(o)):t(o,a,i)}eachChild(e){e(this.lhs),e(this.rhs),this.collator&&e(this.collator)}outputDefined(){return!0}}}const Rt=Lt("==",function(e,t,r){return t===r},Dt),Gt=Lt("!=",function(e,t,r){return t!==r},function(e,t,r,n){return!Dt(0,t,r,n)}),Ut=Lt("<",function(e,t,r){return t<r},function(e,t,r,n){return n.compare(t,r)<0}),Bt=Lt(">",function(e,t,r){return t>r},function(e,t,r,n){return n.compare(t,r)>0}),Ht=Lt("<=",function(e,t,r){return t<=r},function(e,t,r,n){return n.compare(t,r)<=0}),Zt=Lt(">=",function(e,t,r){return t>=r},function(e,t,r,n){return n.compare(t,r)>=0});class Vt{constructor(e,t,r){this.type=pe,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 n=t.parse(void 0!==r["case-sensitive"]&&r["case-sensitive"],1,ae);if(!n)return null;const o=t.parse(void 0!==r["diacritic-sensitive"]&&r["diacritic-sensitive"],1,ae);if(!o)return null;let a=null;return r.locale&&(a=t.parse(r.locale,1,oe),!a)?null:new Vt(n,o,a)}evaluate(e){return new Xe(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}}class Wt{constructor(e,t,r,n,o,a){this.type=oe,this.number=e,this.locale=t,this.currency=r,this.unit=n,this.minFractionDigits=o,this.maxFractionDigits=a}static parse(e,t){if(3!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,ne);if(!r)return null;const n=e[2];if("object"!=typeof n||Array.isArray(n))return t.error("NumberFormat options argument must be an object.");let o=null;if(n.locale&&(o=t.parse(n.locale,1,oe),!o))return null;let a=null;if(n.currency&&(a=t.parse(n.currency,1,oe),!a))return null;let i=null;if(n.unit&&(i=t.parse(n.unit,1,oe),!i))return null;if(a&&i)return t.error("NumberFormat options `currency` and `unit` are mutually exclusive");let s=null;if(n["min-fraction-digits"]&&(s=t.parse(n["min-fraction-digits"],1,ne),!s))return null;let l=null;return n["max-fraction-digits"]&&(l=t.parse(n["max-fraction-digits"],1,ne),!l)?null:new Wt(r,o,a,i,s,l)}evaluate(e){return new Intl.NumberFormat(this.locale?this.locale.evaluate(e):[],{style:this.currency?"currency":this.unit?"unit":"decimal",currency:this.currency?this.currency.evaluate(e):void 0,unit:this.unit?this.unit.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.unit&&e(this.unit),this.minFractionDigits&&e(this.minFractionDigits),this.maxFractionDigits&&e(this.maxFractionDigits)}outputDefined(){return!1}}class Jt{constructor(e){this.type=ce,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 n=[];let o=!1;for(let r=1;r<=e.length-1;++r){const a=e[r];if(o&&"object"==typeof a&&!Array.isArray(a)){o=!1;let e=null;if(a["font-scale"]&&(e=t.parse(a["font-scale"],1,ne),!e))return null;let r=null;if(a["text-font"]&&(r=t.parse(a["text-font"],1,ge(oe)),!r))return null;let i=null;if(a["text-color"]&&(i=t.parse(a["text-color"],1,ie),!i))return null;let s=null;if(a["vertical-align"]){if("string"==typeof a["vertical-align"]&&!Ye.includes(a["vertical-align"]))return t.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${a["vertical-align"]}' instead.`);if(s=t.parse(a["vertical-align"],1,oe),!s)return null}const l=n[n.length-1];l.scale=e,l.font=r,l.textColor=i,l.verticalAlign=s}else{const a=t.parse(e[r],1,ue);if(!a)return null;const i=a.type.kind;if("string"!==i&&"value"!==i&&"null"!==i&&"resolvedImage"!==i)return t.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");o=!0,n.push({content:a,scale:null,font:null,textColor:null,verticalAlign:null})}}return new Jt(n)}evaluate(e){return new Qe(this.sections.map(t=>{const r=t.content.evaluate(e);return pt(r)===ye?new Ke("",r,null,null,null,t.verticalAlign?t.verticalAlign.evaluate(e):null):new Ke(ct(r),null,t.scale?t.scale.evaluate(e):null,t.font?t.font.evaluate(e).join(","):null,t.textColor?t.textColor.evaluate(e):null,t.verticalAlign?t.verticalAlign.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),t.verticalAlign&&e(t.verticalAlign)}outputDefined(){return!1}}class Xt{constructor(e){this.type=ye,this.input=e}static parse(e,t){if(2!==e.length)return t.error("Expected two arguments.");const r=t.parse(e[1],1,oe);return r?new Xt(r):t.error("No image name provided.")}evaluate(e){const t=this.input.evaluate(e),r=it.fromString(t);return r&&e.availableImages&&(r.available=e.availableImages.indexOf(t)>-1),r}eachChild(e){e(this.input)}outputDefined(){return!1}}class Yt{constructor(e){this.type=ne,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 ${ve(r.type)} instead.`):new Yt(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 nt(`Expected value to be of type string or array, but found ${ve(pt(t))} instead.`)}eachChild(e){e(this.input)}outputDefined(){return!1}}const Kt=8192;function Qt(e,t){const r=(180+e[0])/360;const n=(o=e[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+o*Math.PI/360)))/360);var o;const a=Math.pow(2,t.z);return[Math.round(r*a*Kt),Math.round(n*a*Kt)]}function er(e,t){const r=Math.pow(2,t.z),n=(e[0]/Kt+t.x)/r,o=(e[1]/Kt+t.y)/r;return[(i=n,360*i-180),(a=o,360/Math.PI*Math.atan(Math.exp((180-360*a)*Math.PI/180))-90)];var a,i}function tr(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 rr(e,t){return!(e[0]<=t[0])&&(!(e[2]>=t[2])&&(!(e[1]<=t[1])&&!(e[3]>=t[3])))}function nr(e,t,r){return t[1]>e[1]!=r[1]>e[1]&&e[0]<(r[0]-t[0])*(e[1]-t[1])/(r[1]-t[1])+t[0]}function or(e,t,r){const n=e[0]-t[0],o=e[1]-t[1],a=e[0]-r[0],i=e[1]-r[1];return n*i-a*o===0&&n*a<=0&&o*i<=0}function ar(e,t,r,n){const o=[t[0]-e[0],t[1]-e[1]],a=[n[0]-r[0],n[1]-r[1]];return 0!==(i=a)[0]*(s=o)[1]-i[1]*s[0]&&!(!cr(e,t,r,n)||!cr(r,n,e,t));var i,s}function ir(e,t,r){for(const n of r)for(let r=0;r<n.length-1;++r)if(ar(e,t,n[r],n[r+1]))return!0;return!1}function sr(e,t,r=!1){let n=!1;for(const o of t)for(let t=0;t<o.length-1;t++){if(or(e,o[t],o[t+1]))return r;nr(e,o[t],o[t+1])&&(n=!n)}return n}function lr(e,t){for(const r of t)if(sr(e,r))return!0;return!1}function ur(e,t){for(const r of e)if(!sr(r,t))return!1;for(let r=0;r<e.length-1;++r)if(ir(e[r],e[r+1],t))return!1;return!0}function pr(e,t){for(const r of t)if(ur(e,r))return!0;return!1}function cr(e,t,r,n){const o=e[0]-r[0],a=e[1]-r[1],i=t[0]-r[0],s=t[1]-r[1],l=n[0]-r[0],u=n[1]-r[1],p=o*u-l*a,c=i*u-l*s;return p>0&&c<0||p<0&&c>0}function fr(e,t,r){const n=[];for(let o=0;o<e.length;o++){const a=[];for(let n=0;n<e[o].length;n++){const i=Qt(e[o][n],r);tr(t,i),a.push(i)}n.push(a)}return n}function dr(e,t,r){const n=[];for(let o=0;o<e.length;o++){const a=fr(e[o],t,r);n.push(a)}return n}function mr(e,t,r,n){if(e[0]<r[0]||e[0]>r[2]){const t=.5*n;let o=e[0]-r[0]>t?-n:r[0]-e[0]>t?n:0;0===o&&(o=e[0]-r[2]>t?-n:r[2]-e[0]>t?n:0),e[0]+=o}tr(t,e)}function yr(e,t,r,n){const o=Math.pow(2,n.z)*Kt,a=[n.x*Kt,n.y*Kt],i=[];for(const n of e)for(const e of n){const n=[e.x+a[0],e.y+a[1]];mr(n,t,r,o),i.push(n)}return i}function hr(e,t,r,n){const o=Math.pow(2,n.z)*Kt,a=[n.x*Kt,n.y*Kt],i=[];for(const r of e){const e=[];for(const n of r){const r=[n.x+a[0],n.y+a[1]];tr(t,r),e.push(r)}i.push(e)}if(t[2]-t[0]<=o/2){!function(e){e[0]=e[1]=1/0,e[2]=e[3]=-1/0}(t);for(const e of i)for(const n of e)mr(n,t,r,o)}return i}class gr{constructor(e,t){this.type=ae,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(ut(e[1])){const t=e[1];if("FeatureCollection"===t.type){const e=[];for(const r of t.features){const{type:t,coordinates:n}=r.geometry;"Polygon"===t&&e.push(n),"MultiPolygon"===t&&e.push(...n)}if(e.length){return new gr(t,{type:"MultiPolygon",coordinates:e})}}else if("Feature"===t.type){const e=t.geometry.type;if("Polygon"===e||"MultiPolygon"===e)return new gr(t,t.geometry)}else if("Polygon"===t.type||"MultiPolygon"===t.type)return new gr(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],n=[1/0,1/0,-1/0,-1/0],o=e.canonicalID();if("Polygon"===t.type){const a=fr(t.coordinates,n,o),i=yr(e.geometry(),r,n,o);if(!rr(r,n))return!1;for(const e of i)if(!sr(e,a))return!1}if("MultiPolygon"===t.type){const a=dr(t.coordinates,n,o),i=yr(e.geometry(),r,n,o);if(!rr(r,n))return!1;for(const e of i)if(!lr(e,a))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],n=[1/0,1/0,-1/0,-1/0],o=e.canonicalID();if("Polygon"===t.type){const a=fr(t.coordinates,n,o),i=hr(e.geometry(),r,n,o);if(!rr(r,n))return!1;for(const e of i)if(!ur(e,a))return!1}if("MultiPolygon"===t.type){const a=dr(t.coordinates,n,o),i=hr(e.geometry(),r,n,o);if(!rr(r,n))return!1;for(const e of i)if(!pr(e,a))return!1}return!0}(e,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class vr{constructor(e=[],t=(e,t)=>e<t?-1:e>t?1:0){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._up(this.length++)}pop(){if(0===this.length)return;const e=this.data[0],t=this.data.pop();return--this.length>0&&(this.data[0]=t,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:t,compare:r}=this,n=t[e];for(;e>0;){const o=e-1>>1,a=t[o];if(r(n,a)>=0)break;t[e]=a,e=o}t[e]=n}_down(e){const{data:t,compare:r}=this,n=this.length>>1,o=t[e];for(;e<n;){let n=1+(e<<1);const a=n+1;if(a<this.length&&r(t[a],t[n])<0&&(n=a),r(t[n],o)>=0)break;t[e]=t[n],e=n}t[e]=o}}function br(e){let t=0;for(let r,n,o=0,a=e.length,i=a-1;o<a;i=o++)r=e[o],n=e[i],t+=(n.x-r.x)*(r.y+n.y);return t}const xr=1/298.257223563,wr=xr*(2-xr),kr=Math.PI/180;class Mr{constructor(e){const t=6378.137*kr*1e3,r=Math.cos(e*kr),n=1/(1-wr*(1-r*r)),o=Math.sqrt(n);this.kx=t*o*r,this.ky=t*o*n*(1-wr)}distance(e,t){const r=this.wrap(e[0]-t[0])*this.kx,n=(e[1]-t[1])*this.ky;return Math.sqrt(r*r+n*n)}pointOnLine(e,t){let r,n,o,a,i=1/0;for(let s=0;s<e.length-1;s++){let l=e[s][0],u=e[s][1],p=this.wrap(e[s+1][0]-l)*this.kx,c=(e[s+1][1]-u)*this.ky,f=0;0===p&&0===c||(f=(this.wrap(t[0]-l)*this.kx*p+(t[1]-u)*this.ky*c)/(p*p+c*c),f>1?(l=e[s+1][0],u=e[s+1][1]):f>0&&(l+=p/this.kx*f,u+=c/this.ky*f)),p=this.wrap(t[0]-l)*this.kx,c=(t[1]-u)*this.ky;const d=p*p+c*c;d<i&&(i=d,r=l,n=u,o=s,a=f)}return{point:[r,n],index:o,t:Math.max(0,Math.min(1,a))}}wrap(e){for(;e<-180;)e+=360;for(;e>180;)e-=360;return e}}function Sr(e,t){return t[0]-e[0]}function zr(e){return e[1]-e[0]+1}function Ir(e,t){return e[1]>=e[0]&&e[1]<t}function Ar(e,t){if(e[0]>e[1])return[null,null];const r=zr(e);if(t){if(2===r)return[e,null];const t=Math.floor(r/2);return[[e[0],e[0]+t],[e[0]+t,e[1]]]}if(1===r)return[e,null];const n=Math.floor(r/2)-1;return[[e[0],e[0]+n],[e[0]+n+1,e[1]]]}function _r(e,t){if(!Ir(t,e.length))return[1/0,1/0,-1/0,-1/0];const r=[1/0,1/0,-1/0,-1/0];for(let n=t[0];n<=t[1];++n)tr(r,e[n]);return r}function Er(e){const t=[1/0,1/0,-1/0,-1/0];for(const r of e)for(const e of r)tr(t,e);return t}function jr(e){return e[0]!==-1/0&&e[1]!==-1/0&&e[2]!==1/0&&e[3]!==1/0}function $r(e,t,r){if(!jr(e)||!jr(t))return NaN;let n=0,o=0;return e[2]<t[0]&&(n=t[0]-e[2]),e[0]>t[2]&&(n=e[0]-t[2]),e[1]>t[3]&&(o=e[1]-t[3]),e[3]<t[1]&&(o=t[1]-e[3]),r.distance([0,0],[n,o])}function Cr(e,t,r){const n=r.pointOnLine(t,e);return r.distance(e,n.point)}function Pr(e,t,r,n,o){const a=Math.min(Cr(e,[r,n],o),Cr(t,[r,n],o)),i=Math.min(Cr(r,[e,t],o),Cr(n,[e,t],o));return Math.min(a,i)}function Tr(e,t,r,n,o){if(!(Ir(t,e.length)&&Ir(n,r.length)))return 1/0;let a=1/0;for(let i=t[0];i<t[1];++i){const t=e[i],s=e[i+1];for(let e=n[0];e<n[1];++e){const n=r[e],i=r[e+1];if(ar(t,s,n,i))return 0;a=Math.min(a,Pr(t,s,n,i,o))}}return a}function qr(e,t,r,n,o){if(!(Ir(t,e.length)&&Ir(n,r.length)))return NaN;let a=1/0;for(let i=t[0];i<=t[1];++i)for(let t=n[0];t<=n[1];++t)if(a=Math.min(a,o.distance(e[i],r[t])),0===a)return a;return a}function Fr(e,t,r){if(sr(e,t,!0))return 0;let n=1/0;for(const o of t){const t=o[0],a=o[o.length-1];if(t!==a&&(n=Math.min(n,Cr(e,[a,t],r)),0===n))return n;const i=r.pointOnLine(o,e);if(n=Math.min(n,r.distance(e,i.point)),0===n)return n}return n}function Or(e,t,r,n){if(!Ir(t,e.length))return NaN;for(let n=t[0];n<=t[1];++n)if(sr(e[n],r,!0))return 0;let o=1/0;for(let a=t[0];a<t[1];++a){const t=e[a],i=e[a+1];for(const e of r)for(let r=0,a=e.length,s=a-1;r<a;s=r++){const a=e[s],l=e[r];if(ar(t,i,a,l))return 0;o=Math.min(o,Pr(t,i,a,l,n))}}return o}function Nr(e,t){for(const r of e)for(const e of r)if(sr(e,t,!0))return!0;return!1}function Dr(e,t,r,n=1/0){const o=Er(e),a=Er(t);if(n!==1/0&&$r(o,a,r)>=n)return n;if(rr(o,a)){if(Nr(e,t))return 0}else if(Nr(t,e))return 0;let i=1/0;for(const n of e)for(let e=0,o=n.length,a=o-1;e<o;a=e++){const o=n[a],s=n[e];for(const e of t)for(let t=0,n=e.length,a=n-1;t<n;a=t++){const n=e[a],l=e[t];if(ar(o,s,n,l))return 0;i=Math.min(i,Pr(o,s,n,l,r))}}return i}function Lr(e,t,r,n,o,a){if(!a)return;const i=$r(_r(n,a),o,r);i<t&&e.push([i,a,[0,0]])}function Rr(e,t,r,n,o,a,i){if(!a||!i)return;const s=$r(_r(n,a),_r(o,i),r);s<t&&e.push([s,a,i])}function Gr(e,t,r,n,o=1/0){let a=Math.min(n.distance(e[0],r[0][0]),o);if(0===a)return a;const i=new vr([[0,[0,e.length-1],[0,0]]],Sr),s=Er(r);for(;i.length>0;){const o=i.pop();if(o[0]>=a)continue;const l=o[1],u=t?50:100;if(zr(l)<=u){if(!Ir(l,e.length))return NaN;if(t){const t=Or(e,l,r,n);if(isNaN(t)||0===t)return t;a=Math.min(a,t)}else for(let t=l[0];t<=l[1];++t){const o=Fr(e[t],r,n);if(a=Math.min(a,o),0===a)return 0}}else{const r=Ar(l,t);Lr(i,a,n,e,s,r[0]),Lr(i,a,n,e,s,r[1])}}return a}function Ur(e,t,r,n,o,a=1/0){let i=Math.min(a,o.distance(e[0],r[0]));if(0===i)return i;const s=new vr([[0,[0,e.length-1],[0,r.length-1]]],Sr);for(;s.length>0;){const a=s.pop();if(a[0]>=i)continue;const l=a[1],u=a[2],p=t?50:100,c=n?50:100;if(zr(l)<=p&&zr(u)<=c){if(!Ir(l,e.length)&&Ir(u,r.length))return NaN;let a;if(t&&n)a=Tr(e,l,r,u,o),i=Math.min(i,a);else if(t&&!n){const t=e.slice(l[0],l[1]+1);for(let e=u[0];e<=u[1];++e)if(a=Cr(r[e],t,o),i=Math.min(i,a),0===i)return i}else if(!t&&n){const t=r.slice(u[0],u[1]+1);for(let r=l[0];r<=l[1];++r)if(a=Cr(e[r],t,o),i=Math.min(i,a),0===i)return i}else a=qr(e,l,r,u,o),i=Math.min(i,a)}else{const a=Ar(l,t),p=Ar(u,n);Rr(s,i,o,e,r,a[0],p[0]),Rr(s,i,o,e,r,a[0],p[1]),Rr(s,i,o,e,r,a[1],p[0]),Rr(s,i,o,e,r,a[1],p[1])}}return i}function Br(e,t){const r=e.geometry();if(0===r.length||0===r[0].length)return NaN;const n=function(e){if(e.length<=1)return[e];const t=[];let r,n;for(const o of e){const e=br(o);0!==e&&(o.area=Math.abs(e),void 0===n&&(n=e<0),n===e<0?(r&&t.push(r),r=[o]):r.push(o))}return r&&t.push(r),t}(r).map(t=>t.map(t=>t.map(t=>er([t.x,t.y],e.canonical)))),o=new Mr(n[0][0][0][1]);let a=1/0;for(const e of t)for(const t of n){switch(e.type){case"Point":a=Math.min(a,Gr([e.coordinates],!1,t,o,a));break;case"LineString":a=Math.min(a,Gr(e.coordinates,!0,t,o,a));break;case"Polygon":a=Math.min(a,Dr(t,e.coordinates,o,a))}if(0===a)return a}return a}function Hr(e){return"MultiPolygon"===e.type?e.coordinates.map(e=>({type:"Polygon",coordinates:e})):"MultiLineString"===e.type?e.coordinates.map(e=>({type:"LineString",coordinates:e})):"MultiPoint"===e.type?e.coordinates.map(e=>({type:"Point",coordinates:e})):[e]}class Zr{constructor(e,t){this.type=ne,this.geojson=e,this.geometries=t}static parse(e,t){if(2!==e.length)return t.error(`'distance' expression requires exactly one argument, but found ${e.length-1} instead.`);if(ut(e[1])){const t=e[1];if("FeatureCollection"===t.type)return new Zr(t,t.features.map(e=>Hr(e.geometry)).flat());if("Feature"===t.type)return new Zr(t,Hr(t.geometry));if("type"in t&&"coordinates"in t)return new Zr(t,Hr(t))}return t.error("'distance' 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=e.geometry(),n=r.flat().map(t=>er([t.x,t.y],e.canonical));if(0===r.length)return NaN;const o=new Mr(n[0][1]);let a=1/0;for(const e of t){switch(e.type){case"Point":a=Math.min(a,Ur(n,!1,[e.coordinates],!1,o,a));break;case"LineString":a=Math.min(a,Ur(n,!1,e.coordinates,!0,o,a));break;case"Polygon":a=Math.min(a,Gr(n,!1,e.coordinates,o,a))}if(0===a)return a}return a}(e,this.geometries);if("LineString"===e.geometryType())return function(e,t){const r=e.geometry(),n=r.flat().map(t=>er([t.x,t.y],e.canonical));if(0===r.length)return NaN;const o=new Mr(n[0][1]);let a=1/0;for(const e of t){switch(e.type){case"Point":a=Math.min(a,Ur(n,!0,[e.coordinates],!1,o,a));break;case"LineString":a=Math.min(a,Ur(n,!0,e.coordinates,!0,o,a));break;case"Polygon":a=Math.min(a,Gr(n,!0,e.coordinates,o,a))}if(0===a)return a}return a}(e,this.geometries);if("Polygon"===e.geometryType())return Br(e,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class Vr{constructor(e){this.type=ue,this.key=e}static parse(e,t){if(2!==e.length)return t.error(`Expected 1 argument, but found ${e.length-1} instead.`);const r=e[1];return null==r?t.error("Global state property must be defined."):"string"!=typeof r?t.error(`Global state property must be string, but found ${typeof e[1]} instead.`):new Vr(r)}evaluate(e){var t;const r=null===(t=e.globals)||void 0===t?void 0:t.globalState;return r&&0!==Object.keys(r).length?Le(r,this.key):null}eachChild(){}outputDefined(){return!1}}const Wr={"==":Rt,"!=":Gt,">":Bt,"<":Ut,">=":Zt,"<=":Ht,array:mt,at:kt,boolean:mt,case:It,coalesce:Ot,collator:Vt,format:Jt,image:Xt,in:Mt,"index-of":St,interpolate:qt,"interpolate-hcl":qt,"interpolate-lab":qt,length:Yt,let:xt,literal:ft,match:zt,number:mt,"number-format":Wt,object:mt,slice:At,step:Et,string:mt,"to-boolean":ht,"to-color":ht,"to-number":ht,"to-string":ht,var:wt,within:gr,distance:Zr,"global-state":Vr};class Jr{constructor(e,t,r,n){this.name=e,this.type=t,this._evaluate=r,this.args=n}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],n=Jr.definitions[r];if(!n)return t.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0);const o=Array.isArray(n)?n[0]:n.type,a=Array.isArray(n)?[[n[1],n[2]]]:n.overloads,i=a.filter(([t])=>!Array.isArray(t)||t.length===e.length-1);let s=null;for(const[n,a]of i){s=new bt(t.registry,en,t.path,null,t.scope);const i=[];let l=!1;for(let t=1;t<e.length;t++){const r=e[t],o=Array.isArray(n)?n[t-1]:n.type,a=s.parse(r,1+i.length,o);if(!a){l=!0;break}i.push(a)}if(!l)if(Array.isArray(n)&&n.length!==i.length)s.error(`Expected ${n.length} arguments, but found ${i.length} instead.`);else{for(let e=0;e<i.length;e++){const t=Array.isArray(n)?n[e]:n.type,r=i[e];s.concat(e+1).checkSubtype(t,r.type)}if(0===s.errors.length)return new Jr(r,o,a,i)}}if(1===i.length)t.errors.push(...s.errors);else{const r=(i.length?i:a).map(([e])=>{return t=e,Array.isArray(t)?`(${t.map(ve).join(", ")})`:`(${ve(t.type)}...)`;var t}).join(" | "),n=[];for(let r=1;r<e.length;r++){const o=t.parse(e[r],1+n.length);if(!o)return null;n.push(ve(o.type))}t.error(`Expected arguments of type ${r}, but found (${n.join(", ")}) instead.`)}return null}static register(e,t){Jr.definitions=t;for(const r in t)e[r]=Jr}}function Xr(e,[t,r,n,o]){t=t.evaluate(e),r=r.evaluate(e),n=n.evaluate(e);const a=o?o.evaluate(e):1,i=lt(t,r,n,a);if(i)throw new nt(i);return new Je(t/255,r/255,n/255,a,!1)}function Yr(e,t){return e in t}function Kr(e,t){const r=t[e];return void 0===r?null:r}function Qr(e){return{type:e}}function en(e){if(e instanceof wt)return en(e.boundExpression);if(e instanceof Jr&&"error"===e.name)return!1;if(e instanceof Vt)return!1;if(e instanceof gr)return!1;if(e instanceof Zr)return!1;if(e instanceof Vr)return!1;const t=e instanceof ht||e instanceof mt;let r=!0;return e.eachChild(e=>{r=t?r&&en(e):r&&e instanceof ft}),!!r&&(tn(e)&&nn(e,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"]))}function tn(e){if(e instanceof Jr){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 gr)return!1;if(e instanceof Zr)return!1;let t=!0;return e.eachChild(e=>{t&&!tn(e)&&(t=!1)}),t}function rn(e){if(e instanceof Jr&&"feature-state"===e.name)return!1;let t=!0;return e.eachChild(e=>{t&&!rn(e)&&(t=!1)}),t}function nn(e,t){if(e instanceof Jr&&t.indexOf(e.name)>=0)return!1;let r=!0;return e.eachChild(e=>{r&&!nn(e,t)&&(r=!1)}),r}function on(e){return{result:"success",value:e}}function an(e){return{result:"error",value:e}}function sn(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&pt(e)===le}Jr.register(Wr,{error:[{kind:"error"},[oe],(e,[t])=>{throw new nt(t.evaluate(e))}],typeof:[oe,[ue],(e,[t])=>ve(pt(t.evaluate(e)))],"to-rgba":[ge(ne,4),[ie],(e,[t])=>{const[r,n,o,a]=t.evaluate(e).rgb;return[255*r,255*n,255*o,a]}],rgb:[ie,[ne,ne,ne],Xr],rgba:[ie,[ne,ne,ne,ne],Xr],has:{type:ae,overloads:[[[oe],(e,[t])=>Yr(t.evaluate(e),e.properties())],[[oe,le],(e,[t,r])=>Yr(t.evaluate(e),r.evaluate(e))]]},get:{type:ue,overloads:[[[oe],(e,[t])=>Kr(t.evaluate(e),e.properties())],[[oe,le],(e,[t,r])=>Kr(t.evaluate(e),r.evaluate(e))]]},"feature-state":[ue,[oe],(e,[t])=>Kr(t.evaluate(e),e.featureState||{})],properties:[le,[],e=>e.properties()],"geometry-type":[oe,[],e=>e.geometryType()],id:[ue,[],e=>e.id()],zoom:[ne,[],e=>e.globals.zoom],"heatmap-density":[ne,[],e=>e.globals.heatmapDensity||0],elevation:[ne,[],e=>e.globals.elevation||0],"line-progress":[ne,[],e=>e.globals.lineProgress||0],accumulated:[ue,[],e=>void 0===e.globals.accumulated?null:e.globals.accumulated],"+":[ne,Qr(ne),(e,t)=>{let r=0;for(const n of t)r+=n.evaluate(e);return r}],"*":[ne,Qr(ne),(e,t)=>{let r=1;for(const n of t)r*=n.evaluate(e);return r}],"-":{type:ne,overloads:[[[ne,ne],(e,[t,r])=>t.evaluate(e)-r.evaluate(e)],[[ne],(e,[t])=>-t.evaluate(e)]]},"/":[ne,[ne,ne],(e,[t,r])=>t.evaluate(e)/r.evaluate(e)],"%":[ne,[ne,ne],(e,[t,r])=>t.evaluate(e)%r.evaluate(e)],ln2:[ne,[],()=>Math.LN2],pi:[ne,[],()=>Math.PI],e:[ne,[],()=>Math.E],"^":[ne,[ne,ne],(e,[t,r])=>Math.pow(t.evaluate(e),r.evaluate(e))],sqrt:[ne,[ne],(e,[t])=>Math.sqrt(t.evaluate(e))],log10:[ne,[ne],(e,[t])=>Math.log(t.evaluate(e))/Math.LN10],ln:[ne,[ne],(e,[t])=>Math.log(t.evaluate(e))],log2:[ne,[ne],(e,[t])=>Math.log(t.evaluate(e))/Math.LN2],sin:[ne,[ne],(e,[t])=>Math.sin(t.evaluate(e))],cos:[ne,[ne],(e,[t])=>Math.cos(t.evaluate(e))],tan:[ne,[ne],(e,[t])=>Math.tan(t.evaluate(e))],asin:[ne,[ne],(e,[t])=>Math.asin(t.evaluate(e))],acos:[ne,[ne],(e,[t])=>Math.acos(t.evaluate(e))],atan:[ne,[ne],(e,[t])=>Math.atan(t.evaluate(e))],min:[ne,Qr(ne),(e,t)=>Math.min(...t.map(t=>t.evaluate(e)))],max:[ne,Qr(ne),(e,t)=>Math.max(...t.map(t=>t.evaluate(e)))],abs:[ne,[ne],(e,[t])=>Math.abs(t.evaluate(e))],round:[ne,[ne],(e,[t])=>{const r=t.evaluate(e);return r<0?-Math.round(-r):Math.round(r)}],floor:[ne,[ne],(e,[t])=>Math.floor(t.evaluate(e))],ceil:[ne,[ne],(e,[t])=>Math.ceil(t.evaluate(e))],"filter-==":[ae,[oe,ue],(e,[t,r])=>e.properties()[t.value]===r.value],"filter-id-==":[ae,[ue],(e,[t])=>e.id()===t.value],"filter-type-==":[ae,[oe],(e,[t])=>e.geometryType()===t.value],"filter-<":[ae,[oe,ue],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n<o}],"filter-id-<":[ae,[ue],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<n}],"filter->":[ae,[oe,ue],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n>o}],"filter-id->":[ae,[ue],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>n}],"filter-<=":[ae,[oe,ue],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n<=o}],"filter-id-<=":[ae,[ue],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r<=n}],"filter->=":[ae,[oe,ue],(e,[t,r])=>{const n=e.properties()[t.value],o=r.value;return typeof n==typeof o&&n>=o}],"filter-id->=":[ae,[ue],(e,[t])=>{const r=e.id(),n=t.value;return typeof r==typeof n&&r>=n}],"filter-has":[ae,[ue],(e,[t])=>t.value in e.properties()],"filter-has-id":[ae,[],e=>null!==e.id()&&void 0!==e.id()],"filter-type-in":[ae,[ge(oe)],(e,[t])=>t.value.indexOf(e.geometryType())>=0],"filter-id-in":[ae,[ge(ue)],(e,[t])=>t.value.indexOf(e.id())>=0],"filter-in-small":[ae,[oe,ge(ue)],(e,[t,r])=>r.value.indexOf(e.properties()[t.value])>=0],"filter-in-large":[ae,[oe,ge(ue)],(e,[t,r])=>function(e,t,r,n){for(;r<=n;){const o=r+n>>1;if(t[o]===e)return!0;t[o]>e?n=o-1:r=o+1}return!1}(e.properties()[t.value],r.value,0,r.value.length-1)],all:{type:ae,overloads:[[[ae,ae],(e,[t,r])=>t.evaluate(e)&&r.evaluate(e)],[Qr(ae),(e,t)=>{for(const r of t)if(!r.evaluate(e))return!1;return!0}]]},any:{type:ae,overloads:[[[ae,ae],(e,[t,r])=>t.evaluate(e)||r.evaluate(e)],[Qr(ae),(e,t)=>{for(const r of t)if(r.evaluate(e))return!0;return!1}]]},"!":[ae,[ae],(e,[t])=>!t.evaluate(e)],"is-supported-script":[ae,[oe],(e,[t])=>{const r=e.globals&&e.globals.isSupportedScript;return!r||r(t.evaluate(e))}],upcase:[oe,[oe],(e,[t])=>t.evaluate(e).toUpperCase()],downcase:[oe,[oe],(e,[t])=>t.evaluate(e).toLowerCase()],concat:[oe,Qr(ue),(e,t)=>t.map(t=>ct(t.evaluate(e))).join("")],split:[ge(oe),[oe,oe],(e,[t,r])=>t.evaluate(e).split(r.evaluate(e))],join:[oe,[ge(oe),oe],(e,[t,r])=>t.evaluate(e).join(r.evaluate(e))],"resolved-locale":[oe,[pe],(e,[t])=>t.evaluate(e).resolvedLocale()]});class ln{constructor(e,t,r){this.expression=e,this._warningHistory={},this._evaluator=new vt,this._defaultValue=t?function(e){if("color"===e.type&&sn(e.default))return new Je(0,0,0,0);switch(e.type){case"color":return Je.parse(e.default)||null;case"padding":return et.parse(e.default)||null;case"numberArray":return tt.parse(e.default)||null;case"colorArray":return rt.parse(e.default)||null;case"variableAnchorOffsetCollection":return at.parse(e.default)||null;case"projectionDefinition":return st.parse(e.default)||null;default:return void 0===e.default?null:e.default}}(t):null,this._enumValues=t&&"enum"===t.type?t.values:null,this._globalState=r}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=hn(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t,this._evaluator.featureState=r,this._evaluator.canonical=n,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a,this.expression.evaluate(this._evaluator)}evaluate(e,t,r,n,o,a){this._globalState&&(e=hn(e,this._globalState)),this._evaluator.globals=e,this._evaluator.feature=t||null,this._evaluator.featureState=r||null,this._evaluator.canonical=n,this._evaluator.availableImages=o||null,this._evaluator.formattedSection=a||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 nt(`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 un(e){return Array.isArray(e)&&e.length>0&&"string"==typeof e[0]&&e[0]in Wr}function pn(e,t,r){const n=new bt(Wr,en,[],t?function(e){const t={color:ie,string:oe,number:ne,enum:oe,boolean:ae,formatted:ce,padding:fe,numberArray:me,colorArray:de,projectionDefinition:se,resolvedImage:ye,variableAnchorOffsetCollection:he};if("array"===e.type)return ge(t[e.value]||ue,e.length);return t[e.type]}(t):void 0),o=n.parse(e,void 0,void 0,void 0,t&&"string"===t.type?{typeAnnotation:"coerce"}:void 0);return o?on(new ln(o,t,r)):an(n.errors)}class cn{constructor(e,t,r){this.kind=e,this._styleExpression=t,this.isStateDependent="constant"!==e&&!rn(t.expression),this.globalStateRefs=yn(t.expression),this._globalState=r}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=hn(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,o,a)}evaluate(e,t,r,n,o,a){return this._globalState&&(e=hn(e,this._globalState)),this._styleExpression.evaluate(e,t,r,n,o,a)}}class fn{constructor(e,t,r,n,o){this.kind=e,this.zoomStops=r,this._styleExpression=t,this.isStateDependent="camera"!==e&&!rn(t.expression),this.globalStateRefs=yn(t.expression),this.interpolationType=n,this._globalState=o}evaluateWithoutErrorHandling(e,t,r,n,o,a){return this._globalState&&(e=hn(e,this._globalState)),this._styleExpression.evaluateWithoutErrorHandling(e,t,r,n,o,a)}evaluate(e,t,r,n,o,a){return this._globalState&&(e=hn(e,this._globalState)),this._styleExpression.evaluate(e,t,r,n,o,a)}interpolationFactor(e,t,r){return this.interpolationType?qt.interpolationFactor(this.interpolationType,e,t,r):0}}function dn(e,t,r){const n=pn(e,t,r);if("error"===n.result)return n;const o=n.value.expression,a=tn(o);if(!a&&("data-driven"!==(i=t)["property-type"]&&"cross-faded-data-driven"!==i["property-type"]))return an([new ee("","data expressions not supported")]);var i;const s=nn(o,["zoom"]);if(!s&&!function(e){return!!e.expression&&e.expression.parameters.indexOf("zoom")>-1}(t))return an([new ee("","zoom expressions not supported")]);const l=mn(o);if(!l&&!s)return an([new ee("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(l instanceof ee)return an([l]);if(l instanceof qt&&!function(e){return!!e.expression&&e.expression.interpolated}(t))return an([new ee("",'"interpolate" expressions cannot be used with this property')]);if(!l)return on(new cn(a?"constant":"source",n.value,r));const u=l instanceof qt?l.interpolation:void 0;return on(new fn(a?"camera":"composite",n.value,l.labels,u,r))}function mn(e){let t=null;if(e instanceof xt)t=mn(e.result);else if(e instanceof Ot){for(const r of e.args)if(t=mn(r),t)break}else(e instanceof Et||e instanceof qt)&&e.input instanceof Jr&&"zoom"===e.input.name&&(t=e);return t instanceof ee||e.eachChild(e=>{const r=mn(e);r instanceof ee?t=r:!t&&r?t=new ee("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):t&&r&&t!==r&&(t=new ee("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),t}function yn(e,t=new Set){return e instanceof Vr&&t.add(e.key),e.eachChild(e=>{yn(e,t)}),t}function hn(e,t){const{zoom:r,heatmapDensity:n,elevation:o,lineProgress:a,isSupportedScript:i,accumulated:s}=null!=e?e:{};return{zoom:r,heatmapDensity:n,elevation:o,lineProgress:a,isSupportedScript:i,accumulated:s,globalState:t}}function gn(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(!gn(t)&&"boolean"!=typeof t)return!1;return!0;default:return!0}}const vn={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function bn(e,t){if(null==e)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};gn(e)||(e=kn(e));const r=pn(e,vn,t);if("error"===r.result)throw new Error(r.value.map(e=>`${e.key}: ${e.message}`).join(", "));return{filter:(e,t,n)=>r.value.evaluate(e,t,{},n),needGeometry:wn(e),getGlobalStateRefs:()=>yn(r.value.expression)}}function xn(e,t){return e<t?-1:e>t?1:0}function wn(e){if(!Array.isArray(e))return!1;if("within"===e[0]||"distance"===e[0])return!0;for(let t=1;t<e.length;t++)if(wn(e[t]))return!0;return!1}function kn(e){if(!e)return!0;const t=e[0];if(e.length<=1)return"any"!==t;var r;return"=="===t?Mn(e[1],e[2],"=="):"!="===t?In(Mn(e[1],e[2],"==")):"<"===t||">"===t||"<="===t||">="===t?Mn(e[1],e[2],t):"any"===t?(r=e.slice(1),["any"].concat(r.map(kn))):"all"===t?["all"].concat(e.slice(1).map(kn)):"none"===t?["all"].concat(e.slice(1).map(kn).map(In)):"in"===t?Sn(e[1],e.slice(2)):"!in"===t?In(Sn(e[1],e.slice(2))):"has"===t?zn(e[1]):"!has"!==t||In(zn(e[1]))}function Mn(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 Sn(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(xn)]]:["filter-in-small",e,["literal",t]]}}function zn(e){switch(e){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",e]}}function In(e){return["!",e]}function An(e){return"object"==typeof e?["literal",e]:e}function _n(e,t){let r=e.stops;if(!r)return function(e,t){const r=["get",e.property];if(void 0===e.default)return"string"===t.type?["string",r]:r;if("enum"===t.type)return["match",r,Object.keys(t.values),r,e.default];{const n=["color"===t.type?"to-color":t.type,r,An(e.default)];return"array"===t.type&&n.splice(1,0,t.value,t.length||null),n}}(e,t);const n=r&&"object"==typeof r[0][0],o=n||void 0!==e.property,a=n||!o;return r=r.map(e=>!o&&t.tokens&&"string"==typeof e[1]?[e[0],qn(e[1])]:[e[0],An(e[1])]),n?function(e,t,r){const n={},o={},a=[];for(let t=0;t<r.length;t++){const i=r[t],s=i[0].zoom;void 0===n[s]&&(n[s]={zoom:s,type:e.type,property:e.property,default:e.default},o[s]=[],a.push(s)),o[s].push([i[0].value,i[1]])}const i=Tn({},t);if("exponential"===i){const r=[En(e),["linear"],["zoom"]];for(const e of a){Pn(r,e,$n(n[e],t,o[e]),!1)}return r}{const e=["step",["zoom"]];for(const r of a){Pn(e,r,$n(n[r],t,o[r]),!0)}return Cn(e),e}}(e,t,r):a?function(e,t,r,n=["zoom"]){const o=Tn(e,t);let a,i=!1;if("interval"===o)a=["step",n],i=!0;else{if("exponential"!==o)throw new Error(`Unknown zoom function type "${o}"`);{const t=void 0!==e.base?e.base:1;a=[En(e),1===t?["linear"]:["exponential",t],n]}}for(const e of r)Pn(a,e[0],e[1],i);return Cn(a),a}(e,t,r):$n(e,t,r)}function En(e){switch(e.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function jn(e,t){const r=An((n=e.default,o=t.default,void 0!==n?n:void 0!==o?o:void 0));var n,o;return void 0===r&&"resolvedImage"===t.type?"":r}function $n(e,t,r){const n=Tn(e,t),o=["get",e.property];if("categorical"===n&&"boolean"==typeof r[0][0]){const n=["case"];for(const e of r)n.push(["==",o,e[0]],e[1]);return n.push(jn(e,t)),n}if("categorical"===n){const n=["match",o];for(const e of r)Pn(n,e[0],e[1],!1);return n.push(jn(e,t)),n}if("interval"===n){const t=["step",["number",o]];for(const e of r)Pn(t,e[0],e[1],!0);return Cn(t),void 0===e.default?t:["case",["==",["typeof",o],"number"],t,An(e.default)]}if("exponential"===n){const t=void 0!==e.base?e.base:1,n=[En(e),1===t?["linear"]:["exponential",t],["number",o]];for(const e of r)Pn(n,e[0],e[1],!1);return void 0===e.default?n:["case",["==",["typeof",o],"number"],n,An(e.default)]}throw new Error(`Unknown property function type ${n}`)}function Cn(e){"step"===e[0]&&3===e.length&&(e.push(0),e.push(e[3]))}function Pn(e,t,r,n){e.length>3&&t===e[e.length-2]||(n&&2===e.length||e.push(t),e.push(r))}function Tn(e,t){return e.type?e.type:t.expression.interpolated?"exponential":"interval"}function qn(e){const t=["concat"],r=/{([^{}]+)}/g;let n=0;for(let o=r.exec(e);null!==o;o=r.exec(e)){const a=e.slice(n,r.lastIndex-o[0].length);n=r.lastIndex,a.length>0&&t.push(a),t.push(["get",o[1]])}if(1===t.length)return e;if(n<e.length)t.push(e.slice(n));else if(2===t.length)return["to-string",t[1]];return t}const Fn=Y;function On(e,t){const r=t[0].evaluate(e),n=t[1].evaluate(e),o=t[2].evaluate(e),a=t[3]?t[3].evaluate(e):1;return Je.parse(`hsla(${r}, ${n}%, ${o}%, ${a})`)}function Nn(e){if(Array.isArray(e)){if(0===e.length)return e;const t=e[0];if("literal"===t)return e;if("image"===t&&3===e.length&&"object"==typeof e[2]&&null!==e[2]&&!Array.isArray(e[2])){return["image-config",Nn(e[1]),["literal",e[2]]]}const r=e.length;for(let n=1;n<r;++n){const o=e[n],a=Nn(o);if(a!==o){const o=[t];for(let t=1;t<n;++t)o.push(e[t]);o.push(a);for(let t=n+1;t<r;++t)o.push(Nn(e[t]));return o}}}return e}const Dn={},Ln={zoom:0,distanceFromCenter:0};Jr.register(Wr,{...Jr.definitions,pitch:[{kind:"number"},[],e=>Ln.pitch||0],"distance-from-center":[{kind:"number"},[],e=>Ln.distanceFromCenter||0],"to-hsla":[{kind:"array",itemType:{kind:"number"},N:4},[{kind:"string"}],(e,[t])=>function(e){const t=e[0]/255,r=e[1]/255,n=e[2]/255,o=e[3],a=Math.max(t,r,n),i=Math.min(t,r,n),s=(a+i)/2;let l,u;if(a===i)l=0,u=0;else{const e=a-i;switch(u=s>.5?e/(2-a-i):e/(a+i),a){case t:l=(r-n)/e+(r<n?6:0);break;case r:l=(n-t)/e+2;break;case n:l=(t-r)/e+4;break;default:l=0}l/=6}return[360*l,100*u,100*s,o]}(A(t.evaluate(e)))],hsl:[{kind:"color"},[{kind:"number"},{kind:"number"},{kind:"number"}],On],hsla:[{kind:"color"},[{kind:"number"},{kind:"number"},{kind:"number"},{kind:"number"}],On],"image-config":[{kind:"value"},[{kind:"string"},{kind:"value"}],(e,[t,r])=>t.evaluate(e)],"measure-light":[{kind:"number"},[{kind:"value"}],()=>1],config:[{kind:"value"},[{kind:"string"}],(e,[t])=>{const r=Dn[t.evaluate(e)];return void 0===r?{}:r}]});var Rn={thin:100,hairline:100,"ultra-light":200,"extra-light":200,light:300,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,"extra-bold":800,"ultra-bold":800,heavy:900,black:900,"heavy-black":900,fat:900,poster:900,"ultra-black":950,"extra-black":950},Gn=" ",Un=/(italic|oblique)$/i,Bn={};function Hn(e,t,r){var n=Bn[e];if(!n){Array.isArray(e)||(e=[e]);for(var o,a,i=400,s="normal",l=[],u=0,p=e.length;u<p;++u){var c=e[u].split(" "),f=c[c.length-1].toLowerCase();for(var d in"normal"==f||"italic"==f||"oblique"==f?(s=a?s:f,a=!0,c.pop(),f=c[c.length-1].toLowerCase()):Un.test(f)&&(f=f.replace(Un,""),s=a?s:c[c.length-1].replace(f,""),a=!0),Rn){var m=c.length>1?c[c.length-2].toLowerCase():"";if(f==d||f==d.replace("-","")||m+"-"+f==d){i=o?i:Rn[d],c.pop(),m&&d.startsWith(m)&&c.pop();break}}o||"number"!=typeof f||(i=f,o=!0);var y=c.join(Gn).replace("Klokantech Noto Sans","Noto Sans").replace("DIN Pro","Barlow").replace("Arial Unicode MS","Arial");-1!==y.indexOf(Gn)&&(y='"'+y+'"'),l.push(y)}n=Bn[e]=[s,i,l]}return n[0]+Gn+n[1]+Gn+t+"px"+(r?"/"+r:"")+Gn+n[2]}const Zn=Object.freeze({}),Vn={},Wn={};let Jn=0;function Xn(e){return e.id||(e.id=Jn++),e.id}function Yn(e){return e*Math.PI/180}const Kn=function(){const e=[];for(let t=78271.51696402048;e.length<=24;t/=2)e.push(t);return e}();function Qn(e,t){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(e,t);const r=document.createElement("canvas");return r.width=e,r.height=t,r}function eo(e,t,r,n){const o=[2*r*t.pixelRatio+t.width,2*r*t.pixelRatio+t.height],a=Qn(o[0],o[1]),i=a.getContext("2d");i.drawImage(e,t.x,t.y,t.width,t.height,r*t.pixelRatio,r*t.pixelRatio,t.width,t.height);const s=i.getImageData(0,0,o[0],o[1]);i.globalCompositeOperation="destination-over",i.fillStyle=`rgba(${255*n.r},${255*n.g},${255*n.b},${n.a})`;const l=s.data;for(let e=0,n=s.width;e<n;++e)for(let o=0,a=s.height;o<a;++o){l[4*(o*n+e)+3]>0&&i.arc(e,o,r*t.pixelRatio,0,2*Math.PI)}return i.fill(),a}function to(e,t,r){const n=Math.max(0,Math.min(1,(r-e)/(t-e)));return n*n*(3-2*n)}function ro(e,t,r){const n=Qn(t.width,t.height),o=n.getContext("2d");o.drawImage(e,t.x,t.y,t.width,t.height,0,0,t.width,t.height);const a=o.getImageData(0,0,t.width,t.height),i=a.data;for(let e=0,t=a.width;e<t;++e)for(let n=0,o=a.height;n<o;++n){const o=4*(n*t+e),a=.75,s=.1,l=to(a-s,a+s,i[o+3]/255);l>0?(i[o+0]=Math.round(255*r.r*l),i[o+1]=Math.round(255*r.g*l),i[o+2]=Math.round(255*r.b*l),i[o+3]=Math.round(255*l)):i[o+3]=0}return o.putImageData(a,0,0),n}const no=Array(256).join(" ");function oo(e,t){if(t>=.05){let r="";const n=e.split("\n"),o=no.slice(0,Math.round(t/.1));for(let e=0,t=n.length;e<t;++e)e>0&&(r+="\n"),r+=n[e].split("").join(o);return r}return e}let ao;function io(){return ao||(ao=Qn(1,1).getContext("2d")),ao}function so(e,t){return io().measureText(e).width+(e.length-1)*t}const lo={};function uo(e,t,r,n){if(-1!==e.indexOf("\n")){const o=e.split("\n"),a=[];for(let e=0,i=o.length;e<i;++e)a.push(uo(o[e],t,r,n));return a.join("\n")}const o=r+","+t+","+e+","+n;let a=lo[o];if(!a){const i=e.split(" ");if(i.length>1){const e=io();e.font=t;const o=e.measureText("M").width*r;let s="";const l=[];for(let e=0,t=i.length;e<t;++e){const t=i[e],r=s+(s?" ":"")+t;so(r,n)<=o?s=r:(s&&l.push(s),s=t)}s&&l.push(s);for(let e=0,t=l.length;e<t&&t>1;++e){const r=l[e];if(so(r,n)<.35*o){const o=e>0?so(l[e-1],n):1/0,a=e<t-1?so(l[e+1],n):1/0;l.splice(e,1),t-=1,o<a?(l[e-1]+=" "+r,e-=1):l[e]=r+" "+l[e]}}for(let e=0,t=l.length-1;e<t;++e){const r=l[e],a=l[e+1];if(so(r,n)>.7*o&&so(a,n)<.6*o){const i=r.split(" "),s=i.pop();so(s,n)<.2*o&&(l[e]=i.join(" "),l[e+1]=s+" "+a),t-=1}}a=l.join("\n")}else a=e;a=oo(a,n),lo[o]=a}return a}_.on("propertychange",()=>{for(const e in lo)delete lo[e]});const po={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},co={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},fo=function(e,t){let r=dn(e,t);if("error"===r.result){const n=Nn(e);n!==e&&(r=dn(n,t))}if("error"===r.result){const n=r.value[0];return console.error("Error parsing expression:",e,n.key,n.message),{evaluate:()=>t.default}}return r.value};let mo,yo;function ho(e,t,r,n,o,a){const i=e.id;o||(o={},console.warn("No functionCache provided to getValue()")),o[i]||(o[i]={});const s=o[i];if(!s[r]){let n=(e[t]||Zn)[r];const o=Fn[`${t}_${e.type}`]&&Fn[`${t}_${e.type}`][r];void 0===n&&o&&(n=o.default);let a=un(n);if(!a&&sn(n)&&(n=_n(n,o),a=!0),a){const e=fo(n,o);s[r]=e.evaluate.bind(e)}else{const e=o?o.type:typeof n;"color"!==e&&"colorArray"!==e||(n=Je.parse(n));let t=!1;if("array"===e)for(let e=0;e<n.length;++e){const r=n[e];if(un(r)||sn(r)){t=!0;break}}if(t){const e=Object.assign({},o,{type:o.value}),t=[];for(let r=0;r<n.length;++r){let o=n[r];if(!un(o)&&sn(o)&&(o=_n(o,e)),un(o)){const r=fo(o,e);t.push(r.evaluate.bind(r))}else t.push(function(){return o})}s[r]=function(e,r,n){const o=[];for(let a=0;a<t.length;++a)o[a]=t[a](e,r,n);return o}}else s[r]=function(){return n}}}return s[r](Ln,n,a)}function go(e,t,r,n){if(!ho(e,"layout",`${r}-allow-overlap`,t,n))return"declutter";return ho(e,"layout",`${r}-ignore-placement`,t,n)?"none":"obstacle"}function vo(e,t,r,n){if(n||console.warn("No filterCache provided to evaluateFilter()"),!(e in n))try{n[e]=bn(t).filter}catch(t){console.warn("Filter will evaluate to false: "+t.message),n[e]=function(){return!1}}return n[e](Ln,r)}function bo(e,t){if(e){if(0===e.a||0===t)return;const r=e.a;return t=void 0===t?1:t,0===r?"transparent":"rgba("+Math.round(255*e.r/r)+","+Math.round(255*e.g/r)+","+Math.round(255*e.b/r)+","+r*t+")"}return e}const xo=/\{[^{}}]*\}/g;function wo(e,t){return e.replace(xo,function(e){return t[e.slice(1,-1)]||""})}function ko(e,t){let r=e.split(":")[0];return r===e&&(r="default"),t[r]}let Mo=!1;const So={};function zo(t,n,o,a=Kn,i=void 0,s=void 0,l=void 0,u=void 0){if("string"==typeof n&&(n=JSON.parse(n)),n.schema)for(const e in n.schema){const t=n.schema[e];"default"in t&&(Dn[e]=t.default)}if(8!=n.version)throw new Error("glStyle version 8 required.");So[function(e,t){return Xn(e)+"."+E(t)}(n,t)]=Array.from(arguments);const p={};("string"==typeof s||s instanceof Request||s instanceof Response||s instanceof Promise)&&(s={default:s});for(const e in s){const r=s[e];f(()=>r).then(async r=>{let n;if("undefined"!=typeof Image){const o=new Image;if("string"==typeof r)o.crossOrigin="anonymous",o.src=r;else{let e;r instanceof Request?e=await fetch(r):r instanceof Response&&(e=r);const t=await e.blob();n=URL.createObjectURL(t),o.src=n}o.addEventListener("load",function r(){o.removeEventListener("load",r),p[e]={image:o,size:[o.width,o.height]},t.changed(),n&&URL.revokeObjectURL(n)}),o.addEventListener("error",function e(){URL.revokeObjectURL(n),o.removeEventListener("error",e)})}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){const t=self;t.postMessage({action:"loadImage",src:r}),t.addEventListener("message",function(t){"imageLoaded"===t.data.action&&t.data.src===r&&(p[e]={image:t.data.image,size:[t.data.image.width,t.data.image.height]})})}})}const x=function(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]=Q(e[r],t[e[r].ref]));return e}(n.layers),w={},k=[],M={},S={},z=function(e){let t=Vn[e.id];return t||(t={},Vn[Xn(e)]=t),t}(n),I=function(e){let t=Wn[e.id];return t||(t={},Wn[Xn(e)]=t),t}(n);let A;for(let e=0,t=x.length;e<t;++e){const t=x[e],r=t.id;if("string"==typeof o&&t.source==o||Array.isArray(o)&&-1!==o.indexOf(r)){const o=t["source-layer"];if(A){if(t.source!==A)throw new Error(`Layer "${r}" does not use source "${A}`)}else{A=t.source;const e=n.sources[A];if(!e)throw new Error(`Source "${A}" is not defined`);const r=e.type;if("vector"!==r&&"geojson"!==r)throw new Error(`Source "${A}" is not of type "vector" or "geojson", but "${r}"`)}let a=w[o];a||(a=[],w[o]=a),a.push({layer:t,index:e}),k.push(r)}}const _=[],j=function(o,s,f){const x=t.getSource?.()?.format_?.layerName_??"mvt:layer",k=o.getProperties(),A=w[k[x]];if(!A)return;let E=a.indexOf(s);-1==E&&(E=function(e,t){let r=0;const n=t.length;for(;r<n;++r)if(t[r]<e&&r+1<n){const n=t[r]/t[r+1];return r+Math.log(t[r]/e)/Math.log(n)}return n-1}(s,a)),Ln.zoom=E,Ln.distanceFromCenter=0;const j=o.getGeometry(),$=po[j.getType()],C=t.get("map");if(C&&C instanceof e&&1===$){const e=C.getSize();if(e){const t=C.getView().getCenter(),n=r(j.getExtent());Ln.distanceFromCenter=c(t,n)/s/e[1]}}const P={id:o.getId(),properties:k,type:$},T=t.get("mapbox-featurestate")[o.getId()];let q,F=-1;for(let e=0,r=A.length;e<r;++e){const r=A[e],a=r.layer,c=a.id;if(void 0!==f&&f!==c)continue;const x=a.layout||Zn,w=a.paint||Zn;if("none"===ho(a,"layout","visibility",P,z,T)||"minzoom"in a&&E<a.minzoom||"maxzoom"in a&&E>=a.maxzoom)continue;const j=a.filter;if(!j||vo(c,j,P,I)){let e,c,f,I,A,E;q=a;const j=r.index;if(3==$&&("fill"==a.type||"fill-extrusion"==a.type))if(c=ho(a,"paint",a.type+"-opacity",P,z,T),a.type+"-pattern"in w){const e=ho(a,"paint",a.type+"-pattern",P,z,T);if(e){const t="string"==typeof e?wo(e,k):e.toString(),r=ko(t,p);if(i&&i[t]&&r){++F,E=_[F],E&&E.getFill()&&!E.getStroke()&&!E.getText()||(E=new v({fill:new y}),_[F]=E),f=E.getFill(),E.setZIndex(j);const e=t+"."+c;let n=S[e];if(!n){const o=i[t],a=Qn(o.width,o.height),s=a.getContext("2d");s.globalAlpha=c,s.drawImage(r.image,o.x,o.y,o.width,o.height,0,0,o.width,o.height),n=s.createPattern(a,"repeat"),S[e]=n}f.setColor(n)}}}else if(e=bo(ho(a,"paint",a.type+"-color",P,z,T),c),a.type+"-outline-color"in w&&(A=bo(ho(a,"paint",a.type+"-outline-color",P,z,T),c)),A||(A=e),e||A){if(++F,E=_[F],(!E||e&&!E.getFill()||!e&&E.getFill()||A&&!E.getStroke()||!A&&E.getStroke()||E.getText())&&(E=new v({fill:e?new y:void 0,stroke:A?new g:void 0}),_[F]=E),e&&(f=E.getFill(),f.setColor(e)),"fill-extrusion"===a.type){const e=ho(a,"paint","fill-extrusion-height",P,z,T);if(e>0){const t=Math.max(.1,.9-Math.min(e,225)/280);if(A&&"transparent"!==A){const e=Je.parse(A);A=`rgba(${Math.round(255*e.r*t)},${Math.round(255*e.g*t)},${Math.round(255*e.b*t)},${e.a})`}}}A&&(I=E.getStroke(),I.setColor(A),I.setWidth(.5)),E.setZIndex(j)}if(1!=$&&"line"==a.type){e="line-pattern"in w?void 0:bo(ho(a,"paint","line-color",P,z,T),ho(a,"paint","line-opacity",P,z,T));const t=ho(a,"paint","line-width",P,z,T);e&&t>0&&(++F,E=_[F],E&&E.getStroke()&&!E.getFill()&&!E.getText()||(E=new v({stroke:new g}),_[F]=E),I=E.getStroke(),I.setLineCap(ho(a,"layout","line-cap",P,z,T)),I.setLineJoin(ho(a,"layout","line-join",P,z,T)),I.setMiterLimit(ho(a,"layout","line-miter-limit",P,z,T)),I.setColor(e),I.setWidth(t),I.setLineDash(w["line-dasharray"]?ho(a,"paint","line-dasharray",P,z,T).map(function(e){return e*t}):null),"function"==typeof I.setOffset&&I.setOffset(ho(a,"paint","line-offset",P,z,T)),E.setZIndex(j))}let C,O,N,D,L,R,G,U,B,H=!1,Z=null,V=0;if((1==$||2==$)&&"icon-image"in x){const e=ho(a,"layout","icon-image",P,z,T);if(e){let r;C="string"==typeof e?wo(e,k):e.toString();const n=u?u(t,C):void 0,l=ko(C,p);if(i&&i[C]&&l||n){const e=ho(a,"layout","icon-rotation-alignment",P,z,T);if(2==$){const t=o.getGeometry();if(t.getFlatMidpoint||t.getFlatMidpoints){const n=t.getExtent();if(Math.sqrt(Math.max(Math.pow((n[2]-n[0])/s,2),Math.pow((n[3]-n[1])/s,2)))>150){const n="MultiLineString"===t.getType()?t.getFlatMidpoints():t.getFlatMidpoint();yo||(mo=[NaN,NaN],yo=new d("Point",mo,[],2,{},void 0)),r=yo,mo[0]=n[0],mo[1]=n[1];if("line"===ho(a,"layout","symbol-placement",P,z,T)&&"map"===e){const e=t.getStride(),r=t.getFlatCoordinates();for(let t=0,o=r.length-e;t<o;t+=e){const o=r[t],a=r[t+1],i=r[t+e],s=r[t+e+1],l=Math.min(o,i),u=Math.max(o,i),p=n[0],c=(s-a)*(p-o)-(i-o)*(n[1]-a);if(Math.abs(c)<.001&&p<=u&&p>=l){V=Math.atan2(a-s,i-o);break}}}}}}if(2!==$||r){const t=ho(a,"layout","icon-size",P,z,T),o=void 0!==w["icon-color"]?ho(a,"paint","icon-color",P,z,T):null;if(!o||0!==o.a){const r=ho(a,"paint","icon-halo-color",P,z,T),s=ho(a,"paint","icon-halo-width",P,z,T);let u=`${C}.${t}.${s}.${r}`;if(null!==o&&(u+=`.${o}`),O=M[u],!O){const p=go(a,P,"icon",z);let c;"icon-offset"in x&&(c=ho(a,"layout","icon-offset",P,z,T).slice(0),c[0]*=t,c[1]*=-t);let f=o?[255*o.r,255*o.g,255*o.b,o.a]:void 0;if(n){const r={color:f,rotateWithView:"map"===e,displacement:c,declutterMode:p,scale:t};"string"==typeof n?r.src=n:(r.img=n,r.imgSize=[n.width,n.height]),O=new h(r)}else{const n=i[C];let a,u,d;if(s)n.sdf?(a=eo(ro(l.image,n,o||[0,0,0,1]),{x:0,y:0,width:n.width,height:n.height,pixelRatio:n.pixelRatio},s,r),f=void 0):a=eo(l.image,n,s,r);else{if(n.sdf&&!l.unSDFed){const e=ro(l.image,{x:0,y:0,width:l.size[0],height:l.size[1]},{r:1,g:1,b:1});l.image=e,l.unSDFed=!0}a=l.image,u=[n.width,n.height],d=[n.x,n.y]}O=new h({color:f,img:a,imgSize:l.size,size:u,offset:d,rotateWithView:"map"===e,scale:t/n.pixelRatio,displacement:c,declutterMode:p})}M[u]=O}}O&&(++F,E=_[F],E&&E.getImage()&&!E.getFill()&&!E.getStroke()||(E=new v,_[F]=E),E.setGeometry(r),O.setRotation(V+Yn(ho(a,"layout","icon-rotate",P,z,T))),O.setOpacity(ho(a,"paint","icon-opacity",P,z,T)),O.setAnchor(co[ho(a,"layout","icon-anchor",P,z,T)]),E.setImage(O),Z=E.getText(),E.setText(void 0),E.setZIndex(j),H=!0,N=!1)}else N=!0}}}if(1==$&&"circle"===a.type){++F,E=_[F],E&&E.getImage()&&!E.getFill()&&!E.getStroke()||(E=new v,_[F]=E);const e="circle-radius"in w?ho(a,"paint","circle-radius",P,z,T):5,t=bo(ho(a,"paint","circle-stroke-color",P,z,T),ho(a,"paint","circle-stroke-opacity",P,z,T)),r=ho(a,"paint","circle-translate",P,z,T),n=bo(ho(a,"paint","circle-color",P,z,T),ho(a,"paint","circle-opacity",P,z,T)),o=ho(a,"paint","circle-stroke-width",P,z,T),i=e+"."+t+"."+n+"."+o+"."+r[0]+"."+r[1];O=M[i],O||(O=new m({radius:e,displacement:[r[0],-r[1]],stroke:t&&o>0?new g({width:o,color:t}):void 0,fill:n?new y({color:n}):void 0,declutterMode:"none"}),M[i]=O),E.setImage(O),Z=E.getText(),E.setText(void 0),E.setGeometry(void 0),E.setZIndex(j),H=!0}if("text-field"in x){G=Math.round(ho(a,"layout","text-size",P,z,T));const e=ho(a,"layout","text-font",P,z,T);R=ho(a,"layout","text-line-height",P,z,T),L=Hn(l?l(e,n.metadata?n.metadata["ol:webfonts"]:void 0):e,G,R),L.includes("sans-serif")||(L+=",sans-serif"),U=ho(a,"layout","text-letter-spacing",P,z,T),B=ho(a,"layout","text-max-width",P,z,T);const t=ho(a,"layout","text-field",P,z,T);D="object"==typeof t&&t.sections?1===t.sections.length?t.toString():t.sections.reduce((t,r,n)=>{const o=r.fontStack?r.fontStack.split(","):e,a=Hn(l?l(o):o,G*(r.scale||1),R);let i=r.text;if("\n"===i)return t.push("\n",""),t;if(2==$)return t.push(oo(i,U),a),t;i=uo(i,a,B,U).split("\n");for(let e=0,r=i.length;e<r;++e)e>0&&t.push("\n",""),t.push(i[e],a);return t},[]):wo(t,k).trim(),c=ho(a,"paint","text-opacity",P,z,T)}if(D&&c&&!N){H||(++F,E=_[F],E&&E.getText()&&!E.getFill()&&!E.getStroke()||(E=new v,_[F]=E),E.setImage(void 0),E.setGeometry(void 0));const e=go(a,P,"text",z);E.getText()||E.setText(Z),Z=E.getText(),(!Z||"getDeclutterMode"in Z&&Z.getDeclutterMode()!==e)&&(Z=new b({padding:[2,2,2,2],declutterMode:e}),E.setText(Z));const t=ho(a,"layout","text-transform",P,z,T);"uppercase"==t?D=Array.isArray(D)?D.map((e,t)=>t%2?e:e.toUpperCase()):D.toUpperCase():"lowercase"==t&&(D=Array.isArray(D)?D.map((e,t)=>t%2?e:e.toLowerCase()):D.toLowerCase());const r=Array.isArray(D)?D:2==$?oo(D,U):uo(D,L,B,U);if(Z.setText(r),Z.setFont(L),Z.setRotation(Yn(ho(a,"layout","text-rotate",P,z,T))),"function"==typeof Z.setKeepUpright){const e=ho(a,"layout","text-keep-upright",P,z,T);Z.setKeepUpright(e)}const n=ho(a,"layout","text-anchor",P,z,T),o=H||1==$?"point":ho(a,"layout","symbol-placement",P,z,T);let i;if("line-center"===o?(Z.setPlacement("line"),i="center"):Z.setPlacement(o),"line"===o&&"function"==typeof Z.setRepeat){const e=ho(a,"layout","symbol-spacing",P,z,T);Z.setRepeat(2*e)}Z.setOverflow("point"===o);let s=ho(a,"paint","text-halo-width",P,z,T);const l=ho(a,"layout","text-offset",P,z,T),u=ho(a,"paint","text-translate",P,z,T);let p=0,f=0;if("point"==o){i="center",-1!==n.indexOf("left")?(i="left",f=s):-1!==n.indexOf("right")&&(i="right",f=-s);const e=ho(a,"layout","text-rotation-alignment",P,z,T);Z.setRotateWithView("map"==e)}else Z.setMaxAngle(Yn(ho(a,"layout","text-max-angle",P,z,T))*D.length/r.length),Z.setRotateWithView(!1);Z.setTextAlign(i);let d="middle";0==n.indexOf("bottom")?(d="bottom",p=-s-.5*(R-1)*G):0==n.indexOf("top")&&(d="top",p=s+.5*(R-1)*G),Z.setTextBaseline(d);const m=ho(a,"layout","text-justify",P,z,T);Z.setJustify("auto"===m?void 0:m),Z.setOffsetX(l[0]*G+f+u[0]),Z.setOffsetY(l[1]*G+p+u[1]);const h=Z.getFill()||new y;h.setColor(bo(ho(a,"paint","text-color",P,z,T),c)),Z.setFill(h);const x=bo(ho(a,"paint","text-halo-color",P,z,T),c);if(x&&s>0){const e=Z.getStroke()||new g;e.setColor(x),s*=2;const t=.5*G;e.setWidth(s<=t?s:t),Z.setStroke(e)}else Z.setStroke(void 0);const w=ho(a,"layout","text-padding",P,z,T),k=Z.getPadding();w!==k[0]&&(k[0]=w,k[1]=w,k[2]=w,k[3]=w),E.setZIndex(j)}}}return F>-1?(_.length=F+1,Mo&&("set"in o?o.set("mapbox-layer",q):o.getProperties()["mapbox-layer"]=q),_):void 0};return t.setStyle(j),t.set("mapbox-layers",k),t.set("mapbox-source",A),t.set("mapbox-featurestate",t.get("mapbox-featurestate")||{}),j}Je.parse("#000000"),Je.parse("#FFFFFF"),Je.parse("#000000"),function(e=!1){Mo=e}(!0);const Io="EPSG:27700",Ao=new Set(["vector","raster","wms","ogc-vt"]);function _o(e,t,r){const n=r&&r(e,t)||{};return fetch(n.url||e,{headers:n.headers||{}})}const Eo=e=>(t,r)=>{const n=e(r,"Tile")||{},o=n.url||r,a=n.headers||{};fetch(o,{headers:a}).then(e=>e.blob()).then(e=>{t.getImage().src=URL.createObjectURL(e)}).catch(()=>t.setState(I.ERROR))};function jo(e){return new p({resolutions:L,origin:G,tileSize:256,...e&&{extent:e}})}async function $o(e,t){if(e.type&&!Ao.has(e.type))throw new Error(`Unsupported map style type: '${e.type}'`);if("wms"===e.type){const r=function(e,t,r){const n=jo();return new S({url:e,params:t,projection:Io,tileGrid:n,tileLoadFunction:r?Eo(r):void 0})}(e.url,e.params||{},t);return{layer:new a({source:r}),source:r}}if("raster"===e.type){const r=function(e,t,r){const n=jo(r);return new M({projection:Io,tileGrid:n,tileUrlFunction:([t,r,n])=>e.replace("{z}",t).replace("{x}",r).replace("{y}",n),tileLoadFunction:t?Eo(t):void 0})}(e.url,t,e.extent);return{layer:new a({source:r}),source:r}}return"ogc-vt"===e.type?async function(e,t,{renderMode:r}={}){const n=await _o(e,"Style",t).then(e=>e.json()),a=Object.keys(n.sources)[0],i=n.sources[a].url,l=Co(n.sprite,t),u=await _o(i,"Source",t).then(e=>e.json()),c=u.links?.find(e=>"http://www.opengis.net/def/rel/ogc/1.0/tiling-scheme"===e.rel),[f,d]=await Promise.all([_o(c.href,"Source",t).then(e=>e.json()),l.fetch()]),m=f.tileMatrices.map(e=>e.cellSize),y=f.tileMatrices[0].pointOfOrigin,h=[f.tileMatrices[0].tileHeight,f.tileMatrices[0].tileWidth],g=new o;g.supportedMediaTypes.push("application/octet-stream");const v=new p({resolutions:m,origin:y,tileSize:h}),b=new z({url:i,format:g,tileGrid:v,projection:Io}),x=new s({source:b,declutter:!0,...r&&{renderMode:r}});return x.set("layerType","vectorTile"),zo(x,n,a,m,d,l.pngUrl),{layer:x,source:b}}(e.url,t,e):async function(e,t,{renderMode:r}={}){const n=await _o(e,"Style",t).then(e=>e.json()),a=Object.keys(n.sources)[0],i=n.sources[a].url,l=await _o(i,"Source",t).then(e=>e.json()),c=[l.fullExtent.xmin,l.fullExtent.ymin,l.fullExtent.xmax,l.fullExtent.ymax],f=[l.tileInfo.origin.x,l.tileInfo.origin.y],d=l.tileInfo.lods.map(e=>e.resolution).slice(0,16),m=l.tileInfo.rows,y=l.tiles[0],h=Co(n.sprite,t),g=await h.fetch();!function(e){e.layers.forEach(e=>{e.paint?.["icon-color"]&&(e.paint["icon-color"]=e.paint["icon-color"].replace(",0)",",1)"))})}(n);const v=new p({extent:c,origin:f,resolutions:d,tileSize:m}),b=new u({format:new o,url:y,projection:Io,tileGrid:v}),x=new s({source:b,declutter:!0,...r&&{renderMode:r}});return x.set("layerType","vectorTile"),zo(x,n,a,d,g,h.pngUrl),{layer:x,source:b}}(e.url,t,e)}function Co(e,t){const r=e.indexOf("?"),[n,o]=r>=0?[e.slice(0,r),e.slice(r)]:[e,""],a=`${n}.json${o}`;return{jsonUrl:a,pngUrl:`${n}.png${o}`,fetch:()=>_o(a,"SpriteJSON",t).then(e=>e.json())}}function Po(e,t,r){if(null!==e)for(var n,o,a,i,s,l,u,p,c=0,f=0,d=e.type,m="FeatureCollection"===d,y="Feature"===d,h=m?e.features.length:1,g=0;g<h;g++){s=(p=!!(u=m?e.features[g].geometry:y?e.geometry:e)&&"GeometryCollection"===u.type)?u.geometries.length:1;for(var v=0;v<s;v++){var b=0,x=0;if(null!==(i=p?u.geometries[v]:u)){l=i.coordinates;var w=i.type;switch(c=0,w){case null:break;case"Point":if(!1===t(l,f,g,b,x))return!1;f++,b++;break;case"LineString":case"MultiPoint":for(n=0;n<l.length;n++){if(!1===t(l[n],f,g,b,x))return!1;f++,"MultiPoint"===w&&b++}"LineString"===w&&b++;break;case"Polygon":case"MultiLineString":for(n=0;n<l.length;n++){for(o=0;o<l[n].length-c;o++){if(!1===t(l[n][o],f,g,b,x))return!1;f++}"MultiLineString"===w&&b++,"Polygon"===w&&x++}"Polygon"===w&&b++;break;case"MultiPolygon":for(n=0;n<l.length;n++){for(x=0,o=0;o<l[n].length;o++){for(a=0;a<l[n][o].length-c;a++){if(!1===t(l[n][o][a],f,g,b,x))return!1;f++}x++}b++}break;case"GeometryCollection":for(n=0;n<i.geometries.length;n++)if(!1===Po(i.geometries[n],t))return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}var To=function(e,t={}){if(null!=e.bbox&&!0!==t.recompute)return e.bbox;const r=[1/0,1/0,-1/0,-1/0];return Po(e,e=>{r[0]>e[0]&&(r[0]=e[0]),r[1]>e[1]&&(r[1]=e[1]),r[2]<e[0]&&(r[2]=e[0]),r[3]<e[1]&&(r[3]=e[1])}),r};const qo=e=>{const t=e/1609.344;if(t<.5){const t=Math.round(e);return`${t} ${1===t?"metre":"metres"}`}if(t<10){const e=Number.parseFloat(t.toFixed(1));return`${e} ${1===e?"mile":"miles"}`}return`${Math.round(t)} miles`},Fo=e=>To(e),Oo="EPSG:27700",No=new n({dataProjection:Oo,featureProjection:Oo}),Do=(e,t,r)=>{const n=[];for(let o=t;o<r;o+=2)n.push([e[o],e[o+1]]);return n},Lo=e=>{const t=e.getType(),r=e.getFlatCoordinates();if("Point"===t)return{type:"Point",coordinates:[r[0],r[1]]};if("LineString"===t)return{type:"LineString",coordinates:Do(r,0,r.length)};if("Polygon"===t){const t=e.getEnds();let n=0;return{type:"Polygon",coordinates:t.map(e=>{const t=Do(r,n,e);return n=e,t})}}if("MultiPolygon"===t){const t=e.getEndss();let n=0;return{type:"MultiPolygon",coordinates:t.map(e=>{let t=n;const o=e.map(e=>{const n=Do(r,t,e);return t=e,n});return n=e[e.length-1],o})}}return{type:t,coordinates:Do(r,0,r.length)}},Ro=(e,t,r,n)=>{const o=[];return e.getLayers().forEach(e=>{if("vectorTile"!==e.get("layerType"))return;const a=e.getSource(),i=a?.sourceTiles_;i&&Object.values(i).forEach(a=>{a.getState()===I.LOADED&&a.getFeatures().forEach(a=>{if((a.get("mapbox-layer")?.id??e.get("layerId"))!==t)return;const i=n?a.get(n):a.getId();String(i)===String(r)&&o.push((e=>e.getGeometry?No.writeGeometryObject(e.getGeometry()):Lo(e))(a))})})}),o},Go="EPSG:27700",Uo=new n({dataProjection:Go,featureProjection:Go}),Bo="_highlight",Ho=999,Zo=(e,t)=>{if(!e)return[];const{stroke:r,selectionStroke:n,fill:o,strokeWidth:a,activeStrokeWidth:i}=e;if(t)return[new v({stroke:new g({color:r,width:i}),zIndex:Ho}),new v({stroke:new g({color:n,width:a}),zIndex:1e3})];const s=[new v({stroke:new g({color:n,width:a}),zIndex:Ho})];return o&&"transparent"!==o&&s.push(new v({fill:new y({color:o}),zIndex:Ho})),s},Vo=(e,t,r)=>{if(n=e,!n?.symbol&&!n?.symbolSvgContent)return null;var n;const o=t?e.symbolActiveImageId:e.symbolSelectedImageId,a=o&&r?.getImage(o);if(!a||!e.symbolImageAnchor)return null;const i=1/(e.symbolPixelRatio||1);return[new v({image:new h({img:a,anchor:e.symbolImageAnchor,scale:i}),zIndex:Ho})]},Wo=e=>{const t=new Set,r={};for(const{layerId:n,featureId:o,idProperty:a}of e??[])t.add(`${n}:${o}`),a&&(r[n]=a);return{keys:t,idProps:r}},Jo=(e,t)=>e.getLayers().getArray().find(e=>"vector"===e.get("layerType")&&!e.get(Bo)&&e.get("layerId")===t),Xo=(e,t,r)=>{if(null==r)return;const n=Jo(e,t)?.getSource()?.getFeatureById(String(r));return n?.getProperties()},Yo=(e,t,r,n)=>{const o=Jo(e,t)?.get("symbolMeta");if(!o||!n)return null;const a=r?n.getActiveImageId(o.imageId):n.getSelectedImageId(o.imageId),i=a&&n.getImage(a);return i?[new v({image:new h({img:i,anchor:o.anchor,scale:1/o.pixelRatio}),zIndex:Ho})]:null},Ko=(e,t,r,n,o,a)=>{for(const{layerId:i,featureId:s,geometry:l}of r??[]){if(!l)continue;const r=Xo(e,i,s),u=Vo(r,n,a)??Yo(e,i,n,a)??Zo(o?.[i],n);if(u.length){const e=new j({geometry:Uo.readGeometry(l)});e.setStyle(u),t.addFeature(e)}}},Qo=(e,t)=>{const{type:r,coordinates:n}=e,o=([e,r])=>t(e,r),a=e=>e.forEach(o);"Point"===r?o(n):"MultiPoint"===r||"LineString"===r?n.forEach(o):"MultiLineString"===r||"Polygon"===r?n.forEach(a):"MultiPolygon"===r&&n.forEach(e=>e.forEach(a))},ea=(e,t,r,n,o)=>{if(!e)return null;const a=new Set;e.getLayers().forEach(e=>{if("vector"===e.get("layerType")&&!e.get(Bo)){const t=e.get("layerId");t&&a.add(t)}});const{keys:s,idProps:u}=Wo(t),{keys:p,idProps:c}=Wo(r),f={...u,...c};((e,t,r,n,o)=>{e.getLayers().forEach(e=>{if("vectorTile"!==e.get("layerType"))return;if(!(t.size>0||r.size>0))return void(e._highlightOriginalStyle&&(e.setStyle(e._highlightOriginalStyle),delete e._highlightOriginalStyle));e._highlightOriginalStyle&&e.getStyleFunction()===e._highlightWrappedStyle||(e._highlightOriginalStyle=e.getStyleFunction());const a=e._highlightOriginalStyle,i=(i,s)=>{const l=a(i,s),u=i.get("mapbox-layer")?.id??e.get("layerId");if(!u)return l;const p=n[u],c=`${u}:${p?i.get(p):i.getId()}`,f=r.has(c),d=!f&&t.has(c);if(!f&&!d)return l;const m=Zo(o?.[u],f);return m.length?[...(y=l,y?Array.isArray(y)?y:[y]:[]),...m]:l;var y};e._highlightWrappedStyle=i,e.setStyle(i)})})(e,s,p,f,n);const d=(e=>{let t=e.getLayers().getArray().find(e=>e.get(Bo));return t||(t=new i({source:new l,zIndex:1001}),t.set(Bo,!0),t.set("layerType","vector"),e.addLayer(t)),t})(e),m=d.getSource();m.clear();const y=(t??[]).filter(e=>a.has(e.layerId)),h=(r??[]).filter(e=>a.has(e.layerId));Ko(e,m,h,!0,n,o),Ko(e,m,y,!1,n,o);const g=(t??[]).flatMap(t=>((e,{layerId:t,featureId:r,idProperty:n,geometry:o})=>{if(null!=r){const o=Ro(e,t,r,n);if(o.length>0)return o}return o?[o]:[]})(e,t));return(e=>{if(!e.length)return null;let t=1/0,r=1/0,n=-1/0,o=-1/0;for(const a of e)Qo(a,(e,a)=>{e<t&&(t=e),a<r&&(r=a),e>n&&(n=e),a>o&&(o=a)});return t===1/0?null:[t,r,n,o]})(g)};class ta{sets=(()=>new Map)();add(e,t){const r=this.sets.get(e)??new Set;this.sets.delete(e),this.sets.set(e,r),t.forEach(e=>r.add(e));const n=new Set;for(;this.sets.size>2;){const[e,t]=this.sets.entries().next().value;this.sets.delete(e),t.forEach(e=>n.add(e))}return this.sets.forEach(e=>e.forEach(e=>n.delete(e))),Array.from(n)}}class ra{images=(()=>new Map)();dataUris=(()=>new Map)();activeImageIds=(()=>new Map)();selectedImageIds=(()=>new Map)();recentImageSets=(()=>new ta)();getImage(e){return this.images.get(e)}getDataUri(e){return this.dataUris.get(e)}getActiveImageId(e){return this.activeImageIds.get(e)??null}getSelectedImageId(e){return this.selectedImageIds.get(e)??null}addImage(e,t,r){const n=document.createElement("canvas");if(n.width=t.width,n.height=t.height,n.getContext("2d").putImageData(t,0,0),this.images.set(e,n),r){const t=n.toDataURL();this.dataUris.set(e,t),C.set(t,null,new $(n,t,void 0,P.LOADED,null))}}removeImage(e){const t=this.dataUris.get(e);this.dataUris.delete(e),t&&!Array.from(this.dataUris.values()).includes(t)&&C.set(t,null,new $(void 0,t,void 0,P.IDLE,null)),this.images.delete(e),this.activeImageIds.delete(e),this.selectedImageIds.delete(e)}async registerSymbol(e,t,r,n){const o=r.getSymbolImageIds(e,t,n);return o?(this.activeImageIds.set(o.normal,o.active),this.selectedImageIds.set(o.normal,o.selected),await Promise.all(Object.entries(o).map(async([o,a])=>{if(this.images.has(a))return;const i=await r.rasteriseSymbolImage(e,t,o,n);i&&!this.images.has(i.imageId)&&this.addImage(i.imageId,i.imageData,"normal"===o)})),Object.values(o)):[]}async registerSymbols(e,t,r,n){const o=await Promise.all(e.map(e=>this.registerSymbol(e,t,r,n)));this.recentImageSets.add(`${t?.id}|${n}`,o.flat()).forEach(e=>this.removeImage(e))}}class na{fills=(()=>new Map)();recentImageSets=(()=>new ta)();getFill(e){return this.fills.get(e)}addFill(e,t){const r=document.createElement("canvas");r.width=t.width,r.height=t.height,r.getContext("2d").putImageData(t,0,0);const n=document.createElement("canvas").getContext("2d").createPattern(r,"repeat");this.fills.set(e,new y({color:n}))}async registerPatterns(e,t,r,n){const o=new Map;e.forEach(e=>{const a=r.getPatternImageId(e,t,n);a&&!o.has(a)&&o.set(a,e)}),await Promise.all(Array.from(o,async([e,o])=>{if(this.fills.has(e))return;const a=await r.rasterisePatternImage(o,t,n);a&&!this.fills.has(a.imageId)&&this.addFill(a.imageId,a.imageData)})),this.recentImageSets.add(`${t}|${n}`,Array.from(o.keys())).forEach(e=>this.fills.delete(e))}}const oa=e=>{if(!e)return null;const t=T(e,F,O()),r=q();return e=>(r.properties=e.getProperties(),r.featureId=e.getId()??null,r.geometryType=e.getGeometry()?.getType()??"",Boolean(t(r)))},aa="EPSG:27700",ia=new n({dataProjection:aa,featureProjection:aa}),sa=e=>{const t=e.getId();if(null!=t)return t;const r={...e.getProperties()};return delete r["mapbox-layer"],JSON.stringify(r)},la=(e,t,r,n)=>{if(!r)return;const o=`${r}:${sa(n)}`;t.has(o)||(t.add(o),e.push({id:n.getId(),layer:{id:r},geometry:ia.writeGeometryObject(n.getGeometry()),properties:n.getProperties()}))},ua=(e,t,r,n)=>{const o=r?.id;if(!o||"background"===r?.type)return;const a=`${o}:${sa(n)}`;t.has(a)||(t.add(a),e.push({id:n.getId(),layer:{id:o},geometry:Lo(n),properties:n.getProperties()}))},pa=(e,t,r={})=>{if(!t)return[];const{radius:n=10}=r,o=[t.x,t.y],a=[],i=new Set;return e.forEachFeatureAtPixel(o,(e,t)=>{"vectorTile"===t.get("layerType")?((e,t,r,n)=>{const o=n.get("mapbox-layer");o?ua(e,t,o,n):la(e,t,r.get("layerId"),n)})(a,i,t,e):"vector"!==t.get("layerType")||t.get("_highlight")||la(a,i,t.get("layerId"),e)},{hitTolerance:n}),a},ca=(e,t,r)=>{const n=e.getViewport();if(r&&e.un("pointermove",r),!t?.length)return n.style.cursor="",null;const o=new Set(t);let a=null;const i=t=>{if("mouse"!==t.originalEvent?.pointerType)return;const r=t.pixel;null!==a&&cancelAnimationFrame(a),a=requestAnimationFrame(()=>{a=null;const t=e.forEachFeatureAtPixel(r,(e,t)=>((e,t,r)=>{if("vectorTile"===t.get("layerType")){const n=e.get("mapbox-layer")?.id??t.get("layerId");return Boolean(n&&r.has(n))}if("vector"===t.get("layerType")&&!t.get("_highlight")){const e=t.get("layerId");return Boolean(e&&r.has(e))}return!1})(e,t,o),{hitTolerance:8});n.style.cursor=t?"pointer":""})};return e.on("pointermove",i),i};(()=>{if("undefined"==typeof HTMLCanvasElement)return;const e=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=function(t,r,...n){return e.call(this,t,"2d"===t?{...r,willReadFrequently:!0}:r,...n)}})();const fa=D,da=e=>{if(!e)return;const{top:t=0,right:r=0,bottom:n=0,left:o=0}=e;return[t,r,n,o]};class ma extends N{constructor({mapProviderConfig:e={},events:t,eventBus:r}){super(),this.events=t,this.eventBus=r,this.capabilities={supportedShortcuts:H,supportsMapSizes:!0},this.symbolImages=new ra,this.patternImages=new na,Object.assign(this,e)}get name(){return"OpenLayersProvider"}isBaseMapReady(){return Boolean(this.map)}async initMap(n){const{container:o,padding:a,mapStyle:i,mapSize:s,center:l,zoom:u,bounds:p,minZoom:c,maxZoom:f,transformRequest:d,pixelRatio:m}=n;this.mapStyleId=i?.id,this.mapSize=s;const{events:y,eventBus:h}=this,{layer:g,source:v}=await $o(i,d),b=(this.zoomAlignment??Z)===V?{resolutions:R,defaultMinZoom:6,maxZoom:20}:{resolutions:L,defaultMinZoom:0,maxZoom:L.length-1};const w=new t({projection:fa,center:l??(p?r(p):void 0),zoom:u??b.defaultMinZoom,minZoom:c??b.defaultMinZoom,maxZoom:f??b.maxZoom,resolutions:b.resolutions,constrainResolution:!1,padding:da(a)}),k=new e({target:o,layers:[g],view:w,controls:[],interactions:x({doubleClickZoom:!1}),pixelRatio:m});p&&k.once("rendercomplete",()=>{w.fit(p,{size:k.getSize(),duration:0})}),this.mapEventHandles=X({map:k,source:v,events:y,eventBus:h,getZoom:this.getZoom.bind(this),getCenter:this.getCenter.bind(this),getBounds:this.getBounds.bind(this),getResolution:this.getResolution.bind(this)}),this.appEventHandles=function({mapProvider:e,transformRequest:t,events:r,eventBus:n,map:o,onBaseSourceChange:a}){const i=async i=>{const{layer:s,source:l}=await $o(i,t);o.getLayers().setAt(0,s),a(l),n.emit(r.MAP_STYLE_CHANGE,{mapStyleId:i.id}),e.reapplyHighlights()},s=e=>{o.setPixelRatio(e)},l=({mapSize:t})=>{e.mapSize=t};return n.on(r.MAP_SET_STYLE,i),n.on(r.MAP_SET_PIXEL_RATIO,s),n.on(r.MAP_SIZE_CHANGE,l),{remove(){n.off(r.MAP_SET_STYLE,i),n.off(r.MAP_SET_PIXEL_RATIO,s),n.off(r.MAP_SIZE_CHANGE,l)}}}({mapProvider:this,transformRequest:d,events:y,eventBus:h,map:k,onBaseSourceChange:this.mapEventHandles.setSource})||[],this.map=k,this.view=w,h.emit(y.MAP_READY,{map:this.map,mapStyleId:this.mapStyleId,mapSize:this.mapSize,crs:this.crs})}destroyMap(){this.mapEventHandles?.remove(),this.appEventHandles?.remove(),this.mapEventHandles=null,this.appEventHandles=null,this.map&&(this._onHoverMove&&(this.map.un("pointermove",this._onHoverMove),this._onHoverMove=null),this.map.setTarget(null),this.map=null),this.view=null}setView({center:e,zoom:t}){this.view.animate({center:e??this.view.getCenter(),zoom:t??this.view.getZoom(),duration:U})}zoomIn(e){this.view.animate({zoom:this.view.getZoom()+e,duration:U})}zoomOut(e){this.view.animate({zoom:this.view.getZoom()-e,duration:U})}panBy(e){const t=this.view.getCenter(),r=this.view.getResolution();this.view.animate({center:[t[0]+e[0]*r,t[1]-e[1]*r],duration:U})}fitToBounds(e){const t=Array.isArray(e)?e:Fo(e);this.view.fit(t,{duration:U})}setPadding(e){this.view.padding=da(e)}getCenter(){const e=this.view.getCenter(),t=B;return[Math.round(e[0]*Math.pow(10,t))/Math.pow(10,t),Math.round(e[1]*Math.pow(10,t))/Math.pow(10,t)]}getZoom(){return this.view.getZoom()}getBounds(){return this.view.calculateExtent(this.map.getSize()).map(e=>Math.round(100*e)/100)}getFeaturesAtPoint(e,t){return pa(this.map,e,t)}getFeatureGeometry(e,t,r){const n=Ro(this.map,e,t,r);if(0===n.length)return null;if(1===n.length)return n[0];return{type:"MultiPolygon",coordinates:n.flatMap(e=>"MultiPolygon"===e.type?e.coordinates:[e.coordinates])}}setHoverCursor(e){this.map&&(this._onHoverMove=ca(this.map,e,this._onHoverMove))}getVisibleFeatures(e){return((e,t)=>{const r=new Set(t),n=[],o=new Set,a=e.getView().calculateExtent(e.getSize());return e.getLayers().forEach(e=>{if("vectorTile"===e.get("layerType")){const t=e.getSource()?.sourceTiles_;if(!t)return;const a=e.get("layerId"),i=oa(e.get("filter"));Object.values(t).forEach(e=>{e.getState()===I.LOADED&&e.getFeatures().forEach(e=>{const t=e.get("mapbox-layer");t?r.has(t.id)&&ua(n,o,t,e):!r.has(a)||i&&!i(e)||la(n,o,a,e)})})}else if("vector"===e.get("layerType")){const t=e.get("layerId");if(!t||!r.has(t)||e.get("_highlight"))return;const i=oa(e.get("filter"));e.getSource()?.getFeaturesInExtent(a).forEach(e=>{i&&!i(e)||la(n,o,t,e)})}}),n})(this.map,e)}updateHighlightedFeatures(e,t,r){return this._lastHighlightArgs={selectedFeatures:e,activeFeatures:t,stylesMap:r},ea(this.map,e,t,r,this.symbolImages)}reapplyHighlights(){if(!this._lastHighlightArgs)return;const{selectedFeatures:e,activeFeatures:t,stylesMap:r}=this._lastHighlightArgs;ea(this.map,e,t,r,this.symbolImages)}async addSymbolsToMap(e,t,r,n=this.map.getPixelRatio()||1){return this.symbolImages.registerSymbols(e,t,r,n)}getSymbolImage(e){return this.symbolImages.getImage(e)}getSymbolDataUri(e){return this.symbolImages.getDataUri(e)}async addPatternsToMap(e,t,r,n=this.map.getPixelRatio()||1){return this.patternImages.registerPatterns(e,t,r,n)}getPatternFill(e){return this.patternImages.getFill(e)}buildFilterEvaluator(e){return oa(e)}getActiveSymbolImageId(e){return this.symbolImages.getActiveImageId(e)}getSelectedSymbolImageId(e){return this.symbolImages.getSelectedImageId(e)}getAreaDimensions(){return(e=>{if(!e)return"";const[t,r,n,o]=e,a=n-t;return`${qo(o-r)} by ${qo(a)}`})((e=>{const t=e.getSize(),r=e.getView().padding||[0,0,0,0],[n,o,a,i]=r,s=[i,t[1]-a],l=[t[0]-o,n],u=e.getCoordinateFromPixel(s),p=e.getCoordinateFromPixel(l);return u&&p?[u[0],u[1],p[0],p[1]]:null})(this.map))}getCardinalMove(e,t){return((e,t)=>{const r=t[0]-e[0],n=t[1]-e[1],o=[];return Math.abs(n)>1&&o.push(`${n>0?"north":"south"} ${qo(Math.abs(n))}`),Math.abs(r)>1&&o.push(`${r>0?"east":"west"} ${qo(Math.abs(r))}`),o.join(", ")})(e,t)}getResolution(){return this.view.getResolution()}mapToScreen(e){if(!this.map)return{x:0,y:0};const t=this.map.getPixelFromCoordinate(e);return t?{x:t[0],y:t[1]}:{x:0,y:0}}screenToMap(e){return this.map.getCoordinateFromPixel([e.x,e.y])}isGeometryObscured(e,t){return((e,t,r)=>{const n=r.getTargetElement().getBoundingClientRect();if(!n.width||!n.height)return!1;const o=r.getViewport().getBoundingClientRect(),a=o.width/n.width,i=o.height/n.height,[s,l,u,p]=Fo(e),c=[[s,l],[s,p],[u,l],[u,p]].map(e=>r.getPixelFromCoordinate(e)).filter(Boolean);if(!c.length)return!1;const f=n.left+Math.min(...c.map(e=>e[0]))*a,d=n.left+Math.max(...c.map(e=>e[0]))*a,m=n.top+Math.min(...c.map(e=>e[1]))*i,y=n.top+Math.max(...c.map(e=>e[1]))*i;return f<t.right&&d>t.left&&m<t.bottom&&y>t.top})(e,t,this.map)}}export{ma as default};